From 1ced1777f8baca3e93bd7adfeea3a9a1e66a8cb4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 8 Oct 2006 18:49:25 +0000 Subject: - Forcing 'classic' as the builtin classic theme (which means it ignores the classic.ini atm) svn-id: r24216 --- gui/ThemeClassic.cpp | 12 ++++++++---- gui/newgui.cpp | 22 +++++++++++++--------- gui/themebrowser.cpp | 7 +++++++ 3 files changed, 28 insertions(+), 13 deletions(-) (limited to 'gui') diff --git a/gui/ThemeClassic.cpp b/gui/ThemeClassic.cpp index 31efd12d51..1485b7e5e7 100644 --- a/gui/ThemeClassic.cpp +++ b/gui/ThemeClassic.cpp @@ -37,10 +37,14 @@ ThemeClassic::ThemeClassic(OSystem *system, const Common::String &config, const #endif _font = 0; - if (cfg) - _configFile = *cfg; - else - loadConfigFile(_stylefile); + // 'classic' is always the built in one, we force it and + // ignore all 'classic' named config files + if (config.compareToIgnoreCase("classic") != 0) { + if (cfg) + _configFile = *cfg; + else + loadConfigFile(_stylefile); + } } ThemeClassic::~ThemeClassic() { diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 211068c30f..d8acabf477 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -128,17 +128,21 @@ bool NewGui::loadNewTheme(const Common::String &style) { Common::String oldTheme = (_theme != 0) ? _theme->getStylefileName() : ""; delete _theme; - if (Theme::themeConfigUseable(style, "", &styleType, &cfg)) { - if (0 == styleType.compareToIgnoreCase("classic")) - _theme = new ThemeClassic(_system, style, &cfg); + if (style.compareToIgnoreCase("classic") == 0) { + _theme = new ThemeClassic(_system); + } else { + if (Theme::themeConfigUseable(style, "", &styleType, &cfg)) { + if (0 == styleType.compareToIgnoreCase("classic")) + _theme = new ThemeClassic(_system, style, &cfg); #ifndef DISABLE_FANCY_THEMES - else if (0 == styleType.compareToIgnoreCase("modern")) - _theme = new ThemeNew(_system, style, &cfg); + else if (0 == styleType.compareToIgnoreCase("modern")) + _theme = new ThemeNew(_system, style, &cfg); #endif - else - warning("Unsupported theme type '%s'", styleType.c_str()); - } else { - warning("Config '%s' is NOT usable for themes or not found", style.c_str()); + else + warning("Unsupported theme type '%s'", styleType.c_str()); + } else { + warning("Config '%s' is NOT usable for themes or not found", style.c_str()); + } } cfg.clear(); diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp index 5bda962db1..5b20d51996 100644 --- a/gui/themebrowser.cpp +++ b/gui/themebrowser.cpp @@ -82,6 +82,13 @@ void ThemeBrowser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) void ThemeBrowser::updateListing() { _themes.clear(); + + // classic is always build in + Entry th; + th.name = "classic"; + th.type = "classic"; + th.file = "classic"; + _themes.push_back(th); if (ConfMan.hasKey("themepath")) addDir(_themes, ConfMan.get("themepath"), 0); -- cgit v1.2.3