[Scummvm-cvs-logs] SF.net SVN: scummvm: [24231] scummvm/trunk/gui

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Oct 8 22:08:09 CEST 2006


Revision: 24231
          http://svn.sourceforge.net/scummvm/?rev=24231&view=rev
Author:   lordhoto
Date:     2006-10-08 13:08:00 -0700 (Sun, 08 Oct 2006)

Log Message:
-----------
Displaying the theme name instead of the theme config file name in the 'Misc' section of the Options dialog.

Modified Paths:
--------------
    scummvm/trunk/gui/ThemeClassic.cpp
    scummvm/trunk/gui/ThemeNew.cpp
    scummvm/trunk/gui/options.cpp
    scummvm/trunk/gui/theme.h

Modified: scummvm/trunk/gui/ThemeClassic.cpp
===================================================================
--- scummvm/trunk/gui/ThemeClassic.cpp	2006-10-08 19:54:52 UTC (rev 24230)
+++ scummvm/trunk/gui/ThemeClassic.cpp	2006-10-08 20:08:00 UTC (rev 24231)
@@ -45,6 +45,11 @@
 		else
 			loadConfigFile(_stylefile);
 	}
+
+	if (_configFile.hasKey("name", "theme"))
+		_configFile.getKey("name", "theme", _stylename);
+	else
+		_stylename = _stylefile;
 }
 
 ThemeClassic::~ThemeClassic() {

Modified: scummvm/trunk/gui/ThemeNew.cpp
===================================================================
--- scummvm/trunk/gui/ThemeNew.cpp	2006-10-08 19:54:52 UTC (rev 24230)
+++ scummvm/trunk/gui/ThemeNew.cpp	2006-10-08 20:08:00 UTC (rev 24231)
@@ -97,6 +97,11 @@
 		return;
 	}
 
+	if (_configFile.hasKey("name", "theme"))
+		_configFile.getKey("name", "theme", _stylename);
+	else
+		_stylename = _stylefile;
+
 	_images = new const Graphics::Surface*[kImageHandlesMax];
 	assert(_images);
 

Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp	2006-10-08 19:54:52 UTC (rev 24230)
+++ scummvm/trunk/gui/options.cpp	2006-10-08 20:08:00 UTC (rev 24231)
@@ -690,7 +690,7 @@
 	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 @@
 		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();

Modified: scummvm/trunk/gui/theme.h
===================================================================
--- scummvm/trunk/gui/theme.h	2006-10-08 19:54:52 UTC (rev 24230)
+++ scummvm/trunk/gui/theme.h	2006-10-08 20:08:00 UTC (rev 24231)
@@ -215,6 +215,7 @@
 	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 @@
 	const Graphics::Font *loadFont(const char *filename);
 	Common::String genCacheFilename(const char *filename);
 
-	String _stylefile;
+	String _stylefile, _stylename;
 
 	Common::Rect _drawArea;
 	Common::ConfigFile _configFile;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list