Finished theme loading support.

Added "themerc" file to default theme.

svn-id: r33851
This commit is contained in:
Vicent Marti 2008-08-13 23:07:26 +00:00
parent 80e059f2bb
commit c4f2a691ce
6 changed files with 84 additions and 38 deletions

View file

@ -91,7 +91,7 @@ void ThemeBrowser::updateListing() {
// classic is always build in
Entry th;
th.name = "Modern Development Theme (Builtin) - WIP";
th.name = "ScummVM Modern Theme (Builtin Version)";
th.file = "builtin";
_themes.push_back(th);
@ -173,26 +173,12 @@ void ThemeBrowser::addDir(ThList &list, const Common::String &dir, int level) {
bool ThemeBrowser::isTheme(const FilesystemNode &node, Entry &out) {
out.file = node.getName();
if (!out.file.hasSuffix(".zip") && !out.file.hasSuffix(".stx"))
if (!out.file.hasSuffix(".zip"))
return false;
for (int i = out.file.size()-1; out.file[i] != '.' && i > 0; --i) {
out.file.deleteLastChar();
}
out.file.deleteLastChar();
if (out.file.empty())
if (!Theme::themeConfigUseable(out.file, out.name))
return false;
// TODO: Check if theme is usable.
// if (!Theme::themeConfigUseable(out.file, "", &type, &cfg))
// return false;
// if (cfg.hasKey("name", "theme"))
// cfg.getKey("name", "theme", out.name);
// else
out.name = out.file;
return true;
}