While in ROM launcher browse mode, change the current 'Note' label and

string to 'Dir', indicating the current directory.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1104 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-05-18 12:20:06 +00:00
parent 6b9329adf1
commit 419a255cfb
1 changed files with 15 additions and 11 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: LauncherDialog.cxx,v 1.54 2006-05-04 17:45:25 stephena Exp $ // $Id: LauncherDialog.cxx,v 1.55 2006-05-18 12:20:06 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -75,9 +75,6 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
"", kTextAlignRight); "", kTextAlignRight);
// Add list with game titles // Add list with game titles
// The list isn't added to focus objects, but is instead made 'sticky'
// This means it will act as if it were focused (wrt how it's drawn), but
// won't actually be able to lose focus
xpos = 10; ypos += fontHeight + 5; xpos = 10; ypos += fontHeight + 5;
myList = new StringListWidget(this, font, xpos, ypos, myList = new StringListWidget(this, font, xpos, ypos,
_w - 20, _h - 28 - bheight - 2*fontHeight); _w - 20, _h - 28 - bheight - 2*fontHeight);
@ -149,7 +146,7 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
// (De)activate browse mode // (De)activate browse mode
myBrowseModeFlag = instance()->settings().getBool("rombrowse"); myBrowseModeFlag = instance()->settings().getBool("rombrowse");
myPrevDirButton->setEnabled(myBrowseModeFlag); myPrevDirButton->setEnabled(myBrowseModeFlag);
myNoteLabel->setEnabled(!myBrowseModeFlag); myNoteLabel->setLabel(myBrowseModeFlag ? "Dir:" : "Note:");
myCurrentNode = instance()->settings().getString("romdir"); myCurrentNode = instance()->settings().getString("romdir");
} }
@ -186,6 +183,7 @@ void LauncherDialog::updateListing(bool fullReload)
{ {
// Start with empty list // Start with empty list
myGameList->clear(); myGameList->clear();
myNote->setLabel("");
// If this is the first time using Stella, the romdir won't be set. // If this is the first time using Stella, the romdir won't be set.
// In that case, display the options dialog, and don't let Stella proceed // In that case, display the options dialog, and don't let Stella proceed
@ -207,6 +205,9 @@ void LauncherDialog::updateListing(bool fullReload)
// Only hilite the 'up' button if there's a parent directory // Only hilite the 'up' button if there's a parent directory
myPrevDirButton->setEnabled(myCurrentNode.hasParent()); myPrevDirButton->setEnabled(myCurrentNode.hasParent());
// Show current directory
myNote->setLabel(myCurrentNode.path());
} }
else else
{ {
@ -243,7 +244,7 @@ void LauncherDialog::updateListing(bool fullReload)
myRomCount->setLabel(buf.str()); myRomCount->setLabel(buf.str());
// Restore last selection // Restore last selection
if(!myList->getList().isEmpty()) if(!(myList->getList().isEmpty() || myBrowseModeFlag))
{ {
if(myBrowseModeFlag) if(myBrowseModeFlag)
myList->setSelected(0); myList->setSelected(0);
@ -455,9 +456,12 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
} }
case kListSelectionChangedCmd: case kListSelectionChangedCmd:
if(!myBrowseModeFlag)
{
item = myList->getSelected(); item = myList->getSelected();
if(item >= 0) if(item >= 0)
myNote->setLabel(myGameList->note(item)); myNote->setLabel(myGameList->note(item));
}
break; break;
case kQuitCmd: case kQuitCmd:
@ -478,7 +482,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
myCurrentNode = instance()->settings().getString("romdir"); myCurrentNode = instance()->settings().getString("romdir");
myBrowseModeFlag = instance()->settings().getBool("rombrowse"); myBrowseModeFlag = instance()->settings().getBool("rombrowse");
myPrevDirButton->setEnabled(myBrowseModeFlag); myPrevDirButton->setEnabled(myBrowseModeFlag);
myNoteLabel->setEnabled(!myBrowseModeFlag); myNoteLabel->setLabel(myBrowseModeFlag ? "Dir:" : "Note:");
break; break;
case kReloadRomDirCmd: case kReloadRomDirCmd: