[Scummvm-cvs-logs] SF.net SVN: scummvm: [25563] scummvm/trunk/gui
sev at users.sourceforge.net
sev at users.sourceforge.net
Tue Feb 13 22:06:46 CET 2007
Revision: 25563
http://scummvm.svn.sourceforge.net/scummvm/?rev=25563&view=rev
Author: sev
Date: 2007-02-13 13:06:45 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
Implement FR#1611172: GUI: Add autosave period widgets
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 2007-02-13 21:06:13 UTC (rev 25562)
+++ scummvm/trunk/gui/options.cpp 2007-02-13 21:06:45 UTC (rev 25563)
@@ -81,7 +81,11 @@
};
#endif
+static const char *savePeriodLabels[] = { "Never", "each 5 mins", "each 10 mins", "each 15 mins", "each 30 mins", 0 };
+static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 };
+
+
OptionsDialog::OptionsDialog(const String &domain, int x, int y, int w, int h)
: Dialog(x, y, w, h), _domain(domain) {
init();
@@ -697,6 +701,14 @@
new ButtonWidget(tab, "globaloptions_themebutton2", "Theme:", kChooseThemeCmd, 0);
_curTheme = new StaticTextWidget(tab, "globaloptions_curtheme", g_gui.theme()->getThemeName());
+ int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
+
+ _autosavePeriodPopUp = new PopUpWidget(tab, "globaloptions_autosaveperiod", "Autosave: ", labelWidth);
+
+ for (int i = 0; savePeriodLabels[i]; i++) {
+ _autosavePeriodPopUp->appendEntry(savePeriodLabels[i], savePeriodValues[i]);
+ }
+
// TODO: joystick setting
@@ -748,6 +760,14 @@
_extraPath->setLabel(extraPath);
}
#endif
+
+ // Misc Tab
+ _autosavePeriodPopUp->setSelected(1);
+ int value = ConfMan.getInt("autosave_period");
+ for (int i = 0; savePeriodLabels[i]; i++) {
+ if (value == savePeriodValues[i])
+ _autosavePeriodPopUp->setSelected(i);
+ }
}
void GlobalOptionsDialog::close() {
@@ -762,6 +782,8 @@
String extraPath(_extraPath->getLabel());
if (!extraPath.empty() && (extraPath != "None"))
ConfMan.set("extrapath", extraPath, _domain);
+
+ ConfMan.setInt("autosave_period", _autosavePeriodPopUp->getSelectedTag(), _domain);
}
OptionsDialog::close();
}
Modified: scummvm/trunk/gui/options.h
===================================================================
--- scummvm/trunk/gui/options.h 2007-02-13 21:06:13 UTC (rev 25562)
+++ scummvm/trunk/gui/options.h 2007-02-13 21:06:45 UTC (rev 25563)
@@ -155,7 +155,12 @@
StaticTextWidget *_themePath;
StaticTextWidget *_extraPath;
+ //
+ // Misc controls
+ //
StaticTextWidget *_curTheme;
+
+ PopUpWidget *_autosavePeriodPopUp;
};
} // End of namespace GUI
Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp 2007-02-13 21:06:13 UTC (rev 25562)
+++ scummvm/trunk/gui/theme-config.cpp 2007-02-13 21:06:45 UTC (rev 25563)
@@ -190,6 +190,8 @@
"glOff=((buttonHeight - kLineHeight) / 2 + 2)\n"
"globaloptions_themebutton2=10 yoffset buttonWidth buttonHeight\n"
"globaloptions_curtheme=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight\n"
+"yoffset=(yoffset + buttonHeight + 4)\n"
+"globaloptions_autosaveperiod=10 yoffset (parent.w - 10 - 25) (kLineHeight + 2)\n"
"\n"
"globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
"globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h\n"
Modified: scummvm/trunk/gui/themes/modern.ini
===================================================================
--- scummvm/trunk/gui/themes/modern.ini 2007-02-13 21:06:13 UTC (rev 25562)
+++ scummvm/trunk/gui/themes/modern.ini 2007-02-13 21:06:45 UTC (rev 25563)
@@ -304,6 +304,8 @@
glOff=((buttonHeight - kLineHeight) / 2 + 2)
globaloptions_themebutton2=10 yoffset buttonWidth buttonHeight
globaloptions_curtheme=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
+yoffset=(yoffset + buttonHeight + 12)
+globaloptions_autosaveperiod=10 yoffset (parent.w - 10 - 25) kPopUpHeight
globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h
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