aboutsummaryrefslogtreecommitdiff
path: root/gui/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/options.cpp')
-rw-r--r--gui/options.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index a540fbb9d1..5752702f5c 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,11 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
setResult(1);
close();
break;
+ case kCloseCmd:
+ g_gui.loadNewTheme(_oldTheme);
+ ConfMan.set("gui_theme", _oldTheme);
+ close();
+ break;
default:
Dialog::handleCommand(sender, cmd, data);
}
@@ -1316,7 +1322,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 +1329,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 {