Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MythUIScreenType, MythUIGroup and MythUIStateType all inherit from it. It allows to use SetTextFromMap and templates on all those composite elements and their children objects. Fixes #11680
- Loading branch information
Showing
9 changed files
with
116 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "mythuicomposite.h" | ||
#include "mythuitext.h" | ||
|
||
MythUIComposite::MythUIComposite(QObject *parent, const QString &name) : | ||
MythUIType(parent, name) | ||
{ | ||
} | ||
|
||
void MythUIComposite::SetTextFromMap(InfoMap &infoMap) | ||
{ | ||
QList<MythUIType *> *children = GetAllChildren(); | ||
QMutableListIterator<MythUIType *> i(*children); | ||
|
||
while (i.hasNext()) | ||
{ | ||
MythUIType *type = i.next(); | ||
|
||
MythUIText *textType = dynamic_cast<MythUIText *> (type); | ||
if (textType) | ||
textType->SetTextFromMap(infoMap); | ||
|
||
MythUIComposite *group = dynamic_cast<MythUIComposite *> (type); | ||
if (group) | ||
group->SetTextFromMap(infoMap); | ||
} | ||
} | ||
|
||
void MythUIComposite::ResetMap(InfoMap &infoMap) | ||
{ | ||
if (infoMap.isEmpty()) | ||
return; | ||
|
||
QList<MythUIType *> *children = GetAllChildren(); | ||
QMutableListIterator<MythUIType *> i(*children); | ||
|
||
while (i.hasNext()) | ||
{ | ||
MythUIType *type = i.next(); | ||
|
||
MythUIText *textType = dynamic_cast<MythUIText *> (type); | ||
if (textType && infoMap.contains(textType->objectName())) | ||
textType->Reset(); | ||
|
||
MythUIComposite *group = dynamic_cast<MythUIComposite *> (type); | ||
if (group) | ||
group->ResetMap(infoMap); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef __MythTV__mythuicomposite__ | ||
#define __MythTV__mythuicomposite__ | ||
|
||
#include "mythuitype.h" | ||
|
||
class MUI_PUBLIC MythUIComposite : public MythUIType | ||
{ | ||
public: | ||
MythUIComposite(QObject *parent, const QString &name); | ||
virtual ~MythUIComposite() { } | ||
|
||
virtual void SetTextFromMap(InfoMap &infoMap); | ||
virtual void ResetMap(InfoMap &infoMap); | ||
}; | ||
|
||
#endif /* defined(__MythTV__mythuicomposite__) */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters