aboutsummaryrefslogtreecommitdiff
path: root/gui/launcher.cpp
diff options
context:
space:
mode:
authorMax Horn2005-04-16 17:55:09 +0000
committerMax Horn2005-04-16 17:55:09 +0000
commitaea451f092a90bdc28bc8bd82508ec40b9920868 (patch)
tree54e7afc9cd5318b5d7413482509299fe5a0351bd /gui/launcher.cpp
parentcaf142657dad21aa80a09387e34786591b2088ed (diff)
downloadscummvm-rg350-aea451f092a90bdc28bc8bd82508ec40b9920868.tar.gz
scummvm-rg350-aea451f092a90bdc28bc8bd82508ec40b9920868.tar.bz2
scummvm-rg350-aea451f092a90bdc28bc8bd82508ec40b9920868.zip
Reunify DirBrowserDialog and FileBrowserDialog; implemented file browser mode for OSX, too; fixed some memory leaks in the launcher
svn-id: r17639
Diffstat (limited to 'gui/launcher.cpp')
-rw-r--r--gui/launcher.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 67b562dfd8..d9aa0a5789 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -370,16 +370,17 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// Change path for the game
case kCmdGameBrowser: {
- DirBrowserDialog *_browser = new DirBrowserDialog("Select additional game directory");
- if (_browser->runModal() > 0) {
+ BrowserDialog browser("Select additional game directory", true);
+ if (browser.runModal() > 0) {
// User made his choice...
- FilesystemNode dir(_browser->getResult());
+ FilesystemNode dir(browser.getResult());
// TODO: Verify the game can be found in the new directory... Best
// done with optional specific gameid to pluginmgr detectgames?
// FSList files = dir.listDir(FilesystemNode::kListFilesOnly);
_gamePathWidget->setLabel(dir.path());
+ draw();
}
draw();
break;
@@ -387,22 +388,24 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// Change path for extra game data (eg, using sword cutscenes when playing via CD)
case kCmdExtraBrowser: {
- DirBrowserDialog *_browser = new DirBrowserDialog("Select additional game directory");
- if (_browser->runModal() > 0) {
+ BrowserDialog browser("Select additional game directory", true);
+ if (browser.runModal() > 0) {
// User made his choice...
- FilesystemNode dir(_browser->getResult());
+ FilesystemNode dir(browser.getResult());
_extraPathWidget->setLabel(dir.path());
+ draw();
}
draw();
break;
}
// Change path for stored save game (perm and temp) data
case kCmdSaveBrowser: {
- DirBrowserDialog *_browser = new DirBrowserDialog("Select directory for saved games");
- if (_browser->runModal() > 0) {
+ BrowserDialog browser("Select directory for saved games", true);
+ if (browser.runModal() > 0) {
// User made his choice...
- FilesystemNode dir(_browser->getResult());
+ FilesystemNode dir(browser.getResult());
_savePathWidget->setLabel(dir.path());
+ draw();
}
draw();
break;
@@ -470,7 +473,7 @@ LauncherDialog::LauncherDialog(GameDetector &detector)
updateButtons();
// Create file browser dialog
- _browser = new DirBrowserDialog("Select directory with game data");
+ _browser = new BrowserDialog("Select directory with game data", true);
}
void LauncherDialog::selectGame(const String &name) {