diff options
-rw-r--r-- | gui/options.cpp | 11 | ||||
-rw-r--r-- | gui/options.h | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index a540fbb9d1..a12630a0e7 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -144,6 +144,7 @@ void OptionsDialog::init() { _subSpeedDesc = 0; _subSpeedSlider = 0; _subSpeedLabel = 0; + _oldTheme = ConfMan.get("gui_theme"); // Retrieve game GUI options _guioptions = 0; @@ -509,6 +510,13 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data setResult(1); close(); break; + case kCloseCmd: + if (g_gui.theme()->getThemeId() != _oldTheme) { + g_gui.loadNewTheme(_oldTheme); + ConfMan.set("gui_theme", _oldTheme); + } + close(); + break; default: Dialog::handleCommand(sender, cmd, data); } @@ -1316,7 +1324,6 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 #ifdef USE_TRANSLATION Common::String lang = TransMan.getCurrentLanguage(); #endif - Common::String oldTheme = g_gui.theme()->getThemeId(); if (g_gui.loadNewTheme(theme)) { #ifdef USE_TRANSLATION // If the charset has changed, it means the font were not found for the @@ -1324,7 +1331,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 // language without restarting, we let the user know about this. if (lang != TransMan.getCurrentLanguage()) { TransMan.setLanguage(lang.c_str()); - g_gui.loadNewTheme(oldTheme); + g_gui.loadNewTheme(_oldTheme); MessageDialog error(_("The theme you selected does not support your current language. If you want to use this theme you need to switch to another language first.")); error.runModal(); } else { diff --git a/gui/options.h b/gui/options.h index eba1779b69..5cc13b5cf6 100644 --- a/gui/options.h +++ b/gui/options.h @@ -174,6 +174,11 @@ protected: // uint32 _guioptions; Common::String _guioptionsString; + + // + //Theme Options + // + Common::String _oldTheme; }; |