MythTV master
editmetadata.cpp
Go to the documentation of this file.
1
2// myth
7
8// mytharchive
9#include "editmetadata.h"
10
12{
13 // Load the theme for this screen
14 bool foundtheme = LoadWindowFromXML("mythburn-ui.xml", "edit_metadata", this);
15 if (!foundtheme)
16 return false;
17
18 bool err = false;
19 UIUtilE::Assign(this, m_titleEdit, "title_edit", &err);
20 UIUtilE::Assign(this, m_subtitleEdit, "subtitle_edit", &err);
21 UIUtilE::Assign(this, m_descriptionEdit, "description_edit", &err);
22 UIUtilE::Assign(this, m_starttimeEdit, "starttime_edit", &err);
23 UIUtilE::Assign(this, m_startdateEdit, "startdate_edit", &err);
24 UIUtilE::Assign(this, m_okButton, "ok_button", &err);
25 UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
26
27 if (err)
28 {
29 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'edit_metadata'");
30 return false;
31 }
32
35
41
43
45
46 return true;
47}
48
50{
51 if (GetFocusWidget()->keyPressEvent(event))
52 return true;
53
55 return true;
56
57 return false;
58}
59
61{
68
69 emit haveResult(true, m_sourceMetadata);
70 Close();
71}
72
74{
75 emit haveResult(false, m_sourceMetadata);
76 Close();
77}
void okPressed(void)
void haveResult(bool ok, ArchiveItem *item)
MythUIButton * m_okButton
Definition: editmetadata.h:49
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
MythUITextEdit * m_descriptionEdit
Definition: editmetadata.h:45
MythUITextEdit * m_titleEdit
bool Create() override
ArchiveItem * m_sourceMetadata
Definition: editmetadata.h:41
void cancelPressed(void)
MythUITextEdit * m_subtitleEdit
MythUIButton * m_cancelButton
Definition: editmetadata.h:48
MythUITextEdit * m_startdateEdit
Definition: editmetadata.h:46
MythUITextEdit * m_starttimeEdit
Definition: editmetadata.h:47
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
virtual void Close()
void Clicked()
QString GetText(void) const
void SetText(const QString &text, bool moveCursor=true)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
QString startDate
Definition: archiveutil.h:57
QString title
Definition: archiveutil.h:54
QString startTime
Definition: archiveutil.h:58
QString subtitle
Definition: archiveutil.h:55
QString description
Definition: archiveutil.h:56
bool editedDetails
Definition: archiveutil.h:71
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27