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"));
110  sortList->SetValue(m_currentSortMode);
111 
112 
113  // Source List
114  new MythUIButtonListItem(m_sourceList,tr("All"),
115  QVariant::fromValue((int)FILTER_ALL));
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  QVariant::fromValue((int)FILTER_UNASSIGNED));
128  connect(sortList, &MythUIButtonList::itemSelected,
130 
131  // Hide/Show channels without channum checkbox
132  hideCheck->SetCheckState(m_currentHideMode);
133  connect(hideCheck, &MythUICheckBox::toggled,
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, &MythUIButton::Clicked, this, &ChannelEditor::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, &MythUIButton::Clicked, this, &ChannelEditor::transportEditor);
152 
153  // Other signals
155  this, &ChannelEditor::edit);
158  connect(scanButton, &MythUIButton::Clicked, this, &ChannelEditor::scan);
159  connect(deleteButton, &MythUIButton::Clicked, this, &ChannelEditor::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, SUBSTRING_INDEX(channum, '_', -1) + 0";
274  }
275  else if (m_currentSortMode == tr("Multiplex Frequency"))
276  {
277  querystr += " ORDER BY dtv_multiplex.frequency, serviceid";
278  }
279 
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  // Also hide channels that are not visible
312  if ((!visible || channum.isEmpty()) && m_currentHideMode)
313  continue;
314 
315  if (name.isEmpty())
316  name = "(Unnamed : " + chanid + ")";
317 
318  QString compoundname = name;
319 
320  if (m_currentSortMode == tr("Channel Name"))
321  {
322  if (!channum.isEmpty())
323  compoundname += " (" + channum + ")";
324  }
325  else if (m_currentSortMode == tr("Channel Number"))
326  {
327  if (!channum.isEmpty())
328  compoundname = channum + ". " + compoundname;
329  else
330  compoundname = "???. " + compoundname;
331  }
332 
333  if (m_sourceFilter == FILTER_ALL)
334  compoundname += " (" + sourceid + ")";
335 
336  bool sel = (chanid == currentValue);
337  selidx = (sel) ? idx : selidx;
338  item = new MythUIButtonListItem(m_channelList, "",
339  QVariant::fromValue(chanid));
340  item->SetText(compoundname, "compoundname");
341  item->SetText(name, "name");
342  item->SetText(channum, "channum");
343  item->SetText(chanid, "chanid");
344  item->SetText(callsign, "callsign");
345  item->SetText(sourceid, "sourcename");
346 
347  // mythtv-setup needs direct access to channel icon dir to import. We
348  // also can't rely on the backend to be running, so access the file directly
349  QString tmpIcon = GetConfDir() + "/channels/" + icon;
350  item->SetImage(tmpIcon);
351  item->SetImage(tmpIcon, "icon");
352 
353  item->DisplayState(state, "status");
354  }
355  }
356 
357  // Make sure we select the current item, or the following one after
358  // deletion, with wrap around to "(New Channel)" after deleting last item.
359  m_channelList->SetItemCurrent((!selidx && currentIndex < idx) ? currentIndex : selidx);
360 }
361 
363 {
364  if (!item)
365  return;
366 
367  QString sortName = item->GetText();
368 
369  if (m_currentSortMode != sortName)
370  {
371  m_currentSortMode = sortName;
372  fillList();
373  }
374 }
375 
377 {
378  if (!item)
379  return;
380 
381  QString sourceName = item->GetText();
382  int sourceID = item->GetData().toInt();
383 
384  if (m_sourceFilter != sourceID)
385  {
386  m_sourceFilterName = sourceName;
387  m_sourceFilter = sourceID;
388  fillList();
389  }
390 }
391 
393 {
394  if (m_currentHideMode != hide)
395  {
396  m_currentHideMode = hide;
397  fillList();
398  }
399 }
400 
402 {
404 
405  if (!item)
406  return;
407 
408  QString message = tr("Delete channel '%1'?").arg(item->GetText("name"));
409 
410  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
411  auto *dialog = new MythConfirmationDialog(popupStack, message, true);
412 
413  if (dialog->Create())
414  {
415  dialog->SetData(QVariant::fromValue(item));
416  dialog->SetReturnEvent(this, "delsingle");
417  popupStack->AddScreen(dialog);
418  }
419  else
420  delete dialog;
421 
422 }
423 
425 {
426  const QString currentLabel = m_sourceList->GetValue();
427 
428  bool del_all = m_sourceFilter == FILTER_ALL;
429  bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
430 
431  QString message =
432  (del_all) ? tr("Delete ALL channels?") :
433  ((del_nul) ? tr("Delete all unassigned channels?") :
434  tr("Delete all channels on %1?").arg(currentLabel));
435 
436  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
437  auto *dialog = new MythConfirmationDialog(popupStack, message, true);
438 
439  if (dialog->Create())
440  {
441  dialog->SetReturnEvent(this, "delall");
442  popupStack->AddScreen(dialog);
443  }
444  else
445  delete dialog;
446 }
447 
449 {
450  if (!item)
451  item = m_channelList->GetItemCurrent();
452 
453  if (!item)
454  return;
455 
457 
458  int chanid = item->GetData().toInt();
459  auto *cw = new ChannelWizard(chanid, m_sourceFilter);
460  auto *ssd = new StandardSettingDialog(mainStack, "channelwizard", cw);
461  if (ssd->Create())
462  {
463  connect(ssd, &MythScreenType::Exiting, this, &ChannelEditor::fillList);
464  mainStack->AddScreen(ssd);
465  }
466  else
467  delete ssd;
468 }
469 
471 {
473 
474  if (!item)
475  return;
476 
477  int chanid = item->GetData().toInt();
478  if (chanid == 0)
479  edit(item);
480  else
481  {
482  QString label = tr("Channel Options");
483 
484  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
485 
486  auto *menu = new MythDialogBox(label, popupStack, "chanoptmenu");
487 
488  if (menu->Create())
489  {
490  menu->SetReturnEvent(this, "channelopts");
491 
492  menu->AddButton(tr("Edit"));
493 // if ()
494 // menu->AddButton(tr("Set Hidden"));
495 // else
496 // menu->AddButton(tr("Set Visible"));
497  menu->AddButton(tr("Delete"));
498 
499  popupStack->AddScreen(menu);
500  }
501  else
502  {
503  delete menu;
504  return;
505  }
506  }
507 }
508 
509 // Check that we have a video source and that at least one
510 // capture card is connected to the video source.
511 //
512 static bool check_cardsource(int sourceid, QString &sourcename)
513 {
514  // Check for videosource
515  if (sourceid < 1)
516  {
517  MythConfirmationDialog *md = ShowOkPopup(QObject::tr(
518  "Select a video source. 'All' cannot be used. "
519  "If there is no video source then create one in the "
520  "'Video sources' menu page and connect a capture card."));
521  WaitFor(md);
522  return false;
523  }
524 
525  // Check for a connected capture card
527  query.prepare(
528  "SELECT capturecard.cardid "
529  "FROM capturecard "
530  "WHERE capturecard.sourceid = :SOURCEID AND "
531  " capturecard.hostname = :HOSTNAME");
532  query.bindValue(":SOURCEID", sourceid);
533  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
534 
535  if (!query.exec() || !query.isActive())
536  {
537  MythDB::DBError("check_capturecard()", query);
538  return false;
539  }
540  uint cardid = 0;
541  if (query.next())
542  cardid = query.value(0).toUInt();
543 
544  if (cardid < 1)
545  {
546  MythConfirmationDialog *md = ShowOkPopup(QObject::tr(
547  "No capture card!"
548  "\n"
549  "Connect video source '%1' to a capture card "
550  "in the 'Input Connections' menu page.")
551  .arg(sourcename));
552  WaitFor(md);
553  return false;
554  }
555 
556  // At least one capture card connected to the video source
557  // must be able to do channel scanning
558  if (SourceUtil::IsUnscanable(sourceid))
559  {
560  MythConfirmationDialog *md = ShowOkPopup(QObject::tr(
561  "The capture card(s) connected to video source '%1' "
562  "cannot be used for channel scanning.")
563  .arg(sourcename));
564  WaitFor(md);
565  return false;
566  }
567 
568  return true;
569 }
570 
572 {
573  // Check that we have a videosource and a connected capture card
575  return;
576 
577  // Create the dialog now that we have a video source and a capture card
579  auto *ssd = new StandardSettingDialog(mainStack, "scanwizard",
581  if (ssd->Create())
582  {
583  connect(ssd, &MythScreenType::Exiting, this, &ChannelEditor::fillList);
584  mainStack->AddScreen(ssd);
585  }
586  else
587  delete ssd;
588 }
589 
591 {
592  // Check that we have a videosource and a connected capture card
594  return;
595 
596  // Create the dialog now that we have a video source and a capture card
598  auto *ssd = new StandardSettingDialog(mainStack, "transporteditor",
600  if (ssd->Create())
601  {
602  connect(ssd, &MythScreenType::Exiting, this, &ChannelEditor::fillList);
603  mainStack->AddScreen(ssd);
604  }
605  else
606  delete ssd;
607 }
608 
610 {
611  if (m_channelList->GetCount() == 0)
612  {
613  ShowOkPopup(tr("Add some channels first!"));
614  return;
615  }
616 
617  int channelID = 0;
619  if (item)
620  channelID = item->GetData().toInt();
621 
622  // Get selected channel name from database
623  QString querystr = QString("SELECT channel.name FROM channel "
624  "WHERE chanid='%1'").arg(channelID);
625  QString channelname;
627  query.prepare(querystr);
628 
629  if (query.exec() && query.next())
630  {
631  channelname = query.value(0).toString();
632  }
633 
634  QString label = tr("Icon Import Options");
635 
636  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
637 
638  auto *menu = new MythDialogBox(label, popupStack, "iconoptmenu");
639 
640  if (menu->Create())
641  {
642  menu->SetReturnEvent(this, "iconimportopt");
643 
644  menu->AddButton(tr("Download all icons..."));
645  menu->AddButton(tr("Rescan for missing icons..."));
646  if (!channelname.isEmpty())
647  menu->AddButton(tr("Download icon for %1").arg(channelname),
648  channelname);
649 
650  popupStack->AddScreen(menu);
651  }
652  else
653  {
654  delete menu;
655  return;
656  }
657 }
658 
659 void ChannelEditor::customEvent(QEvent *event)
660 {
661  if (event->type() == DialogCompletionEvent::kEventType)
662  {
663  auto *dce = (DialogCompletionEvent*)(event);
664 
665  QString resultid= dce->GetId();
666  int buttonnum = dce->GetResult();
667 
668  if (resultid == "channelopts")
669  {
670  switch (buttonnum)
671  {
672  case 0 :
674  break;
675  case 1 :
676  del();
677  break;
678  }
679  }
680  else if (resultid == "delsingle" && buttonnum == 1)
681  {
682  auto *item = dce->GetData().value<MythUIButtonListItem *>();
683  if (!item)
684  return;
685  uint chanid = item->GetData().toUInt();
686  if (chanid && ChannelUtil::DeleteChannel(chanid))
687  m_channelList->RemoveItem(item);
688  }
689  else if (resultid == "delall" && buttonnum == 1)
690  {
691  bool del_all = m_sourceFilter == FILTER_ALL;
692  bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
693 
695  if (del_all)
696  {
697  query.prepare("TRUNCATE TABLE channel");
698  }
699  else if (del_nul)
700  {
701  query.prepare("SELECT sourceid "
702  "FROM videosource "
703  "GROUP BY sourceid");
704 
705  if (!query.exec() || !query.isActive())
706  {
707  MythDB::DBError("ChannelEditor Delete Channels", query);
708  return;
709  }
710 
711  QString tmp = "";
712  while (query.next())
713  tmp += "'" + query.value(0).toString() + "',";
714 
715  if (tmp.isEmpty())
716  {
717  query.prepare("TRUNCATE TABLE channel");
718  }
719  else
720  {
721  tmp = tmp.left(tmp.length() - 1);
722  query.prepare(QString("UPDATE channel "
723  "SET deleted = NOW() "
724  "WHERE deleted IS NULL AND "
725  " sourceid NOT IN (%1)").arg(tmp));
726  }
727  }
728  else
729  {
730  query.prepare("UPDATE channel "
731  "SET deleted = NOW() "
732  "WHERE deleted IS NULL AND sourceid = :SOURCEID");
733  query.bindValue(":SOURCEID", m_sourceFilter);
734  }
735 
736  if (!query.exec())
737  MythDB::DBError("ChannelEditor Delete Channels", query);
738 
739  fillList();
740  }
741  else if (resultid == "iconimportopt")
742  {
744 
745  ImportIconsWizard *iconwizard = nullptr;
746 
747  QString channelname = dce->GetData().toString();
748 
749  switch (buttonnum)
750  {
751  case 0 : // Import all icons
752  iconwizard = new ImportIconsWizard(mainStack, false);
753  break;
754  case 1 : // Rescan for missing
755  iconwizard = new ImportIconsWizard(mainStack, true);
756  break;
757  case 2 : // Import a single channel icon
758  iconwizard = new ImportIconsWizard(mainStack, true,
759  channelname);
760  break;
761  default:
762  return;
763  }
764 
765  if (iconwizard->Create())
766  {
767  connect(iconwizard, &MythScreenType::Exiting, this, &ChannelEditor::fillList);
768  mainStack->AddScreen(iconwizard);
769  }
770  else
771  {
772  delete iconwizard;
773 
774  if (buttonnum == 2)
775  {
776  // Reload the list since ImportIconsWizard::Create() will return false
777  // if it automatically downloaded an icon for the selected channel
778  fillList();
779  }
780  }
781  }
782  }
783 }
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:592
ChannelOptionsFilters
Definition: channelsettings.h:134
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:126
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:321
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:98
StandardSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:163
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:551
mythdb.h
ChannelEditor::scan
void scan(void)
Definition: channeleditor.cpp:571
ChannelEditor::m_callsign
MythUIText * m_callsign
Definition: channeleditor.h:56
ChannelUtil::DeleteChannel
static bool DeleteChannel(uint channel_id)
Definition: channelutil.cpp:1766
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1139
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:470
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
ChannelWizard::m_cid
ChannelID * m_cid
Definition: channeleditor.h:71
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:16
arg
arg(title).arg(filename).arg(doDelete))
ImportIconsWizard::Create
bool Create(void) override
Definition: importicons.cpp:61
ChannelEditor::keyPressEvent
bool keyPressEvent(QKeyEvent *Event) override
Key event handler.
Definition: osd.cpp:96
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
ChannelOptionsCommon
Definition: channelsettings.h:114
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
check_cardsource
static bool check_cardsource(int sourceid, QString &sourcename)
Definition: channeleditor.cpp:512
mythdirs.h
MythUIImage::Reset
void Reset(void) override
Reset the image back to the default defined in the theme.
Definition: mythuiimage.cpp:645
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:326
mythuibuttonlist.h
ChannelEditor::edit
void edit(MythUIButtonListItem *item=nullptr)
Definition: channeleditor.cpp:448
ScanWizard
Definition: scanwizard.h:45
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:21
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
ImportIconsWizard
Definition: importicons.h:29
ChannelEditor::m_channame
MythUIText * m_channame
Definition: channeleditor.h:54
StandardSettingDialog
Definition: standardsettings.h:466
ChannelEditor::customEvent
void customEvent(QEvent *event) override
Definition: channeleditor.cpp:659
StandardSetting::addChild
virtual void addChild(StandardSetting *child)
Definition: standardsettings.cpp:64
sourceutil.h
ChannelEditor::m_sourceList
MythUIButtonList * m_sourceList
Definition: channeleditor.h:51
mythlogging.h
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
MythUIButtonList::itemClicked
void itemClicked(MythUIButtonListItem *item)
MythUIButtonList::GetCurrentPos
int GetCurrentPos() const
Definition: mythuibuttonlist.h:190
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:138
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:153
TransportListEditor
Definition: transporteditor.h:69
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
ChannelOptionsRawTS
Definition: channelsettings.h:146
ChannelEditor::m_channelList
MythUIButtonList * m_channelList
Definition: channeleditor.h:50
ChannelEditor::del
void del(void)
Definition: channeleditor.cpp:401
ChannelEditor::m_channum
MythUIText * m_channum
Definition: channeleditor.h:55
MythUIType::SetEnabled
void SetEnabled(bool enable)
Definition: mythuitype.cpp:1108
SourceUtil::IsUnscanable
static bool IsUnscanable(uint sourceid)
Definition: sourceutil.cpp:341
StandardSetting::getValue
virtual QString getValue(void) const
Definition: standardsettings.h:51
ChannelEditor::deleteChannels
void deleteChannels(void)
Definition: channeleditor.cpp:424
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3580
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:56
MythUICheckBox
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
Definition: mythuicheckbox.h:16
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:376
ChannelEditor::channelIconImport
void channelIconImport(void)
Definition: channeleditor.cpp:609
ChannelEditor::m_compoundname
MythUIText * m_compoundname
Definition: channeleditor.h:59
ChannelEditor::m_chanid
MythUIText * m_chanid
Definition: channeleditor.h:57
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
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.
Definition: mythdialogbox.h:222
mythcorecontext.h
ChannelOptionsV4L
Definition: channelsettings.h:140
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: osd.cpp:36
ChannelEditor::setHideMode
void setHideMode(bool hide)
Definition: channeleditor.cpp:392
ChannelEditor::fillList
void fillList()
Definition: channeleditor.cpp:235
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:42
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:134
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:362
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:105
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
ChannelEditor::transportEditor
void transportEditor(void)
Definition: channeleditor.cpp:590
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:855
ChannelEditor::m_currentSortMode
QString m_currentSortMode
Definition: channeleditor.h:47
ChannelWizard
Definition: channeleditor.h:65
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:197
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:166
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
ChannelEditor::FILTER_ALL
@ FILTER_ALL
Definition: channeleditor.h:41
query
MSqlQuery query(MSqlQuery::InitCon())
ChannelEditor::ChannelEditor
ChannelEditor(QObject *RetObject, const char *Name)
Definition: osd.h:86
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