MythTV  master
mytharchive/mytharchive/editmetadata.cpp
Go to the documentation of this file.
1 
2 // myth
3 #include <mythcontext.h>
4 #include <mythuitext.h>
5 #include <mythuibutton.h>
6 #include <mythuitextedit.h>
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 
33  connect(m_okButton, SIGNAL(Clicked()), this, SLOT(okPressed()));
34  connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed()));
35 
41 
43 
45 
46  return true;
47 }
48 
49 bool EditMetadataDialog::keyPressEvent(QKeyEvent *event)
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 }
mythuitext.h
EditMetadataDialog::Create
bool Create() override
Definition: editvideometadata.cpp:52
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
EditMetadataDialog::haveResult
void haveResult(bool ok, ArchiveItem *item)
ArchiveItem::startTime
QString startTime
Definition: archiveutil.h:59
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
EditMetadataDialog::m_okButton
MythUIButton * m_okButton
Definition: mytharchive/mytharchive/editmetadata.h:49
MythUITextEdit::GetText
QString GetText(void) const
Definition: mythuitextedit.h:47
EditMetadataDialog::m_subtitleEdit
MythUITextEdit * m_subtitleEdit
Definition: editvideometadata.h:94
ArchiveItem::title
QString title
Definition: archiveutil.h:55
EditMetadataDialog::m_sourceMetadata
ArchiveItem * m_sourceMetadata
Definition: mytharchive/mytharchive/editmetadata.h:41
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
EditMetadataDialog::cancelPressed
void cancelPressed(void)
Definition: mytharchive/mytharchive/editmetadata.cpp:73
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:216
EditMetadataDialog::m_cancelButton
MythUIButton * m_cancelButton
Definition: mytharchive/mytharchive/editmetadata.h:48
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:117
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
EditMetadataDialog::okPressed
void okPressed(void)
Definition: mytharchive/mytharchive/editmetadata.cpp:60
ArchiveItem::startDate
QString startDate
Definition: archiveutil.h:58
editmetadata.h
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:414
ArchiveItem::description
QString description
Definition: archiveutil.h:57
mythuitextedit.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
mythcontext.h
EditMetadataDialog::m_descriptionEdit
MythUITextEdit * m_descriptionEdit
Definition: mytharchive/mytharchive/editmetadata.h:45
EditMetadataDialog::m_startdateEdit
MythUITextEdit * m_startdateEdit
Definition: mytharchive/mytharchive/editmetadata.h:46
mythuibutton.h
ArchiveItem::subtitle
QString subtitle
Definition: archiveutil.h:56
EditMetadataDialog::m_starttimeEdit
MythUITextEdit * m_starttimeEdit
Definition: mytharchive/mytharchive/editmetadata.h:47
EditMetadataDialog::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: mytharchive/mytharchive/editmetadata.cpp:49
EditMetadataDialog::m_titleEdit
MythUITextEdit * m_titleEdit
Definition: editvideometadata.h:93
ArchiveItem::editedDetails
bool editedDetails
Definition: archiveutil.h:72