committed patch #1255847, thanks Simon Sawatzki.

svn-id: r18653
This commit is contained in:
Gregory Montoir 2005-08-10 18:30:55 +00:00
parent 3e7feb5cb1
commit 42d4032b59
3 changed files with 16 additions and 19 deletions

View File

@ -409,7 +409,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// Change path for the game
case kCmdGameBrowser: {
BrowserDialog browser("Select additional game directory", true);
BrowserDialog browser("Select directory with game data", true);
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(browser.getResult());

View File

@ -571,19 +571,12 @@ GlobalOptionsDialog::GlobalOptionsDialog()
addButton(this, _w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
addButton(this, _w - (buttonWidth + 10), _h - buttonHeight - 8, "OK", kOKCmd, 0, ws);
// Create file browser dialogs
_dirBrowser = new BrowserDialog("Select directory for savegames", true);
_fileBrowser = new BrowserDialog("Select SoundFont", false);
#ifdef SMALL_SCREEN_DEVICE
_keysDialog = new KeysDialog();
#endif
}
GlobalOptionsDialog::~GlobalOptionsDialog() {
delete _dirBrowser;
delete _fileBrowser;
#ifdef SMALL_SCREEN_DEVICE
delete _keysDialog;
#endif
@ -639,31 +632,37 @@ void GlobalOptionsDialog::close() {
void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
switch (cmd) {
case kChooseSaveDirCmd:
if (_dirBrowser->runModal() > 0) {
case kChooseSaveDirCmd: {
BrowserDialog browser("Select directory for savegames", true);
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(_dirBrowser->getResult());
FilesystemNode dir(browser.getResult());
_savePath->setLabel(dir.path());
draw();
// TODO - we should check if the directory is writeable before accepting it
}
break;
case kChooseExtraDirCmd:
if (_dirBrowser->runModal() > 0) {
}
case kChooseExtraDirCmd: {
BrowserDialog browser("Select directory for extra files", true);
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(_dirBrowser->getResult());
FilesystemNode dir(browser.getResult());
_extraPath->setLabel(dir.path());
draw();
}
break;
case kChooseSoundFontCmd:
if (_fileBrowser->runModal() > 0) {
}
case kChooseSoundFontCmd: {
BrowserDialog browser("Select SoundFont", false);
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode file(_fileBrowser->getResult());
FilesystemNode file(browser.getResult());
_soundFont->setLabel(file.path());
draw();
}
break;
}
#ifdef SMALL_SCREEN_DEVICE
case kChooseKeyMappingCmd:
_keysDialog->runModal();

View File

@ -118,8 +118,6 @@ public:
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
protected:
BrowserDialog *_dirBrowser;
BrowserDialog *_fileBrowser;
#ifdef SMALL_SCREEN_DEVICE
KeysDialog *_keysDialog;
#endif