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
QStringListIterator castIterator(cast);
39
while
(castIterator.hasNext())
40
{
41
new
MythUIButtonListItem
(castList, castIterator.next());
42
}
43
44
BuildFocusList
();
45
46
return
true
;
47
}
48
50
51
bool
PlotDialog::Create
()
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
75
BuildFocusList
();
76
77
return
true
;
78
}
MythUIButton::Clicked
void Clicked()
mythuitext.h
CastDialog::m_metadata
VideoMetadata * m_metadata
Definition:
videopopups.h:22
videometadata.h
MythScreenType::Close
virtual void Close()
Definition:
mythscreentype.cpp:383
PlotDialog::m_metadata
VideoMetadata * m_metadata
Definition:
videopopups.h:36
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition:
mythlogging.h:39
mythuibuttonlist.h
videopopups.h
VideoMetadata::GetPlot
const QString & GetPlot() const
Definition:
videometadata.cpp:1654
MythUIButtonListItem
Definition:
mythuibuttonlist.h:41
mythlogging.h
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition:
mythscreentype.cpp:203
MythUIButton
A single button widget.
Definition:
mythuibutton.h:21
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition:
mythuiutils.h:27
CastDialog::Create
bool Create() override
Definition:
videopopups.cpp:15
MythUIText
All purpose text widget, displays a text string.
Definition:
mythuitext.h:28
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition:
xmlparsebase.cpp:687
PlotDialog::Create
bool Create() override
Definition:
videopopups.cpp:51
MythUIText::SetText
virtual void SetText(const QString &text)
Definition:
mythuitext.cpp:115
mythuibutton.h
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition:
mythuibuttonlist.h:191
GetDisplayCast
QStringList GetDisplayCast(const VideoMetadata &item)
Definition:
videoutils.cpp:226
videoutils.h
Generated on Mon Nov 25 2024 03:16:20 for MythTV by
1.8.17