MythTV  master
channeleditor.cpp
Go to the documentation of this file.
1 // Qt
2 #include <QCoreApplication>
3 
4 // MythTV
5 #include "mythprogressdialog.h"
6 #include "mythuibuttonlist.h"
7 #include "channelsettings.h"
8 #include "transporteditor.h"
9 #include "mythuicheckbox.h"
10 #include "mythuitextedit.h"
11 #include "channeleditor.h"
12 #include "mythdialogbox.h"
13 #include "mythuibutton.h"
14 #include "channelutil.h"
15 #include "importicons.h"
16 #include "mythlogging.h"
17 #include "mythuiimage.h"
18 #include "mythuitext.h"
19 #include "scanwizard.h"
20 #include "sourceutil.h"
21 #include "cardutil.h"
22 #include "mythdirs.h"
23 #include "mythdb.h"
24 
25 ChannelWizard::ChannelWizard(int id, int default_sourceid)
26 {
27  setLabel(tr("Channel Options"));
28 
29  // Must be first.
30  addChild(m_cid = new ChannelID());
31  m_cid->setValue(id);
32 
33  QStringList cardtypes = ChannelUtil::GetInputTypes(m_cid->getValue().toUInt());
34 
35  // For a new channel the list will be empty so get it this way.
36  if (cardtypes.empty())
37  cardtypes = CardUtil::GetInputTypeNames(default_sourceid);
38 
39  bool all_v4l = !cardtypes.empty();
40  bool all_asi = !cardtypes.empty();
41  for (uint i = 0; i < (uint) cardtypes.size(); i++)
42  {
43  all_v4l &= CardUtil::IsV4L(cardtypes[i]);
44  all_asi &= cardtypes[i] == "ASI";
45  }
46 
48  new ChannelOptionsCommon(*m_cid, default_sourceid,!all_v4l);
50 
51  ChannelOptionsFilters *filters =
53  addChild(filters);
54 
55  if (all_v4l)
57  else if (all_asi)
59 }
60 
62 
64  : MythScreenType(parent, "channeleditor"),
65  m_currentSortMode(QCoreApplication::translate("(Common)", "Channel Name"))
66 {
67 }
68 
70 {
71  // Load the theme for this screen
72  bool foundtheme = LoadWindowFromXML("config-ui.xml", "channeloverview", this);
73  if (!foundtheme)
74  return false;
75 
76  MythUIButtonList *sortList = dynamic_cast<MythUIButtonList *>(GetChild("sorting"));
77  m_sourceList = dynamic_cast<MythUIButtonList *>(GetChild("source"));
78  m_channelList = dynamic_cast<MythUIButtonList *>(GetChild("channels"));
79  m_preview = dynamic_cast<MythUIImage *>(GetChild("preview"));
80  m_channame = dynamic_cast<MythUIText *>(GetChild("name"));
81  m_channum = dynamic_cast<MythUIText *>(GetChild("channum"));
82  m_callsign = dynamic_cast<MythUIText *>(GetChild("callsign"));
83  m_chanid = dynamic_cast<MythUIText *>(GetChild("chanid"));
84  m_sourcename = dynamic_cast<MythUIText *>(GetChild("sourcename"));
85  m_compoundname = dynamic_cast<MythUIText *>(GetChild("compoundname"));
86 
87  MythUIButton *deleteButton = dynamic_cast<MythUIButton *>(GetChild("delete"));
88  MythUIButton *scanButton = dynamic_cast<MythUIButton *>(GetChild("scan"));
89  MythUIButton *importIconButton = dynamic_cast<MythUIButton *>(GetChild("importicons"));
90  MythUIButton *transportEditorButton = dynamic_cast<MythUIButton *>(GetChild("edittransport"));
91 
92  MythUICheckBox *hideCheck = dynamic_cast<MythUICheckBox *>(GetChild("nochannum"));
93 
94  if (!sortList || !m_sourceList || !m_channelList || !deleteButton ||
95  !scanButton || !importIconButton || !transportEditorButton ||
96  !hideCheck)
97  {
98 
99  return false;
100  }
101 
102  // Delete button help text
103  deleteButton->SetHelpText(tr("Delete all channels on currently selected source(s)."));
104 
105  // Sort List
106  new MythUIButtonListItem(sortList, tr("Channel Name"));
107  new MythUIButtonListItem(sortList, tr("Channel Number"));
108  new MythUIButtonListItem(sortList, tr("Multiplex Frequency"));
109  connect(m_sourceList, SIGNAL(itemSelected(MythUIButtonListItem *)),
111  sortList->SetValue(m_currentSortMode);
112 
113 
114  // Source List
115  new MythUIButtonListItem(m_sourceList,tr("All"),
116  qVariantFromValue((int)FILTER_ALL));
117  MSqlQuery query(MSqlQuery::InitCon());
118  query.prepare("SELECT name, sourceid FROM videosource");
119  if (query.exec())
120  {
121  while(query.next())
122  {
123  new MythUIButtonListItem(m_sourceList, query.value(0).toString(),
124  query.value(1).toInt());
125  }
126  }
127  new MythUIButtonListItem(m_sourceList,tr("(Unassigned)"),
128  qVariantFromValue((int)FILTER_UNASSIGNED));
129  connect(sortList, SIGNAL(itemSelected(MythUIButtonListItem *)),
131 
132  // Hide/Show channels without channum checkbox
133  hideCheck->SetCheckState(m_currentHideMode);
134  connect(hideCheck, SIGNAL(toggled(bool)),
135  SLOT(setHideMode(bool)));
136 
137  // Scan Button
138  scanButton->SetHelpText(tr("Starts the channel scanner."));
140 
141  // Import Icons Button
142  importIconButton->SetHelpText(tr("Starts the icon downloader"));
143  importIconButton->SetEnabled(true);
144  connect(importIconButton, SIGNAL(Clicked()), SLOT(channelIconImport()));
145 
146  // Transport Editor Button
147  transportEditorButton->SetHelpText(
148  tr("Allows you to edit the transports directly. "
149  "This is rarely required unless you are using "
150  "a satellite dish and must enter an initial "
151  "frequency to for the channel scanner to try."));
152  connect(transportEditorButton, SIGNAL(Clicked()), SLOT(transportEditor()));
153 
154  // Other signals
155  connect(m_channelList, SIGNAL(itemClicked(MythUIButtonListItem *)),
156  SLOT(edit(MythUIButtonListItem *)));
157  connect(m_channelList, SIGNAL(itemSelected(MythUIButtonListItem *)),
159  connect(scanButton, SIGNAL(Clicked()), SLOT(scan()));
160  connect(deleteButton, SIGNAL(Clicked()), SLOT(deleteChannels()));
161 
162  fillList();
163 
164  BuildFocusList();
165 
166  return true;
167 }
168 
169 bool ChannelEditor::keyPressEvent(QKeyEvent *event)
170 {
171  if (GetFocusWidget()->keyPressEvent(event))
172  return true;
173 
174  QStringList actions;
175  bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
176 
177  for (int i = 0; i < actions.size() && !handled; i++)
178  {
179  QString action = actions[i];
180  handled = true;
181 
182  if (action == "MENU")
183  menu();
184  else if (action == "DELETE")
185  del();
186  else if (action == "EDIT")
187  edit();
188  else
189  handled = false;
190  }
191 
192  if (!handled && MythScreenType::keyPressEvent(event))
193  handled = true;
194 
195  return handled;
196 }
197 
199 {
200  if (!item)
201  return;
202 
203  if (m_preview)
204  {
205  m_preview->Reset();
206  QString iconpath = item->GetImageFilename();
207  if (!iconpath.isEmpty())
208  {
209  // mythtv-setup needs direct access to channel icon dir to import. We
210  // also can't rely on the backend to be running, so access the file directly
211  QString tmpIcon = GetConfDir() + "/channels/" + iconpath;
212  m_preview->SetFilename(tmpIcon);
213  m_preview->Load();
214  }
215  }
216 
217  if (m_channame)
218  m_channame->SetText(item->GetText("name"));
219 
220  if (m_channum)
221  m_channum->SetText(item->GetText("channum"));
222 
223  if (m_callsign)
224  m_callsign->SetText(item->GetText("callsign"));
225 
226  if (m_chanid)
227  m_chanid->SetText(item->GetText("chanid"));
228 
229  if (m_sourcename)
230  m_sourcename->SetText(item->GetText("sourcename"));
231 
232  if (m_compoundname)
233  m_compoundname->SetText(item->GetText("compoundname"));
234 }
235 
237 {
238  QString currentValue = m_channelList->GetValue();
239  uint currentIndex = qMax(m_channelList->GetCurrentPos(), 0);
240  m_channelList->Reset();
241  QString newchanlabel = tr("(Add New Channel)");
243  item->SetText(newchanlabel, "compoundname");
244  item->SetText(newchanlabel, "name");
245 
246  bool fAllSources = true;
247 
248  QString querystr = "SELECT channel.name,channum,chanid,callsign,icon,"
249  "channel.visible ,videosource.name, serviceid, "
250  "dtv_multiplex.frequency FROM channel "
251  "LEFT JOIN videosource ON "
252  "(channel.sourceid = videosource.sourceid) "
253  "LEFT JOIN dtv_multiplex ON "
254  "(channel.mplexid = dtv_multiplex.mplexid)";
255 
256  if (m_sourceFilter == FILTER_ALL)
257  {
258  fAllSources = true;
259  }
260  else
261  {
262  querystr += QString(" WHERE channel.sourceid='%1' ")
263  .arg(m_sourceFilter);
264  fAllSources = false;
265  }
266 
267  if (m_currentSortMode == tr("Channel Name"))
268  {
269  querystr += " ORDER BY channel.name";
270  }
271  else if (m_currentSortMode == tr("Channel Number"))
272  {
273  querystr += " ORDER BY channum + 0";
274  }
275  else if (m_currentSortMode == tr("Multiplex Frequency"))
276  {
277  querystr += " ORDER BY dtv_multiplex.frequency, serviceid";
278  }
279 
280  MSqlQuery query(MSqlQuery::InitCon());
281  query.prepare(querystr);
282 
283  uint selidx = 0, idx = 1;
284  if (query.exec() && query.size() > 0)
285  {
286  for (; query.next() ; idx++)
287  {
288  QString name = query.value(0).toString();
289  QString channum = query.value(1).toString();
290  QString chanid = query.value(2).toString();
291  QString callsign = query.value(3).toString();
292  QString icon = query.value(4).toString();
293  bool visible = query.value(5).toBool();
294  QString sourceid = "Unassigned";
295 
296  QString state = "normal";
297 
298  if (!visible)
299  state = "disabled";
300 
301  if (!query.value(6).toString().isEmpty())
302  {
303  sourceid = query.value(6).toString();
304  if (fAllSources && m_sourceFilter == FILTER_UNASSIGNED)
305  continue;
306  }
307  else
308  state = "warning";
309 
310  if (channum.isEmpty() && m_currentHideMode)
311  continue;
312 
313  if (name.isEmpty())
314  name = "(Unnamed : " + chanid + ")";
315 
316  QString compoundname = name;
317 
318  if (m_currentSortMode == tr("Channel Name"))
319  {
320  if (!channum.isEmpty())
321  compoundname += " (" + channum + ")";
322  }
323  else if (m_currentSortMode == tr("Channel Number"))
324  {
325  if (!channum.isEmpty())
326  compoundname = channum + ". " + compoundname;
327  else
328  compoundname = "???. " + compoundname;
329  }
330 
331  if (m_sourceFilter == FILTER_ALL)
332  compoundname += " (" + sourceid + ")";
333 
334  bool sel = (chanid == currentValue);
335  selidx = (sel) ? idx : selidx;
336  item = new MythUIButtonListItem(m_channelList, "",
337  qVariantFromValue(chanid));
338  item->SetText(compoundname, "compoundname");
339  item->SetText(name, "name");
340  item->SetText(channum, "channum");
341  item->SetText(chanid, "chanid");
342  item->SetText(callsign, "callsign");
343  item->SetText(sourceid, "sourcename");
344 
345  // mythtv-setup needs direct access to channel icon dir to import. We
346  // also can't rely on the backend to be running, so access the file directly
347  QString tmpIcon = GetConfDir() + "/channels/" + icon;
348  item->SetImage(tmpIcon);
349  item->SetImage(tmpIcon, "icon");
350 
351  item->DisplayState(state, "status");
352  }
353  }
354 
355  // Make sure we select the current item, or the following one after
356  // deletion, with wrap around to "(New Channel)" after deleting last item.
357  m_channelList->SetItemCurrent((!selidx && currentIndex < idx) ? currentIndex : selidx);
358 }
359 
361 {
362  if (!item)
363  return;
364 
365  QString sortName = item->GetText();
366 
367  if (m_currentSortMode != sortName)
368  {
369  m_currentSortMode = sortName;
370  fillList();
371  }
372 }
373 
375 {
376  if (!item)
377  return;
378 
379  QString sourceName = item->GetText();
380  int sourceID = item->GetData().toInt();
381 
382  if (m_sourceFilter != sourceID)
383  {
384  m_sourceFilterName = sourceName;
385  m_sourceFilter = sourceID;
386  fillList();
387  }
388 }
389 
391 {
392  if (m_currentHideMode != hide)
393  {
394  m_currentHideMode = hide;
395  fillList();
396  }
397 }
398 
400 {
402 
403  if (!item)
404  return;
405 
406  QString message = tr("Delete channel '%1'?").arg(item->GetText("name"));
407 
408  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
409  MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
410 
411  if (dialog->Create())
412  {
413  dialog->SetData(qVariantFromValue(item));
414  dialog->SetReturnEvent(this, "delsingle");
415  popupStack->AddScreen(dialog);
416  }
417  else
418  delete dialog;
419 
420 }
421 
423 {
424  const QString currentLabel = m_sourceList->GetValue();
425 
426  bool del_all = m_sourceFilter == FILTER_ALL;
427  bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
428 
429  QString message =
430  (del_all) ? tr("Delete ALL channels?") :
431  ((del_nul) ? tr("Delete all unassigned channels?") :
432  tr("Delete all channels on %1?").arg(currentLabel));
433 
434  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
435  MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
436 
437  if (dialog->Create())
438  {
439  dialog->SetReturnEvent(this, "delall");
440  popupStack->AddScreen(dialog);
441  }
442  else
443  delete dialog;
444 }
445 
447 {
448  if (!item)
449  item = m_channelList->GetItemCurrent();
450 
451  if (!item)
452  return;
453 
455 
456  int chanid = item->GetData().toInt();
457  ChannelWizard *cw = new ChannelWizard(chanid, m_sourceFilter);
458  StandardSettingDialog *ssd = new StandardSettingDialog(mainStack,
459  "channelwizard", cw);
460  if (ssd->Create())
461  {
462  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
463  mainStack->AddScreen(ssd);
464  }
465  else
466  delete ssd;
467 }
468 
470 {
472 
473  if (!item)
474  return;
475 
476  int chanid = item->GetData().toInt();
477  if (chanid == 0)
478  edit(item);
479  else
480  {
481  QString label = tr("Channel Options");
482 
483  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
484 
485  MythDialogBox *menu = new MythDialogBox(label, popupStack, "chanoptmenu");
486 
487  if (menu->Create())
488  {
489  menu->SetReturnEvent(this, "channelopts");
490 
491  menu->AddButton(tr("Edit"));
492 // if ()
493 // menu->AddButton(tr("Set Hidden"));
494 // else
495 // menu->AddButton(tr("Set Visible"));
496  menu->AddButton(tr("Delete"));
497 
498  popupStack->AddScreen(menu);
499  }
500  else
501  {
502  delete menu;
503  return;
504  }
505  }
506 }
507 
509 {
510 #ifdef USING_BACKEND
512  StandardSettingDialog *ssd =
513  new StandardSettingDialog(mainStack, "scanwizard",
515  if (ssd->Create())
516  {
517  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
518  mainStack->AddScreen(ssd);
519  }
520  else
521  delete ssd;
522 
523 #else
524  LOG(VB_GENERAL, LOG_ERR,
525  "You must compile the backend to be able to scan for channels");
526 #endif
527 }
528 
530 {
532  StandardSettingDialog *ssd =
533  new StandardSettingDialog(mainStack, "transporteditor",
535  if (ssd->Create())
536  {
537  connect(ssd, SIGNAL(Exiting()), SLOT(fillList()));
538  mainStack->AddScreen(ssd);
539  }
540  else
541  delete ssd;
542 }
543 
545 {
546  if (m_channelList->GetCount() == 0)
547  {
548  ShowOkPopup(tr("Add some channels first!"));
549  return;
550  }
551 
552  int channelID = 0;
554  if (item)
555  channelID = item->GetData().toInt();
556 
557  // Get selected channel name from database
558  QString querystr = QString("SELECT channel.name FROM channel "
559  "WHERE chanid='%1'").arg(channelID);
560  QString channelname;
561  MSqlQuery query(MSqlQuery::InitCon());
562  query.prepare(querystr);
563 
564  if (query.exec() && query.next())
565  {
566  channelname = query.value(0).toString();
567  }
568 
569  QString label = tr("Icon Import Options");
570 
571  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
572 
573  MythDialogBox *menu = new MythDialogBox(label, popupStack, "iconoptmenu");
574 
575  if (menu->Create())
576  {
577  menu->SetReturnEvent(this, "iconimportopt");
578 
579  menu->AddButton(tr("Download all icons..."));
580  menu->AddButton(tr("Rescan for missing icons..."));
581  if (!channelname.isEmpty())
582  menu->AddButton(tr("Download icon for %1").arg(channelname),
583  channelname);
584 
585  popupStack->AddScreen(menu);
586  }
587  else
588  {
589  delete menu;
590  return;
591  }
592 }
593 
594 void ChannelEditor::customEvent(QEvent *event)
595 {
596  if (event->type() == DialogCompletionEvent::kEventType)
597  {
599 
600  QString resultid= dce->GetId();
601  int buttonnum = dce->GetResult();
602 
603  if (resultid == "channelopts")
604  {
605  switch (buttonnum)
606  {
607  case 0 :
609  break;
610  case 1 :
611  del();
612  break;
613  }
614  }
615  else if (resultid == "delsingle" && buttonnum == 1)
616  {
617  MythUIButtonListItem *item =
618  dce->GetData().value<MythUIButtonListItem *>();
619  if (!item)
620  return;
621  uint chanid = item->GetData().toUInt();
622  if (chanid && ChannelUtil::DeleteChannel(chanid))
623  m_channelList->RemoveItem(item);
624  }
625  else if (resultid == "delall" && buttonnum == 1)
626  {
627  bool del_all = m_sourceFilter == FILTER_ALL;
628  bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
629 
630  MSqlQuery query(MSqlQuery::InitCon());
631  if (del_all)
632  {
633  query.prepare("TRUNCATE TABLE channel");
634  }
635  else if (del_nul)
636  {
637  query.prepare("SELECT sourceid "
638  "FROM videosource "
639  "GROUP BY sourceid");
640 
641  if (!query.exec() || !query.isActive())
642  {
643  MythDB::DBError("ChannelEditor Delete Channels", query);
644  return;
645  }
646 
647  QString tmp = "";
648  while (query.next())
649  tmp += "'" + query.value(0).toString() + "',";
650 
651  if (tmp.isEmpty())
652  {
653  query.prepare("TRUNCATE TABLE channel");
654  }
655  else
656  {
657  tmp = tmp.left(tmp.length() - 1);
658  query.prepare(QString("DELETE FROM channel "
659  "WHERE sourceid NOT IN (%1)").arg(tmp));
660  }
661  }
662  else
663  {
664  query.prepare("DELETE FROM channel "
665  "WHERE sourceid = :SOURCEID");
666  query.bindValue(":SOURCEID", m_sourceFilter);
667  }
668 
669  if (!query.exec())
670  MythDB::DBError("ChannelEditor Delete Channels", query);
671 
672  fillList();
673  }
674  else if (resultid == "iconimportopt")
675  {
677 
678  ImportIconsWizard *iconwizard;
679 
680  QString channelname = dce->GetData().toString();
681 
682  switch (buttonnum)
683  {
684  case 0 : // Import all icons
685  iconwizard = new ImportIconsWizard(mainStack, false);
686  break;
687  case 1 : // Rescan for missing
688  iconwizard = new ImportIconsWizard(mainStack, true);
689  break;
690  case 2 : // Import a single channel icon
691  iconwizard = new ImportIconsWizard(mainStack, true,
692  channelname);
693  break;
694  default:
695  return;
696  }
697 
698  if (iconwizard->Create())
699  {
700  connect(iconwizard, SIGNAL(Exiting()), SLOT(fillList()));
701  mainStack->AddScreen(iconwizard);
702  }
703  else
704  {
705  delete iconwizard;
706 
707  if (buttonnum == 2)
708  {
709  // Reload the list since ImportIconsWizard::Create() will return false
710  // if it automatically downloaded an icon for the selected channel
711  fillList();
712  }
713  }
714  }
715  }
716 }
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
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
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.
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
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 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
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)