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 
49  new ChannelOptionsCommon(*m_cid, default_sourceid,!all_v4l);
51 
52  ChannelOptionsFilters *filters =
54  addChild(filters);
55 
56  if (all_v4l)
58  else if (all_asi)
60 }
61 
63 
65  : MythScreenType(parent, "channeleditor"),
66  m_currentSortMode(QCoreApplication::translate("(Common)", "Channel Name"))
67 {
68 }
69 
71 {
72  // Load the theme for this screen
73  bool foundtheme = LoadWindowFromXML("config-ui.xml", "channeloverview", this);
74  if (!foundtheme)
75  return false;
76 
77  MythUIButtonList *sortList = dynamic_cast<MythUIButtonList *>(GetChild("sorting"));
78  m_sourceList = dynamic_cast<MythUIButtonList *>(GetChild("source"));
79  m_channelList = dynamic_cast<MythUIButtonList *>(GetChild("channels"));
80  m_preview = dynamic_cast<MythUIImage *>(GetChild("preview"));
81  m_channame = dynamic_cast<MythUIText *>(GetChild("name"));
82  m_channum = dynamic_cast<MythUIText *>(GetChild("channum"));
83  m_callsign = dynamic_cast<MythUIText *>(GetChild("callsign"));
84  m_chanid = dynamic_cast<MythUIText *>(GetChild("chanid"));
85  m_sourcename = dynamic_cast<MythUIText *>(GetChild("sourcename"));
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 source(s)."));
105 
106  // Sort List
107  new MythUIButtonListItem(sortList, tr("Channel Name"));
108  new MythUIButtonListItem(sortList, tr("Channel Number"));
109  new MythUIButtonListItem(sortList, tr("Multiplex Frequency"));
110  connect(m_sourceList, SIGNAL(itemSelected(MythUIButtonListItem *)),
112  sortList->SetValue(m_currentSortMode);
113 
114 
115  // Source List
116  new MythUIButtonListItem(m_sourceList,tr("All"),
117  qVariantFromValue((int)FILTER_ALL));
118  MSqlQuery query(MSqlQuery::InitCon());
119  query.prepare("SELECT name, sourceid FROM videosource");
120  if (query.exec())
121  {
122  while(query.next())
123  {
124  new MythUIButtonListItem(m_sourceList, query.value(0).toString(),
125  query.value(1).toInt());
126  }
127  }
128  new MythUIButtonListItem(m_sourceList,tr("(Unassigned)"),
129  qVariantFromValue((int)FILTER_UNASSIGNED));
130  connect(sortList, SIGNAL(itemSelected(MythUIButtonListItem *)),
132 
133  // Hide/Show channels without channum checkbox
134  hideCheck->SetCheckState(m_currentHideMode);
135  connect(hideCheck, SIGNAL(toggled(bool)),
136  SLOT(setHideMode(bool)));
137 
138  // Scan Button
139  scanButton->SetHelpText(tr("Starts the channel scanner."));
141 
142  // Import Icons Button
143  importIconButton->SetHelpText(tr("Starts the icon downloader"));
144  importIconButton->SetEnabled(true);
145  connect(importIconButton, SIGNAL(Clicked()), SLOT(channelIconImport()));
146 
147  // Transport Editor Button
148  transportEditorButton->SetHelpText(
149  tr("Allows you to edit the transports directly. "
150  "This is rarely required unless you are using "
151  "a satellite dish and must enter an initial "
152  "frequency to for the channel scanner to try."));
153  connect(transportEditorButton, SIGNAL(Clicked()), SLOT(transportEditor()));
154 
155  // Other signals
156  connect(m_channelList, SIGNAL(itemClicked(MythUIButtonListItem *)),
157  SLOT(edit(MythUIButtonListItem *)));
158  connect(m_channelList, SIGNAL(itemSelected(MythUIButtonListItem *)),
160  connect(scanButton, SIGNAL(Clicked()), SLOT(scan()));
161  connect(deleteButton, SIGNAL(Clicked()), SLOT(deleteChannels()));
162 
163  fillList();
164 
165  BuildFocusList();
166 
167  return true;
168 }
169 
170 bool ChannelEditor::keyPressEvent(QKeyEvent *event)
171 {
172  if (GetFocusWidget()->keyPressEvent(event))
173  return true;
174 
175  QStringList actions;
176  bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
177 
178  for (int i = 0; i < actions.size() && !handled; i++)
179  {
180  QString action = actions[i];
181  handled = true;
182 
183  if (action == "MENU")
184  menu();
185  else if (action == "DELETE")
186  del();
187  else if (action == "EDIT")
188  edit();
189  else
190  handled = false;
191  }
192 
193  if (!handled && MythScreenType::keyPressEvent(event))
194  handled = true;
195 
196  return handled;
197 }
198 
200 {
201  if (!item)
202  return;
203 
204  if (m_preview)
205  {
206  m_preview->Reset();
207  QString iconpath = item->GetImageFilename();
208  if (!iconpath.isEmpty())
209  {
210  // mythtv-setup needs direct access to channel icon dir to import. We
211  // also can't rely on the backend to be running, so access the file directly
212  QString tmpIcon = GetConfDir() + "/channels/" + iconpath;
213  m_preview->SetFilename(tmpIcon);
214  m_preview->Load();
215  }
216  }
217 
218  if (m_channame)
219  m_channame->SetText(item->GetText("name"));
220 
221  if (m_channum)
222  m_channum->SetText(item->GetText("channum"));
223 
224  if (m_callsign)
225  m_callsign->SetText(item->GetText("callsign"));
226 
227  if (m_chanid)
228  m_chanid->SetText(item->GetText("chanid"));
229 
230  if (m_sourcename)
231  m_sourcename->SetText(item->GetText("sourcename"));
232 
233  if (m_compoundname)
234  m_compoundname->SetText(item->GetText("compoundname"));
235 }
236 
238 {
239  QString currentValue = m_channelList->GetValue();
240  uint currentIndex = qMax(m_channelList->GetCurrentPos(), 0);
241  m_channelList->Reset();
242  QString newchanlabel = tr("(Add New Channel)");
244  item->SetText(newchanlabel, "compoundname");
245  item->SetText(newchanlabel, "name");
246 
247  bool fAllSources = true;
248 
249  QString querystr = "SELECT channel.name,channum,chanid,callsign,icon,"
250  "channel.visible ,videosource.name, serviceid, "
251  "dtv_multiplex.frequency FROM channel "
252  "LEFT JOIN videosource ON "
253  "(channel.sourceid = videosource.sourceid) "
254  "LEFT JOIN dtv_multiplex ON "
255  "(channel.mplexid = dtv_multiplex.mplexid)";
256 
257  if (m_sourceFilter == FILTER_ALL)
258  {
259  fAllSources = true;
260  }
261  else
262  {
263  querystr += QString(" WHERE channel.sourceid='%1' ")
264  .arg(m_sourceFilter);
265  fAllSources = false;
266  }
267 
268  if (m_currentSortMode == tr("Channel Name"))
269  {
270  querystr += " ORDER BY channel.name";
271  }
272  else if (m_currentSortMode == tr("Channel Number"))
273  {
274  querystr += " ORDER BY channum + 0";
275  }
276  else if (m_currentSortMode == tr("Multiplex Frequency"))
277  {
278  querystr += " ORDER BY dtv_multiplex.frequency, serviceid";
279  }
280 
281  MSqlQuery query(MSqlQuery::InitCon());
282  query.prepare(querystr);
283 
284  uint selidx = 0, 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  MythConfirmationDialog *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  MythConfirmationDialog *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  ChannelWizard *cw = new ChannelWizard(chanid, m_sourceFilter);
459  StandardSettingDialog *ssd = new StandardSettingDialog(mainStack,
460  "channelwizard", cw);
461  if (ssd->Create())
462  {
463  connect(ssd, SIGNAL(Exiting()), SLOT(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  MythDialogBox *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
526  MSqlQuery query(MSqlQuery::InitCon());
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  return true;
557 }
558 
560 {
561  // Check that we have a videosource and a connected capture card
563  return;
564 
565  // Create the dialog now that we have a video source and a capture card
567  StandardSettingDialog *ssd =
568  new StandardSettingDialog(mainStack, "scanwizard",
570  if (ssd->Create())
571  {
572  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
573  mainStack->AddScreen(ssd);
574  }
575  else
576  delete ssd;
577 }
578 
580 {
581  // Check that we have a videosource and a connected capture card
583  return;
584 
585  // Create the dialog now that we have a video source and a capture card
587  StandardSettingDialog *ssd =
588  new StandardSettingDialog(mainStack, "transporteditor",
590  if (ssd->Create())
591  {
592  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
593  mainStack->AddScreen(ssd);
594  }
595  else
596  delete ssd;
597 }
598 
600 {
601  if (m_channelList->GetCount() == 0)
602  {
603  ShowOkPopup(tr("Add some channels first!"));
604  return;
605  }
606 
607  int channelID = 0;
609  if (item)
610  channelID = item->GetData().toInt();
611 
612  // Get selected channel name from database
613  QString querystr = QString("SELECT channel.name FROM channel "
614  "WHERE chanid='%1'").arg(channelID);
615  QString channelname;
616  MSqlQuery query(MSqlQuery::InitCon());
617  query.prepare(querystr);
618 
619  if (query.exec() && query.next())
620  {
621  channelname = query.value(0).toString();
622  }
623 
624  QString label = tr("Icon Import Options");
625 
626  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
627 
628  MythDialogBox *menu = new MythDialogBox(label, popupStack, "iconoptmenu");
629 
630  if (menu->Create())
631  {
632  menu->SetReturnEvent(this, "iconimportopt");
633 
634  menu->AddButton(tr("Download all icons..."));
635  menu->AddButton(tr("Rescan for missing icons..."));
636  if (!channelname.isEmpty())
637  menu->AddButton(tr("Download icon for %1").arg(channelname),
638  channelname);
639 
640  popupStack->AddScreen(menu);
641  }
642  else
643  {
644  delete menu;
645  return;
646  }
647 }
648 
649 void ChannelEditor::customEvent(QEvent *event)
650 {
651  if (event->type() == DialogCompletionEvent::kEventType)
652  {
654 
655  QString resultid= dce->GetId();
656  int buttonnum = dce->GetResult();
657 
658  if (resultid == "channelopts")
659  {
660  switch (buttonnum)
661  {
662  case 0 :
664  break;
665  case 1 :
666  del();
667  break;
668  }
669  }
670  else if (resultid == "delsingle" && buttonnum == 1)
671  {
672  MythUIButtonListItem *item =
673  dce->GetData().value<MythUIButtonListItem *>();
674  if (!item)
675  return;
676  uint chanid = item->GetData().toUInt();
677  if (chanid && ChannelUtil::DeleteChannel(chanid))
678  m_channelList->RemoveItem(item);
679  }
680  else if (resultid == "delall" && buttonnum == 1)
681  {
682  bool del_all = m_sourceFilter == FILTER_ALL;
683  bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
684 
685  MSqlQuery query(MSqlQuery::InitCon());
686  if (del_all)
687  {
688  query.prepare("TRUNCATE TABLE channel");
689  }
690  else if (del_nul)
691  {
692  query.prepare("SELECT sourceid "
693  "FROM videosource "
694  "GROUP BY sourceid");
695 
696  if (!query.exec() || !query.isActive())
697  {
698  MythDB::DBError("ChannelEditor Delete Channels", query);
699  return;
700  }
701 
702  QString tmp = "";
703  while (query.next())
704  tmp += "'" + query.value(0).toString() + "',";
705 
706  if (tmp.isEmpty())
707  {
708  query.prepare("TRUNCATE TABLE channel");
709  }
710  else
711  {
712  tmp = tmp.left(tmp.length() - 1);
713  query.prepare(QString("DELETE FROM channel "
714  "WHERE sourceid NOT IN (%1)").arg(tmp));
715  }
716  }
717  else
718  {
719  query.prepare("DELETE FROM channel "
720  "WHERE sourceid = :SOURCEID");
721  query.bindValue(":SOURCEID", m_sourceFilter);
722  }
723 
724  if (!query.exec())
725  MythDB::DBError("ChannelEditor Delete Channels", query);
726 
727  fillList();
728  }
729  else if (resultid == "iconimportopt")
730  {
732 
733  ImportIconsWizard *iconwizard;
734 
735  QString channelname = dce->GetData().toString();
736 
737  switch (buttonnum)
738  {
739  case 0 : // Import all icons
740  iconwizard = new ImportIconsWizard(mainStack, false);
741  break;
742  case 1 : // Rescan for missing
743  iconwizard = new ImportIconsWizard(mainStack, true);
744  break;
745  case 2 : // Import a single channel icon
746  iconwizard = new ImportIconsWizard(mainStack, true,
747  channelname);
748  break;
749  default:
750  return;
751  }
752 
753  if (iconwizard->Create())
754  {
755  connect(iconwizard, SIGNAL(Exiting()), SLOT(fillList()));
756  mainStack->AddScreen(iconwizard);
757  }
758  else
759  {
760  delete iconwizard;
761 
762  if (buttonnum == 2)
763  {
764  // Reload the list since ImportIconsWizard::Create() will return false
765  // if it automatically downloaded an icon for the selected channel
766  fillList();
767  }
768  }
769  }
770  }
771 }
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
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:343
int size(void) const
Definition: mythdbcon.h:203
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:136
MythScreenStack * GetStack(const QString &stackname)
MythUIText * m_channum
Definition: channeleditor.h:55
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: osd.cpp:106
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythScreenStack * GetMainStack()
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 SetImage(MythImage *image, const QString &name="")
Sets an image directly, should only be used in special circumstances since it bypasses the cache.
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:46
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 SetReturnEvent(QObject *retobject, const QString &resultid)
void Reset(void) override
Reset the image back to the default defined in the theme.
QString m_currentSortMode
Definition: channeleditor.h:47
void SetText(const QString &text, const QString &name="", const QString &state="")
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
void setSourceID(MythUIButtonListItem *item)
const char * name
Definition: ParseText.cpp:328
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
ChannelEditor(QObject *retobject, const char *name)
Definition: osd.cpp:36
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.
bool Create(void) override
void customEvent(QEvent *event) override
bool m_currentHideMode
Definition: channeleditor.h:48
bool Create(void) override
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
void DisplayState(const QString &state, const QString &name)
virtual void setValue(const QString &newValue)
void itemChanged(MythUIButtonListItem *item)
static bool IsV4L(const QString &rawtype)
Definition: cardutil.h:131
void channelIconImport(void)
void SetData(QVariant data)
MythUIButtonListItem * GetItemCurrent() const
static bool DeleteChannel(uint channel_id)