From 2b6c2da831970fff17035cc38dd6ad44a6ac06b4 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Mon, 24 Oct 2011 19:34:10 +0100
Subject: GUI: Added clear button to paths
---
gui/ThemeEngine.h | 2 +-
gui/launcher.cpp | 37 +-
gui/options.cpp | 42 +
gui/options.h | 3 +
gui/themes/default.inc | 2872 ++++++++++----------
gui/themes/scummclassic.zip | Bin 91096 -> 92312 bytes
gui/themes/scummclassic/THEMERC | 2 +-
gui/themes/scummclassic/classic_layout.stx | 20 +
gui/themes/scummclassic/classic_layout_lowres.stx | 20 +
gui/themes/scummmodern.zip | Bin 199391 -> 200607 bytes
gui/themes/scummmodern/THEMERC | 2 +-
gui/themes/scummmodern/scummmodern_layout.stx | 20 +
.../scummmodern/scummmodern_layout_lowres.stx | 20 +
13 files changed, 1620 insertions(+), 1420 deletions(-)
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 5783401570..d9b1f09f25 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -35,7 +35,7 @@
#include "graphics/pixelformat.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.3"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.4"
class OSystem;
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());
diff --git a/gui/options.cpp b/gui/options.cpp
index 1b9316f449..4bc7ce30ad 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -52,8 +52,11 @@ enum {
kChooseSoundFontCmd = 'chsf',
kClearSoundFontCmd = 'clsf',
kChooseSaveDirCmd = 'chos',
+ kSavePathClearCmd = 'clsp',
kChooseThemeDirCmd = 'chth',
+ kThemePathClearCmd = 'clth',
kChooseExtraDirCmd = 'chex',
+ kExtraPathClearCmd = 'clex',
kChoosePluginsDirCmd = 'chpl',
kChooseThemeCmd = 'chtf'
};
@@ -847,6 +850,7 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
else
_soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _c("SoundFont:", "lowres"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd);
_soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _c("None", "soundfont"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"));
+
#ifndef DISABLE_FANCY_THEMES
if (g_gui.xmlEval()->getVar("Globals.ShowSearchPic") == 1 && g_gui.theme()->supportsImages()) {
_soundFontClearButton = new PicButtonWidget(boss, prefix + "mcFontClearButton", _("Clear value"), kClearSoundFontCmd);
@@ -1112,18 +1116,45 @@ GlobalOptionsDialog::GlobalOptionsDialog()
new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _c("Save Path:", "lowres"), _("Specifies where your savegames are put"), kChooseSaveDirCmd);
_savePath = new StaticTextWidget(tab, "GlobalOptions_Paths.SavePath", "/foo/bar", _("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, "GlobalOptions_Paths.SavePathClearButton", _("Clear value"), kSavePathClearCmd);
+ ((PicButtonWidget *)_savePathClearButton)->useThemeTransparency(true);
+ ((PicButtonWidget *)_savePathClearButton)->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEraser));
+ } else
+#endif
+ _savePathClearButton = new ButtonWidget(tab, "GlobalOptions_Paths.SavePathClearButton", "C", _("Clear value"), kSavePathClearCmd);
+
if (g_system->getOverlayWidth() > 320)
new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), 0, kChooseThemeDirCmd);
else
new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _c("Theme Path:", "lowres"), 0, kChooseThemeDirCmd);
_themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _c("None", "path"));
+#ifndef DISABLE_FANCY_THEMES
+ if (g_gui.xmlEval()->getVar("Globals.ShowSearchPic") == 1 && g_gui.theme()->supportsImages()) {
+ _themePathClearButton = new PicButtonWidget(tab, "GlobalOptions_Paths.ThemePathClearButton", _("Clear value"), kThemePathClearCmd);
+ ((PicButtonWidget *)_themePathClearButton)->useThemeTransparency(true);
+ ((PicButtonWidget *)_themePathClearButton)->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEraser));
+ } else
+#endif
+ _themePathClearButton = new ButtonWidget(tab, "GlobalOptions_Paths.ThemePathClearButton", "C", _("Clear value"), kThemePathClearCmd);
+
if (g_system->getOverlayWidth() > 320)
new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
else
new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _c("Extra Path:", "lowres"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
_extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _c("None", "path"), _("Specifies path to additional data used by all games or ScummVM"));
+#ifndef DISABLE_FANCY_THEMES
+ if (g_gui.xmlEval()->getVar("Globals.ShowSearchPic") == 1 && g_gui.theme()->supportsImages()) {
+ _extraPathClearButton = new PicButtonWidget(tab, "GlobalOptions_Paths.ExtraPathClearButton", _("Clear value"), kExtraPathClearCmd);
+ ((PicButtonWidget *)_extraPathClearButton)->useThemeTransparency(true);
+ ((PicButtonWidget *)_extraPathClearButton)->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEraser));
+ } else
+#endif
+ _extraPathClearButton = new ButtonWidget(tab, "GlobalOptions_Paths.ExtraPathClearButton", "C", _("Clear value"), kExtraPathClearCmd);
+
#ifdef DYNAMIC_MODULES
if (g_system->getOverlayWidth() > 320)
new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), 0, kChoosePluginsDirCmd);
@@ -1276,6 +1307,8 @@ void GlobalOptionsDialog::close() {
Common::String savePath(_savePath->getLabel());
if (!savePath.empty() && (savePath != _c("None", "path")))
ConfMan.set("savepath", savePath, _domain);
+ else
+ ConfMan.removeKey("savepath", _domain);
Common::String themePath(_themePath->getLabel());
if (!themePath.empty() && (themePath != _c("None", "path")))
@@ -1383,6 +1416,15 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
break;
}
#endif
+ case kThemePathClearCmd:
+ _themePath->setLabel(_c("None", "path"));
+ break;
+ case kExtraPathClearCmd:
+ _extraPath->setLabel(_c("None", "path"));
+ break;
+ case kSavePathClearCmd:
+ _savePath->setLabel(_c("None", "path"));
+ break;
case kChooseSoundFontCmd: {
BrowserDialog browser(_("Select SoundFont"), false);
if (browser.runModal() > 0) {
diff --git a/gui/options.h b/gui/options.h
index c6b1d328c1..92ce3e5df4 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -196,8 +196,11 @@ protected:
KeysDialog *_keysDialog;
#endif
StaticTextWidget *_savePath;
+ ButtonWidget *_savePathClearButton;
StaticTextWidget *_themePath;
+ ButtonWidget *_themePathClearButton;
StaticTextWidget *_extraPath;
+ ButtonWidget *_extraPathClearButton;
#ifdef DYNAMIC_MODULES
StaticTextWidget *_pluginsPath;
#endif
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 2716e6ca72..4f42361a0f 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1,614 +1,688 @@
""
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
" "
-" "
-" "
-" "
-" "
+" "
-" "
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
+" "
" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
" "
-" "
+" "
+" "
+" "
" "
" "
" "
" "
" "
-" "
+" "
" "
@@ -1023,215 +1138,259 @@
"type='SmallLabel' "
"/> "
" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
+" "
+" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
+" "
" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
" "
-" "
-" "
" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
" "
-" "
" "
" "
" "
-" "
-" "
+" "
+" "
" "
" "
" "
@@ -1244,168 +1403,90 @@
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
" "
" "
-" "
-" "
+" "
+" "
" "
-" "
-" "
" "
" "
-" "
-" "
" "
-" "
" "
-" "
-" "
" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
" "
" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
" "
" "
" "
" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
" "
-" "
-" "
+" "
" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
" "
+" "
+" "
" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
-" "
-" "
-" "
+" "
+" "
-" "
" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
" "
-" "
-" "
" "
" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
+" "
-" "
+" "
+" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
-" "
-" "
+" "
+" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
+" "
+" "
+" "
-" "
-" "
-" "
-" "
+" "
-" "
-" "
-" "
-" "
-" "
+" "
+" "
+" "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index a7f9cc5f56..dfc7e5c66c 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 17e934d5ef..b871dfe430 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.3:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.4:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 4b42b4f36d..3d916e28e9 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -388,6 +388,10 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+