[Scummvm-cvs-logs] scummvm master -> d0e9ef7dc12f5c9ff18f09536545c0e2e5e604d7

lordhoto lordhoto at gmail.com
Mon Jan 28 16:15:32 CET 2013


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0a3e00b307 GUI: Allow user to display hidden files in the browser dialog.
d0e9ef7dc1 Merge pull request #306 from lordhoto/filechooser-hidden


Commit: 0a3e00b307c7977fda9849b577a81c5c6304b8e5
    https://github.com/scummvm/scummvm/commit/0a3e00b307c7977fda9849b577a81c5c6304b8e5
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2013-01-27T10:13:44-08:00

Commit Message:
GUI: Allow user to display hidden files in the browser dialog.

This implements feature request #3600774 "File browser: show hidden files".

Changed paths:
    base/commandLine.cpp
    gui/ThemeEngine.h
    gui/browser.cpp
    gui/browser.h
    gui/themes/default.inc
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/THEMERC
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/THEMERC
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx



diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index c5c9fe3..f6d1f1f 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -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
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index dda9f2c..6e5fd29 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -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;
 
diff --git a/gui/browser.cpp b/gui/browser.cpp
index 2b4f254..84f2d0f 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -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());
diff --git a/gui/browser.h b/gui/browser.h
index 5cf091f..7c09861 100644
--- a/gui/browser.h
+++ b/gui/browser.h
@@ -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;
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 78c04f1..b0db473 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -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'> "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 3183417..3529288 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 36eaacd..8f40cb2 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.19:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.20:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 312a90e..656d780 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -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>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index d42efb5..097f4d6 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -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>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 412ed6a..8daabf8 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 9e87762..f430462 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.19:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8.20:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index fa57e62..49c13cf 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -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>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 5c3cc83..5e6ba32 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -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>


Commit: d0e9ef7dc12f5c9ff18f09536545c0e2e5e604d7
    https://github.com/scummvm/scummvm/commit/d0e9ef7dc12f5c9ff18f09536545c0e2e5e604d7
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2013-01-28T07:14:40-08:00

Commit Message:
Merge pull request #306 from lordhoto/filechooser-hidden

GUI: Allow user to display hidden files in the browser dialog.

Changed paths:
    base/commandLine.cpp
    gui/ThemeEngine.h
    gui/browser.cpp
    gui/browser.h
    gui/themes/default.inc
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/THEMERC
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/THEMERC
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx









More information about the Scummvm-git-logs mailing list