diff options
-rw-r--r-- | gui/launcher.cpp | 2 | ||||
-rw-r--r-- | gui/options.cpp | 31 | ||||
-rw-r--r-- | gui/options.h | 2 |
3 files changed, 16 insertions, 19 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 4a5b6d7e9f..8469e613b7 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -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()); diff --git a/gui/options.cpp b/gui/options.cpp index 3c51066710..8e1af7fc35 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -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(); diff --git a/gui/options.h b/gui/options.h index 9a35fe8d12..73f9479521 100644 --- a/gui/options.h +++ b/gui/options.h @@ -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 |