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 for (const auto& person : std::as_const(cast))
39 new MythUIButtonListItem(castList, person);
40
42
43 return true;
44}
45
47
49{
50 if (!LoadWindowFromXML("video-ui.xml", "descriptionpopup", this))
51 return false;
52
53 MythUIText *plotText = nullptr;
54 MythUIButton *okButton = nullptr;
55
56 bool err = false;
57 UIUtilE::Assign(this, plotText, "description", &err);
58
59 if (err)
60 {
61 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'descriptionpopup'");
62 return false;
63 }
64
65 UIUtilW::Assign(this, okButton, "ok");
66
67 plotText->SetText(m_metadata->GetPlot());
68
69 if (okButton)
70 connect(okButton, &MythUIButton::Clicked, this, &MythScreenType::Close);
71
73
74 return true;
75}
76
77#include "moc_videopopups.cpp"
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:48
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:232