mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 07:53:12 +00:00
GUI: Allow user to display hidden files in the browser dialog.
This implements feature request #3600774 "File browser: show hidden files".
This commit is contained in:
parent
69424b71bd
commit
0a3e00b307
@ -240,6 +240,8 @@ void registerDefaults() {
|
||||
ConfMan.registerDefault("gui_saveload_chooser", "grid");
|
||||
ConfMan.registerDefault("gui_saveload_last_pos", "0");
|
||||
|
||||
ConfMan.registerDefault("gui_browser_show_hidden", false);
|
||||
|
||||
#ifdef USE_FLUIDSYNTH
|
||||
// The settings are deliberately stored the same way as in Qsynth. The
|
||||
// FluidSynth music driver is responsible for transforming them into
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "graphics/pixelformat.h"
|
||||
|
||||
|
||||
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.19"
|
||||
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.20"
|
||||
|
||||
class OSystem;
|
||||
|
||||
|
@ -32,7 +32,8 @@ namespace GUI {
|
||||
|
||||
enum {
|
||||
kChooseCmd = 'Chos',
|
||||
kGoUpCmd = 'GoUp'
|
||||
kGoUpCmd = 'GoUp',
|
||||
kHiddenCmd = 'Hidd'
|
||||
};
|
||||
|
||||
/* We want to use this as a general directory selector at some point... possible uses
|
||||
@ -47,6 +48,7 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
|
||||
_isDirBrowser = dirBrowser;
|
||||
_fileList = NULL;
|
||||
_currentPath = NULL;
|
||||
_showHidden = ConfMan.getBool("gui_browser_show_hidden", Common::ConfigManager::kApplicationDomain);
|
||||
|
||||
// Headline - TODO: should be customizable during creation time
|
||||
new StaticTextWidget(this, "Browser.Headline", title);
|
||||
@ -61,6 +63,9 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
|
||||
|
||||
_backgroundType = GUI::ThemeEngine::kDialogBackgroundPlain;
|
||||
|
||||
// Checkbox for the "show hidden files" state.
|
||||
_showHiddenWidget = new CheckboxWidget(this, "Browser.Hidden", _("Show hidden files"), _("Show files marked with the hidden attribute"), kHiddenCmd);
|
||||
|
||||
// Buttons
|
||||
if (g_system->getOverlayWidth() > 320)
|
||||
new ButtonWidget(this, "Browser.Up", _("Go up"), _("Go to previous directory level"), kGoUpCmd);
|
||||
@ -132,6 +137,15 @@ void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
|
||||
if (data != (uint32)-1 && _isDirBrowser && !_nodeContent[data].isDirectory())
|
||||
_fileList->setSelected(-1);
|
||||
break;
|
||||
case kHiddenCmd:
|
||||
// Update whether the user wants hidden files to be shown
|
||||
_showHidden = _showHiddenWidget->getState();
|
||||
// We save the state in the application domain to avoid cluttering and
|
||||
// to prevent odd behavior.
|
||||
ConfMan.setBool("gui_browser_show_hidden", _showHidden, Common::ConfigManager::kApplicationDomain);
|
||||
// Update the file listing
|
||||
updateListing();
|
||||
break;
|
||||
default:
|
||||
Dialog::handleCommand(sender, cmd, data);
|
||||
}
|
||||
@ -145,7 +159,7 @@ void BrowserDialog::updateListing() {
|
||||
ConfMan.set("browser_lastpath", _node.getPath());
|
||||
|
||||
// Read in the data from the file system
|
||||
if (!_node.getChildren(_nodeContent, Common::FSNode::kListAll))
|
||||
if (!_node.getChildren(_nodeContent, Common::FSNode::kListAll, _showHidden))
|
||||
_nodeContent.clear();
|
||||
else
|
||||
Common::sort(_nodeContent.begin(), _nodeContent.end());
|
||||
|
@ -29,6 +29,7 @@ namespace GUI {
|
||||
|
||||
class ListWidget;
|
||||
class StaticTextWidget;
|
||||
class CheckboxWidget;
|
||||
class CommandSender;
|
||||
|
||||
class BrowserDialog : public Dialog {
|
||||
@ -40,6 +41,7 @@ public:
|
||||
virtual int runModal();
|
||||
#else
|
||||
virtual void open();
|
||||
|
||||
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
||||
#endif
|
||||
|
||||
@ -54,6 +56,8 @@ protected:
|
||||
StaticTextWidget *_currentPath;
|
||||
Common::FSNode _node;
|
||||
Common::FSList _nodeContent;
|
||||
bool _showHidden;
|
||||
CheckboxWidget *_showHiddenWidget;
|
||||
#endif
|
||||
Common::FSNode _choice;
|
||||
bool _isDirBrowser;
|
||||
|
@ -740,7 +740,11 @@
|
||||
"height='Globals.Line.Height' "
|
||||
"/> "
|
||||
"<widget name='List'/> "
|
||||
"<layout type='horizontal' padding='0,0,8,0'> "
|
||||
"<layout type='vertical' padding='0,0,8,0'> "
|
||||
"<widget name='Hidden' "
|
||||
"type='Checkbox' "
|
||||
"/> "
|
||||
"<layout type='horizontal' padding='0,0,0,0'> "
|
||||
"<widget name='Up' "
|
||||
"type='Button' "
|
||||
"/> "
|
||||
@ -753,6 +757,7 @@
|
||||
"/> "
|
||||
"</layout> "
|
||||
"</layout> "
|
||||
"</layout> "
|
||||
"</dialog> "
|
||||
"<dialog name='GlobalOptions' overlays='screen' inset='16' shading='dim'> "
|
||||
"<layout type='vertical' padding='0,0,0,0'> "
|
||||
@ -1868,7 +1873,11 @@
|
||||
"height='Globals.Line.Height' "
|
||||
"/> "
|
||||
"<widget name='List'/> "
|
||||
"<layout type='horizontal' padding='0,0,16,0'> "
|
||||
"<layout type='vertical' padding='0,0,16,0'> "
|
||||
"<widget name='Hidden' "
|
||||
"type='Checkbox' "
|
||||
"/> "
|
||||
"<layout type='horizontal' padding='0,0,0,0'> "
|
||||
"<widget name='Up' "
|
||||
"type='Button' "
|
||||
"/> "
|
||||
@ -1881,6 +1890,7 @@
|
||||
"/> "
|
||||
"</layout> "
|
||||
"</layout> "
|
||||
"</layout> "
|
||||
"</dialog> "
|
||||
"<dialog name='GlobalOptions' overlays='Dialog.Launcher.GameList' shading='dim'> "
|
||||
"<layout type='vertical' padding='0,0,0,0'> "
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
[SCUMMVM_STX0.8.19:ScummVM Classic Theme:No Author]
|
||||
[SCUMMVM_STX0.8.20:ScummVM Classic Theme:No Author]
|
||||
|
@ -166,17 +166,22 @@
|
||||
height = 'Globals.Line.Height'
|
||||
/>
|
||||
<widget name = 'List'/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 16, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
<layout type = 'vertical' padding = '0, 0, 16, 0'>
|
||||
<widget name = 'Hidden'
|
||||
type = 'Checkbox'
|
||||
/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
/>
|
||||
</layout>
|
||||
</layout>
|
||||
</layout>
|
||||
</dialog>
|
||||
|
@ -163,18 +163,22 @@
|
||||
height = 'Globals.Line.Height'
|
||||
/>
|
||||
<widget name = 'List'/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 8, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
<layout type = 'vertical' padding = '0, 0, 8, 0'>
|
||||
<widget name = 'Hidden'
|
||||
type = 'Checkbox'
|
||||
/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
/>
|
||||
</layout>
|
||||
</layout>
|
||||
</layout>
|
||||
</dialog>
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
[SCUMMVM_STX0.8.19:ScummVM Modern Theme:No Author]
|
||||
[SCUMMVM_STX0.8.20:ScummVM Modern Theme:No Author]
|
||||
|
@ -180,17 +180,22 @@
|
||||
height = 'Globals.Line.Height'
|
||||
/>
|
||||
<widget name = 'List'/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 16, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
<layout type = 'vertical' padding = '0, 0, 16, 0'>
|
||||
<widget name = 'Hidden'
|
||||
type = 'Checkbox'
|
||||
/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
/>
|
||||
</layout>
|
||||
</layout>
|
||||
</layout>
|
||||
</dialog>
|
||||
|
@ -161,18 +161,22 @@
|
||||
height = 'Globals.Line.Height'
|
||||
/>
|
||||
<widget name = 'List'/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 8, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
<layout type = 'vertical' padding = '0, 0, 8, 0'>
|
||||
<widget name = 'Hidden'
|
||||
type = 'Checkbox'
|
||||
/>
|
||||
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
|
||||
<widget name = 'Up'
|
||||
type = 'Button'
|
||||
/>
|
||||
<space/>
|
||||
<widget name = 'Cancel'
|
||||
type = 'Button'
|
||||
/>
|
||||
<widget name = 'Choose'
|
||||
type = 'Button'
|
||||
/>
|
||||
</layout>
|
||||
</layout>
|
||||
</layout>
|
||||
</dialog>
|
||||
|
Loading…
x
Reference in New Issue
Block a user