mirror of https://github.com/stella-emu/stella.git
Fixed 'Go Up' issue in Windows. Hopefully this doesn't break the Linux
code. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1060 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
8cff84b4d2
commit
0158d5ca95
|
@ -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: BrowserDialog.cxx,v 1.16 2006-03-19 22:06:20 stephena Exp $
|
||||
// $Id: BrowserDialog.cxx,v 1.17 2006-03-19 23:11:31 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -152,6 +152,7 @@ void BrowserDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void BrowserDialog::updateListing()
|
||||
{
|
||||
cerr << "node path = " << _node.path() << endl;
|
||||
// Update the path display
|
||||
_currentPath->setLabel(_node.path());
|
||||
|
||||
|
|
|
@ -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.50 2006-03-19 22:06:20 stephena Exp $
|
||||
// $Id: LauncherDialog.cxx,v 1.51 2006-03-19 23:11:31 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -52,8 +52,7 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
|||
myGameList(NULL),
|
||||
myProgressBar(NULL),
|
||||
mySelectedItem(0),
|
||||
myBrowseModeFlag(false),
|
||||
myCurrentDir("")
|
||||
myBrowseModeFlag(false)
|
||||
{
|
||||
const GUI::Font& font = instance()->launcherFont();
|
||||
|
||||
|
@ -159,6 +158,8 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
|||
myBrowseModeFlag = instance()->settings().getBool("rombrowse");
|
||||
myPrevDirButton->setEnabled(myBrowseModeFlag);
|
||||
myNoteLabel->setEnabled(!myBrowseModeFlag);
|
||||
|
||||
myCurrentNode = FilesystemNode(instance()->settings().getString("romdir"));
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -210,14 +211,10 @@ void LauncherDialog::updateListing(bool fullReload)
|
|||
// don't translate by md5sum at all
|
||||
if(myBrowseModeFlag)
|
||||
{
|
||||
if(myCurrentDir == "")
|
||||
myCurrentDir = romdir;
|
||||
|
||||
loadDirListing();
|
||||
|
||||
// Only hilite the 'up' button if there's a parent directory
|
||||
FilesystemNode dir(myCurrentDir);
|
||||
myPrevDirButton->setEnabled(dir.hasParent());
|
||||
myPrevDirButton->setEnabled(myCurrentNode.hasParent());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -288,8 +285,7 @@ void LauncherDialog::updateListing(bool fullReload)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::loadDirListing()
|
||||
{
|
||||
FilesystemNode dir(myCurrentDir);
|
||||
FSList files = dir.listDir(FilesystemNode::kListAll);
|
||||
FSList files = myCurrentNode.listDir(FilesystemNode::kListAll);
|
||||
|
||||
for(unsigned int idx = 0; idx < files.size(); idx++)
|
||||
{
|
||||
|
@ -501,7 +497,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
// Directory's should be selected (ie, enter them and redisplay)
|
||||
if(myBrowseModeFlag && myGameList->isDir(item))
|
||||
{
|
||||
myCurrentDir = entry;
|
||||
myCurrentNode = entry;//FilesystemNodemyCurrentNode[item];// _nodeContent[data];
|
||||
updateListing();
|
||||
}
|
||||
else if(instance()->createConsole(entry))
|
||||
|
@ -522,8 +518,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
|
||||
case kPrevDirCmd:
|
||||
{
|
||||
FilesystemNode dir(myCurrentDir);
|
||||
myCurrentDir = dir.getParent().path();
|
||||
myCurrentNode = myCurrentNode.getParent();
|
||||
updateListing(!myBrowseModeFlag); // Force full update in non-browse mode
|
||||
break;
|
||||
}
|
||||
|
@ -540,7 +535,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
break;
|
||||
|
||||
case kRomDirChosenCmd:
|
||||
myCurrentDir = instance()->settings().getString("romdir");
|
||||
myCurrentNode = instance()->settings().getString("romdir");
|
||||
updateListing();
|
||||
break;
|
||||
|
||||
|
@ -549,6 +544,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
break;
|
||||
|
||||
case kBrowseChangedCmd:
|
||||
myCurrentNode = instance()->settings().getString("romdir");
|
||||
myBrowseModeFlag = instance()->settings().getBool("rombrowse");
|
||||
myPrevDirButton->setEnabled(myBrowseModeFlag);
|
||||
myNoteLabel->setEnabled(!myBrowseModeFlag);
|
||||
|
|
|
@ -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.19 2006-03-19 20:57:55 stephena Exp $
|
||||
// $Id: LauncherDialog.hxx,v 1.20 2006-03-19 23:11:31 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -32,6 +32,7 @@ class ButtonWidget;
|
|||
class OSystem;
|
||||
|
||||
#include "Dialog.hxx"
|
||||
#include "FSNode.hxx"
|
||||
#include "GameList.hxx"
|
||||
#include "bspf.hxx"
|
||||
|
||||
|
@ -86,7 +87,7 @@ class LauncherDialog : public Dialog
|
|||
private:
|
||||
int mySelectedItem;
|
||||
bool myBrowseModeFlag;
|
||||
string myCurrentDir;
|
||||
FilesystemNode myCurrentNode;
|
||||
|
||||
enum {
|
||||
kStartCmd = 'STRT',
|
||||
|
|
Loading…
Reference in New Issue