From 6fd559b4f66bae48cb0c86ed5ebb2ec4a9814c59 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 2 Jan 2009 20:21:21 +0000 Subject: - Fixed --gui-theme command line description - Added --list-themes command line command to list available GUI themes svn-id: r35681 --- gui/GuiManager.cpp | 19 +++++++++---------- gui/GuiManager.h | 4 ++-- gui/themebrowser.cpp | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'gui') diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp index fc2b2c1a4b..95ab7e9fac 100644 --- a/gui/GuiManager.cpp +++ b/gui/GuiManager.cpp @@ -60,7 +60,6 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), // Clear the cursor memset(_cursor, 0xFF, sizeof(_cursor)); - ConfMan.registerDefault("gui_theme", "scummmodern"); Common::String themefile(ConfMan.get("gui_theme")); @@ -151,7 +150,7 @@ struct TDComparator { } // end of anonymous namespace -void GuiManager::listUseableThemes(Common::List &list) { +void GuiManager::listUsableThemes(Common::List &list) { ThemeDescriptor th; th.name = "ScummVM Classic Theme (Builtin Version)"; th.id = "builtin"; @@ -159,10 +158,10 @@ void GuiManager::listUseableThemes(Common::List &list) { list.push_back(th); if (ConfMan.hasKey("themepath")) - listUseableThemes(Common::FSNode(ConfMan.get("themepath")), list); + listUsableThemes(Common::FSNode(ConfMan.get("themepath")), list); #ifdef DATA_PATH - listUseableThemes(Common::FSNode(DATA_PATH), list); + listUsableThemes(Common::FSNode(DATA_PATH), list); #endif #ifdef MACOSX @@ -171,16 +170,16 @@ void GuiManager::listUseableThemes(Common::List &list) { char buf[256]; if (CFURLGetFileSystemRepresentation(resourceUrl, true, (UInt8 *)buf, 256)) { Common::FSNode resourcePath(buf); - listUseableThemes(resourcePath, list); + listUsableThemes(resourcePath, list); } CFRelease(resourceUrl); } #endif if (ConfMan.hasKey("extrapath")) - listUseableThemes(Common::FSNode(ConfMan.get("extrapath")), list); + listUsableThemes(Common::FSNode(ConfMan.get("extrapath")), list); - listUseableThemes(Common::FSNode("."), list); + listUsableThemes(Common::FSNode("."), list); // Now we need to strip all duplicates // TODO: It might not be the best idea to strip duplicates. The user might @@ -199,7 +198,7 @@ void GuiManager::listUseableThemes(Common::List &list) { output.clear(); } -void GuiManager::listUseableThemes(Common::FSNode node, Common::List &list) { +void GuiManager::listUsableThemes(Common::FSNode node, Common::List &list) { if (!node.exists() || !node.isReadable() || !node.isDirectory()) return; @@ -252,7 +251,7 @@ void GuiManager::listUseableThemes(Common::FSNode node, Common::List list; - listUseableThemes(list); + listUsableThemes(list); for (Common::List::const_iterator i = list.begin(); i != list.end(); ++i) { if (id.equalsIgnoreCase(i->id)) diff --git a/gui/GuiManager.h b/gui/GuiManager.h index 5e97fd82a2..2f3f3711ab 100644 --- a/gui/GuiManager.h +++ b/gui/GuiManager.h @@ -102,7 +102,7 @@ public: /** * Lists all theme files useable. */ - void listUseableThemes(Common::List &list); + static void listUsableThemes(Common::List &list); protected: enum RedrawStatus { kRedrawDisabled = 0, @@ -159,7 +159,7 @@ protected: void screenChange(); Common::String findThemeFile(const Common::String &id); - void listUseableThemes(Common::FSNode node, Common::List &list); + static void listUsableThemes(Common::FSNode node, Common::List &list); }; } // End of namespace GUI diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp index 7fc35e9bf0..b3db9a3405 100644 --- a/gui/themebrowser.cpp +++ b/gui/themebrowser.cpp @@ -95,7 +95,7 @@ void ThemeBrowser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) void ThemeBrowser::updateListing() { _themes.clear(); - g_gui.listUseableThemes(_themes); + GuiManager::listUsableThemes(_themes); Common::StringList list; for (ThemeDescList::const_iterator i = _themes.begin(); i != _themes.end(); ++i) -- cgit v1.2.3