aboutsummaryrefslogtreecommitdiff
path: root/gui/options.cpp
diff options
context:
space:
mode:
authorThierry Crozat2010-10-01 21:41:40 +0000
committerThierry Crozat2010-10-01 21:41:40 +0000
commit1177692701ccfef3eee94ab092a606c0da631566 (patch)
treeae638aa71677d99c9e7f6cec8a86136b1e841eae /gui/options.cpp
parent5541af78b1b3ec506fcdd03c96104c4b10168742 (diff)
downloadscummvm-rg350-1177692701ccfef3eee94ab092a606c0da631566.tar.gz
scummvm-rg350-1177692701ccfef3eee94ab092a606c0da631566.tar.bz2
scummvm-rg350-1177692701ccfef3eee94ab092a606c0da631566.zip
GUI: Fix bug #3075649 (Fonts not found with built-in theme)
When switching to a theme that do not have the fonts needed to properly display the current language, it now revert to the previously used theme and display an error message telling the user to change the language first if he wants to use the theme he selected. svn-id: r52969
Diffstat (limited to 'gui/options.cpp')
-rw-r--r--gui/options.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index b02200b47e..e497da9942 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1281,19 +1281,20 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
Common::String theme = browser.getSelected();
// FIXME: Actually, any changes (including the theme change) should
// only become active *after* the options dialog has closed.
- Common::String charset = TransMan.getCurrentCharset();
+ Common::String lang = TransMan.getCurrentLanguage();
+ Common::String oldTheme = g_gui.theme()->getThemeId();
if (g_gui.loadNewTheme(theme)) {
- _curTheme->setLabel(g_gui.theme()->getThemeName());
- ConfMan.set("gui_theme", theme);
// If the charset has changed, it means the font were not found for the
// new theme. Since for the moment we do not support change of translation
// language without restarting, we let the user know about this.
- if (charset != TransMan.getCurrentCharset()) {
- MessageDialog error(
- "The theme you selected does not support your current language. You need to close "
- "ScummVM and when you start it again it will be using this new theme and english language."
- );
+ if (lang != TransMan.getCurrentLanguage()) {
+ TransMan.setLanguage(lang.c_str());
+ 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 {
+ _curTheme->setLabel(g_gui.theme()->getThemeName());
+ ConfMan.set("gui_theme", theme);
}
}
draw();