Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup forms initialization #103

Merged
merged 1 commit into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions KeeTrayTOTP/FormAbout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ namespace KeeTrayTOTP
/// </summary>
internal partial class FormAbout : Form
{
/// <summary>
/// Plugin Host.
/// </summary>
private readonly KeeTrayTOTPExt _plugin;

/// <summary>
/// Windows Form Constructor.
/// </summary>
/// <param name="plugin">Plugin Host.</param>
internal FormAbout(KeeTrayTOTPExt plugin)
internal FormAbout()
{
_plugin = plugin;
InitializeComponent();
}

Expand Down
7 changes: 1 addition & 6 deletions KeeTrayTOTP/FormHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ namespace KeeTrayTOTP
/// </summary>
internal partial class FormHelp : Form
{
/// <summary>
/// Plugin Host.
/// </summary>
private readonly KeeTrayTOTPExt _plugin;
/// <summary>
/// Getting started flag.
/// </summary>
Expand All @@ -23,9 +19,8 @@ internal partial class FormHelp : Form
/// </summary>
/// <param name="plugin">Plugin Host.</param>
/// <param name="gettingStarted">Getting Started Display Flag.</param>
internal FormHelp(KeeTrayTOTPExt plugin, bool gettingStarted = false)
internal FormHelp(bool gettingStarted = false)
{
_plugin = plugin;
_gettingStarted = gettingStarted;
InitializeComponent();
}
Expand Down
10 changes: 4 additions & 6 deletions KeeTrayTOTP/TrayTOTP_Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public override bool Initialize(IPluginHost host)
PluginHost = host;

// Instantiate Help Form.
_helpForm = new FormHelp(this);
_helpForm = new FormHelp();

// Register events.
PluginHost.MainWindow.Shown += MainWindow_Shown;
Expand Down Expand Up @@ -302,7 +302,7 @@ private void MainWindow_Shown(object sender, EventArgs e)
PluginHost.CustomConfig.SetBool(setname_bool_FirstInstall_Shown, true);
if (!_helpForm.Visible)
{
_helpForm = new FormHelp(this, true);
_helpForm = new FormHelp(true);
_helpForm.Show();
}
else
Expand All @@ -319,8 +319,7 @@ private void MainWindow_Shown(object sender, EventArgs e)
/// <param name="e"></param>
private void OnMenuSettingsClick(object sender, EventArgs e)
{
var formSettings = new FormSettings(this);
UIUtil.ShowDialogAndDestroy(formSettings);
UIUtil.ShowDialogAndDestroy(new FormSettings(this));
}

/// <summary>
Expand All @@ -347,8 +346,7 @@ private void OnMenuHelpClick(object sender, EventArgs e)
/// <param name="e"></param>
private void OnMenuAboutClick(object sender, EventArgs e)
{
var formAbout = new FormAbout(this);
UIUtil.ShowDialogAndDestroy(formAbout);
UIUtil.ShowDialogAndDestroy(new FormAbout());
}

/// <summary>
Expand Down