Skip to content

Commit

Permalink
MythUI: allow include files to be added to a window definition
Browse files Browse the repository at this point in the history
This extends the current include file support to allow window definitions
to load additional widget definitions from an included file e.g.

<window name="playlistview" include="music-base.xml">
.
.
.
</window>

The main benefit over the current include support is the included file will only
be parsed when needed rather than every time an xml file is parsed.
  • Loading branch information
Paul Harrison committed Dec 30, 2011
1 parent 30a6a74 commit 9844611
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mythtv/libs/libmythui/xmlparsebase.cpp
Expand Up @@ -695,13 +695,17 @@ bool XMLParseBase::doLoad(const QString &windowname,
if (onlywindows && e.tagName() == "window")
{
QString name = e.attribute("name", "");
QString include = e.attribute("include", "");
if (name.isEmpty())
{
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, e,
"Window needs a name");
return false;
}

if (!include.isEmpty())
LoadBaseTheme(include);

if (name == windowname)
{
ParseChildren(filename, e, parent, showWarnings);
Expand Down

0 comments on commit 9844611

Please sign in to comment.