[Scummvm-cvs-logs] SF.net SVN: scummvm: [23032] scummvm/trunk/gui
sev at users.sourceforge.net
sev at users.sourceforge.net
Sun Jun 11 22:40:41 CEST 2006
Revision: 23032
Author: sev
Date: 2006-06-11 13:40:22 -0700 (Sun, 11 Jun 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23032&view=rev
Log Message:
-----------
Patch from bugreport #1502409: "Search ScummVM directory for GUI theme".
It adds theme patch setting to GUI.
Modified Paths:
--------------
scummvm/trunk/gui/options.cpp
scummvm/trunk/gui/options.h
scummvm/trunk/gui/theme-config.cpp
scummvm/trunk/gui/themes/modern.ini
Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp 2006-06-11 20:30:43 UTC (rev 23031)
+++ scummvm/trunk/gui/options.cpp 2006-06-11 20:40:22 UTC (rev 23032)
@@ -65,6 +65,7 @@
kSpeechVolumeChanged = 'vcvc',
kChooseSoundFontCmd = 'chsf',
kChooseSaveDirCmd = 'chos',
+ kChooseThemeDirCmd = 'chth',
kChooseExtraDirCmd = 'chex'
};
@@ -644,6 +645,9 @@
new ButtonWidget(tab, "globaloptions_savebutton", "Save Path: ", kChooseSaveDirCmd, 0);
_savePath = new StaticTextWidget(tab, "globaloptions_savepath", "/foo/bar");
+ new ButtonWidget(tab, "globaloptions_themebutton", "Theme Path:", kChooseThemeDirCmd, 0);
+ _themePath = new StaticTextWidget(tab, "globaloptions_themepath", "None");
+
new ButtonWidget(tab, "globaloptions_extrabutton", "Extra Path:", kChooseExtraDirCmd, 0);
_extraPath = new StaticTextWidget(tab, "globaloptions_extrapath", "None");
#endif
@@ -678,11 +682,12 @@
#if !( defined(__DC__) || defined(__GP32__) || defined(__PLAYSTATION2__) )
// Set _savePath to the current save path
- Common::String dir(ConfMan.get("savepath", _domain));
+ Common::String savePath(ConfMan.get("savepath", _domain));
+ Common::String themePath(ConfMan.get("themepath", _domain));
Common::String extraPath(ConfMan.get("extrapath", _domain));
- if (!dir.empty()) {
- _savePath->setLabel(dir);
+ if (!savePath.empty()) {
+ _savePath->setLabel(savePath);
} else {
// Default to the current directory...
char buf[MAXPATHLEN];
@@ -690,6 +695,12 @@
_savePath->setLabel(buf);
}
+ if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) {
+ _themePath->setLabel("None");
+ } else {
+ _themePath->setLabel(themePath);
+ }
+
if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
_extraPath->setLabel("None");
} else {
@@ -703,6 +714,10 @@
// Savepath
ConfMan.set("savepath", _savePath->getLabel(), _domain);
+ String themePath(_themePath->getLabel());
+ if (!themePath.empty() && (themePath != "None"))
+ ConfMan.set("themepath", themePath, _domain);
+
String extraPath(_extraPath->getLabel());
if (!extraPath.empty() && (extraPath != "None"))
ConfMan.set("extrapath", extraPath, _domain);
@@ -723,6 +738,16 @@
}
break;
}
+ case kChooseThemeDirCmd: {
+ BrowserDialog browser("Select directory for GUI themes", true);
+ if (browser.runModal() > 0) {
+ // User made his choice...
+ FilesystemNode dir(browser.getResult());
+ _themePath->setLabel(dir.path());
+ draw();
+ }
+ break;
+ }
case kChooseExtraDirCmd: {
BrowserDialog browser("Select directory for extra files", true);
if (browser.runModal() > 0) {
Modified: scummvm/trunk/gui/options.h
===================================================================
--- scummvm/trunk/gui/options.h 2006-06-11 20:30:43 UTC (rev 23031)
+++ scummvm/trunk/gui/options.h 2006-06-11 20:40:22 UTC (rev 23032)
@@ -147,6 +147,7 @@
KeysDialog *_keysDialog;
#endif
StaticTextWidget *_savePath;
+ StaticTextWidget *_themePath;
StaticTextWidget *_extraPath;
};
Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp 2006-06-11 20:30:43 UTC (rev 23031)
+++ scummvm/trunk/gui/theme-config.cpp 2006-06-11 20:40:22 UTC (rev 23032)
@@ -166,6 +166,9 @@
"globaloptions_savebutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
"globaloptions_savepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
"yoffset=(yoffset + buttonHeight + 4)\n"
+"globaloptions_themebutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
+"globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
+"yoffset=(yoffset + buttonHeight + 4)\n"
"globaloptions_extrabutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
"globaloptions_extrapath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
"yoffset=(yoffset + buttonHeight + 4)\n"
Modified: scummvm/trunk/gui/themes/modern.ini
===================================================================
--- scummvm/trunk/gui/themes/modern.ini 2006-06-11 20:30:43 UTC (rev 23031)
+++ scummvm/trunk/gui/themes/modern.ini 2006-06-11 20:40:22 UTC (rev 23032)
@@ -277,6 +277,9 @@
globaloptions_savebutton=10 yoffset buttonWidth buttonHeight
globaloptions_savepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
yoffset=(yoffset + buttonHeight + 8)
+globaloptions_themebutton=10 yoffset buttonWidth buttonHeight
+globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
+yoffset=(yoffset + buttonHeight + 8)
globaloptions_extrabutton=10 yoffset buttonWidth buttonHeight
globaloptions_extrapath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
yoffset=(yoffset + buttonHeight + 12)
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