diff options
author | Eugene Sandulenko | 2006-03-07 19:02:42 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-03-07 19:02:42 +0000 |
commit | fc84c7fc1d8ff4d6cff0b998322fb6015287e79c (patch) | |
tree | 803cd94ba5a1c725c84aa8028da4caa2c2c1782e /gui/theme-config.cpp | |
parent | d7bc756edcc4a69d8e016670e78901bcce94ebe4 (diff) | |
download | scummvm-rg350-fc84c7fc1d8ff4d6cff0b998322fb6015287e79c.tar.gz scummvm-rg350-fc84c7fc1d8ff4d6cff0b998322fb6015287e79c.tar.bz2 scummvm-rg350-fc84c7fc1d8ff4d6cff0b998322fb6015287e79c.zip |
o More widgets fot alternative constructors
o Cleanup of launcher dialog
o Implemented useWithPrefix keyword
svn-id: r21131
Diffstat (limited to 'gui/theme-config.cpp')
-rw-r--r-- | gui/theme-config.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp index 20ee93fdd5..68ecb08478 100644 --- a/gui/theme-config.cpp +++ b/gui/theme-config.cpp @@ -120,7 +120,7 @@ void Theme::processSingleLine(const String §ion, const String name, const St } -void Theme::processResSection(Common::ConfigFile &config, String name, bool skipDefs) { +void Theme::processResSection(Common::ConfigFile &config, String name, bool skipDefs, const String prefix) { debug(3, "Reading section: [%s]", name.c_str()); const Common::ConfigFile::SectionKeyList &keys = config.getKeys(name); @@ -128,16 +128,16 @@ void Theme::processResSection(Common::ConfigFile &config, String name, bool skip Common::ConfigFile::SectionKeyList::const_iterator iterk; for (iterk = keys.begin(); iterk != keys.end(); ++iterk) { if (iterk->key == "set_parent") { - setSpecialAlias("parent", iterk->value); + setSpecialAlias("parent", prefix + iterk->value); continue; } if (iterk->key.hasPrefix("set_")) { - _evaluator->setAlias(name, iterk->key, iterk->value); + _evaluator->setAlias(name, iterk->key, prefix + iterk->value); continue; } if (iterk->key.hasPrefix("def_")) { if (!skipDefs) - _evaluator->setVariable(name, iterk->key, iterk->value); + _evaluator->setVariable(name, prefix + iterk->key, iterk->value); continue; } if (iterk->key == "use") { @@ -148,7 +148,15 @@ void Theme::processResSection(Common::ConfigFile &config, String name, bool skip processResSection(config, iterk->value, true); continue; } - processSingleLine(name, iterk->key, iterk->value); + if (iterk->key == "useWithPrefix") { + if (iterk->value == name) + error("Theme section [%s]: cannot use itself", name.c_str()); + if (!config.hasSection(name)) + error("Undefined use of section [%s]", name.c_str()); + processResSection(config, iterk->value, true, iterk->value + "_"); + continue; + } + processSingleLine(name, prefix + iterk->key, iterk->value); } } |