added directory navigation support to launcher 'Select' button

This commit is contained in:
Thomas Jentzsch 2021-06-16 17:23:24 +02:00
parent b1e9572186
commit cbf1706a0a
3 changed files with 13 additions and 5 deletions

View File

@ -629,7 +629,7 @@
The tables below show the default settings.<br/><br/> The tables below show the default settings.<br/><br/>
Note: All key names are based on the US QWERTY <a href="https://en.wikipedia.org/wiki/Keyboard_layout"> Note: All key names are based on the US QWERTY <a href="https://en.wikipedia.org/wiki/Keyboard_layout">
keyboard layout.</a>. If you use a different layout some keys may differ. You can use the keyboard layout</a>. If you use a different layout some keys may differ. You can use the
following layout image as reference where to find the US keys on your keyboard. following layout image as reference where to find the US keys on your keyboard.
</p> </p>
<p><img src="graphics/qwertz.png"></p> <p><img src="graphics/qwertz.png"></p>

View File

@ -77,6 +77,8 @@ class FileListWidget : public StringListWidget
/** Select parent directory (if applicable) */ /** Select parent directory (if applicable) */
void selectParent(); void selectParent();
/** Descend into currently selected directory */
void selectDirectory();
/** Reload current location (file or directory) */ /** Reload current location (file or directory) */
void reload(); void reload();
@ -98,9 +100,6 @@ class FileListWidget : public StringListWidget
/** Very similar to setDirectory(), but also updates the history */ /** Very similar to setDirectory(), but also updates the history */
void setLocation(const FilesystemNode& node, const string& select); void setLocation(const FilesystemNode& node, const string& select);
/** Descend into currently selected directory */
void selectDirectory();
bool handleText(char text) override; bool handleText(char text) override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override;

View File

@ -287,7 +287,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
"Select", kLoadROMCmd); "Select", kLoadROMCmd);
wid.push_back(myStartButton); wid.push_back(myStartButton);
#endif #endif
myStartButton->setToolTip("Start emulation of selected ROM."); myStartButton->setToolTip("Start emulation of selected ROM\nor switch to selected directory.");
} }
if(myUseMinimalUI) // Highlight 'Rom Listing' if(myUseMinimalUI) // Highlight 'Rom Listing'
mySelectedItem = 0; mySelectedItem = 0;
@ -789,6 +789,15 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
break; break;
case kLoadROMCmd: case kLoadROMCmd:
if(myList->selected().isDirectory())
{
if(myList->selected().getName() == " [..]")
myList->selectParent();
else
myList->selectDirectory();
break;
}
[[fallthrough]];
case FileListWidget::ItemActivated: case FileListWidget::ItemActivated:
saveConfig(); saveConfig();
loadRom(); loadRom();