diff options
-rw-r--r-- | gui/options.cpp | 31 | ||||
-rw-r--r-- | gui/options.h | 1 | ||||
-rw-r--r-- | gui/theme-config.cpp | 3 | ||||
-rw-r--r-- | gui/themes/modern.ini | 3 |
4 files changed, 35 insertions, 3 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index 51fe437b42..75835191af 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -65,6 +65,7 @@ enum { kSpeechVolumeChanged = 'vcvc', kChooseSoundFontCmd = 'chsf', kChooseSaveDirCmd = 'chos', + kChooseThemeDirCmd = 'chth', kChooseExtraDirCmd = 'chex' }; @@ -644,6 +645,9 @@ GlobalOptionsDialog::GlobalOptionsDialog() 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 @@ void GlobalOptionsDialog::open() { #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 @@ void GlobalOptionsDialog::open() { _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 @@ void GlobalOptionsDialog::close() { // 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 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 } 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) { diff --git a/gui/options.h b/gui/options.h index 2fe38b2ba0..adc238c558 100644 --- a/gui/options.h +++ b/gui/options.h @@ -147,6 +147,7 @@ protected: KeysDialog *_keysDialog; #endif StaticTextWidget *_savePath; + StaticTextWidget *_themePath; StaticTextWidget *_extraPath; }; diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp index fe4b5952a4..691681f151 100644 --- a/gui/theme-config.cpp +++ b/gui/theme-config.cpp @@ -166,6 +166,9 @@ const char *Theme::_defaultConfigINI = "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" diff --git a/gui/themes/modern.ini b/gui/themes/modern.ini index aa25e0f0e5..d1c53a0382 100644 --- a/gui/themes/modern.ini +++ b/gui/themes/modern.ini @@ -277,6 +277,9 @@ glOff=((buttonHeight - kLineHeight) / 2 + 2) 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) |