mirror of https://github.com/stella-emu/stella.git
minor refactoring
This commit is contained in:
parent
27507fc4a4
commit
e2576c1f99
|
@ -325,6 +325,21 @@ void FileListWidget::handleCommand(CommandSender* sender, int cmd, int data, int
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case FileListWidget::kHomeDirCmd:
|
||||
// Do not let the boss know
|
||||
selectHomeDir();
|
||||
return;
|
||||
|
||||
case FileListWidget::kPrevDirCmd:
|
||||
// Do not let the boss know
|
||||
selectPrevHistory();
|
||||
return;
|
||||
|
||||
case FileListWidget::kNextDirCmd:
|
||||
// Do not let the boss know
|
||||
selectNextHistory();
|
||||
return;
|
||||
|
||||
case ListWidget::kParentDirCmd:
|
||||
selectParent();
|
||||
// Do not let the boss know
|
||||
|
|
|
@ -86,12 +86,6 @@ class FileListWidget : public StringListWidget
|
|||
virtual void selectDirectory();
|
||||
/** Select parent directory (if applicable) */
|
||||
void selectParent();
|
||||
/** Select to home directory */
|
||||
void selectHomeDir();
|
||||
/** Select previous directory in history (if applicable) */
|
||||
void selectPrevHistory();
|
||||
/** Select next directory in history (if applicable) */
|
||||
void selectNextHistory();
|
||||
/** Check if the there is a previous directory in history */
|
||||
bool hasPrevHistory();
|
||||
/** Check if the there is a next directory in history */
|
||||
|
@ -145,6 +139,12 @@ class FileListWidget : public StringListWidget
|
|||
protected:
|
||||
/** Very similar to setDirectory(), but also updates the history */
|
||||
void setLocation(const FilesystemNode& node, const string select);
|
||||
/** Select to home directory */
|
||||
void selectHomeDir();
|
||||
/** Select previous directory in history (if applicable) */
|
||||
void selectPrevHistory();
|
||||
/** Select next directory in history (if applicable) */
|
||||
void selectNextHistory();
|
||||
virtual bool isDirectory(const FilesystemNode& node) const;
|
||||
virtual void getChildren(const FilesystemNode::CancelCheck& isCancelled);
|
||||
virtual void extendLists(StringList& list) { }
|
||||
|
|
|
@ -1008,19 +1008,19 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
break;
|
||||
|
||||
case FileListWidget::kHomeDirCmd:
|
||||
myList->selectHomeDir();
|
||||
myList->sendCommand(FileListWidget::kHomeDirCmd, 0, 0);
|
||||
break;
|
||||
|
||||
case FileListWidget::kPrevDirCmd:
|
||||
myList->selectPrevHistory();
|
||||
myList->sendCommand(FileListWidget::kPrevDirCmd, 0, 0);
|
||||
break;
|
||||
|
||||
case FileListWidget::kNextDirCmd:
|
||||
myList->selectNextHistory();
|
||||
myList->sendCommand(FileListWidget::kNextDirCmd, 0, 0);
|
||||
break;
|
||||
|
||||
case ListWidget::kParentDirCmd:
|
||||
myList->selectParent();
|
||||
myList->sendCommand(ListWidget::kParentDirCmd, 0, 0);
|
||||
break;
|
||||
|
||||
case kLoadROMCmd:
|
||||
|
|
Loading…
Reference in New Issue