[Scummvm-cvs-logs] CVS: scummvm/gui options.cpp,1.59,1.60 options.h,1.20,1.21
Eugene Sandulenko
sev at users.sourceforge.net
Sun Nov 14 20:43:04 CET 2004
Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30014/gui
Modified Files:
options.cpp options.h
Log Message:
Add global extrapath to GUI and to default directories list.
Index: options.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- options.cpp 6 Oct 2004 09:54:20 -0000 1.59
+++ options.cpp 15 Nov 2004 04:41:50 -0000 1.60
@@ -59,7 +59,8 @@
kMusicVolumeChanged = 'muvc',
kSfxVolumeChanged = 'sfvc',
kSpeechVolumeChanged = 'vcvc',
- kChooseSaveDirCmd = 'chos'
+ kChooseSaveDirCmd = 'chos',
+ kChooseExtraDirCmd = 'chex'
};
OptionsDialog::OptionsDialog(const String &domain, int x, int y, int w, int h)
@@ -407,7 +408,14 @@
// Save game path
new ButtonWidget(tab, 5, yoffset, kButtonWidth + 14, 16, "Save Path: ", kChooseSaveDirCmd, 0);
_savePath = new StaticTextWidget(tab, 5 + kButtonWidth + 20, yoffset + 3, _w - (5 + kButtonWidth + 20) - 10, kLineHeight, "/foo/bar", kTextAlignLeft);
+
+ yoffset += 18;
+
+ new ButtonWidget(tab, 5, yoffset, kButtonWidth + 14, 16, "Extra Path:", kChooseExtraDirCmd, 0);
+ _extraPath = new StaticTextWidget(tab, 5 + kButtonWidth + 20, yoffset + 3, _w - (5 + kButtonWidth + 20) - 10, kLineHeight, "None", kTextAlignLeft);
+ yoffset += 18;
#endif
+
// TODO: joystick setting
@@ -432,6 +440,8 @@
#if !( defined(__DC__) || defined(__GP32__) )
// Set _savePath to the current save path
Common::String dir(ConfMan.get("savepath", _domain));
+ Common::String extraPath(ConfMan.get("extrapath", _domain));
+
if (!dir.isEmpty()) {
_savePath->setLabel(dir);
} else {
@@ -440,6 +450,12 @@
getcwd(buf, sizeof(buf));
_savePath->setLabel(buf);
}
+
+ if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) {
+ _extraPath->setLabel("None");
+ } else {
+ _extraPath->setLabel(extraPath);
+ }
#endif
}
@@ -447,6 +463,10 @@
if (getResult()) {
// Savepath
ConfMan.set("savepath", _savePath->getLabel(), _domain);
+
+ String extraPath = _extraPath->getLabel();
+ if (!extraPath.isEmpty() && (extraPath != "None"))
+ ConfMan.set("extrapath", extraPath, _domain);
}
OptionsDialog::close();
}
@@ -461,6 +481,13 @@
// TODO - we should check if the directory is writeable before accepting it
}
break;
+ case kChooseExtraDirCmd:
+ if (_browser->runModal() > 0) {
+ // User made his choice...
+ FilesystemNode *dir = _browser->getResult();
+ _extraPath->setLabel(dir->path());
+ }
+ break;
default:
OptionsDialog::handleCommand(sender, cmd, data);
}
Index: options.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- options.h 6 Apr 2004 11:50:35 -0000 1.20
+++ options.h 15 Nov 2004 04:41:51 -0000 1.21
@@ -109,6 +109,7 @@
protected:
BrowserDialog *_browser;
StaticTextWidget *_savePath;
+ StaticTextWidget *_extraPath;
};
} // End of namespace GUI
More information about the Scummvm-git-logs
mailing list