aboutsummaryrefslogtreecommitdiff
path: root/gui/launcher.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2011-10-24 19:34:10 +0100
committerEugene Sandulenko2011-10-25 14:56:05 +0100
commit2b6c2da831970fff17035cc38dd6ad44a6ac06b4 (patch)
tree8c222fd21221e551270317fe8f840b58ebfba765 /gui/launcher.cpp
parent202cce30b3d6e1e3912f6eee97a1e8a72a80d70f (diff)
downloadscummvm-rg350-2b6c2da831970fff17035cc38dd6ad44a6ac06b4.tar.gz
scummvm-rg350-2b6c2da831970fff17035cc38dd6ad44a6ac06b4.tar.bz2
scummvm-rg350-2b6c2da831970fff17035cc38dd6ad44a6ac06b4.zip
GUI: Added clear button to paths
Diffstat (limited to 'gui/launcher.cpp')
-rw-r--r--gui/launcher.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index b7d6e51958..a2407dcfd5 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -71,8 +71,10 @@ enum {
kCmdChooseSoundFontCmd = 'chsf',
kCmdExtraBrowser = 'PEXT',
+ kCmdExtraPathClear = 'PEXC',
kCmdGameBrowser = 'PGME',
- kCmdSaveBrowser = 'PSAV'
+ kCmdSaveBrowser = 'PSAV',
+ kCmdSavePathClear = 'PSAC'
};
/*
@@ -129,6 +131,8 @@ protected:
StaticTextWidget *_gamePathWidget;
StaticTextWidget *_extraPathWidget;
StaticTextWidget *_savePathWidget;
+ ButtonWidget *_extraPathClearButton;
+ ButtonWidget *_savePathClearButton;
StaticTextWidget *_langPopUpDesc;
PopUpWidget *_langPopUp;
@@ -300,6 +304,15 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
new ButtonWidget(tab, "GameOptions_Paths.Extrapath", _c("Extra Path:", "lowres"), _("Specifies path to additional data used the game"), kCmdExtraBrowser);
_extraPathWidget = new StaticTextWidget(tab, "GameOptions_Paths.ExtrapathText", extraPath, _("Specifies path to additional data used the game"));
+#ifndef DISABLE_FANCY_THEMES
+ if (g_gui.xmlEval()->getVar("Globals.ShowSearchPic") == 1 && g_gui.theme()->supportsImages()) {
+ _extraPathClearButton = new PicButtonWidget(tab, "GameOptions_Paths.ExtraPathClearButton", _("Clear value"), kCmdExtraPathClear);
+ ((PicButtonWidget *)_extraPathClearButton)->useThemeTransparency(true);
+ ((PicButtonWidget *)_extraPathClearButton)->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEraser));
+ } else
+#endif
+ _extraPathClearButton = new ButtonWidget(tab, "GameOptions_Paths.ExtraPathClearButton", "C", _("Clear value"), kCmdExtraPathClear);
+
// GUI: Button + Label for the save path
if (g_system->getOverlayWidth() > 320)
new ButtonWidget(tab, "GameOptions_Paths.Savepath", _("Save Path:"), _("Specifies where your savegames are put"), kCmdSaveBrowser);
@@ -307,6 +320,16 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
new ButtonWidget(tab, "GameOptions_Paths.Savepath", _c("Save Path:", "lowres"), _("Specifies where your savegames are put"), kCmdSaveBrowser);
_savePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.SavepathText", savePath, _("Specifies where your savegames are put"));
+#ifndef DISABLE_FANCY_THEMES
+ if (g_gui.xmlEval()->getVar("Globals.ShowSearchPic") == 1 && g_gui.theme()->supportsImages()) {
+ _savePathClearButton = new PicButtonWidget(tab, "GameOptions_Paths.SavePathClearButton", _("Clear value"), kCmdSavePathClear);
+ ((PicButtonWidget *)_savePathClearButton)->useThemeTransparency(true);
+ ((PicButtonWidget *)_savePathClearButton)->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEraser));
+ } else
+#endif
+ _savePathClearButton = new ButtonWidget(tab, "GameOptions_Paths.SavePathClearButton", "C", _("Clear value"), kCmdSavePathClear);
+
+
// Activate the first tab
tab->setActiveTab(0);
_tabWidget = tab;
@@ -410,10 +433,14 @@ void EditGameDialog::close() {
String extraPath(_extraPathWidget->getLabel());
if (!extraPath.empty() && (extraPath != _c("None", "path")))
ConfMan.set("extrapath", extraPath, _domain);
+ else
+ ConfMan.removeKey("extrapath", _domain);
String savePath(_savePathWidget->getLabel());
if (!savePath.empty() && (savePath != _("Default")))
ConfMan.set("savepath", savePath, _domain);
+ else
+ ConfMan.removeKey("savepath", _domain);
Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag();
if (platform < 0)
@@ -510,6 +537,14 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
break;
}
+ case kCmdExtraPathClear:
+ _extraPathWidget->setLabel(_c("None", "path"));
+ break;
+
+ case kCmdSavePathClear:
+ _savePathWidget->setLabel(_("Default"));
+ break;
+
case kOKCmd: {
// Write back changes made to config object
String newDomain(_domainWidget->getEditString());