MythTV  master
channeleditor.cpp
Go to the documentation of this file.
1 // Qt
2 #include <QCoreApplication>
3 
4 // MythTV
5 #include "mythcorecontext.h"
6 #include "mythprogressdialog.h"
7 #include "mythuibuttonlist.h"
8 #include "channelsettings.h"
9 #include "transporteditor.h"
10 #include "mythuicheckbox.h"
11 #include "mythuitextedit.h"
12 #include "channeleditor.h"
13 #include "mythdialogbox.h"
14 #include "mythuibutton.h"
15 #include "channelutil.h"
16 #include "importicons.h"
17 #include "mythlogging.h"
18 #include "mythuiimage.h"
19 #include "mythuitext.h"
20 #include "scanwizard.h"
21 #include "sourceutil.h"
22 #include "cardutil.h"
23 #include "mythdirs.h"
24 #include "mythdb.h"
25 
26 ChannelWizard::ChannelWizard(int id, int default_sourceid)
27 {
28  setLabel(tr("Channel Options"));
29 
30  // Must be first.
31  addChild(m_cid = new ChannelID());
32  m_cid->setValue(id);
33 
34  QStringList cardtypes = ChannelUtil::GetInputTypes(m_cid->getValue().toUInt());
35 
36  // For a new channel the list will be empty so get it this way.
37  if (cardtypes.empty())
38  cardtypes = CardUtil::GetInputTypeNames(default_sourceid);
39 
40  bool all_v4l = !cardtypes.empty();
41  bool all_asi = !cardtypes.empty();
42  for (uint i = 0; i < (uint) cardtypes.size(); i++)
43  {
44  all_v4l &= CardUtil::IsV4L(cardtypes[i]);
45  all_asi &= cardtypes[i] == "ASI";
46  }
47 
48  auto *common = new ChannelOptionsCommon(*m_cid, default_sourceid,!all_v4l);
50 
51  auto *filters = new ChannelOptionsFilters(*m_cid);
52  addChild(filters);
53 
54  if (all_v4l)
56  else if (all_asi)
58 }
59 
61 
63  : MythScreenType(parent, "channeleditor"),
64  m_currentSortMode(QCoreApplication::translate("(Common)", "Channel Name"))
65 {
66 }
67 
69 {
70  // Load the theme for this screen
71  bool foundtheme = LoadWindowFromXML("config-ui.xml", "channeloverview", this);
72  if (!foundtheme)
73  return false;
74 
75  MythUIButtonList *sortList = dynamic_cast<MythUIButtonList *>(GetChild("sorting"));
76  m_sourceList = dynamic_cast<MythUIButtonList *>(GetChild("source"));
77  m_channelList = dynamic_cast<MythUIButtonList *>(GetChild("channels"));
78  m_preview = dynamic_cast<MythUIImage *>(GetChild("preview"));
79  m_channame = dynamic_cast<MythUIText *>(GetChild("name"));
80  m_channum = dynamic_cast<MythUIText *>(GetChild("channum"));
81  m_callsign = dynamic_cast<MythUIText *>(GetChild("callsign"));
82  m_chanid = dynamic_cast<MythUIText *>(GetChild("chanid"));
83  m_sourcename = dynamic_cast<MythUIText *>(GetChild("sourcename"));
84  m_compoundname = dynamic_cast<MythUIText *>(GetChild("compoundname"));
85 
86  MythUIButton *deleteButton = dynamic_cast<MythUIButton *>(GetChild("delete"));
87  MythUIButton *scanButton = dynamic_cast<MythUIButton *>(GetChild("scan"));
88  MythUIButton *importIconButton = dynamic_cast<MythUIButton *>(GetChild("importicons"));
89  MythUIButton *transportEditorButton = dynamic_cast<MythUIButton *>(GetChild("edittransport"));
90 
91  MythUICheckBox *hideCheck = dynamic_cast<MythUICheckBox *>(GetChild("nochannum"));
92 
93  if (!sortList || !m_sourceList || !m_channelList || !deleteButton ||
94  !scanButton || !importIconButton || !transportEditorButton ||
95  !hideCheck)
96  {
97 
98  return false;
99  }
100 
101  // Delete button help text
102  deleteButton->SetHelpText(tr("Delete all channels on currently selected source(s)."));
103 
104  // Sort List
105  new MythUIButtonListItem(sortList, tr("Channel Name"));
106  new MythUIButtonListItem(sortList, tr("Channel Number"));
107  new MythUIButtonListItem(sortList, tr("Multiplex Frequency"));
108  connect(m_sourceList, SIGNAL(itemSelected(MythUIButtonListItem *)),
110  sortList->SetValue(m_currentSortMode);
111 
112 
113  // Source List
114  new MythUIButtonListItem(m_sourceList,tr("All"),
115  qVariantFromValue((int)FILTER_ALL));
116  MSqlQuery query(MSqlQuery::InitCon());
117  query.prepare("SELECT name, sourceid FROM videosource");
118  if (query.exec())
119  {
120  while(query.next())
121  {
122  new MythUIButtonListItem(m_sourceList, query.value(0).toString(),
123  query.value(1).toInt());
124  }
125  }
126  new MythUIButtonListItem(m_sourceList,tr("(Unassigned)"),
127  qVariantFromValue((int)FILTER_UNASSIGNED));
128  connect(sortList, SIGNAL(itemSelected(MythUIButtonListItem *)),
130 
131  // Hide/Show channels without channum checkbox
132  hideCheck->SetCheckState(m_currentHideMode);
133  connect(hideCheck, SIGNAL(toggled(bool)),
134  SLOT(setHideMode(bool)));
135 
136  // Scan Button
137  scanButton->SetHelpText(tr("Starts the channel scanner."));
139 
140  // Import Icons Button
141  importIconButton->SetHelpText(tr("Starts the icon downloader"));
142  importIconButton->SetEnabled(true);
143  connect(importIconButton, SIGNAL(Clicked()), SLOT(channelIconImport()));
144 
145  // Transport Editor Button
146  transportEditorButton->SetHelpText(
147  tr("Allows you to edit the transports directly. "
148  "This is rarely required unless you are using "
149  "a satellite dish and must enter an initial "
150  "frequency to for the channel scanner to try."));
151  connect(transportEditorButton, SIGNAL(Clicked()), SLOT(transportEditor()));
152 
153  // Other signals
154  connect(m_channelList, SIGNAL(itemClicked(MythUIButtonListItem *)),
155  SLOT(edit(MythUIButtonListItem *)));
156  connect(m_channelList, SIGNAL(itemSelected(MythUIButtonListItem *)),
158  connect(scanButton, SIGNAL(Clicked()), SLOT(scan()));
159  connect(deleteButton, SIGNAL(Clicked()), SLOT(deleteChannels()));
160 
161  fillList();
162 
163  BuildFocusList();
164 
165  return true;
166 }
167 
168 bool ChannelEditor::keyPressEvent(QKeyEvent *event)
169 {
170  if (GetFocusWidget()->keyPressEvent(event))
171  return true;
172 
173  QStringList actions;
174  bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
175 
176  for (int i = 0; i < actions.size() && !handled; i++)
177  {
178  QString action = actions[i];
179  handled = true;
180 
181  if (action == "MENU")
182  menu();
183  else if (action == "DELETE")
184  del();
185  else if (action == "EDIT")
186  edit();
187  else
188  handled = false;
189  }
190 
191  if (!handled && MythScreenType::keyPressEvent(event))
192  handled = true;
193 
194  return handled;
195 }
196 
198 {
199  if (!item)
200  return;
201 
202  if (m_preview)
203  {
204  m_preview->Reset();
205  QString iconpath = item->GetImageFilename();
206  if (!iconpath.isEmpty())
207  {
208  // mythtv-setup needs direct access to channel icon dir to import. We
209  // also can't rely on the backend to be running, so access the file directly
210  QString tmpIcon = GetConfDir() + "/channels/" + iconpath;
211  m_preview->SetFilename(tmpIcon);
212  m_preview->Load();
213  }
214  }
215 
216  if (m_channame)
217  m_channame->SetText(item->GetText("name"));
218 
219  if (m_channum)
220  m_channum->SetText(item->GetText("channum"));
221 
222  if (m_callsign)
223  m_callsign->SetText(item->GetText("callsign"));
224 
225  if (m_chanid)
226  m_chanid->SetText(item->GetText("chanid"));
227 
228  if (m_sourcename)
229  m_sourcename->SetText(item->GetText("sourcename"));
230 
231  if (m_compoundname)
232  m_compoundname->SetText(item->GetText("compoundname"));
233 }
234 
236 {
237  QString currentValue = m_channelList->GetValue();
238  uint currentIndex = qMax(m_channelList->GetCurrentPos(), 0);
239  m_channelList->Reset();
240  QString newchanlabel = tr("(Add New Channel)");
241  auto *item = new MythUIButtonListItem(m_channelList, "");
242  item->SetText(newchanlabel, "compoundname");
243  item->SetText(newchanlabel, "name");
244 
245  bool fAllSources = true;
246 
247  QString querystr = "SELECT channel.name,channum,chanid,callsign,icon,"
248  "channel.visible ,videosource.name, serviceid, "
249  "dtv_multiplex.frequency FROM channel "
250  "LEFT JOIN videosource ON "
251  "(channel.sourceid = videosource.sourceid) "
252  "LEFT JOIN dtv_multiplex ON "
253  "(channel.mplexid = dtv_multiplex.mplexid) "
254  "WHERE deleted IS NULL ";
255 
256  if (m_sourceFilter == FILTER_ALL)
257  {
258  fAllSources = true;
259  }
260  else
261  {
262  querystr += QString("AND channel.sourceid='%1' ")
263  .arg(m_sourceFilter);
264  fAllSources = false;
265  }
266 
267  if (m_currentSortMode == tr("Channel Name"))
268  {
269  querystr += " ORDER BY channel.name";
270  }
271  else if (m_currentSortMode == tr("Channel Number"))
272  {
273  querystr += " ORDER BY channum + 0";
274  }
275  else if (m_currentSortMode == tr("Multiplex Frequency"))
276  {
277  querystr += " ORDER BY dtv_multiplex.frequency, serviceid";
278  }
279 
280  MSqlQuery query(MSqlQuery::InitCon());
281  query.prepare(querystr);
282 
283  uint selidx = 0;
284  uint idx = 1;
285  if (query.exec() && query.size() > 0)
286  {
287  for (; query.next() ; idx++)
288  {
289  QString name = query.value(0).toString();
290  QString channum = query.value(1).toString();
291  QString chanid = query.value(2).toString();
292  QString callsign = query.value(3).toString();
293  QString icon = query.value(4).toString();
294  bool visible = query.value(5).toBool();
295  QString sourceid = "Unassigned";
296 
297  QString state = "normal";
298 
299  if (!visible)
300  state = "disabled";
301 
302  if (!query.value(6).toString().isEmpty())
303  {
304  sourceid = query.value(6).toString();
305  if (fAllSources && m_sourceFilter == FILTER_UNASSIGNED)
306  continue;
307  }
308  else
309  state = "warning";
310 
311  if (channum.isEmpty() && m_currentHideMode)
312  continue;
313 
314  if (name.isEmpty())
315  name = "(Unnamed : " + chanid + ")";
316 
317  QString compoundname = name;
318 
319  if (m_currentSortMode == tr("Channel Name"))
320  {
321  if (!channum.isEmpty())
322  compoundname += " (" + channum + ")";
323  }
324  else if (m_currentSortMode == tr("Channel Number"))
325  {
326  if (!channum.isEmpty())
327  compoundname = channum + ". " + compoundname;
328  else
329  compoundname = "???. " + compoundname;
330  }
331 
332  if (m_sourceFilter == FILTER_ALL)
333  compoundname += " (" + sourceid + ")";
334 
335  bool sel = (chanid == currentValue);
336  selidx = (sel) ? idx : selidx;
337  item = new MythUIButtonListItem(m_channelList, "",
338  qVariantFromValue(chanid));
339  item->SetText(compoundname, "compoundname");
340  item->SetText(name, "name");
341  item->SetText(channum, "channum");
342  item->SetText(chanid, "chanid");
343  item->SetText(callsign, "callsign");
344  item->SetText(sourceid, "sourcename");
345 
346  // mythtv-setup needs direct access to channel icon dir to import. We
347  // also can't rely on the backend to be running, so access the file directly
348  QString tmpIcon = GetConfDir() + "/channels/" + icon;
349  item->SetImage(tmpIcon);
350  item->SetImage(tmpIcon, "icon");
351 
352  item->DisplayState(state, "status");
353  }
354  }
355 
356  // Make sure we select the current item, or the following one after
357  // deletion, with wrap around to "(New Channel)" after deleting last item.
358  m_channelList->SetItemCurrent((!selidx && currentIndex < idx) ? currentIndex : selidx);
359 }
360 
362 {
363  if (!item)
364  return;
365 
366  QString sortName = item->GetText();
367 
368  if (m_currentSortMode != sortName)
369  {
370  m_currentSortMode = sortName;
371  fillList();
372  }
373 }
374 
376 {
377  if (!item)
378  return;
379 
380  QString sourceName = item->GetText();
381  int sourceID = item->GetData().toInt();
382 
383  if (m_sourceFilter != sourceID)
384  {
385  m_sourceFilterName = sourceName;
386  m_sourceFilter = sourceID;
387  fillList();
388  }
389 }
390 
392 {
393  if (m_currentHideMode != hide)
394  {
395  m_currentHideMode = hide;
396  fillList();
397  }
398 }
399 
401 {
403 
404  if (!item)
405  return;
406 
407  QString message = tr("Delete channel '%1'?").arg(item->GetText("name"));
408 
409  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
410  auto *dialog = new MythConfirmationDialog(popupStack, message, true);
411 
412  if (dialog->Create())
413  {
414  dialog->SetData(qVariantFromValue(item));
415  dialog->SetReturnEvent(this, "delsingle");
416  popupStack->AddScreen(dialog);
417  }
418  else
419  delete dialog;
420 
421 }
422 
424 {
425  const QString currentLabel = m_sourceList->GetValue();
426 
427  bool del_all = m_sourceFilter == FILTER_ALL;
428  bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
429 
430  QString message =
431  (del_all) ? tr("Delete ALL channels?") :
432  ((del_nul) ? tr("Delete all unassigned channels?") :
433  tr("Delete all channels on %1?").arg(currentLabel));
434 
435  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
436  auto *dialog = new MythConfirmationDialog(popupStack, message, true);
437 
438  if (dialog->Create())
439  {
440  dialog->SetReturnEvent(this, "delall");
441  popupStack->AddScreen(dialog);
442  }
443  else
444  delete dialog;
445 }
446 
448 {
449  if (!item)
450  item = m_channelList->GetItemCurrent();
451 
452  if (!item)
453  return;
454 
456 
457  int chanid = item->GetData().toInt();
458  auto *cw = new ChannelWizard(chanid, m_sourceFilter);
459  auto *ssd = new StandardSettingDialog(mainStack, "channelwizard", cw);
460  if (ssd->Create())
461  {
462  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
463  mainStack->AddScreen(ssd);
464  }
465  else
466  delete ssd;
467 }
468 
470 {
472 
473  if (!item)
474  return;
475 
476  int chanid = item->GetData().toInt();
477  if (chanid == 0)
478  edit(item);
479  else
480  {
481  QString label = tr("Channel Options");
482 
483  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
484 
485  auto *menu = new MythDialogBox(label, popupStack, "chanoptmenu");
486 
487  if (menu->Create())
488  {
489  menu->SetReturnEvent(this, "channelopts");
490 
491  menu->AddButton(tr("Edit"));
492 // if ()
493 // menu->AddButton(tr("Set Hidden"));
494 // else
495 // menu->AddButton(tr("Set Visible"));
496  menu->AddButton(tr("Delete"));
497 
498  popupStack->AddScreen(menu);
499  }
500  else
501  {
502  delete menu;
503  return;
504  }
505  }
506 }
507 
508 // Check that we have a video source and that at least one
509 // capture card is connected to the video source.
510 //
511 static bool check_cardsource(int sourceid, QString &sourcename)
512 {
513  // Check for videosource
514  if (sourceid < 1)
515  {
516  MythConfirmationDialog *md = ShowOkPopup(QObject::tr(
517  "Select a video source. 'All' cannot be used. "
518  "If there is no video source then create one in the "
519  "'Video sources' menu page and connect a capture card."));
520  WaitFor(md);
521  return false;
522  }
523 
524  // Check for a connected capture card
525  MSqlQuery query(MSqlQuery::InitCon());
526  query.prepare(
527  "SELECT capturecard.cardid "
528  "FROM capturecard "
529  "WHERE capturecard.sourceid = :SOURCEID AND "
530  " capturecard.hostname = :HOSTNAME");
531  query.bindValue(":SOURCEID", sourceid);
532  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
533 
534  if (!query.exec() || !query.isActive())
535  {
536  MythDB::DBError("check_capturecard()", query);
537  return false;
538  }
539  uint cardid = 0;
540  if (query.next())
541  cardid = query.value(0).toUInt();
542 
543  if (cardid < 1)
544  {
545  MythConfirmationDialog *md = ShowOkPopup(QObject::tr(
546  "No capture card!"
547  "\n"
548  "Connect video source '%1' to a capture card "
549  "in the 'Input Connections' menu page.")
550  .arg(sourcename));
551  WaitFor(md);
552  return false;
553  }
554 
555  return true;
556 }
557 
559 {
560  // Check that we have a videosource and a connected capture card
562  return;
563 
564  // Create the dialog now that we have a video source and a capture card
566  auto *ssd = new StandardSettingDialog(mainStack, "scanwizard",
568  if (ssd->Create())
569  {
570  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
571  mainStack->AddScreen(ssd);
572  }
573  else
574  delete ssd;
575 }
576 
578 {
579  // Check that we have a videosource and a connected capture card
581  return;
582 
583  // Create the dialog now that we have a video source and a capture card
585  auto *ssd = new StandardSettingDialog(mainStack, "transporteditor",
587  if (ssd->Create())
588  {
589  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
590  mainStack->AddScreen(ssd);
591  }
592  else
593  delete ssd;
594 }
595 
597 {
598  if (m_channelList->GetCount() == 0)
599  {
600  ShowOkPopup(tr("Add some channels first!"));
601  return;
602  }
603 
604  int channelID = 0;
606  if (item)
607  channelID = item->GetData().toInt();
608 
609  // Get selected channel name from database
610  QString querystr = QString("SELECT channel.name FROM channel "
611  "WHERE chanid='%1'").arg(channelID);
612  QString channelname;
613  MSqlQuery query(MSqlQuery::InitCon());
614  query.prepare(querystr);
615 
616  if (query.exec() && query.next())
617  {
618  channelname = query.value(0).toString();
619  }
620 
621  QString label = tr("Icon Import Options");
622 
623  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
624 
625  auto *menu = new MythDialogBox(label, popupStack, "iconoptmenu");
626 
627  if (menu->Create())
628  {
629  menu->SetReturnEvent(this, "iconimportopt");
630 
631  menu->AddButton(tr("Download all icons..."));
632  menu->AddButton(tr("Rescan for missing icons..."));
633  if (!channelname.isEmpty())
634  menu->AddButton(tr("Download icon for %1").arg(channelname),
635  channelname);
636 
637  popupStack->AddScreen(menu);
638  }
639  else
640  {
641  delete menu;
642  return;
643  }
644 }
645 
646 void ChannelEditor::customEvent(QEvent *event)
647 {
648  if (event->type() == DialogCompletionEvent::kEventType)
649  {
650  auto *dce = (DialogCompletionEvent*)(event);
651 
652  QString resultid= dce->GetId();
653  int buttonnum = dce->GetResult();
654 
655  if (resultid == "channelopts")
656  {
657  switch (buttonnum)
658  {
659  case 0 :
661  break;
662  case 1 :
663  del();
664  break;
665  }
666  }
667  else if (resultid == "delsingle" && buttonnum == 1)
668  {
669  auto *item = dce->GetData().value<MythUIButtonListItem *>();
670  if (!item)
671  return;
672  uint chanid = item->GetData().toUInt();
673  if (chanid && ChannelUtil::DeleteChannel(chanid))
674  m_channelList->RemoveItem(item);
675  }
676  else if (resultid == "delall" && buttonnum == 1)
677  {
678  bool del_all = m_sourceFilter == FILTER_ALL;
679  bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
680 
681  MSqlQuery query(MSqlQuery::InitCon());
682  if (del_all)
683  {
684  query.prepare("TRUNCATE TABLE channel");
685  }
686  else if (del_nul)
687  {
688  query.prepare("SELECT sourceid "
689  "FROM videosource "
690  "GROUP BY sourceid");
691 
692  if (!query.exec() || !query.isActive())
693  {
694  MythDB::DBError("ChannelEditor Delete Channels", query);
695  return;
696  }
697 
698  QString tmp = "";
699  while (query.next())
700  tmp += "'" + query.value(0).toString() + "',";
701 
702  if (tmp.isEmpty())
703  {
704  query.prepare("TRUNCATE TABLE channel");
705  }
706  else
707  {
708  tmp = tmp.left(tmp.length() - 1);
709  query.prepare(QString("UPDATE channel "
710  "SET deleted = NOW() "
711  "WHERE deleted IS NULL AND "
712  " sourceid NOT IN (%1)").arg(tmp));
713  }
714  }
715  else
716  {
717  query.prepare("UPDATE channel "
718  "SET deleted = NOW() "
719  "WHERE deleted IS NULL AND sourceid = :SOURCEID");
720  query.bindValue(":SOURCEID", m_sourceFilter);
721  }
722 
723  if (!query.exec())
724  MythDB::DBError("ChannelEditor Delete Channels", query);
725 
726  fillList();
727  }
728  else if (resultid == "iconimportopt")
729  {
731 
732  ImportIconsWizard *iconwizard = nullptr;
733 
734  QString channelname = dce->GetData().toString();
735 
736  switch (buttonnum)
737  {
738  case 0 : // Import all icons
739  iconwizard = new ImportIconsWizard(mainStack, false);
740  break;
741  case 1 : // Rescan for missing
742  iconwizard = new ImportIconsWizard(mainStack, true);
743  break;
744  case 2 : // Import a single channel icon
745  iconwizard = new ImportIconsWizard(mainStack, true,
746  channelname);
747  break;
748  default:
749  return;
750  }
751 
752  if (iconwizard->Create())
753  {
754  connect(iconwizard, SIGNAL(Exiting()), SLOT(fillList()));
755  mainStack->AddScreen(iconwizard);
756  }
757  else
758  {
759  delete iconwizard;
760 
761  if (buttonnum == 2)
762  {
763  // Reload the list since ImportIconsWizard::Create() will return false
764  // if it automatically downloaded an icon for the selected channel
765  fillList();
766  }
767  }
768  }
769  }
770 }
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:782
void del(void)
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:863
bool WaitFor(MythConfirmationDialog *dialog)
Blocks until confirmation dialog exits.
MythUIButtonList * m_sourceList
Definition: channeleditor.h:51
bool keyPressEvent(QKeyEvent *Event) override
Key event handler.
Definition: osd.cpp:95
Dialog asking for user confirmation.
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 setSortMode(MythUIButtonListItem *item)
void SetEnabled(bool enable)
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
ChannelWizard(int id, int default_sourceid)
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
bool Create(void) override
Definition: importicons.cpp:57
virtual void SetValue(int value)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
Basic menu dialog, message and a list of options.
QString GetImageFilename(const QString &name="") const
void scan(void)
static bool IsAnySourceScanable(void)
Definition: sourceutil.cpp:347
int size(void) const
Definition: mythdbcon.h:203
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:135
MythScreenStack * GetStack(const QString &stackname)
MythUIText * m_channum
Definition: channeleditor.h:55
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythScreenStack * GetMainStack()
ChannelEditor(QObject *RetObject, const char *Name)
Definition: osd.h:86
static QStringList GetInputTypes(uint chanid)
static guint32 * tmp
Definition: goom_core.c:35
MythUIImage * m_preview
Definition: channeleditor.h:53
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void RemoveItem(MythUIButtonListItem *item)
void BuildFocusList(void)
static Type kEventType
Definition: mythdialogbox.h:50
void transportEditor(void)
virtual QString getValue(void) const
QString GetConfDir(void)
Definition: mythdirs.cpp:224
QVariant value(int i) const
Definition: mythdbcon.h:198
MythUIText * m_chanid
Definition: channeleditor.h:57
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void SetHelpText(const QString &text)
Definition: mythuitype.h:150
void edit(MythUIButtonListItem *item=nullptr)
bool Create(void) override
Definition: osd.cpp:35
MythUIText * m_callsign
Definition: channeleditor.h:56
void setHideMode(bool hide)
virtual void setLabel(QString str)
QString m_sourceFilterName
Definition: channeleditor.h:46
bool isActive(void) const
Definition: mythdbcon.h:204
void Reset(void) override
Reset the image back to the default defined in the theme.
QString m_currentSortMode
Definition: channeleditor.h:47
unsigned int uint
Definition: compat.h:140
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
void setSourceID(MythUIButtonListItem *item)
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
virtual void addChild(StandardSetting *child)
MythUIType * GetFocusWidget(void) const
A single button widget.
Definition: mythuibutton.h:21
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
MythMainWindow * GetMythMainWindow(void)
QString GetText(const QString &name="") const
virtual QString GetValue() const
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:807
bool keyPressEvent(QKeyEvent *) override
Key event handler.
void customEvent(QEvent *event) override
bool m_currentHideMode
Definition: channeleditor.h:48
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
static bool check_cardsource(int sourceid, QString &sourcename)
static QStringList GetInputTypeNames(uint sourceid)
Get a list of card input types for a source id.
Definition: cardutil.cpp:379
MythUIText * m_compoundname
Definition: channeleditor.h:59
void SetCheckState(MythUIStateType::StateType state)
ChannelID * m_cid
Definition: channeleditor.h:71
MythUIText * m_sourcename
Definition: channeleditor.h:58
void SetItemCurrent(MythUIButtonListItem *item)
MythUIButtonList * m_channelList
Definition: channeleditor.h:50
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
void menu(void)
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:179
Screen in which all other widgets are contained and rendered.
void deleteChannels(void)
int GetCurrentPos() const
MythUIText * m_channame
Definition: channeleditor.h:54
QString GetHostName(void)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:37
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:132
virtual void setValue(const QString &newValue)
void itemChanged(MythUIButtonListItem *item)
static bool IsV4L(const QString &rawtype)
Definition: cardutil.h:131
void channelIconImport(void)
MythUIButtonListItem * GetItemCurrent() const
static bool DeleteChannel(uint channel_id)