diff options
author | Vsevolod Kukol <sevoku@xamarin.com> | 2016-06-03 22:49:11 +0300 |
---|---|---|
committer | Vsevolod Kukol <sevoku@xamarin.com> | 2016-06-06 12:57:29 +0300 |
commit | 2861a090fab894b77b0f5c336a814e41ab230b75 (patch) | |
tree | 8639a799defc5102e3dd02b5040a29caef626c5b /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels | |
parent | fc1eab3ed6b7837bc3932b1489d7898af6f8c65c (diff) |
[Ide] Restart hint/option in Style settings
Show a message about a required restart
inside the style options panel, instead of a
separate message box.
Show an additional Restart button, allowing
the user to restart the IDE with a single click.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs index f931d001be..7ce29e7b79 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs @@ -113,6 +113,27 @@ namespace MonoDevelop.Ide.Gui.OptionPanels comboTheme.Active = sel; comboTheme.Changed += ComboThemeChanged; + tableRestart.Visible = separatorRestart.Visible = false; + labelRestart.LabelProp = GettextCatalog.GetString ("These preferences will take effect next time you start {0}", BrandingService.ApplicationName); + btnRestart.Label = GettextCatalog.GetString ("Restart {0}", BrandingService.ApplicationName); + + comboLanguage.Changed += UpdateRestartMessage; + comboTheme.Changed += UpdateRestartMessage; + } + + void RestartClicked (object sender, System.EventArgs e) + { + Store (); + IdeApp.Restart (true); + } + + void UpdateRestartMessage (object sender, EventArgs e) + { + if (currentTheme != IdeApp.Preferences.UserInterfaceThemeName.Value || + LocalizationService.CurrentLocaleSet [comboLanguage.Active].Culture != IdeApp.Preferences.UserInterfaceLanguage) { + tableRestart.Visible = separatorRestart.Visible = true; + } else + tableRestart.Visible = separatorRestart.Visible = false; } void ComboThemeChanged (object sender, EventArgs e) @@ -175,25 +196,11 @@ namespace MonoDevelop.Ide.Gui.OptionPanels public void Store() { string lc = LocalizationService.CurrentLocaleSet [comboLanguage.Active].Culture; - if (lc != IdeApp.Preferences.UserInterfaceLanguage) { + if (lc != IdeApp.Preferences.UserInterfaceLanguage) IdeApp.Preferences.UserInterfaceLanguage.Value = lc; - MessageService.ShowMessage ( - GettextCatalog.GetString ( - "The user interface language change will take effect the next time you start {0}", - BrandingService.ApplicationName - ) - ); - } - if (currentTheme != IdeApp.Preferences.UserInterfaceThemeName.Value) { + if (currentTheme != IdeApp.Preferences.UserInterfaceThemeName.Value) IdeApp.Preferences.UserInterfaceThemeName.Value = currentTheme; - MessageService.ShowMessage ( - GettextCatalog.GetString ( - "The user interface theme change will take effect the next time you start {0}", - BrandingService.ApplicationName - ) - ); - } } } } |