Speed up Theme Option Page load

Fixes #1245

The CheckChanged event was causing load settings to be called more than once on form load.
This commit is contained in:
Sean Kaim
2019-01-02 10:43:33 -05:00
parent ce371e45ae
commit d3e40d7c3d

View File

@@ -3,7 +3,6 @@ using System.Windows.Forms;
using mRemoteNG.Themes;
using System.Linq;
using System.Collections.Generic;
using System.Drawing;
using BrightIdeasSoftware;
using mRemoteNG.UI.Forms.Input;
@@ -56,6 +55,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
public override void LoadSettings()
{
themeEnableCombo.CheckedChanged -= themeEnableCombo_CheckedChanged;
base.SaveSettings();
//At first we cannot create or delete themes, depends later on the type of selected theme
btnThemeNew.Enabled = false;
@@ -81,6 +81,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
// reset to the default theme when disabling theme support
_themeManager.ActiveTheme = _themeManager.DefaultTheme;
}
themeEnableCombo.CheckedChanged += themeEnableCombo_CheckedChanged;
}
private void ListPalette_FormatCell(object sender, FormatCellEventArgs e)