diff --git a/stella/src/emucore/Settings.cxx b/stella/src/emucore/Settings.cxx index ad6ed1296..581f74276 100644 --- a/stella/src/emucore/Settings.cxx +++ b/stella/src/emucore/Settings.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Settings.cxx,v 1.79 2006-03-06 02:26:16 stephena Exp $ +// $Id: Settings.cxx,v 1.80 2006-03-09 17:04:01 stephena Exp $ //============================================================================ #include @@ -76,6 +76,7 @@ Settings::Settings(OSystem* osystem) setInternal("sssingle", "false"); setInternal("romdir", ""); + setInternal("rombrowse", "false"); setInternal("lastrom", ""); setInternal("modtime", ""); // romdir last modification time } diff --git a/stella/src/gui/LauncherDialog.cxx b/stella/src/gui/LauncherDialog.cxx index 5f6bc8547..a89a70446 100644 --- a/stella/src/gui/LauncherDialog.cxx +++ b/stella/src/gui/LauncherDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: LauncherDialog.cxx,v 1.44 2006-03-09 00:29:52 stephena Exp $ +// $Id: LauncherDialog.cxx,v 1.45 2006-03-09 17:04:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -45,8 +45,8 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent, int x, int y, int w, int h) : Dialog(osystem, parent, x, y, w, h), myStartButton(NULL), + myRelPrevButton(NULL), myOptionsButton(NULL), - myReloadButton(NULL), myQuitButton(NULL), myList(NULL), myGameList(NULL), @@ -100,44 +100,44 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent, xpos = 10; ypos += myNote->getHeight() + 4; #ifndef MAC_OSX myStartButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Play", kStartCmd, 'S'); + "Play", kStartCmd, 0); myStartButton->setEditable(true); wid.push_back(myStartButton); xpos += bwidth + 8; + myRelPrevButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, + "", kRelPrevCmd, 0); + myRelPrevButton->setEditable(true); + wid.push_back(myRelPrevButton); + xpos += bwidth + 8; myOptionsButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Options", kOptionsCmd, 'O'); + "Options", kOptionsCmd, 0); myOptionsButton->setEditable(true); wid.push_back(myOptionsButton); xpos += bwidth + 8; - myReloadButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Reload", kReloadCmd, 'R'); - myReloadButton->setEditable(true); - wid.push_back(myReloadButton); - xpos += bwidth + 8; myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Quit", kQuitCmd, 'Q'); + "Quit", kQuitCmd, 0); myQuitButton->setEditable(true); wid.push_back(myQuitButton); xpos += bwidth + 8; mySelectedItem = 0; // Highlight 'Play' button #else myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Quit", kQuitCmd, 'Q'); + "Quit", kQuitCmd, 0); myQuitButton->setEditable(true); wid.push_back(myQuitButton); xpos += bwidth + 8; myOptionsButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Options", kOptionsCmd, 'O'); + "Options", kOptionsCmd, 0); myOptionsButton->setEditable(true); wid.push_back(myOptionsButton); xpos += bwidth + 8; - myReloadButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Reload", kReloadCmd, 'R'); - myReloadButton->setEditable(true); - wid.push_back(myReloadButton); + myRel_PrevButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, + "", kRelPrevCmd, 0); + myRel_PrevButton->setEditable(true); + wid.push_back(myRel_PrevButton); xpos += bwidth + 8; myStartButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, - "Play", kStartCmd, 'Q'); + "Play", kStartCmd, 0); myStartButton->setEditable(true); wid.push_back(myStartButton); xpos += bwidth + 8; @@ -154,6 +154,10 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent, myGameList = new GameList(); addToFocusList(wid); + + // (De)activate browse mode + myBrowseModeFlag = instance()->settings().getBool("rombrowse"); + myRelPrevButton->setLabel(myBrowseModeFlag ? "Go Up" : "Reload"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -178,8 +182,8 @@ void LauncherDialog::loadConfig() void LauncherDialog::enableButtons(bool enable) { myStartButton->setEnabled(enable); + myRelPrevButton->setEnabled(enable); myOptionsButton->setEnabled(enable); - myReloadButton->setEnabled(enable); myQuitButton->setEnabled(enable); } @@ -509,9 +513,13 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, parent()->addDialog(myOptions); break; - case kReloadCmd: - updateListing(true); // force a reload from disk + case kRelPrevCmd: + { + FilesystemNode dir(myCurrentDir); + myCurrentDir = dir.getParent().path(); + updateListing(!myBrowseModeFlag); // Force full update in non-browse mode break; + } case kListSelectionChangedCmd: item = myList->getSelected(); @@ -525,9 +533,15 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, break; case kRomDirChosenCmd: + myCurrentDir = instance()->settings().getString("romdir"); updateListing(); break; + case kBrowseChangedCmd: + myBrowseModeFlag = instance()->settings().getBool("rombrowse"); + myRelPrevButton->setLabel(myBrowseModeFlag ? "Go Up" : "Reload"); + break; + default: Dialog::handleCommand(sender, cmd, data, 0); } diff --git a/stella/src/gui/LauncherDialog.hxx b/stella/src/gui/LauncherDialog.hxx index bb4c36e0f..db74174b9 100644 --- a/stella/src/gui/LauncherDialog.hxx +++ b/stella/src/gui/LauncherDialog.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: LauncherDialog.hxx,v 1.16 2006-03-09 00:29:52 stephena Exp $ +// $Id: LauncherDialog.hxx,v 1.17 2006-03-09 17:04:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -39,7 +39,8 @@ enum { kChooseRomDirCmd = 'roms', // rom select kChooseSnapDirCmd = 'snps', // snap select kRomDirChosenCmd = 'romc', // rom chosen - kSnapDirChosenCmd = 'snpc' // snap chosen + kSnapDirChosenCmd = 'snpc', // snap chosen + kBrowseChangedCmd = 'broc' // browse mode toggled }; class LauncherDialog : public Dialog @@ -61,8 +62,8 @@ class LauncherDialog : public Dialog protected: ButtonWidget* myStartButton; + ButtonWidget* myRelPrevButton; ButtonWidget* myOptionsButton; - ButtonWidget* myReloadButton; ButtonWidget* myQuitButton; StringListWidget* myList; @@ -88,8 +89,8 @@ class LauncherDialog : public Dialog enum { kStartCmd = 'STRT', + kRelPrevCmd = 'REPV', kOptionsCmd = 'OPTI', - kReloadCmd = 'RELO', kQuitCmd = 'QUIT' }; }; diff --git a/stella/src/gui/LauncherOptionsDialog.cxx b/stella/src/gui/LauncherOptionsDialog.cxx index 595390a2f..51bd927cf 100644 --- a/stella/src/gui/LauncherOptionsDialog.cxx +++ b/stella/src/gui/LauncherOptionsDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: LauncherOptionsDialog.cxx,v 1.14 2006-02-22 17:38:04 stephena Exp $ +// $Id: LauncherOptionsDialog.cxx,v 1.15 2006-03-09 17:04:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -59,11 +59,16 @@ LauncherOptionsDialog::LauncherOptionsDialog( _w - xpos - 10, font.getLineHeight(), "", kTextAlignLeft); + // Use ROM browse mode + xpos = 30; ypos += myRomPath->getHeight() + 8; + myBrowseCheckbox = new CheckboxWidget(myTab, font, xpos, ypos, + "Browse folders"); + // 2) The snapshot settings tab myTab->addTab(" Snapshot Settings "); // Snapshot path - xpos = 15; + xpos = 15; ypos = vBorder + 5; new ButtonWidget(myTab, font, xpos, ypos, bwidth, bheight, "Path", kChooseSnapDirCmd, 0); xpos += bwidth + 20; @@ -82,7 +87,7 @@ LauncherOptionsDialog::LauncherOptionsDialog( mySnapTypePopup->appendEntry("md5sum", 2); // Snapshot single or multiple saves - xpos = 30; ypos += mySnapTypePopup->getHeight() + 8; + xpos = 30; ypos += mySnapTypePopup->getHeight() + 5; mySnapSingleCheckbox = new CheckboxWidget(myTab, font, xpos, ypos, "Multiple snapshots"); @@ -127,6 +132,9 @@ void LauncherOptionsDialog::loadConfig() s = instance()->settings().getString("romdir"); myRomPath->setLabel(s); + b = instance()->settings().getBool("rombrowse"); + myBrowseCheckbox->setState(b); + s = instance()->settings().getString("ssdir"); mySnapPath->setLabel(s); @@ -153,6 +161,9 @@ void LauncherOptionsDialog::saveConfig() s = myRomPath->getLabel(); instance()->settings().setString("romdir", s); + b = myBrowseCheckbox->getState(); + instance()->settings().setBool("rombrowse", b); + s = mySnapPath->getLabel(); instance()->settings().setString("ssdir", s); @@ -195,6 +206,7 @@ void LauncherOptionsDialog::handleCommand(CommandSender* sender, int cmd, case kOKCmd: saveConfig(); close(); + sendCommand(kBrowseChangedCmd, 0, 0); // Call this before refreshing ROMs sendCommand(kRomDirChosenCmd, 0, 0); // Let the boss know romdir has changed break; diff --git a/stella/src/gui/LauncherOptionsDialog.hxx b/stella/src/gui/LauncherOptionsDialog.hxx index 175a57e72..ccbff7d8f 100644 --- a/stella/src/gui/LauncherOptionsDialog.hxx +++ b/stella/src/gui/LauncherOptionsDialog.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: LauncherOptionsDialog.hxx,v 1.8 2006-02-22 17:38:04 stephena Exp $ +// $Id: LauncherOptionsDialog.hxx,v 1.9 2006-03-09 17:04:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -53,6 +53,7 @@ class LauncherOptionsDialog : public Dialog, public CommandSender // Rom path controls StaticTextWidget* myRomPath; + CheckboxWidget* myBrowseCheckbox; // Snapshot controls StaticTextWidget* mySnapPath;