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