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 }
void BuildFocusList(void)
QString startTime
Definition: archiveutil.h:59
MythUITextEdit * m_titleEdit
virtual void Close()
bool editedDetails
Definition: archiveutil.h:71
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void SetText(const QString &text, bool moveCursor=true)
MythUIType * GetFocusWidget(void) const
QString subtitle
Definition: archiveutil.h:56
bool Create() override
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
bool keyPressEvent(QKeyEvent *) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
QString startDate
Definition: archiveutil.h:58
QString title
Definition: archiveutil.h:55
void haveResult(bool ok, ArchiveItem *item)
MythUITextEdit * m_subtitleEdit
QString description
Definition: archiveutil.h:57
bool SetFocusWidget(MythUIType *widget=nullptr)
QString GetText(void) const