MythTV master
videopopups.cpp
Go to the documentation of this file.
1//Qt
2#include <QStringList>
3
4// MythTV
11
12// MythFrontend
13#include "videopopups.h"
14
16{
17 if (!LoadWindowFromXML("video-ui.xml", "castpopup", this))
18 return false;
19
20 MythUIButtonList *castList = nullptr;
21 MythUIButton *okButton = nullptr;
22
23 bool err = false;
24 UIUtilE::Assign(this, castList, "cast", &err);
25
26 if (err)
27 {
28 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'castpopup'");
29 return false;
30 }
31
32 UIUtilW::Assign(this, okButton, "ok");
33
34 if (okButton)
35 connect(okButton, &MythUIButton::Clicked, this, &MythScreenType::Close);
36
37 QStringList cast = GetDisplayCast(*m_metadata);
38 QStringListIterator castIterator(cast);
39 while (castIterator.hasNext())
40 {
41 new MythUIButtonListItem(castList, castIterator.next());
42 }
43
45
46 return true;
47}
48
50
52{
53 if (!LoadWindowFromXML("video-ui.xml", "descriptionpopup", this))
54 return false;
55
56 MythUIText *plotText = nullptr;
57 MythUIButton *okButton = nullptr;
58
59 bool err = false;
60 UIUtilE::Assign(this, plotText, "description", &err);
61
62 if (err)
63 {
64 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'descriptionpopup'");
65 return false;
66 }
67
68 UIUtilW::Assign(this, okButton, "ok");
69
70 plotText->SetText(m_metadata->GetPlot());
71
72 if (okButton)
73 connect(okButton, &MythUIButton::Clicked, this, &MythScreenType::Close);
74
76
77 return true;
78}
VideoMetadata * m_metadata
Definition: videopopups.h:22
bool Create() override
Definition: videopopups.cpp:15
void BuildFocusList(void)
virtual void Close()
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A single button widget.
Definition: mythuibutton.h:22
void Clicked()
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:115
bool Create() override
Definition: videopopups.cpp:51
VideoMetadata * m_metadata
Definition: videopopups.h:36
const QString & GetPlot() const
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
QStringList GetDisplayCast(const VideoMetadata &item)
Definition: videoutils.cpp:226