MythTV
master
mythtv
programs
mythfrontend
videopopups.cpp
Go to the documentation of this file.
1
//Qt
2
#include <QStringList>
3
4
// MythTV
5
#include "
libmythbase/mythlogging.h
"
6
#include "
libmythmetadata/videometadata.h
"
7
#include "
libmythmetadata/videoutils.h
"
8
#include "
libmythui/mythuibutton.h
"
9
#include "
libmythui/mythuibuttonlist.h
"
10
#include "
libmythui/mythuitext.h
"
11
12
// MythFrontend
13
#include "
videopopups.h
"
14
15
bool
CastDialog::Create
()
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
41
BuildFocusList
();
42
43
return
true
;
44
}
45
47
48
bool
PlotDialog::Create
()
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
72
BuildFocusList
();
73
74
return
true
;
75
}
76
77
#include "moc_videopopups.cpp"
CastDialog::m_metadata
VideoMetadata * m_metadata
Definition:
videopopups.h:22
CastDialog::Create
bool Create() override
Definition:
videopopups.cpp:15
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition:
mythscreentype.cpp:209
MythScreenType::Close
virtual void Close()
Definition:
mythscreentype.cpp:389
MythUIButtonListItem
Definition:
mythuibuttonlist.h:43
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition:
mythuibuttonlist.h:195
MythUIButton
A single button widget.
Definition:
mythuibutton.h:22
MythUIButton::Clicked
void Clicked()
MythUIText
All purpose text widget, displays a text string.
Definition:
mythuitext.h:29
MythUIText::SetText
virtual void SetText(const QString &text)
Definition:
mythuitext.cpp:115
PlotDialog::Create
bool Create() override
Definition:
videopopups.cpp:48
PlotDialog::m_metadata
VideoMetadata * m_metadata
Definition:
videopopups.h:36
VideoMetadata::GetPlot
const QString & GetPlot() const
Definition:
videometadata.cpp:1656
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition:
xmlparsebase.cpp:703
mythlogging.h
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition:
mythlogging.h:39
mythuibutton.h
mythuibuttonlist.h
mythuitext.h
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition:
mythuiutils.h:27
videometadata.h
videopopups.h
GetDisplayCast
QStringList GetDisplayCast(const VideoMetadata &item)
Definition:
videoutils.cpp:232
videoutils.h
Generated on Mon Aug 10 2026 13:47:26 for MythTV by
1.9.4