aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2006-10-08 20:08:00 +0000
committerJohannes Schickel2006-10-08 20:08:00 +0000
commit3e59682e34e96a9bc41c502ada4b9d0948b46aa3 (patch)
tree32adb1701de409127a085a77b89455b9d8929fff
parentd24f0a7fbd9106b1fd3190d60f838fcfdf2f8309 (diff)
downloadscummvm-rg350-3e59682e34e96a9bc41c502ada4b9d0948b46aa3.tar.gz
scummvm-rg350-3e59682e34e96a9bc41c502ada4b9d0948b46aa3.tar.bz2
scummvm-rg350-3e59682e34e96a9bc41c502ada4b9d0948b46aa3.zip
Displaying the theme name instead of the theme config file name in the 'Misc' section of the Options dialog.
svn-id: r24231
-rw-r--r--gui/ThemeClassic.cpp5
-rw-r--r--gui/ThemeNew.cpp5
-rw-r--r--gui/options.cpp6
-rw-r--r--gui/theme.h3
4 files changed, 15 insertions, 4 deletions
diff --git a/gui/ThemeClassic.cpp b/gui/ThemeClassic.cpp
index af41f8ad05..1ec719bf8a 100644
--- a/gui/ThemeClassic.cpp
+++ b/gui/ThemeClassic.cpp
@@ -45,6 +45,11 @@ ThemeClassic::ThemeClassic(OSystem *system, const Common::String &config, const
else
loadConfigFile(_stylefile);
}
+
+ if (_configFile.hasKey("name", "theme"))
+ _configFile.getKey("name", "theme", _stylename);
+ else
+ _stylename = _stylefile;
}
ThemeClassic::~ThemeClassic() {
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp
index 78afbb487a..b510b78485 100644
--- a/gui/ThemeNew.cpp
+++ b/gui/ThemeNew.cpp
@@ -97,6 +97,11 @@ _lastUsedBitMask(0), _forceRedraw(false), _imageHandles(0), _images(0), _colors(
return;
}
+ if (_configFile.hasKey("name", "theme"))
+ _configFile.getKey("name", "theme", _stylename);
+ else
+ _stylename = _stylefile;
+
_images = new const Graphics::Surface*[kImageHandlesMax];
assert(_images);
diff --git a/gui/options.cpp b/gui/options.cpp
index 73ed138ff8..9e6a28c034 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -690,7 +690,7 @@ GlobalOptionsDialog::GlobalOptionsDialog()
tab->addTab("Misc");
new ButtonWidget(tab, "globaloptions_themebutton2", "Theme:", kChooseThemeCmd, 0);
- _curTheme = new StaticTextWidget(tab, "globaloptions_curtheme", ConfMan.get("gui_theme"));
+ _curTheme = new StaticTextWidget(tab, "globaloptions_curtheme", g_gui.theme()->getThemeName());
// TODO: joystick setting
@@ -808,10 +808,10 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
ThemeBrowser browser;
if (browser.runModal() > 0) {
// User made his choice...
- Common::String theme = browser.selected();
+ const Common::String &theme = browser.selected();
if (0 != theme.compareToIgnoreCase(g_gui.theme()->getStylefileName()))
if (g_gui.loadNewTheme(theme)) {
- _curTheme->setLabel(theme);
+ _curTheme->setLabel(g_gui.theme()->getThemeName());
ConfMan.set("gui_theme", theme);
}
draw();
diff --git a/gui/theme.h b/gui/theme.h
index 1c783d8166..022cf51b33 100644
--- a/gui/theme.h
+++ b/gui/theme.h
@@ -215,6 +215,7 @@ public:
static bool themeConfigUseable(const String &file, const String &style="", String *cStyle=0, Common::ConfigFile *cfg=0);
const String &getStylefileName() const { return _stylefile; }
+ const String &getThemeName() const { return _stylename; }
protected:
bool loadConfigFile(const String &file);
void getColorFromConfig(const String &name, OverlayColor &col);
@@ -223,7 +224,7 @@ protected:
const Graphics::Font *loadFont(const char *filename);
Common::String genCacheFilename(const char *filename);
- String _stylefile;
+ String _stylefile, _stylename;
Common::Rect _drawArea;
Common::ConfigFile _configFile;