diff --git a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs index 6035a071e..722ff462a 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs @@ -12,10 +12,10 @@ namespace mRemoteNG.UI.Forms.OptionsPages { #region Private Fields - private ThemeManager _themeManager; - private ThemeInfo _oriTheme; - private bool _oriActiveTheming; - List modifiedThemes = new List(); + private readonly ThemeManager _themeManager; + private readonly ThemeInfo _oriTheme; + private readonly bool _oriActiveTheming; + private readonly List modifiedThemes = new List(); #endregion public ThemePage() @@ -173,21 +173,19 @@ namespace mRemoteNG.UI.Forms.OptionsPages private void btnThemeNew_Click(object sender, EventArgs e) { var name = _themeManager.ActiveTheme.Name; - using (FrmInputBox frmInputBox = new FrmInputBox(Language.strOptionsThemeNewThemeCaption, Language.strOptionsThemeNewThemeText, ref name)) + using (var frmInputBox = new FrmInputBox(Language.strOptionsThemeNewThemeCaption, Language.strOptionsThemeNewThemeText, ref name)) { - DialogResult dr = frmInputBox.ShowDialog(); - if (dr == DialogResult.OK) + var dr = frmInputBox.ShowDialog(); + if (dr != DialogResult.OK) return; + if (_themeManager.isThemeNameOk(frmInputBox.returnValue)) { - if (_themeManager.isThemeNameOk(frmInputBox.returnValue)) - { - var addedTheme = _themeManager.addTheme(_themeManager.ActiveTheme, frmInputBox.returnValue); - _themeManager.ActiveTheme = addedTheme; - LoadSettings(); - } - else - { - TaskDialog.CTaskDialog.ShowTaskDialogBox(this, Language.strErrors, Language.strOptionsThemeNewThemeError, "", "", "", "", "", "", TaskDialog.ETaskDialogButtons.Ok, TaskDialog.ESysIcons.Error, TaskDialog.ESysIcons.Information, 0); - } + var addedTheme = _themeManager.addTheme(_themeManager.ActiveTheme, frmInputBox.returnValue); + _themeManager.ActiveTheme = addedTheme; + LoadSettings(); + } + else + { + TaskDialog.CTaskDialog.ShowTaskDialogBox(this, Language.strErrors, Language.strOptionsThemeNewThemeError, "", "", "", "", "", "", TaskDialog.ETaskDialogButtons.Ok, TaskDialog.ESysIcons.Error, TaskDialog.ESysIcons.Information, 0); } } } diff --git a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.resx b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 05c5e4a9d..997e8117b 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -816,6 +816,9 @@ FrmInputBox.cs + + ThemePage.cs + PasswordForm.cs Designer