diff options
Diffstat (limited to 'src/gui/theme.cpp')
-rw-r--r-- | src/gui/theme.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 4abf76eb6..9ecac247c 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -1031,3 +1031,35 @@ ImageSet *Theme::getImageSetFromThemeXml(const std::string &name, } return nullptr; } + +ThemeInfo *Theme::loadInfo(const std::string &themeName) +{ + std::string path; + if (themeName.empty()) + path = "graphics/gui/info.xml"; + else + path = defaultThemePath + themeName + "/info.xml"; + logger->log("loading: " + path); + XML::Document doc(path); + const XmlNodePtr rootNode = doc.rootNode(); + + if (!rootNode || !xmlNameEqual(rootNode, "info")) + return nullptr; + + ThemeInfo *info = new ThemeInfo(); + + for_each_xml_child_node(infoNode, rootNode) + { + if (xmlNameEqual(infoNode, "name")) + { + info->name = reinterpret_cast<const char*>( + xmlNodeGetContent(infoNode)); + } + else if (xmlNameEqual(infoNode, "copyright")) + { + info->copyright = reinterpret_cast<const char*>( + xmlNodeGetContent(infoNode)); + } + } + return info; +} |