MythTV  master
importnative.cpp
Go to the documentation of this file.
1 #include <cstdlib>
2 
3 // Qt
4 #include <QApplication>
5 #include <QDir>
6 #include <QFileInfo>
7 #include <QDomDocument>
8 
9 // Myth
10 #include <mythcontext.h>
11 #include <mythdbcon.h>
12 #include <mythuihelper.h>
13 #include <mythmainwindow.h>
14 #include <mythuitext.h>
15 #include <mythuitextedit.h>
16 #include <mythuibutton.h>
17 #include <mythuibuttonlist.h>
18 #include <mythdialogbox.h>
19 #include <mythsystemlegacy.h>
20 #include <exitcodes.h>
21 #include <mythdate.h>
22 
23 // mytharchive
24 #include "importnative.h"
25 #include "archiveutil.h"
26 #include "logviewer.h"
27 
28 
30 
31 static bool loadDetailsFromXML(const QString &filename, FileDetails *details)
32 {
33  QDomDocument doc("mydocument");
34  QFile file(filename);
35  if (!file.open(QIODevice::ReadOnly))
36  return false;
37 
38  if (!doc.setContent(&file))
39  {
40  file.close();
41  return false;
42  }
43  file.close();
44 
45  QString docType = doc.doctype().name();
46 
47  if (docType == "MYTHARCHIVEITEM")
48  {
49  QDomNodeList itemNodeList = doc.elementsByTagName("item");
50  QString type, dbVersion;
51 
52  if (itemNodeList.count() < 1)
53  {
54  LOG(VB_GENERAL, LOG_ERR,
55  "Couldn't find an 'item' element in XML file");
56  return false;
57  }
58 
59  QDomNode n = itemNodeList.item(0);
60  QDomElement e = n.toElement();
61  type = e.attribute("type");
62  dbVersion = e.attribute("databaseversion");
63  if (type == "recording")
64  {
65  QDomNodeList nodeList = e.elementsByTagName("recorded");
66  if (nodeList.count() < 1)
67  {
68  LOG(VB_GENERAL, LOG_ERR,
69  "Couldn't find a 'recorded' element in XML file");
70  return false;
71  }
72 
73  n = nodeList.item(0);
74  e = n.toElement();
75  n = e.firstChild();
76  while (!n.isNull())
77  {
78  e = n.toElement();
79  if (!e.isNull())
80  {
81  if (e.tagName() == "title")
82  details->title = e.text();
83 
84  if (e.tagName() == "subtitle")
85  details->subtitle = e.text();
86 
87  if (e.tagName() == "starttime")
88  details->startTime = MythDate::fromString(e.text());
89 
90  if (e.tagName() == "description")
91  details->description = e.text();
92  }
93  n = n.nextSibling();
94  }
95 
96  // get channel info
97  n = itemNodeList.item(0);
98  e = n.toElement();
99  nodeList = e.elementsByTagName("channel");
100  if (nodeList.count() < 1)
101  {
102  LOG(VB_GENERAL, LOG_ERR,
103  "Couldn't find a 'channel' element in XML file");
104  details->chanID = "";
105  details->chanNo = "";
106  details->chanName = "";
107  details->callsign = "";
108  return false;
109  }
110 
111  n = nodeList.item(0);
112  e = n.toElement();
113  details->chanID = e.attribute("chanid");
114  details->chanNo = e.attribute("channum");
115  details->chanName = e.attribute("name");
116  details->callsign = e.attribute("callsign");
117  return true;
118  }
119  else if (type == "video")
120  {
121  QDomNodeList nodeList = e.elementsByTagName("videometadata");
122  if (nodeList.count() < 1)
123  {
124  LOG(VB_GENERAL, LOG_ERR,
125  "Couldn't find a 'videometadata' element in XML file");
126  return false;
127  }
128 
129  n = nodeList.item(0);
130  e = n.toElement();
131  n = e.firstChild();
132  while (!n.isNull())
133  {
134  e = n.toElement();
135  if (!e.isNull())
136  {
137  if (e.tagName() == "title")
138  {
139  details->title = e.text();
140  details->subtitle = "";
141  details->startTime = QDateTime();
142  }
143 
144  if (e.tagName() == "plot")
145  {
146  details->description = e.text();
147  }
148  }
149  n = n.nextSibling();
150  }
151 
152  details->chanID = "N/A";
153  details->chanNo = "N/A";
154  details->chanName = "N/A";
155  details->callsign = "N/A";
156 
157  return true;
158  }
159  }
160 
161  return false;
162 }
163 
165 
167  FileSelector(parent, nullptr, FSTYPE_FILE, "", "*.xml"),
168  m_nextButton(nullptr),
169  m_prevButton(nullptr),
170  m_progTitle(nullptr),
171  m_progSubtitle(nullptr),
172  m_progStartTime(nullptr)
173 {
174  m_curDirectory = gCoreContext->GetSetting("MythNativeLoadFilename", "/");
175 }
176 
178 {
179  gCoreContext->SaveSetting("MythNativeLoadFilename", m_curDirectory);
180 }
181 
183 {
184  // Load the theme for this screen
185  bool foundtheme = LoadWindowFromXML("mythnative-ui.xml", "archivefile_selector", this);
186  if (!foundtheme)
187  return false;
188 
189  bool err = false;
190  UIUtilW::Assign(this, m_titleText, "title");
191  UIUtilE::Assign(this, m_fileButtonList, "filelist", &err);
192  UIUtilE::Assign(this, m_locationEdit, "location_edit", &err);
193  UIUtilE::Assign(this, m_backButton, "back_button", &err);
194  UIUtilE::Assign(this, m_homeButton, "home_button", &err);
195  UIUtilE::Assign(this, m_nextButton, "next_button", &err);
196  UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
197  UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
198  UIUtilE::Assign(this, m_progTitle, "title_text", &err);
199  UIUtilE::Assign(this, m_progSubtitle, "subtitle_text", &err);
200  UIUtilE::Assign(this, m_progStartTime, "starttime_text", &err);
201 
202  if (err)
203  {
204  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'archivefile_selector'");
205  return false;
206  }
207 
208  if (m_titleText)
209  m_titleText->SetText(tr("Find File To Import"));
210 
211  connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(nextPressed()));
212  connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed()));
213  connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(prevPressed()));
214 
215  connect(m_locationEdit, SIGNAL(LosingFocus()),
216  this, SLOT(locationEditLostFocus()));
218 
219  connect(m_backButton, SIGNAL(Clicked()), this, SLOT(backPressed()));
220  connect(m_homeButton, SIGNAL(Clicked()), this, SLOT(homePressed()));
221 
223  this, SLOT(itemSelected(MythUIButtonListItem *)));
224 
226  this, SLOT(itemClicked(MythUIButtonListItem *)));
227 
228  BuildFocusList();
229 
231 
233  updateFileList();
234 
235  return true;
236 }
237 
239 {
240  m_xmlFile.clear();
241 
242  if (!item)
243  return;
244 
245  FileData *fileData = item->GetData().value<FileData*>();
246  if (!fileData)
247  return;
248 
249  if (loadDetailsFromXML(m_curDirectory + "/" + fileData->filename, &m_details))
250  {
251  m_xmlFile = m_curDirectory + "/" + fileData->filename;
255  .toString("dd MMM yy (hh:mm)"));
256  }
257  else
258  {
259  m_progTitle->Reset();
262  }
263 }
264 
266 {
267  if (m_xmlFile == "")
268  {
269  ShowOkPopup(tr("The selected item is not a valid archive file!"));
270  }
271  else
272  {
274 
275  ImportNative *native = new ImportNative(mainStack, this, m_xmlFile, m_details);
276 
277  if (native->Create())
278  mainStack->AddScreen(native);
279  }
280 }
281 
283 {
284  Close();
285 }
286 
288 {
289  Close();
290 }
291 
293 
295  MythScreenStack *parent, MythScreenType *previousScreen,
296  const QString &xmlFile, FileDetails details) :
297  MythScreenType(parent, "ImportNative"),
298  m_xmlFile(xmlFile),
299  m_details(details),
300  m_previousScreen(previousScreen),
301  m_progTitle_text(nullptr),
302  m_progDateTime_text(nullptr),
303  m_progDescription_text(nullptr),
304  m_chanID_text(nullptr),
305  m_chanNo_text(nullptr),
306  m_chanName_text(nullptr),
307  m_callsign_text(nullptr),
308  m_localChanID_text(nullptr),
309  m_localChanNo_text(nullptr),
310  m_localChanName_text(nullptr),
311  m_localCallsign_text(nullptr),
312  m_searchChanID_button(nullptr),
313  m_searchChanNo_button(nullptr),
314  m_searchChanName_button(nullptr),
315  m_searchCallsign_button(nullptr),
316  m_finishButton(nullptr),
317  m_prevButton(nullptr),
318  m_cancelButton(nullptr),
319  m_isValidXMLSelected(false)
320 {
321 }
322 
324 {
325 }
326 
328 {
329  // Load the theme for this screen
330  bool foundtheme = LoadWindowFromXML("mythnative-ui.xml", "importnative", this);
331  if (!foundtheme)
332  return false;
333 
334  bool err = false;
335  UIUtilE::Assign(this, m_progTitle_text, "progtitle", &err);
336  UIUtilE::Assign(this, m_progDateTime_text, "progdatetime", &err);
337  UIUtilE::Assign(this, m_progDescription_text, "progdescription", &err);
338 
339  UIUtilE::Assign(this, m_chanID_text, "chanid", &err);
340  UIUtilE::Assign(this, m_chanNo_text, "channo", &err);
341  UIUtilE::Assign(this, m_chanName_text, "name", &err);
342  UIUtilE::Assign(this, m_callsign_text, "callsign", &err);
343 
344  UIUtilE::Assign(this, m_localChanID_text, "local_chanid", &err);
345  UIUtilE::Assign(this, m_localChanNo_text, "local_channo", &err);
346  UIUtilE::Assign(this, m_localChanName_text, "local_name", &err);
347  UIUtilE::Assign(this, m_localCallsign_text, "local_callsign", &err);
348 
349  UIUtilE::Assign(this, m_searchChanID_button, "searchchanid_button", &err);
350  UIUtilE::Assign(this, m_searchChanNo_button, "searchchanno_button", &err);
351  UIUtilE::Assign(this, m_searchChanName_button, "searchname_button", &err);
352  UIUtilE::Assign(this, m_searchCallsign_button ,"searchcallsign_button", &err);
353 
354  UIUtilE::Assign(this, m_finishButton, "finish_button", &err);
355  UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
356  UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
357 
358  if (err)
359  {
360  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'importarchive'");
361  return false;
362  }
363 
364  connect(m_finishButton, SIGNAL(Clicked()), this, SLOT(finishedPressed()));
365  connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(prevPressed()));
366  connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed()));
367 
368  connect(m_searchChanID_button, SIGNAL(Clicked()), this, SLOT(searchChanID()));
369  connect(m_searchChanNo_button, SIGNAL(Clicked()), this, SLOT(searchChanNo()));
370  connect(m_searchChanName_button, SIGNAL(Clicked()), this, SLOT(searchName()));
371  connect(m_searchCallsign_button, SIGNAL(Clicked()), this, SLOT(searchCallsign()));
372 
374 
376  .toString("dd MMM yy (hh:mm)"));
378  (m_details.subtitle == "" ? m_details.subtitle + "\n" : "") + m_details.description);
379 
384 
387 
388  BuildFocusList();
389 
391 
392  return true;
393 }
394 
395 bool ImportNative::keyPressEvent(QKeyEvent *event)
396 {
397  if (GetFocusWidget()->keyPressEvent(event))
398  return true;
399 
400  QStringList actions;
401  bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
402 
403  for (int i = 0; i < actions.size() && !handled; i++)
404  {
405  QString action = actions[i];
406  handled = true;
407 
408  if (action == "MENU")
409  {
410  }
411  else
412  handled = false;
413  }
414 
415  if (!handled && MythScreenType::keyPressEvent(event))
416  handled = true;
417 
418  return handled;
419 }
420 
422 
423 {
424  if (m_details.chanID != "N/A" && m_localChanID_text->GetText() == "")
425  {
426  ShowOkPopup(tr("You need to select a valid channel id!"));
427  return;
428  }
429 
430  QString commandline;
431  QString tempDir = gCoreContext->GetSetting("MythArchiveTempDir", "");
432  QString chanID = m_localChanID_text->GetText();
433 
434  if (chanID == "")
435  chanID = m_details.chanID;
436 
437  if (tempDir == "")
438  return;
439 
440  if (!tempDir.endsWith("/"))
441  tempDir += "/";
442 
443  QString logDir = tempDir + "logs";
444 
445  // remove any existing logs
446  myth_system("rm -f " + logDir + "/*.log");
447 
448  commandline = "mytharchivehelper --logpath " + logDir + " --importarchive "
449  "--infile \"" + m_xmlFile +
450  "\" --chanid " + chanID;
451 
454  uint retval = myth_system(commandline, flags);
455  if (retval != GENERIC_EXIT_RUNNING && retval != GENERIC_EXIT_OK)
456  {
457  ShowOkPopup(tr("It was not possible to import the Archive. "
458  " An error occured when running 'mytharchivehelper'") );
459  return;
460  }
461 
462  showLogViewer();
463 
465  Close();
466 }
467 
469 {
470  Close();
471 }
472 
474 {
476  Close();
477 }
478 
479 void ImportNative::findChannelMatch(const QString &chanID, const QString &chanNo,
480  const QString &name, const QString &callsign)
481 {
482  // find best match in channel table for this recording
483 
484  // look for an exact match - maybe the user is importing back an old recording
485  MSqlQuery query(MSqlQuery::InitCon());
486  query.prepare("SELECT chanid, channum, name, callsign FROM channel "
487  "WHERE chanid = :CHANID AND channum = :CHANNUM AND name = :NAME "
488  "AND callsign = :CALLSIGN;");
489  query.bindValue(":CHANID", chanID);
490  query.bindValue(":CHANNUM", chanNo);
491  query.bindValue(":NAME", name);
492  query.bindValue(":CALLSIGN", callsign);
493 
494  if (query.exec() && query.next())
495  {
496  // got match
497  m_localChanID_text->SetText(query.value(0).toString());
498  m_localChanNo_text->SetText(query.value(1).toString());
499  m_localChanName_text->SetText(query.value(2).toString());
500  m_localCallsign_text->SetText(query.value(3).toString());
501  return;
502  }
503 
504  // try to find callsign
505  query.prepare("SELECT chanid, channum, name, callsign FROM channel "
506  "WHERE callsign = :CALLSIGN;");
507  query.bindValue(":CALLSIGN", callsign);
508 
509  if (query.exec() && query.next())
510  {
511  // got match
512  m_localChanID_text->SetText(query.value(0).toString());
513  m_localChanNo_text->SetText(query.value(1).toString());
514  m_localChanName_text->SetText(query.value(2).toString());
515  m_localCallsign_text->SetText(query.value(3).toString());
516  return;
517  }
518 
519  // try to find name
520  query.prepare("SELECT chanid, channum, name, callsign FROM channel "
521  "WHERE name = :NAME;");
522  query.bindValue(":NAME", callsign);
523 
524  if (query.exec() && query.next())
525  {
526  // got match
527  m_localChanID_text->SetText(query.value(0).toString());
528  m_localChanNo_text->SetText(query.value(1).toString());
529  m_localChanName_text->SetText(query.value(2).toString());
530  m_localCallsign_text->SetText(query.value(3).toString());
531  return;
532  }
533 
534  // give up
539 }
540 
541 void ImportNative::showList(const QString &caption, QString &value,
542  const char *slot)
543 {
544  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
545 
546  MythUISearchDialog *searchDialog = new
547  MythUISearchDialog(popupStack, caption, m_searchList, true, value);
548 
549  if (!searchDialog->Create())
550  {
551  delete searchDialog;
552  searchDialog = nullptr;
553  return;
554  }
555 
556  connect(searchDialog, SIGNAL(haveResult(QString)), this, slot);
557 
558  popupStack->AddScreen(searchDialog);
559 }
560 
561 void ImportNative::fillSearchList(const QString &field)
562 {
563 
564  m_searchList.clear();
565 
566  QString querystr;
567  querystr = QString("SELECT %1 FROM channel ORDER BY %2").arg(field).arg(field);
568 
569  MSqlQuery query(MSqlQuery::InitCon());
570 
571  if (query.exec(querystr))
572  {
573  while (query.next())
574  {
575  m_searchList << query.value(0).toString();
576  }
577  }
578 }
579 
581 {
582  QString s;
583 
584  fillSearchList("chanid");
585 
586  s = m_chanID_text->GetText();
587  showList(tr("Select a channel id"), s, SLOT(gotChanID(QString)));
588 }
589 
590 void ImportNative::gotChanID(QString value)
591 {
592  MSqlQuery query(MSqlQuery::InitCon());
593  query.prepare("SELECT chanid, channum, name, callsign "
594  "FROM channel WHERE chanid = :CHANID;");
595  query.bindValue(":CHANID", value);
596 
597  if (query.exec() && query.next())
598  {
599  m_localChanID_text->SetText(query.value(0).toString());
600  m_localChanNo_text->SetText(query.value(1).toString());
601  m_localChanName_text->SetText(query.value(2).toString());
602  m_localCallsign_text->SetText(query.value(3).toString());
603  }
604 }
605 
607 {
608  QString s;
609 
610  fillSearchList("channum");
611 
612  s = m_chanNo_text->GetText();
613  showList(tr("Select a channel number"), s, SLOT(gotChanNo(QString)));
614 }
615 
616 void ImportNative::gotChanNo(QString value)
617 {
618  MSqlQuery query(MSqlQuery::InitCon());
619  query.prepare("SELECT chanid, channum, name, callsign "
620  "FROM channel WHERE channum = :CHANNUM;");
621  query.bindValue(":CHANNUM", value);
622 
623  if (query.exec() && query.next())
624  {
625  m_localChanID_text->SetText(query.value(0).toString());
626  m_localChanNo_text->SetText(query.value(1).toString());
627  m_localChanName_text->SetText(query.value(2).toString());
628  m_localCallsign_text->SetText(query.value(3).toString());
629  }
630 }
631 
633 {
634  QString s;
635 
636  fillSearchList("name");
637 
638  s = m_chanName_text->GetText();
639  showList(tr("Select a channel name"), s, SLOT(gotName(QString)));
640 }
641 
642 void ImportNative::gotName(QString value)
643 {
644  MSqlQuery query(MSqlQuery::InitCon());
645  query.prepare("SELECT chanid, channum, name, callsign "
646  "FROM channel WHERE name = :NAME;");
647  query.bindValue(":NAME", value);
648 
649  if (query.exec() && query.next())
650  {
651  m_localChanID_text->SetText(query.value(0).toString());
652  m_localChanNo_text->SetText(query.value(1).toString());
653  m_localChanName_text->SetText(query.value(2).toString());
654  m_localCallsign_text->SetText(query.value(3).toString());
655  }
656 }
657 
659 {
660  QString s;
661 
662  fillSearchList("callsign");
663 
664  s = m_callsign_text->GetText();
665  showList(tr("Select a Callsign"), s, SLOT(gotCallsign(QString)));
666 }
667 
668 void ImportNative::gotCallsign(QString value)
669 {
670  MSqlQuery query(MSqlQuery::InitCon());
671  query.prepare("SELECT chanid, channum, name, callsign "
672  "FROM channel WHERE callsign = :CALLSIGN;");
673  query.bindValue(":CALLSIGN", value);
674 
675  if (query.exec() && query.next())
676  {
677  m_localChanID_text->SetText(query.value(0).toString());
678  m_localChanNo_text->SetText(query.value(1).toString());
679  m_localChanName_text->SetText(query.value(2).toString());
680  m_localCallsign_text->SetText(query.value(3).toString());
681  }
682 }
MythUIText * m_progStartTime
Definition: importnative.h:70
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:794
ArchiveFileSelector(MythScreenStack *parent)
void finishedPressed()
avoid disabling UI drawing
Definition: mythsystem.h:35
void bindValue(const QString &placeholder, const QVariant &val)
Definition: mythdbcon.cpp:875
MythUIButton * m_cancelButton
Definition: importnative.h:131
void showList(const QString &caption, QString &value, const char *slot)
bool Create(void) override
MythUIText * m_localChanName_text
Definition: importnative.h:121
QString m_xmlFile
Definition: importnative.h:104
void gotCallsign(QString value)
FileDetails m_details
Definition: importnative.h:63
#define GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:10
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
void LosingFocus()
void gotChanNo(QString value)
QDateTime startTime
Definition: importnative.h:32
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
MythUIText * m_titleText
Definition: fileselector.h:80
MythUIText * m_chanName_text
Definition: importnative.h:116
MythUIText * m_progDateTime_text
Definition: importnative.h:111
FileDetails m_details
Definition: importnative.h:105
MythUIText * m_localChanID_text
Definition: importnative.h:119
MythUIButton * m_nextButton
Definition: importnative.h:66
MythUIText * m_localCallsign_text
Definition: importnative.h:122
void SaveSetting(const QString &key, int newValue)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
run child in the background
Definition: mythsystem.h:36
MythUIButton * m_searchCallsign_button
Definition: importnative.h:127
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:168
void cancelPressed(void)
MythScreenType * m_previousScreen
Definition: importnative.h:106
MythUIText * m_progTitle
Definition: importnative.h:68
ImportNative(MythScreenStack *parent, MythScreenType *m_previousScreen, const QString &xmlFile, FileDetails details)
MythScreenStack * GetStack(const QString &stackname)
void backPressed(void)
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythScreenStack * GetMainStack()
void updateFileList(void)
QString m_curDirectory
Definition: fileselector.h:73
MythUIButton * m_prevButton
Definition: importnative.h:67
QString description
Definition: importnative.h:33
void gotName(QString value)
bool Create(void) override
void gotChanID(QString value)
void BuildFocusList(void)
MythUIButton * m_homeButton
Definition: fileselector.h:86
void searchCallsign(void)
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
void findChannelMatch(const QString &chanid, const QString &chanNo, const QString &name, const QString &callsign)
QString GetText(void) const
Definition: mythuitext.h:41
MythUIText * m_callsign_text
Definition: importnative.h:117
QVariant value(int i) const
Definition: mythdbcon.h:182
virtual void Close()
MythUIText * m_progTitle_text
Definition: importnative.h:110
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythUIText * m_chanNo_text
Definition: importnative.h:115
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
void updateSelectedList(void)
MythUIButton * m_cancelButton
Definition: fileselector.h:84
MythUIButton * m_searchChanID_button
Definition: importnative.h:124
MythUIButtonList * m_fileButtonList
Definition: fileselector.h:81
QString GetSetting(const QString &key, const QString &defaultval="")
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:116
void searchChanNo(void)
#define GENERIC_EXIT_RUNNING
Process is running.
Definition: exitcodes.h:25
MythUIText * m_progDescription_text
Definition: importnative.h:112
void cancelPressed()
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:547
void fillSearchList(const QString &field)
void homePressed(void)
const char * name
Definition: ParseText.cpp:339
uint myth_system(const QString &command, uint flags, uint timeout)
void searchChanID(void)
MythUIButton * m_finishButton
Definition: importnative.h:129
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
QString title
Definition: importnative.h:30
void SetText(const QString &text, bool moveCursor=true)
MythUIText * m_progSubtitle
Definition: importnative.h:69
MythUIType * GetFocusWidget(void) const
MythUIButton * m_searchChanNo_button
Definition: importnative.h:125
MythMainWindow * GetMythMainWindow(void)
QString filename
Definition: fileselector.h:21
MythUIButton * m_prevButton
Definition: importnative.h:130
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:819
bool keyPressEvent(QKeyEvent *) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
string dbVersion
Definition: mythburn.py:143
QString callsign
Definition: importnative.h:37
bool Create(void) override
MythUIButton * m_backButton
Definition: fileselector.h:85
QString subtitle
Definition: importnative.h:31
void showLogViewer(void)
Definition: logviewer.cpp:26
QString chanName
Definition: importnative.h:36
void searchName(void)
MythUIButton * m_searchChanName_button
Definition: importnative.h:126
QString chanID
Definition: importnative.h:34
bool SetFocusWidget(MythUIType *widget=nullptr)
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:615
Screen in which all other widgets are contained and rendered.
void itemClicked(MythUIButtonListItem *item)
void prevPressed()
MythUIText * m_localChanNo_text
Definition: importnative.h:120
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:30
void itemSelected(MythUIButtonListItem *item)
QString chanNo
Definition: importnative.h:35
MythUIText * m_chanID_text
Definition: importnative.h:114
void locationEditLostFocus(void)
Provide a dialog to quickly find an entry in a list.
static bool loadDetailsFromXML(const QString &filename, FileDetails *details)
QStringList m_searchList
Definition: importnative.h:108
avoid blocking LIRC & Joystick Menu
Definition: mythsystem.h:34
MythUITextEdit * m_locationEdit
Definition: fileselector.h:82