MythTV  master
scheduleeditor.cpp
Go to the documentation of this file.
1 // C++
2 #include <utility>
3 
4 // Qt
5 #include <QCoreApplication>
6 #include <QHash>
7 #include <QString>
8 
9 // MythTV
10 #include "libmyth/programtypes.h"
11 #include "libmyth/recordingtypes.h"
13 #include "libmythbase/mythtypes.h"
18 #include "libmythtv/cardutil.h"
20 #include "libmythtv/playgroup.h"
22 #include "libmythtv/tv_play.h"
26 #include "libmythui/mythuibutton.h"
30 #include "libmythui/mythuihelper.h"
31 #include "libmythui/mythuiimage.h"
34 #include "libmythui/mythuitext.h"
35 #include "libmythui/mythuiutils.h"
36 
37 // MythFrontend
38 #include "proglist.h"
39 #include "scheduleeditor.h"
40 #include "viewschedulediff.h"
41 
42 #define ENUM_TO_QVARIANT(a) QVariant::fromValue(static_cast<int>(a))
43 
44 //static const QString _Location = QObject::tr("Schedule Editor");
45 
46 // Define the strings inserted into the recordfilter table in the
47 // database. This should make them available to the translators.
48 static QString fs0(QT_TRANSLATE_NOOP("SchedFilterEditor", "New episode"));
49 static QString fs1(QT_TRANSLATE_NOOP("SchedFilterEditor", "Identifiable episode"));
50 static QString fs2(QT_TRANSLATE_NOOP("SchedFilterEditor", "First showing"));
51 static QString fs3(QT_TRANSLATE_NOOP("SchedFilterEditor", "Prime time"));
52 static QString fs4(QT_TRANSLATE_NOOP("SchedFilterEditor", "Commercial free"));
53 static QString fs5(QT_TRANSLATE_NOOP("SchedFilterEditor", "High definition"));
54 static QString fs6(QT_TRANSLATE_NOOP("SchedFilterEditor", "This episode"));
55 static QString fs7(QT_TRANSLATE_NOOP("SchedFilterEditor", "This series"));
56 static QString fs8(QT_TRANSLATE_NOOP("SchedFilterEditor", "This time"));
57 static QString fs9(QT_TRANSLATE_NOOP("SchedFilterEditor", "This day and time"));
58 static QString fs10(QT_TRANSLATE_NOOP("SchedFilterEditor", "This channel"));
59 static QString fs11(QT_TRANSLATE_NOOP("SchedFilterEditor", "No episodes"));
60 
61 void *ScheduleEditor::RunScheduleEditor(ProgramInfo *proginfo, void *player)
62 {
63  auto *rule = new RecordingRule();
64  rule->LoadByProgram(proginfo);
65 
67  auto *se = new ScheduleEditor(mainStack, rule, static_cast<TV*>(player));
68 
69  if (se->Create())
70  mainStack->AddScreen(se, (player == nullptr));
71  else
72  delete se;
73 
74  return nullptr;
75 }
76 
83  RecordingInfo *recInfo, TV *player)
84  : ScheduleCommon(parent, "ScheduleEditor"),
85  SchedOptMixin(*this, nullptr), FilterOptMixin(*this, nullptr),
86  StoreOptMixin(*this, nullptr), PostProcMixin(*this, nullptr),
87  m_recInfo(new RecordingInfo(*recInfo)),
88  m_player(player)
89 {
96 
97  if (m_player)
98  m_player->IncrRef();
99 }
100 
102  RecordingRule *recRule, TV *player)
103  : ScheduleCommon(parent, "ScheduleEditor"),
104  SchedOptMixin(*this, recRule),
105  FilterOptMixin(*this, recRule),
106  StoreOptMixin(*this, recRule),
107  PostProcMixin(*this, recRule),
108  m_recordingRule(recRule),
109  m_player(player)
110 {
111  if (m_player)
112  m_player->IncrRef();
113 }
114 
116 {
117  delete m_recordingRule;
118 
119  // if we have a player, we need to tell we are done
120  if (m_player)
121  {
122  emit m_player->RequestEmbedding(false);
123  m_player->DecrRef();
124  }
125 }
126 
128 {
129  if (!LoadWindowFromXML("schedule-ui.xml", "scheduleeditor", this))
130  return false;
131 
132  bool err = false;
133 
134  UIUtilE::Assign(this, m_rulesList, "rules", &err);
135 
136  UIUtilW::Assign(this, m_schedOptButton, "schedoptions");
137  UIUtilW::Assign(this, m_storeOptButton, "storeoptions");
138  UIUtilW::Assign(this, m_postProcButton, "postprocessing");
139  UIUtilW::Assign(this, m_metadataButton, "metadata");
140  UIUtilW::Assign(this, m_schedInfoButton, "schedinfo");
141  UIUtilW::Assign(this, m_previewButton, "preview");
142  UIUtilW::Assign(this, m_filtersButton, "filters");
143 
144  SchedOptMixin::Create(&err);
146  StoreOptMixin::Create(&err);
147  PostProcMixin::Create(&err);
148 
149  UIUtilW::Assign(this, m_cancelButton, "cancel");
150  UIUtilE::Assign(this, m_saveButton, "save", &err);
151 
152  if (err)
153  {
154  LOG(VB_GENERAL, LOG_ERR, "ScheduleEditor, theme is missing "
155  "required elements");
156  return false;
157  }
158 
161 
162  if (m_schedOptButton)
164  if (m_filtersButton)
166  if (m_storeOptButton)
168  if (m_postProcButton)
170  if (m_schedInfoButton)
172  if (m_previewButton)
174  if (m_metadataButton)
176 
177  if (m_cancelButton)
180 
181  if (m_schedInfoButton)
183  if (m_previewButton)
185 
186  if (m_dupmethodList)
189  if (m_filtersList)
192  if (m_maxepSpin)
195  if (m_recgroupList)
198  if (m_transcodeCheck)
201 
202  BuildFocusList();
203 
204  if (!m_recordingRule->IsLoaded())
205  {
206  if (m_recInfo)
208  else if (m_recordingRule->m_recordID)
210 
211  if (!m_recordingRule->IsLoaded())
212  {
213  LOG(VB_GENERAL, LOG_ERR,
214  "ScheduleEditor::Create() - Failed to load recording rule");
215  return false;
216  }
217  }
218 
219  if (m_player)
220  emit m_player->RequestEmbedding(true);
221 
222  return true;
223 }
224 
226 {
227  if (m_child)
228  m_child->Close();
229 
230  // don't fade the screen if we are returning to the player
231  if (m_player)
232  GetScreenStack()->PopScreen(this, false);
233  else
234  GetScreenStack()->PopScreen(this, true);
235 }
236 
238 {
243 
244  if (!m_loaded)
245  {
246  // Copy this now, it will change briefly after the first item
247  // is inserted into the list by design of
248  // MythUIButtonList::itemSelected()
250 
251  // Rules List
253  {
255  .compare("Default", Qt::CaseInsensitive) != 0)
256  {
258  tr("Delete this recording rule template"),
260  }
264  }
265  else if (m_recordingRule->m_isOverride)
266  {
268  tr("Record this showing with normal options"),
276  }
277  else
278  {
279  bool hasChannel = !m_recordingRule->m_station.isEmpty();
280  bool isManual = (m_recordingRule->m_searchType == kManualSearch);
281 
285  if (hasChannel)
286  {
290  }
291  if (!isManual)
292  {
296  }
297  if (!hasChannel || isManual)
298  {
305  }
306  if (!isManual)
307  {
311  }
312  }
313 
315  }
317 
318  InfoMap progMap;
319 
320  m_recordingRule->ToMap(progMap);
321 
322  if (m_recInfo)
323  m_recInfo->ToMap(progMap);
324 
325  SetTextFromMap(progMap);
326 
327  m_loaded = true;
328 }
329 
330 void ScheduleEditor::LoadTemplate(const QString& name)
331 {
333  Load();
334  emit templateLoaded();
335 }
336 
338 {
339  if (!item)
340  return;
341 
342  m_recordingRule->m_type = static_cast<RecordingType>
343  (item->GetData().toInt());
344 
345  bool isScheduled = (m_recordingRule->m_type != kNotRecording &&
347 
348  if (m_schedOptButton)
349  m_schedOptButton->SetEnabled(isScheduled);
350  if (m_filtersButton)
351  m_filtersButton->SetEnabled(isScheduled);
352  if (m_storeOptButton)
353  m_storeOptButton->SetEnabled(isScheduled);
354  if (m_postProcButton)
355  m_postProcButton->SetEnabled(isScheduled);
356  if (m_metadataButton)
357  m_metadataButton->SetEnabled(isScheduled &&
359 
364 }
365 
367 {
369 }
370 
372 {
374 }
375 
377 {
379 }
380 
382 {
384 }
385 
387 {
389 }
390 
392 {
393  if (m_child)
394  m_child->Close();
395 
397  {
398  int recid = m_recordingRule->m_recordID;
399  DeleteRule();
400  if (recid)
401  emit ruleDeleted(recid);
402  Close();
403  return;
404  }
405 
410  m_recordingRule->Save(true);
412 
413  Close();
414 }
415 
417 {
419 }
420 
422 {
425  return;
426 
427  if (m_child)
428  m_child->Close();
429 
431 
433  auto *schedoptedit = new SchedOptEditor(mainStack, *this,
435  if (!schedoptedit->Create())
436  {
437  delete schedoptedit;
438  return;
439  }
440 
442  m_child = schedoptedit;
443  mainStack->AddScreen(schedoptedit);
444 }
445 
447 {
450  return;
451 
452  if (m_child)
453  m_child->Close();
454 
456 
458  auto *storeoptedit = new StoreOptEditor(mainStack, *this,
460  if (!storeoptedit->Create())
461  {
462  delete storeoptedit;
463  return;
464  }
465 
467  m_child = storeoptedit;
468  mainStack->AddScreen(storeoptedit);
469 }
470 
472 {
475  return;
476 
477  if (m_child)
478  m_child->Close();
479 
481 
483  auto *ppedit = new PostProcEditor(mainStack, *this,
485  if (!ppedit->Create())
486  {
487  delete ppedit;
488  return;
489  }
490 
492  m_child = ppedit;
493  mainStack->AddScreen(ppedit);
494 }
495 
497 {
499  return;
500 
501  QString label = tr("Schedule Information");
502 
503  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
504  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
505 
506  if (menuPopup->Create())
507  {
508  menuPopup->SetReturnEvent(this, "schedinfo");
509 
510  if (m_recInfo)
511  menuPopup->AddButton(tr("Program Details"));
512  menuPopup->AddButton(tr("Upcoming Episodes"));
513  menuPopup->AddButton(tr("Upcoming Recordings"));
515  menuPopup->AddButton(tr("Previously Recorded"));
516 
517  popupStack->AddScreen(menuPopup);
518  }
519  else
520  delete menuPopup;
521 }
522 
523 bool ScheduleEditor::keyPressEvent(QKeyEvent *event)
524 {
525  if (GetFocusWidget()->keyPressEvent(event))
526  return true;
527 
528  QStringList actions;
529  bool handled = GetMythMainWindow()->
530  TranslateKeyPress("TV Frontend", event, actions);
531 
532  for (int i = 0; i < actions.size() && !handled; i++)
533  {
534  QString action = actions[i];
535  handled = true;
536 
537  if (action == "MENU")
538  showMenu();
539  else if (action == "INFO")
540  ShowDetails();
541  else if (action == "GUIDE")
542  ShowGuide();
543  else if (action == "UPCOMING")
545  else if (action == "PREVVIEW")
547  else if (action == "NEXTVIEW")
548  ShowNextView();
549  else
550  handled = false;
551  }
552 
553  if (!handled && MythScreenType::keyPressEvent(event))
554  handled = true;
555 
556  return handled;
557 }
558 
559 void ScheduleEditor::customEvent(QEvent *event)
560 {
561  if (event->type() == DialogCompletionEvent::kEventType)
562  {
563  auto *dce = (DialogCompletionEvent*)(event);
564 
565  QString resultid = dce->GetId();
566  QString resulttext = dce->GetResultText();
567 
568  if (resultid == "menu")
569  {
570  if (resulttext == tr("Main Options"))
571  m_child->Close();
572  if (resulttext == tr("Schedule Options"))
573  ShowSchedOpt();
574  else if (resulttext == tr("Filter Options"))
575  ShowFilters();
576  else if (resulttext == tr("Storage Options"))
577  ShowStoreOpt();
578  else if (resulttext == tr("Post Processing"))
579  ShowPostProc();
580  else if (resulttext == tr("Metadata Options"))
582  else if (resulttext == tr("Use Template"))
584  else if (resulttext == tr("Schedule Info"))
585  ShowSchedInfo();
586  else if (resulttext == tr("Preview Changes"))
587  ShowPreview();
588  }
589  else if (resultid == "templatemenu")
590  {
591  LoadTemplate(resulttext);
592  }
593  else if (resultid == "schedinfo")
594  {
595  if (resulttext == tr("Program Details"))
596  ShowDetails();
597  else if (resulttext == tr("Upcoming Episodes"))
599  else if (resulttext == tr("Upcoming Recordings"))
601  else if (resulttext == tr("Previously Recorded"))
604  }
605  else if (resultid == "newrecgroup")
606  {
607  int groupID = CreateRecordingGroup(resulttext);
608  StoreOptMixin::SetRecGroup(groupID, resulttext);
609  }
610  }
611 }
612 
614 {
616  return;
617 
618  // No rule? Search by title
619  if (m_recordingRule->m_recordID <= 0)
620  {
622  return;
623  }
624 
626  auto *pl = new ProgLister(mainStack, plRecordid,
627  QString::number(m_recordingRule->m_recordID), "");
628 
629  if (pl->Create())
630  mainStack->AddScreen(pl);
631  else
632  delete pl;
633 }
634 
636 {
638  return;
639 
640  // Existing rule and search? Search by rule
641  if (m_recordingRule->m_recordID > 0 &&
644 
645  QString title = m_recordingRule->m_title;
646 
648  title.remove(RecordingInfo::kReSearchTypeName);
649 
651 }
652 
654 {
656  return;
657 
658  if (m_child)
659  {
660  m_child->Save();
661  if (m_view == kSchedOptView)
663  else if (m_view == kStoreOptView)
665  else if (m_view == kPostProcView)
667  }
668 
673 
674  QString ttable = "record_tmp";
675  m_recordingRule->UseTempTable(true, ttable);
676 
678  auto *vsd = new ViewScheduleDiff(mainStack, ttable,
681  if (vsd->Create())
682  mainStack->AddScreen(vsd);
683  else
684  delete vsd;
685 
687 }
688 
690 {
694  return;
695 
696  if (m_child)
697  m_child->Close();
698 
700  auto *rad = new MetadataOptions(mainStack, *this,
702  if (!rad->Create())
703  {
704  delete rad;
705  return;
706  }
707 
709  m_child = rad;
710  mainStack->AddScreen(rad);
711 }
712 
714 {
717  return;
718 
719  if (m_child)
720  m_child->Close();
721 
723 
725  auto *schedfilteredit = new SchedFilterEditor(mainStack, *this,
727  if (!schedfilteredit->Create())
728  {
729  delete schedfilteredit;
730  return;
731  }
732 
734  m_child = schedfilteredit;
735  mainStack->AddScreen(schedfilteredit);
736 }
737 
739 {
742  return;
743 
746  else if ((m_view == kMainView) || (m_view == kMetadataView))
747  ShowPostProc();
748  else if (m_view == kSchedOptView)
749  m_child->Close();
750  else if (m_view == kFilterView)
751  ShowSchedOpt();
752  else if (m_view == kStoreOptView)
753  ShowFilters();
754  else if (m_view == kPostProcView)
755  ShowStoreOpt();
756 }
757 
759 {
762  return;
763 
764  if (m_view == kMainView)
765  ShowSchedOpt();
766  else if (m_view == kSchedOptView)
767  ShowFilters();
768  else if (m_view == kFilterView)
769  ShowStoreOpt();
770  else if (m_view == kStoreOptView)
771  ShowPostProc();
774  else if ((m_view == kPostProcView) || (m_view == kMetadataView))
775  m_child->Close();
776 }
777 
779 {
780  if (m_view == kSchedOptView)
782  else if (m_view == kFilterView)
784  else if (m_view == kStoreOptView)
786  else if (m_view == kPostProcView)
788 
789  m_child = nullptr;
790  m_view = kMainView;
791 }
792 
794 {
795  QString label = tr("Options");
796  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
797  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
798 
800  RecordingType type = static_cast<RecordingType>(item->GetData().toInt());
801  bool isScheduled = (type != kNotRecording && type != kDontRecord);
802 
803  if (menuPopup->Create())
804  {
805  menuPopup->SetReturnEvent(this, "menu");
806  if (m_view != kMainView)
807  menuPopup->AddButton(tr("Main Options"));
808  if (isScheduled && m_view != kSchedOptView)
809  menuPopup->AddButton(tr("Schedule Options"));
810  if (isScheduled && m_view != kFilterView)
811  menuPopup->AddButton(tr("Filter Options"));
812  if (isScheduled && m_view != kStoreOptView)
813  menuPopup->AddButton(tr("Storage Options"));
814  if (isScheduled && m_view != kPostProcView)
815  menuPopup->AddButton(tr("Post Processing"));
816  if (isScheduled && !m_recordingRule->m_isTemplate &&
818  menuPopup->AddButton(tr("Metadata Options"));
820  {
821  menuPopup->AddButton(tr("Schedule Info"));
822  menuPopup->AddButton(tr("Preview Changes"));
823  }
824  menuPopup->AddButton(tr("Use Template"));
825  popupStack->AddScreen(menuPopup);
826  }
827  else
828  {
829  delete menuPopup;
830  }
831 }
832 
834 {
835  QStringList templates = RecordingRule::GetTemplateNames();
836  if (templates.empty())
837  {
838  ShowOkPopup(tr("No templates available"));
839  return;
840  }
841 
842  QString label = tr("Template Options");
843  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
844  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
845 
846  if (menuPopup->Create())
847  {
848  menuPopup->SetReturnEvent(this, "templatemenu");
849  while (!templates.empty())
850  {
851  QString name = templates.front();
852  if (name == "Default")
853  menuPopup->AddButton(tr("Default"));
854  else
855  menuPopup->AddButton(name);
856  templates.pop_front();
857  }
858  popupStack->AddScreen(menuPopup);
859  }
860  else
861  {
862  delete menuPopup;
863  }
864 }
865 
867 
872 SchedEditChild::SchedEditChild(MythScreenStack *parent, const QString &name,
873  ScheduleEditor &editor, RecordingRule &rule,
874  RecordingInfo *recInfo)
875  : MythScreenType(parent, name),
876  m_editor(&editor), m_recordingRule(&rule), m_recInfo(recInfo)
877 {
878 }
879 
880 bool SchedEditChild::keyPressEvent(QKeyEvent *event)
881 {
882  if (GetFocusWidget()->keyPressEvent(event))
883  return true;
884 
885  QStringList actions;
886  bool handled = GetMythMainWindow()->
887  TranslateKeyPress("TV Frontend", event, actions);
888 
889  for (int i = 0; i < actions.size() && !handled; i++)
890  {
891  QString action = actions[i];
892  handled = true;
893 
894  if (action == "MENU")
895  m_editor->showMenu();
896  else if (action == "INFO")
898  else if (action == "UPCOMING")
900  if (action == "ESCAPE")
901  Close();
902  else if (action == "PREVVIEW")
904  else if (action == "NEXTVIEW")
906  else
907  handled = false;
908  }
909 
910  if (!handled && MythScreenType::keyPressEvent(event))
911  handled = true;
912 
913  return handled;
914 }
915 
917  const QString &xmlfile, const QString &winname, bool isTemplate)
918 {
919  if (!LoadWindowFromXML(xmlfile, winname, this))
920  return false;
921 
922  UIUtilW::Assign(this, m_backButton, "back");
923  UIUtilW::Assign(this, m_saveButton, "save");
924  UIUtilW::Assign(this, m_previewButton, "preview");
925 
928 
929  if (m_backButton)
931  if (m_saveButton)
933  if (m_previewButton)
934  {
937  m_previewButton->SetEnabled(!isTemplate);
938  }
939 
940  return true;
941 }
942 
944 {
945  InfoMap progMap;
946 
947  m_recordingRule->ToMap(progMap);
948 
949  if (m_recInfo)
950  m_recInfo->ToMap(progMap);
951 
952  SetTextFromMap(progMap);
953 }
954 
956 {
957  Save();
958  emit Closing();
960 }
961 
963 
970  ScheduleEditor &editor,
971  RecordingRule &rule,
972  RecordingInfo *recInfo)
973  : SchedEditChild(parent, "ScheduleOptionsEditor", editor, rule, recInfo),
974  SchedOptMixin(*this, &rule, &editor)
975 {
976 }
977 
979 {
981  "schedule-ui.xml", "scheduleoptionseditor",
983  {
984  return false;
985  }
986 
987  bool err = false;
988 
989  SchedOptMixin::Create(&err);
990 
991  UIUtilW::Assign(this, m_filtersButton, "filters");
992 
993  if (err)
994  {
995  LOG(VB_GENERAL, LOG_ERR, "SchedOptEditor, theme is missing "
996  "required elements");
997  return false;
998  }
999 
1000  if (m_dupmethodList)
1003 
1004  if (m_filtersButton)
1007 
1008  BuildFocusList();
1009 
1010  return true;
1011 }
1012 
1014 {
1016  SetTextFromMaps();
1017 }
1018 
1020 {
1022 }
1023 
1025 {
1027 }
1028 
1030 
1037  ScheduleEditor &editor,
1038  RecordingRule &rule,
1039  RecordingInfo *recInfo)
1040  : SchedEditChild(parent, "ScheduleFilterEditor", editor, rule, recInfo),
1041  FilterOptMixin(*this, &rule, &editor)
1042 {
1043 }
1044 
1046 {
1048  "schedule-ui.xml", "schedulefiltereditor",
1050  {
1051  return false;
1052  }
1053 
1054  bool err = false;
1055 
1056  FilterOptMixin::Create(&err);
1057 
1058  if (err)
1059  {
1060  LOG(VB_GENERAL, LOG_ERR, "SchedFilterEditor, theme is missing "
1061  "required elements");
1062  return false;
1063  }
1064 
1067 
1068  BuildFocusList();
1069 
1070  return true;
1071 }
1072 
1074 {
1076  SetTextFromMaps();
1077 }
1078 
1080 {
1082 }
1083 
1085 {
1087 }
1088 
1090 
1097  ScheduleEditor &editor,
1098  RecordingRule &rule,
1099  RecordingInfo *recInfo)
1100  : SchedEditChild(parent, "StorageOptionsEditor", editor, rule, recInfo),
1101  StoreOptMixin(*this, &rule, &editor)
1102 {
1103 }
1104 
1106 {
1108  "schedule-ui.xml", "storageoptionseditor",
1110  {
1111  return false;
1112  }
1113 
1114  bool err = false;
1115 
1116  StoreOptMixin::Create(&err);
1117 
1118  if (err)
1119  {
1120  LOG(VB_GENERAL, LOG_ERR, "StoreOptEditor, theme is missing "
1121  "required elements");
1122  return false;
1123  }
1124 
1125  if (m_maxepSpin)
1128  if (m_recgroupList)
1131 
1132  BuildFocusList();
1133 
1134  return true;
1135 }
1136 
1138 {
1140  SetTextFromMaps();
1141 }
1142 
1144 {
1146 }
1147 
1149 {
1151 }
1152 
1153 void StoreOptEditor::customEvent(QEvent *event)
1154 {
1155  if (event->type() == DialogCompletionEvent::kEventType)
1156  {
1157  auto *dce = (DialogCompletionEvent*)(event);
1158 
1159  QString resultid = dce->GetId();
1160  QString resulttext = dce->GetResultText();
1161 
1162  if (resultid == "newrecgroup")
1163  {
1164  int groupID = CreateRecordingGroup(resulttext);
1165  StoreOptMixin::SetRecGroup(groupID, resulttext);
1166  }
1167  }
1168 }
1169 
1171 {
1173 }
1174 
1176 
1183  ScheduleEditor &editor,
1184  RecordingRule &rule,
1185  RecordingInfo *recInfo)
1186  : SchedEditChild(parent, "PostProcOptionsEditor", editor, rule, recInfo),
1187  PostProcMixin(*this, &rule, &editor)
1188 {
1189 }
1190 
1192 {
1194  "schedule-ui.xml", "postproceditor",
1196  {
1197  return false;
1198  }
1199 
1200  bool err = false;
1201 
1202  PostProcMixin::Create(&err);
1203 
1204  if (err)
1205  {
1206  LOG(VB_GENERAL, LOG_ERR, "PostProcEditor, theme is missing "
1207  "required elements");
1208  return false;
1209  }
1210 
1211  if (m_transcodeCheck)
1214 
1215  BuildFocusList();
1216 
1217  return true;
1218 }
1219 
1221 {
1223  SetTextFromMaps();
1224 }
1225 
1227 {
1229 }
1230 
1232 {
1234 }
1235 
1237 
1244  ScheduleEditor &editor,
1245  RecordingRule &rule,
1246  RecordingInfo *recInfo)
1247  : SchedEditChild(parent, "MetadataOptions", editor, rule, recInfo)
1248 {
1249  m_popupStack = GetMythMainWindow()->GetStack("popup stack");
1250 
1251  m_metadataFactory = new MetadataFactory(this);
1252  m_imageLookup = new MetadataDownload(this);
1254 
1257 }
1258 
1260 {
1261  if (m_imageLookup)
1262  {
1263  m_imageLookup->cancel();
1264  delete m_imageLookup;
1265  m_imageLookup = nullptr;
1266  }
1267 
1268  if (m_imageDownload)
1269  {
1271  delete m_imageDownload;
1272  m_imageDownload = nullptr;
1273  }
1274 }
1275 
1277 {
1279  "schedule-ui.xml", "metadataoptions",
1281  {
1282  return false;
1283  }
1284 
1285  bool err = false;
1286 
1287  UIUtilE::Assign(this, m_inetrefEdit, "inetref_edit", &err);
1288  UIUtilW::Assign(this, m_inetrefClear, "inetref_clear", &err);
1289  UIUtilE::Assign(this, m_seasonSpin, "season_spinbox", &err);
1290  UIUtilE::Assign(this, m_episodeSpin, "episode_spinbox", &err);
1291  UIUtilE::Assign(this, m_queryButton, "query_button", &err);
1292  UIUtilE::Assign(this, m_localFanartButton, "local_fanart_button", &err);
1293  UIUtilE::Assign(this, m_localCoverartButton, "local_coverart_button", &err);
1294  UIUtilE::Assign(this, m_localBannerButton, "local_banner_button", &err);
1295  UIUtilE::Assign(this, m_onlineFanartButton, "online_fanart_button", &err);
1296  UIUtilE::Assign(this, m_onlineCoverartButton, "online_coverart_button", &err);
1297  UIUtilE::Assign(this, m_onlineBannerButton, "online_banner_button", &err);
1298  UIUtilW::Assign(this, m_fanart, "fanart");
1299  UIUtilW::Assign(this, m_coverart, "coverart");
1300  UIUtilW::Assign(this, m_banner, "banner");
1301 
1302  if (err)
1303  {
1304  LOG(VB_GENERAL, LOG_ERR, "MetadataOptions, theme is missing "
1305  "required elements");
1306  return false;
1307  }
1308 
1325 
1328 
1329  // InetRef
1331 
1332  // Season
1333  m_seasonSpin->SetRange(0,9999,1,5);
1335 
1336  // Episode
1337  m_episodeSpin->SetRange(0,9999,1,10);
1339 
1340  if (m_coverart)
1341  {
1343  m_coverart->Load();
1344  }
1345 
1346  if (m_fanart)
1347  {
1349  m_fanart->Load();
1350  }
1351 
1352  if (m_banner)
1353  {
1355  m_banner->Load();
1356  }
1357 
1358  BuildFocusList();
1359 
1360  return true;
1361 }
1362 
1364 {
1365  SetTextFromMaps();
1366 }
1367 
1368 void MetadataOptions::CreateBusyDialog(const QString& title)
1369 {
1370  if (m_busyPopup)
1371  return;
1372 
1373  const QString& message = title;
1374 
1375  m_busyPopup = new MythUIBusyDialog(message, m_popupStack,
1376  "metaoptsdialog");
1377 
1378  if (m_busyPopup->Create())
1380 }
1381 
1383 {
1384  m_recordingRule->m_inetref.clear();
1386 }
1387 
1389 {
1390  CreateBusyDialog(tr("Trying to manually find this "
1391  "recording online..."));
1392 
1394 
1395  lookup->SetAutomatic(false);
1396  m_metadataFactory->Lookup(lookup);
1397 }
1398 
1400 {
1401  QueryComplete(lookup);
1402 }
1403 
1406 {
1407  QString msg = tr("Downloading selected artwork...");
1408  CreateBusyDialog(msg);
1409 
1410  auto *lookup = new MetadataLookup();
1411 
1412  lookup->SetType(kMetadataVideo);
1413  lookup->SetHost(gCoreContext->GetMasterHostName());
1414  lookup->SetAutomatic(true);
1415  lookup->SetData(QVariant::fromValue<VideoArtworkType>(type));
1416 
1417  DownloadMap downloads;
1418  downloads.insert(type, info);
1419  lookup->SetDownloads(downloads);
1420  lookup->SetAllowOverwrites(true);
1421  lookup->SetTitle(m_recordingRule->m_title);
1422  lookup->SetSubtitle(m_recordingRule->m_subtitle);
1423  lookup->SetInetref(m_inetrefEdit->GetText());
1424  lookup->SetSeason(m_seasonSpin->GetIntValue());
1425  lookup->SetEpisode(m_episodeSpin->GetIntValue());
1426 
1427  m_imageDownload->addDownloads(lookup);
1428 }
1429 
1431 {
1432  if (!CanSetArtwork())
1433  return;
1434 
1435  QString url = generate_file_url("Fanart",
1437  "");
1438  FindImagePopup(url,"",*this, "fanart");
1439 }
1440 
1442 {
1443  if (!CanSetArtwork())
1444  return;
1445 
1446  QString url = generate_file_url("Coverart",
1448  "");
1449  FindImagePopup(url,"",*this, "coverart");
1450 }
1451 
1453 {
1454  if (!CanSetArtwork())
1455  return;
1456 
1457  QString url = generate_file_url("Banners",
1459  "");
1460  FindImagePopup(url,"",*this, "banner");
1461 }
1462 
1464 {
1466 }
1467 
1469 {
1471 }
1472 
1474 {
1476 }
1477 
1479 {
1480  // Season
1481  if (m_seasonSpin)
1483 
1484  // Episode
1485  if (m_episodeSpin)
1487 
1488  // InetRef
1489  if (m_inetrefEdit)
1491 }
1492 
1494 {
1495  if (!lookup)
1496  return;
1497 
1498  // InetRef
1499  m_inetrefEdit->SetText(lookup->GetInetref());
1500 
1501  // Season
1502  m_seasonSpin->SetValue(lookup->GetSeason());
1503 
1504  // Episode
1505  m_episodeSpin->SetValue(lookup->GetEpisode());
1506 
1507  InfoMap metadataMap;
1508  lookup->toMap(metadataMap);
1509  SetTextFromMap(metadataMap);
1510 }
1511 
1513  const QString &prefixAlt,
1514  QObject &inst,
1515  const QString &returnEvent)
1516 {
1517  QString fp;
1518 
1519  if (prefix.startsWith("myth://"))
1520  fp = prefix;
1521  else
1522  fp = prefix.isEmpty() ? prefixAlt : prefix;
1523 
1524  MythScreenStack *popupStack =
1525  GetMythMainWindow()->GetStack("popup stack");
1526 
1527  auto *fb = new MythUIFileBrowser(popupStack, fp);
1528  fb->SetNameFilter(GetSupportedImageExtensionFilter());
1529  if (fb->Create())
1530  {
1531  fb->SetReturnEvent(&inst, returnEvent);
1532  popupStack->AddScreen(fb);
1533  }
1534  else
1535  delete fb;
1536 }
1537 
1539 {
1540  QStringList ret;
1541 
1542  QList<QByteArray> exts = QImageReader::supportedImageFormats();
1543  for (const auto & ext : qAsConst(exts))
1544  {
1545  ret.append(QString("*.").append(ext));
1546  }
1547 
1548  return ret;
1549 }
1550 
1552 {
1553  if (m_inetrefEdit->GetText().isEmpty())
1554  {
1555  ShowOkPopup(tr("You must set a reference number "
1556  "on this rule to set artwork. For items "
1557  "without a metadata source, you can set "
1558  "any unique value."));
1559  return false;
1560  }
1561 
1562  return true;
1563 }
1564 
1566 {
1567  auto *lookup = new MetadataLookup();
1568  lookup->SetStep(kLookupSearch);
1569  lookup->SetType(mtype);
1571 
1572  if (type == kUnknownVideo)
1573  {
1575  (m_seasonSpin->GetIntValue() == 0 &&
1576  m_episodeSpin->GetIntValue() == 0))
1577  {
1578  lookup->SetSubtype(kProbableMovie);
1579  }
1580  else
1581  {
1582  lookup->SetSubtype(kProbableTelevision);
1583  }
1584  }
1585  else
1586  {
1587  // we could determine the type from the inetref
1588  lookup->SetSubtype(type);
1589  }
1590  lookup->SetAllowGeneric(true);
1591  lookup->SetHandleImages(false);
1592  lookup->SetHost(gCoreContext->GetMasterHostName());
1593  lookup->SetTitle(m_recordingRule->m_title);
1594  lookup->SetSubtitle(m_recordingRule->m_subtitle);
1595  lookup->SetInetref(m_inetrefEdit->GetText());
1596  lookup->SetCollectionref(m_inetrefEdit->GetText());
1597  lookup->SetSeason(m_seasonSpin->GetIntValue());
1598  lookup->SetEpisode(m_episodeSpin->GetIntValue());
1599 
1600  return lookup;
1601 }
1602 
1604 {
1605  if (!CanSetArtwork())
1606  return;
1607 
1608  QString msg = tr("Searching for available artwork...");
1609  CreateBusyDialog(msg);
1610 
1612 
1613  lookup->SetAutomatic(true);
1614  lookup->SetData(QVariant::fromValue<VideoArtworkType>(type));
1615  m_imageLookup->addLookup(lookup);
1616 }
1617 
1619 {
1620  if (!lookup)
1621  return;
1622 
1623  if (m_busyPopup)
1624  {
1625  m_busyPopup->Close();
1626  m_busyPopup = nullptr;
1627  }
1628 
1629  auto type = lookup->GetData().value<VideoArtworkType>();
1630  ArtworkList list = lookup->GetArtwork(type);
1631 
1632  if (list.isEmpty())
1633  {
1634  MythWarningNotification n(tr("No image found"), tr("Schedule Editor"));
1636  return;
1637  }
1638 
1639  auto *resultsdialog = new ImageSearchResultsDialog(m_popupStack, list, type);
1640 
1641  connect(resultsdialog, &ImageSearchResultsDialog::haveResult,
1643 
1644  if (resultsdialog->Create())
1645  m_popupStack->AddScreen(resultsdialog);
1646 }
1647 
1649 {
1650  if (!lookup)
1651  return;
1652 
1653  DownloadMap map = lookup->GetDownloads();
1654 
1655  if (map.isEmpty())
1656  return;
1657 
1658  for (DownloadMap::const_iterator i = map.cbegin(); i != map.cend(); ++i)
1659  {
1660  VideoArtworkType type = i.key();
1661  const ArtworkInfo& info = i.value();
1662 
1663  if (type == kArtworkCoverart)
1664  m_artworkMap.replace(kArtworkCoverart, info);
1665  else if (type == kArtworkFanart)
1666  m_artworkMap.replace(kArtworkFanart, info);
1667  else if (type == kArtworkBanner)
1668  m_artworkMap.replace(kArtworkBanner, info);
1669  }
1670 
1673 
1674  ValuesChanged();
1675 }
1676 
1678 {
1681 
1682  if (m_coverart)
1683  {
1685  m_coverart->Load();
1686  }
1687 
1688  if (m_fanart)
1689  {
1691  m_fanart->Load();
1692  }
1693 
1694  if (m_banner)
1695  {
1697  m_banner->Load();
1698  }
1699 }
1700 
1701 void MetadataOptions::customEvent(QEvent *levent)
1702 {
1703  if (levent->type() == MetadataFactoryMultiResult::kEventType)
1704  {
1705  if (m_busyPopup)
1706  {
1707  m_busyPopup->Close();
1708  m_busyPopup = nullptr;
1709  }
1710 
1711  auto *mfmr = dynamic_cast<MetadataFactoryMultiResult*>(levent);
1712  if (!mfmr)
1713  return;
1714 
1715  MetadataLookupList list = mfmr->m_results;
1716 
1717  if (list.count() > 1)
1718  {
1719  int yearindex = -1;
1720 
1721  for (int p = 0; p != list.size(); ++p)
1722  {
1723  if (!m_recordingRule->m_seriesid.isEmpty() &&
1724  m_recordingRule->m_seriesid == (list[p])->GetTMSref())
1725  {
1726  MetadataLookup *lookup = list[p];
1727  QueryComplete(lookup);
1728  return;
1729  }
1730  if (m_recInfo &&
1732  (list[p])->GetYear() != 0 &&
1733  m_recInfo->GetYearOfInitialRelease() == (list[p])->GetYear())
1734  {
1735  if (yearindex > -1)
1736  {
1737  LOG(VB_GENERAL, LOG_INFO, "Multiple results matched on year. No definite "
1738  "match could be found based on year alone.");
1739  yearindex = -2;
1740  }
1741  else if (yearindex == -1)
1742  {
1743  LOG(VB_GENERAL, LOG_INFO, "Matched based on year. ");
1744  yearindex = p;
1745  }
1746  }
1747  }
1748 
1749  if (yearindex > -1)
1750  {
1751  MetadataLookup *lookup = list[yearindex];
1752  QueryComplete(lookup);
1753  return;
1754  }
1755 
1756  LOG(VB_GENERAL, LOG_INFO, "Falling through to selection dialog.");
1757  auto *resultsdialog = new MetadataResultsDialog(m_popupStack, list);
1758 
1759  connect(resultsdialog, &MetadataResultsDialog::haveResult,
1761  Qt::QueuedConnection);
1762 
1763  if (resultsdialog->Create())
1764  m_popupStack->AddScreen(resultsdialog);
1765  }
1766  }
1767  else if (levent->type() == MetadataFactorySingleResult::kEventType)
1768  {
1769  if (m_busyPopup)
1770  {
1771  m_busyPopup->Close();
1772  m_busyPopup = nullptr;
1773  }
1774 
1775  auto *mfsr = dynamic_cast<MetadataFactorySingleResult*>(levent);
1776  if (!mfsr)
1777  return;
1778 
1779  MetadataLookup *lookup = mfsr->m_result;
1780 
1781  if (!lookup)
1782  return;
1783 
1784  QueryComplete(lookup);
1785  }
1786  else if (levent->type() == MetadataFactoryNoResult::kEventType)
1787  {
1788  if (m_busyPopup)
1789  {
1790  m_busyPopup->Close();
1791  m_busyPopup = nullptr;
1792  }
1793 
1794  auto *mfnr = dynamic_cast<MetadataFactoryNoResult*>(levent);
1795  if (!mfnr)
1796  return;
1797 
1798  QString title = tr("No match found for this recording. You can "
1799  "try entering a TVDB/TMDB number, season, and "
1800  "episode manually.");
1801 
1802  auto *okPopup = new MythConfirmationDialog(m_popupStack, title, false);
1803 
1804  if (okPopup->Create())
1805  m_popupStack->AddScreen(okPopup);
1806  }
1807  else if (levent->type() == MetadataLookupEvent::kEventType)
1808  {
1809  if (m_busyPopup)
1810  {
1811  m_busyPopup->Close();
1812  m_busyPopup = nullptr;
1813  }
1814 
1815  auto *lue = (MetadataLookupEvent *)levent;
1816 
1817  MetadataLookupList lul = lue->m_lookupList;
1818 
1819  if (lul.isEmpty())
1820  return;
1821 
1822  if (lul.count() >= 1)
1823  {
1824  OnArtworkSearchDone(lul[0]);
1825  }
1826  }
1827  else if (levent->type() == MetadataLookupFailure::kEventType)
1828  {
1829  if (m_busyPopup)
1830  {
1831  m_busyPopup->Close();
1832  m_busyPopup = nullptr;
1833  }
1834 
1835  auto *luf = (MetadataLookupFailure *)levent;
1836 
1837  MetadataLookupList lul = luf->m_lookupList;
1838 
1839  if (!lul.empty())
1840  {
1841  QString title = tr("This number, season, and episode combination "
1842  "does not appear to be valid (or the site may "
1843  "be down). Check your information and try "
1844  "again.");
1845 
1846  auto *okPopup = new MythConfirmationDialog(m_popupStack, title, false);
1847 
1848  if (okPopup->Create())
1849  m_popupStack->AddScreen(okPopup);
1850  }
1851  }
1852  else if (levent->type() == ImageDLEvent::kEventType)
1853  {
1854  if (m_busyPopup)
1855  {
1856  m_busyPopup->Close();
1857  m_busyPopup = nullptr;
1858  }
1859 
1860  auto *ide = (ImageDLEvent *)levent;
1861 
1862  MetadataLookup *lookup = ide->m_item;
1863 
1864  if (!lookup)
1865  return;
1866 
1867  HandleDownloadedImages(lookup);
1868  }
1869  else if (levent->type() == ImageDLFailureEvent::kEventType)
1870  {
1871  if (m_busyPopup)
1872  {
1873  m_busyPopup->Close();
1874  m_busyPopup = nullptr;
1875  }
1876  MythErrorNotification n(tr("Failed to retrieve image(s)"),
1877  tr("Schedule Editor"),
1878  tr("Check logs"));
1880  }
1881  else if (levent->type() == DialogCompletionEvent::kEventType)
1882  {
1883  auto *dce = (DialogCompletionEvent*)(levent);
1884 
1885  const QString resultid = dce->GetId();
1886  ArtworkInfo info;
1887  info.url = dce->GetResultText();
1888 
1889  if (resultid == "coverart")
1890  {
1891  m_artworkMap.replace(kArtworkCoverart, info);
1892  }
1893  else if (resultid == "fanart")
1894  {
1895  m_artworkMap.replace(kArtworkFanart, info);
1896  }
1897  else if (resultid == "banner")
1898  {
1899  m_artworkMap.replace(kArtworkBanner, info);
1900  }
1901 
1904 
1905  ValuesChanged();
1906  }
1907 
1908 }
1909 
1911 
1918  SchedOptMixin *other)
1919  : m_screen(&screen), m_rule(rule), m_other(other),
1920  m_haveRepeats(gCoreContext->GetBoolSetting("HaveRepeats", false))
1921 {
1922 }
1923 
1924 void SchedOptMixin::Create(bool *err)
1925 {
1926  if (!m_rule)
1927  return;
1928 
1929  if (m_other && !m_other->m_prioritySpin)
1930  UIUtilE::Assign(m_screen, m_prioritySpin, "priority", err);
1931  else
1932  UIUtilW::Assign(m_screen, m_prioritySpin, "priority");
1933 
1935  UIUtilE::Assign(m_screen, m_startoffsetSpin, "startoffset", err);
1936  else
1937  UIUtilW::Assign(m_screen, m_startoffsetSpin, "startoffset");
1938 
1939  if (m_other && !m_other->m_endoffsetSpin)
1940  UIUtilE::Assign(m_screen, m_endoffsetSpin, "endoffset", err);
1941  else
1942  UIUtilW::Assign(m_screen, m_endoffsetSpin, "endoffset");
1943 
1944  if (m_other && !m_other->m_dupmethodList)
1945  UIUtilE::Assign(m_screen, m_dupmethodList, "dupmethod", err);
1946  else
1947  UIUtilW::Assign(m_screen, m_dupmethodList, "dupmethod");
1948 
1949  if (m_other && !m_other->m_dupscopeList)
1950  UIUtilE::Assign(m_screen, m_dupscopeList, "dupscope", err);
1951  else
1952  UIUtilW::Assign(m_screen, m_dupscopeList, "dupscope");
1953 
1954  if (m_other && !m_other->m_autoExtendList)
1955  UIUtilE::Assign(m_screen, m_autoExtendList, "autoextend", err);
1956  else
1957  UIUtilW::Assign(m_screen, m_autoExtendList, "autoextend");
1958 
1959  if (m_other && !m_other->m_inputList)
1960  UIUtilE::Assign(m_screen, m_inputList, "input", err);
1961  else
1963 
1965  UIUtilE::Assign(m_screen, m_ruleactiveCheck, "ruleactive", err);
1966  else
1967  UIUtilW::Assign(m_screen, m_ruleactiveCheck, "ruleactive");
1968 
1969  UIUtilW::Assign(m_screen, m_newrepeatList, "newrepeat");
1970 }
1971 
1973 {
1974  if (!m_rule)
1975  return;
1976 
1977  // Priority
1978  if (m_prioritySpin)
1979  {
1980  if (!m_loaded)
1981  m_prioritySpin->SetRange(-99,99,1,5);
1983  }
1984 
1985  // Start Offset
1986  if (m_startoffsetSpin)
1987  {
1988  if (!m_loaded)
1989  m_startoffsetSpin->SetRange(480,-480,1,10);
1991  }
1992 
1993  // End Offset
1994  if (m_endoffsetSpin)
1995  {
1996  if (!m_loaded)
1997  m_endoffsetSpin->SetRange(-480,480,1,10);
1999  }
2000 
2001  // Duplicate Match Type
2002  if (m_dupmethodList)
2003  {
2004  if (!m_loaded)
2005  {
2007 
2023 
2024  m_rule->m_dupMethod = dupMethod;
2025  }
2027  }
2028 
2029  // Duplicate Matching Scope
2030  if (m_dupscopeList)
2031  {
2032  if (!m_loaded)
2033  {
2043  if (m_haveRepeats && !m_newrepeatList &&
2045  {
2049  }
2050  }
2052  }
2053 
2054  // Auto Extend Services
2055  if (m_autoExtendList)
2056  {
2057  if (!m_loaded)
2058  {
2068  }
2070  }
2071 
2072  // Preferred Input
2073  if (m_inputList)
2074  {
2075  if (!m_loaded)
2076  {
2078  QObject::tr("Use any available input"),
2079  QVariant::fromValue(0));
2080 
2081  std::vector<uint> inputids = CardUtil::GetSchedInputList();
2082  for (uint id : inputids)
2083  {
2085  QObject::tr("Prefer input %1")
2086  .arg(CardUtil::GetDisplayName(id)), id);
2087  }
2088  }
2090  }
2091 
2092  // Active/Disabled
2093  if (m_ruleactiveCheck)
2094  {
2096  }
2097 
2098  // Record new and repeat
2099  if (m_newrepeatList)
2100  {
2101  if (!m_loaded)
2102  {
2104  QObject::tr("Record new and repeat "
2105  "episodes"), ENUM_TO_QVARIANT(0));
2107  QObject::tr("Record new episodes only"),
2109  }
2111  (m_rule->m_dupIn & kDupsNewEpi));
2112  }
2113 
2114  m_loaded = true;
2115 
2116  RuleChanged();
2117 }
2118 
2120 {
2121  if (!m_rule)
2122  return;
2123 
2124  if (m_prioritySpin)
2126  if (m_startoffsetSpin)
2128  if (m_endoffsetSpin)
2130  if (m_dupmethodList)
2131  m_rule->m_dupMethod = static_cast<RecordingDupMethodType>
2132  (m_dupmethodList->GetDataValue().toInt());
2133  if (m_dupscopeList)
2134  {
2135  int mask = ((m_other && m_other->m_newrepeatList) ||
2136  m_newrepeatList) ? kDupsInAll : ~0;
2137  int val = ((m_rule->m_dupIn & ~mask) |
2138  m_dupscopeList->GetDataValue().toInt());
2139  m_rule->m_dupIn = static_cast<RecordingDupInType>(val);
2140  }
2141  if (m_autoExtendList)
2142  {
2143  int val = m_autoExtendList->GetDataValue().toInt();
2144  m_rule->m_autoExtend = static_cast<AutoExtendType>(val);
2145  }
2146  if (m_inputList)
2148  if (m_ruleactiveCheck)
2150  if (m_newrepeatList)
2151  {
2152  int val = ((m_rule->m_dupIn & ~kDupsNewEpi) |
2153  m_newrepeatList->GetDataValue().toInt());
2154  m_rule->m_dupIn = static_cast<RecordingDupInType>(val);
2155  }
2156 }
2157 
2159 {
2160  if (!m_rule)
2161  return;
2162 
2163  bool isScheduled = (m_rule->m_type != kNotRecording &&
2164  m_rule->m_type != kDontRecord);
2165  bool isSingle = (m_rule->m_type == kSingleRecord ||
2167  bool isManual = (m_rule->m_searchType == kManualSearch);
2168 
2169  if (m_prioritySpin)
2170  m_prioritySpin->SetEnabled(isScheduled);
2171  if (m_startoffsetSpin)
2172  m_startoffsetSpin->SetEnabled(isScheduled);
2173  if (m_endoffsetSpin)
2174  m_endoffsetSpin->SetEnabled(isScheduled);
2175  if (m_dupmethodList)
2176  {
2178  isScheduled && !isSingle &&
2179  (!isManual || m_rule->m_dupMethod != kDupCheckNone));
2180  }
2181  if (m_dupscopeList)
2182  m_dupscopeList->SetEnabled(isScheduled && !isSingle &&
2184  if (m_inputList)
2185  m_inputList->SetEnabled(isScheduled);
2186  if (m_ruleactiveCheck)
2187  m_ruleactiveCheck->SetEnabled(isScheduled);
2188  if (m_newrepeatList)
2189  m_newrepeatList->SetEnabled(isScheduled && !isSingle && m_haveRepeats);
2190 }
2191 
2193 {
2194  if (!item || !m_rule)
2195  return;
2196 
2197  m_rule->m_dupMethod = static_cast<RecordingDupMethodType>
2198  (item->GetData().toInt());
2199 
2200  if (m_dupscopeList)
2202 }
2203 
2205 
2211 void FilterOptMixin::Create(bool *err)
2212 {
2213  if (!m_rule)
2214  return;
2215 
2216  if (m_other && !m_other->m_filtersList)
2217  UIUtilE::Assign(m_screen, m_filtersList, "filters", err);
2218  else
2219  UIUtilW::Assign(m_screen, m_filtersList, "filters");
2220 
2221  UIUtilW::Assign(m_screen, m_activeFiltersList, "activefilters");
2222  if (m_activeFiltersList)
2224 }
2225 
2227 {
2228  if (!m_rule)
2229  return;
2230 
2231  if (!m_loaded)
2232  {
2233  MSqlQuery query(MSqlQuery::InitCon());
2234 
2235  query.prepare("SELECT filterid, description, newruledefault "
2236  "FROM recordfilter ORDER BY filterid");
2237 
2238  if (query.exec())
2239  {
2240  while (query.next())
2241  {
2242  m_descriptions << QObject::tr(query.value(1).toString()
2243  .toUtf8().constData());
2244  }
2245  }
2246  m_loaded = true;
2247  }
2248 
2249  if (m_activeFiltersList)
2251 
2252  MythUIButtonListItem *button = nullptr;
2253  QStringList::iterator Idesc;
2254  int idx = 0;
2255  bool not_empty = m_filtersList && !m_filtersList->IsEmpty();
2256  for (Idesc = m_descriptions.begin(), idx = 0;
2257  Idesc != m_descriptions.end(); ++Idesc, ++idx)
2258  {
2259  bool active = (m_rule->m_filter & (1 << idx)) != 0U;
2260  if (m_filtersList)
2261  {
2262  if (not_empty)
2263  button = m_filtersList->GetItemAt(idx);
2264  else
2265  button = new MythUIButtonListItem(m_filtersList, *Idesc, idx);
2266  button->setCheckable(true);
2269  }
2270  if (active && m_activeFiltersList)
2271  {
2272  /* Create a simple list of active filters the theme can
2273  use for informational purposes. */
2275  *Idesc, idx);
2276  button->setCheckable(false);
2277  }
2278  }
2279 
2281  {
2283  QObject::tr("None"), idx);
2284  button->setCheckable(false);
2285  }
2286 
2287  RuleChanged();
2288 }
2289 
2291 {
2292  if (!m_rule || !m_filtersList)
2293  return;
2294 
2295  // Iterate through button list, and build the mask
2296  uint32_t filter_mask = 0;
2297 
2298  int end = m_filtersList->GetCount();
2299  for (int idx = 0; idx < end; ++idx)
2300  {
2302  if (button != nullptr &&
2304  filter_mask |= (1 << button->GetData().value<uint32_t>());
2305  }
2306  m_rule->m_filter = filter_mask;
2307 }
2308 
2310 {
2311  if (!m_rule)
2312  return;
2313 
2314  bool enabled = m_rule->m_type != kNotRecording &&
2316  if (m_filtersList)
2317  m_filtersList->SetEnabled(enabled);
2318  if (m_activeFiltersList)
2319  m_activeFiltersList->SetEnabled(enabled);
2320 }
2321 
2323 {
2327 }
2328 
2329 
2331 
2337 void StoreOptMixin::Create(bool *err)
2338 {
2339  if (!m_rule)
2340  return;
2341 
2342  if (m_other && !m_other->m_recprofileList)
2343  UIUtilE::Assign(m_screen, m_recprofileList, "recprofile", err);
2344  else
2345  UIUtilW::Assign(m_screen, m_recprofileList, "recprofile");
2346 
2347  if (m_other && !m_other->m_recgroupList)
2348  UIUtilE::Assign(m_screen, m_recgroupList, "recgroup", err);
2349  else
2350  UIUtilW::Assign(m_screen, m_recgroupList, "recgroup");
2351 
2353  UIUtilE::Assign(m_screen, m_storagegroupList, "storagegroup", err);
2354  else
2355  UIUtilW::Assign(m_screen, m_storagegroupList, "storagegroup");
2356 
2357  if (m_other && !m_other->m_playgroupList)
2358  UIUtilE::Assign(m_screen, m_playgroupList, "playgroup", err);
2359  else
2360  UIUtilW::Assign(m_screen, m_playgroupList, "playgroup");
2361 
2362  if (m_other && !m_other->m_maxepSpin)
2363  UIUtilE::Assign(m_screen, m_maxepSpin, "maxepisodes", err);
2364  else
2365  UIUtilW::Assign(m_screen, m_maxepSpin, "maxepisodes");
2366 
2368  UIUtilE::Assign(m_screen, m_maxbehaviourList, "maxnewest", err);
2369  else
2371 
2373  UIUtilE::Assign(m_screen, m_autoexpireCheck, "autoexpire", err);
2374  else
2375  UIUtilW::Assign(m_screen, m_autoexpireCheck, "autoexpire");
2376 }
2377 
2379 {
2380  if (!m_rule)
2381  return;
2382 
2383  QString label;
2384  QStringList groups;
2385  QStringList::Iterator it;
2386  MSqlQuery query(MSqlQuery::InitCon());
2387 
2388  // Recording Profile
2389  if (m_recprofileList)
2390  {
2391  if (!m_loaded)
2392  {
2393  label = QObject::tr("Record using the %1 profile");
2394 
2396  label.arg(QObject::tr("Default")),
2397  QVariant::fromValue(QString("Default")));
2398  // LiveTV profile - it's for LiveTV not scheduled recordings??
2400  label.arg(QObject::tr("LiveTV")),
2401  QVariant::fromValue(QString("LiveTV")));
2403  label.arg(QObject::tr("High Quality")),
2404  QVariant::fromValue(QString("High Quality")));
2406  label.arg(QObject::tr("Low Quality")),
2407  QVariant::fromValue(QString("Low Quality")));
2408  }
2410  }
2411 
2412  // Recording Group
2413  if (m_recgroupList)
2414  {
2415  if (!m_loaded)
2416  {
2417  label = QObject::tr("Include in the \"%1\" recording group");
2419  QObject::tr("Create a new recording group"),
2420  QVariant::fromValue(QString("__NEW_GROUP__")));
2421 
2422  query.prepare("SELECT recgroupid, recgroup FROM recgroups "
2423  "WHERE recgroup <> 'Deleted' AND "
2424  " recgroup <> 'LiveTV' "
2425  "ORDER BY special DESC, recgroup ASC"); // Special groups first
2426  if (query.exec())
2427  {
2428  while (query.next())
2429  {
2430  int id = query.value(0).toInt();
2431  QString name = query.value(1).toString();
2432 
2433  if (name == "Default")
2434  name = QObject::tr("Default");
2435  new MythUIButtonListItem(m_recgroupList, label.arg(name),
2436  QVariant::fromValue(id));
2437  }
2438  }
2439 
2440  }
2442  }
2443 
2444  // Storage Group
2445  if (m_storagegroupList)
2446  {
2447  if (!m_loaded)
2448  {
2449  label = QObject::tr("Store in the \"%1\" storage group");
2451  label.arg(QObject::tr("Default")),
2452  QVariant::fromValue(QString("Default")));
2453 
2455  for (it = groups.begin(); it != groups.end(); ++it)
2456  {
2457  if ((*it).compare("Default", Qt::CaseInsensitive) != 0)
2459  label.arg(*it), QVariant::fromValue(*it));
2460  }
2461  }
2463  }
2464 
2465  // Playback Group
2466  if (m_playgroupList)
2467  {
2468  if (!m_loaded)
2469  {
2470  label = QObject::tr("Use \"%1\" playback group settings");
2472  label.arg(QObject::tr("Default")),
2473  QVariant::fromValue(QString("Default")));
2474 
2475  groups = PlayGroup::GetNames();
2476  for (it = groups.begin(); it != groups.end(); ++it)
2477  {
2478  new MythUIButtonListItem(m_playgroupList, label.arg(*it),
2479  QVariant::fromValue(*it));
2480  }
2481  }
2483  }
2484 
2485  // Max Episodes
2486  if (m_maxepSpin)
2487  {
2488  if (!m_loaded)
2489  {
2490  int maxEpisodes = m_rule->m_maxEpisodes;
2491  m_maxepSpin->SetRange(0,100,1,5);
2492  m_rule->m_maxEpisodes = maxEpisodes;
2493  }
2495  }
2496 
2497  // Max Episode Behaviour
2498  if (m_maxbehaviourList)
2499  {
2500  if (!m_loaded)
2501  {
2503  QObject::tr("Don't record if this would exceed the max "
2504  "episodes"), QVariant::fromValue(false));
2506  QObject::tr("Delete oldest if this would exceed the max "
2507  "episodes"), QVariant::fromValue(true));
2508  }
2510  }
2511 
2512  // Auto-Expire
2513  if (m_autoexpireCheck)
2514  {
2516  }
2517 
2518  m_loaded = true;
2519 
2520  RuleChanged();
2521 }
2522 
2524 {
2525  if (!m_rule)
2526  return;
2527 
2528  if (m_recprofileList)
2530 
2531  if (m_recgroupList)
2532  {
2533  // If the user selected 'Create a new regroup' but failed to enter a
2534  // name when prompted, restore the original value
2535  if (m_recgroupList->GetDataValue().toString() == "__NEW_GROUP__")
2538  }
2539 
2540  if (m_storagegroupList)
2542 
2543  if (m_playgroupList)
2545 
2546  if (m_maxepSpin)
2548 
2549  if (m_maxbehaviourList)
2551 
2552  if (m_autoexpireCheck)
2554 }
2555 
2557 {
2558  if (!m_rule)
2559  return;
2560 
2561  bool isScheduled = (m_rule->m_type != kNotRecording &&
2562  m_rule->m_type != kDontRecord);
2563  bool isSingle = (m_rule->m_type == kSingleRecord ||
2565 
2566  if (m_recprofileList)
2567  m_recprofileList->SetEnabled(isScheduled);
2568  if (m_recgroupList)
2569  m_recgroupList->SetEnabled(isScheduled);
2570  if (m_storagegroupList)
2571  m_storagegroupList->SetEnabled(isScheduled);
2572  if (m_playgroupList)
2573  m_playgroupList->SetEnabled(isScheduled);
2574  if (m_maxepSpin)
2575  m_maxepSpin->SetEnabled(isScheduled && !isSingle);
2576  if (m_maxbehaviourList)
2577  m_maxbehaviourList->SetEnabled(isScheduled && !isSingle &&
2578  m_rule->m_maxEpisodes != 0);
2579  if (m_autoexpireCheck)
2580  m_autoexpireCheck->SetEnabled(isScheduled);
2581 }
2582 
2584 {
2585  if (!item || !m_rule)
2586  return;
2587 
2588  m_rule->m_maxEpisodes = item->GetData().toInt();
2589 
2590  if (m_maxbehaviourList)
2592 }
2593 
2595 {
2596  if (!m_rule)
2597  return;
2598 
2599  if (m_recgroupList->GetDataValue().toString() != "__NEW_GROUP__")
2600  return;
2601 
2602  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2603 
2604  QString label =
2605  QObject::tr("New Recording group name: ");
2606 
2607  auto *textDialog = new MythTextInputDialog(popupStack, label,
2608  static_cast<InputFilter>(FilterSymbols | FilterPunct));
2609 
2610  textDialog->SetReturnEvent(m_screen, "newrecgroup");
2611 
2612  if (textDialog->Create())
2613  popupStack->AddScreen(textDialog, false);
2614 }
2615 
2616 void StoreOptMixin::SetRecGroup(int recgroupID, QString recgroup)
2617 {
2618  if (!m_rule || recgroupID <= 0)
2619  return;
2620 
2621  if (m_recgroupList)
2622  {
2623  recgroup = recgroup.trimmed();
2624  if (recgroup.isEmpty())
2625  return;
2626 
2627  QString label = QObject::tr("Include in the \"%1\" recording group");
2628  auto *item = new MythUIButtonListItem(m_recgroupList, label.arg(recgroup),
2629  QVariant::fromValue(recgroupID));
2631 
2632  if (m_other && m_other->m_recgroupList)
2633  {
2635  label.arg(recgroup), QVariant::fromValue(recgroupID));
2637  }
2638  }
2639 }
2640 
2641 int StoreOptMixin::CreateRecordingGroup(const QString& groupName)
2642 {
2643  int groupID = -1;
2644  MSqlQuery query(MSqlQuery::InitCon());
2645 
2646  query.prepare("INSERT INTO recgroups SET recgroup = :NAME, "
2647  "displayname = :DISPLAYNAME");
2648  query.bindValue(":NAME", groupName);
2649  query.bindValue(":DISPLAYNAME", groupName);
2650 
2651  if (query.exec())
2652  groupID = query.lastInsertId().toInt();
2653 
2654  if (groupID <= 0)
2655  LOG(VB_GENERAL, LOG_ERR, QString("Could not create recording group (%1). "
2656  "Does it already exist?").arg(groupName));
2657 
2658  return groupID;
2659 }
2660 
2662 
2668 void PostProcMixin::Create(bool *err)
2669 {
2670  if (!m_rule)
2671  return;
2672 
2673  if (m_other && !m_other->m_commflagCheck)
2674  UIUtilE::Assign(m_screen, m_commflagCheck, "autocommflag", err);
2675  else
2676  UIUtilW::Assign(m_screen, m_commflagCheck, "autocommflag");
2677 
2678  if (m_other && !m_other->m_transcodeCheck)
2679  UIUtilE::Assign(m_screen, m_transcodeCheck, "autotranscode", err);
2680  else
2681  UIUtilW::Assign(m_screen, m_transcodeCheck, "autotranscode");
2682 
2684  UIUtilE::Assign(m_screen, m_transcodeprofileList, "transcodeprofile", err);
2685  else
2686  UIUtilW::Assign(m_screen, m_transcodeprofileList, "transcodeprofile");
2687 
2688  if (m_other && !m_other->m_userjob1Check)
2689  UIUtilE::Assign(m_screen, m_userjob1Check, "userjob1", err);
2690  else
2692 
2693  if (m_other && !m_other->m_userjob2Check)
2694  UIUtilE::Assign(m_screen, m_userjob2Check, "userjob2", err);
2695  else
2697 
2698  if (m_other && !m_other->m_userjob3Check)
2699  UIUtilE::Assign(m_screen, m_userjob3Check, "userjob3", err);
2700  else
2702 
2703  if (m_other && !m_other->m_userjob4Check)
2704  UIUtilE::Assign(m_screen, m_userjob4Check, "userjob4", err);
2705  else
2707 
2708  UIUtilW::Assign(m_screen, m_metadataLookupCheck, "metadatalookup");
2709 }
2710 
2712 {
2713  if (!m_rule)
2714  return;
2715 
2716  // Auto-commflag
2717  if (m_commflagCheck)
2718  {
2720  }
2721 
2722  // Auto-transcode
2723  if (m_transcodeCheck)
2724  {
2726  }
2727 
2728  // Transcode Method
2730  {
2731  if (!m_loaded)
2732  {
2733  QMap<int, QString> profiles = RecordingProfile::GetTranscodingProfiles();
2734  QMap<int, QString>::iterator it;
2735  for (it = profiles.begin(); it != profiles.end(); ++it)
2736  {
2738  QVariant::fromValue(it.key()));
2739  }
2740  }
2742  }
2743 
2744  // User Job #1
2745  if (m_userjob1Check)
2746  {
2747  if (!m_loaded)
2748  {
2749  MythUIText *userjob1Text = nullptr;
2750  UIUtilW::Assign(m_screen, userjob1Text, "userjob1text");
2751  if (userjob1Text)
2752  userjob1Text->SetText(QObject::tr("Run '%1'")
2753  .arg(gCoreContext->GetSetting("UserJobDesc1", "User Job 1")));
2754  }
2756  }
2757 
2758  // User Job #2
2759  if (m_userjob2Check)
2760  {
2761  if (!m_loaded)
2762  {
2763  MythUIText *userjob2Text = nullptr;
2764  UIUtilW::Assign(m_screen, userjob2Text, "userjob2text");
2765  if (userjob2Text)
2766  userjob2Text->SetText(QObject::tr("Run '%1'")
2767  .arg(gCoreContext->GetSetting("UserJobDesc2", "User Job 2")));
2768  }
2770  }
2771 
2772  // User Job #3
2773  if (m_userjob3Check)
2774  {
2775  if (!m_loaded)
2776  {
2777  MythUIText *userjob3Text = nullptr;
2778  UIUtilW::Assign(m_screen, userjob3Text, "userjob3text");
2779  if (userjob3Text)
2780  userjob3Text->SetText(QObject::tr("Run '%1'")
2781  .arg(gCoreContext->GetSetting("UserJobDesc3", "User Job 3")));
2782  }
2784  }
2785 
2786  // User Job #4
2787  if (m_userjob4Check)
2788  {
2789  if (!m_loaded)
2790  {
2791  MythUIText *userjob4Text = nullptr;
2792  UIUtilW::Assign(m_screen, userjob4Text, "userjob4text");
2793  if (userjob4Text)
2794  userjob4Text->SetText(QObject::tr("Run '%1'")
2795  .arg(gCoreContext->GetSetting("UserJobDesc4", "User Job 4")));
2796  }
2798  }
2799 
2800  // Auto Metadata Lookup
2802  {
2804  }
2805 
2806  m_loaded = true;
2807 
2808  RuleChanged();
2809 }
2810 
2812 {
2813  if (!m_rule)
2814  return;
2815 
2816  if (m_commflagCheck)
2818  if (m_transcodeCheck)
2822  if (m_userjob1Check)
2824  if (m_userjob2Check)
2826  if (m_userjob3Check)
2828  if (m_userjob4Check)
2833 }
2834 
2836 {
2837  if (!m_rule)
2838  return;
2839 
2840  bool isScheduled = (m_rule->m_type != kNotRecording &&
2841  m_rule->m_type != kDontRecord);
2842 
2843  if (m_commflagCheck)
2844  m_commflagCheck->SetEnabled(isScheduled);
2845  if (m_transcodeCheck)
2846  m_transcodeCheck->SetEnabled(isScheduled);
2848  m_transcodeprofileList->SetEnabled(isScheduled &&
2850  if (m_userjob1Check)
2851  m_userjob1Check->SetEnabled(isScheduled);
2852  if (m_userjob2Check)
2853  m_userjob2Check->SetEnabled(isScheduled);
2854  if (m_userjob3Check)
2855  m_userjob3Check->SetEnabled(isScheduled);
2856  if (m_userjob4Check)
2857  m_userjob4Check->SetEnabled(isScheduled);
2859  m_metadataLookupCheck->SetEnabled(isScheduled);
2860 }
2861 
2863 {
2864  if (!m_rule)
2865  return;
2866 
2867  m_rule->m_autoTranscode = enable;
2868 
2871 }
RecordingRule::m_isOverride
bool m_isOverride
Definition: recordingrule.h:150
MetadataFactory::Lookup
void Lookup(ProgramInfo *pginfo, bool automatic=true, bool getimages=true, bool allowgeneric=false)
Definition: metadatafactory.cpp:139
StorageGroup::getRecordingsGroups
static QStringList getRecordingsGroups(void)
Definition: storagegroup.cpp:789
MetadataOptions::~MetadataOptions
~MetadataOptions() override
Definition: scheduleeditor.cpp:1259
MythUIButton::Clicked
void Clicked()
ScheduleEditor::m_view
int m_view
Definition: scheduleeditor.h:237
scheduleeditor.h
RecordingRule::LoadTemplate
bool LoadTemplate(const QString &category, const QString &categoryType="Default")
Definition: recordingrule.cpp:273
MythUIButtonList::GetItemAt
MythUIButtonListItem * GetItemAt(int pos) const
Definition: mythuibuttonlist.cpp:1673
RecordingRule::LoadByProgram
bool LoadByProgram(const ProgramInfo *proginfo)
Definition: recordingrule.cpp:168
FilterOptMixin::SetRule
void SetRule(RecordingRule *rule)
Definition: scheduleeditor.h:124
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:807
kDupCheckDesc
@ kDupCheckDesc
Definition: recordingtypes.h:62
mythuimetadataresults.h
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:315
TVPlaybackState::RequestEmbedding
void RequestEmbedding(bool Embed, const QRect &Rect={}, const QStringList &Data={})
PostProcMixin::m_loaded
bool m_loaded
Definition: scheduleeditor.h:115
RecordingRule::m_autoTranscode
bool m_autoTranscode
Definition: recordingrule.h:130
generate_file_url
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
Definition: videoutils.h:65
SchedEditChild::Save
virtual void Save(void)=0
ScheduleEditor::Load
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: scheduleeditor.cpp:237
MetadataOptions::CanSetArtwork
bool CanSetArtwork(void)
Definition: scheduleeditor.cpp:1551
SchedOptEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:978
VideoArtworkType
VideoArtworkType
Definition: metadataimagehelper.h:10
MetadataOptions::m_queryButton
MythUIButton * m_queryButton
Definition: scheduleeditor.h:416
MetadataOptions::OnImageSearchListSelection
void OnImageSearchListSelection(const ArtworkInfo &info, VideoArtworkType type)
Definition: scheduleeditor.cpp:1404
RecordingRule::m_playGroup
QString m_playGroup
Definition: recordingrule.h:120
PostProcMixin::m_screen
MythScreenType * m_screen
Definition: scheduleeditor.h:112
MetadataOptions::FindImagePopup
static void FindImagePopup(const QString &prefix, const QString &prefixAlt, QObject &inst, const QString &returnEvent)
Definition: scheduleeditor.cpp:1512
RecordingRule::m_seriesid
QString m_seriesid
Definition: recordingrule.h:82
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1587
RefCountHandler
Definition: referencecounterlist.h:17
MythCoreContext::GetMasterHostName
QString GetMasterHostName(void)
Definition: mythcorecontext.cpp:830
RecordingInfo::kReSearchTypeName
static const QRegularExpression kReSearchTypeName
Definition: recordinginfo.h:197
SchedOptMixin::SetRule
void SetRule(RecordingRule *rule)
Definition: scheduleeditor.h:32
CardUtil::GetDisplayName
static QString GetDisplayName(uint inputid)
Definition: cardutil.cpp:1799
MythUIButtonList::SetValueByData
void SetValueByData(const QVariant &data)
Definition: mythuibuttonlist.cpp:1539
mythuitext.h
ScheduleEditor::Close
void Close(void) override
Definition: scheduleeditor.cpp:225
FilterOptMixin::Save
void Save(void)
Definition: scheduleeditor.cpp:2290
MetadataOptions::m_imageDownload
MetadataImageDownload * m_imageDownload
Definition: scheduleeditor.h:401
RecordingRule::m_autoCommFlag
bool m_autoCommFlag
Definition: recordingrule.h:129
ReferenceCounter::DecrRef
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
Definition: referencecounter.cpp:125
RecordingRule::m_inetref
QString m_inetref
Definition: recordingrule.h:85
MetadataOptions::SelectOnlineFanart
void SelectOnlineFanart()
Definition: scheduleeditor.cpp:1463
MetadataImageDownload
Definition: metadataimagedownload.h:87
PostProcMixin::m_transcodeCheck
MythUICheckBox * m_transcodeCheck
Definition: scheduleeditor.h:103
SchedOptMixin::m_newrepeatList
MythUIButtonList * m_newrepeatList
Definition: scheduleeditor.h:47
kMetadataRecording
@ kMetadataRecording
Definition: metadatacommon.h:44
metadataimagehelper.h
MetadataOptions::CreateLookup
MetadataLookup * CreateLookup(MetadataType mtype)
Definition: scheduleeditor.cpp:1565
ScheduleEditor::customEvent
void customEvent(QEvent *event) override
Definition: scheduleeditor.cpp:559
RecordingRule::m_maxNewest
bool m_maxNewest
Definition: recordingrule.h:125
fs6
static QString fs6(QT_TRANSLATE_NOOP("SchedFilterEditor", "This episode"))
SchedOptEditor::DupMethodChanged
void DupMethodChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:1024
MetadataOptions::ClearInetref
void ClearInetref()
Definition: scheduleeditor.cpp:1382
MetadataType
MetadataType
Definition: metadatacommon.h:42
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
RecordingRule::m_category
QString m_category
Definition: recordingrule.h:80
RecordingRule::Save
bool Save(bool sendSig=true)
Definition: recordingrule.cpp:382
MetadataOptions::customEvent
void customEvent(QEvent *event) override
Definition: scheduleeditor.cpp:1701
SchedEditChild::SetTextFromMaps
void SetTextFromMaps(void)
Definition: scheduleeditor.cpp:943
PostProcMixin::m_userjob3Check
MythUICheckBox * m_userjob3Check
Definition: scheduleeditor.h:107
SchedOptMixin::SchedOptMixin
SchedOptMixin(MythScreenType &screen, RecordingRule *rule, SchedOptMixin *other=nullptr)
Definition: scheduleeditor.cpp:1917
StoreOptEditor::MaxEpisodesChanged
void MaxEpisodesChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:1143
MetadataOptions::QueryComplete
void QueryComplete(MetadataLookup *lookup)
Definition: scheduleeditor.cpp:1493
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:386
fs0
static QString fs0(QT_TRANSLATE_NOOP("SchedFilterEditor", "New episode"))
FilterOptMixin::m_activeFiltersList
MythUIButtonList * m_activeFiltersList
Definition: scheduleeditor.h:132
ScheduleEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:127
StoreOptMixin::m_rule
RecordingRule * m_rule
Definition: scheduleeditor.h:84
MetadataResultsDialog
Definition: mythuimetadataresults.h:10
kDailyRecord
@ kDailyRecord
Definition: recordingtypes.h:23
kDupCheckSubThenDesc
@ kDupCheckSubThenDesc
Definition: recordingtypes.h:64
kMetadataVideo
@ kMetadataVideo
Definition: metadatacommon.h:43
PostProcMixin::m_metadataLookupCheck
MythUICheckBox * m_metadataLookupCheck
Definition: scheduleeditor.h:109
ScheduleEditor::MaxEpisodesChanged
void MaxEpisodesChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:376
PostProcMixin::m_userjob2Check
MythUICheckBox * m_userjob2Check
Definition: scheduleeditor.h:106
MetadataOptions::m_metadataFactory
MetadataFactory * m_metadataFactory
Definition: scheduleeditor.h:397
MetadataImageDownload::cancel
void cancel()
Definition: metadataimagedownload.cpp:64
MetadataOptions::SelectLocalBanner
void SelectLocalBanner()
Definition: scheduleeditor.cpp:1452
ArtworkList
QList< ArtworkInfo > ArtworkList
Definition: metadataimagehelper.h:30
RecordingInfo
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:35
SchedFilterEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:1045
StoreOptEditor::customEvent
void customEvent(QEvent *event) override
Definition: scheduleeditor.cpp:1153
ScheduleEditor::Save
void Save(void)
Definition: scheduleeditor.cpp:391
ScheduleEditor::ScheduleEditor
ScheduleEditor(MythScreenStack *parent, RecordingInfo *recinfo, TV *player=nullptr)
Definition: scheduleeditor.cpp:82
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:969
kDupCheckSub
@ kDupCheckSub
Definition: recordingtypes.h:61
ScheduleEditor::~ScheduleEditor
~ScheduleEditor() override
Definition: scheduleeditor.cpp:115
MythUIBusyDialog::Create
bool Create(void) override
Definition: mythprogressdialog.cpp:32
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
ImageDLFailureEvent::kEventType
static Type kEventType
Definition: metadataimagedownload.h:67
RecordingRule::ToMap
void ToMap(InfoMap &infoMap, uint date_format=0) const
Definition: recordingrule.cpp:544
kProbableTelevision
@ kProbableTelevision
Definition: metadatacommon.h:51
ScheduleEditor::DupMethodChanged
void DupMethodChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:366
SchedEditChild::SchedEditChild
SchedEditChild(MythScreenStack *parent, const QString &name, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:872
MSqlQuery::lastInsertId
QVariant lastInsertId()
Return the id of the last inserted row.
Definition: mythdbcon.cpp:912
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
fs4
static QString fs4(QT_TRANSLATE_NOOP("SchedFilterEditor", "Commercial free"))
RecordingRule::m_title
QString m_title
Definition: recordingrule.h:75
MetadataOptions::m_inetrefClear
MythUIButton * m_inetrefClear
Definition: scheduleeditor.h:415
SchedOptEditor::m_filtersButton
MythUIButton * m_filtersButton
Definition: scheduleeditor.h:291
ScheduleEditor::showTemplateMenu
void showTemplateMenu(void)
Definition: scheduleeditor.cpp:833
MythUICheckBox::GetBooleanCheckState
bool GetBooleanCheckState(void) const
Definition: mythuicheckbox.cpp:103
SchedOptMixin::m_prioritySpin
MythUISpinBox * m_prioritySpin
Definition: scheduleeditor.h:39
mythdialogbox.h
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:202
MythScreenStack
Definition: mythscreenstack.h:16
RecordingProfile::GetTranscodingProfiles
static QMap< int, QString > GetTranscodingProfiles()
Definition: recordingprofile.cpp:1873
MetadataOptions::m_episodeSpin
MythUISpinBox * m_episodeSpin
Definition: scheduleeditor.h:413
MythWarningNotification
Definition: mythnotification.h:205
ProgLister
Definition: proglist.h:33
GetArtwork
ArtworkMap GetArtwork(const QString &inetref, uint season, bool strict)
Definition: metadataimagehelper.cpp:23
MythUIButtonListItem::FullChecked
@ FullChecked
Definition: mythuibuttonlist.h:48
ScheduleEditor::ShowPreviousView
void ShowPreviousView(void)
Definition: scheduleeditor.cpp:738
SchedEditChild::m_recordingRule
RecordingRule * m_recordingRule
Definition: scheduleeditor.h:266
MythUIType::SetCanTakeFocus
void SetCanTakeFocus(bool set=true)
Set whether this widget can take focus.
Definition: mythuitype.cpp:359
StoreOptMixin::m_autoexpireCheck
MythUICheckBox * m_autoexpireCheck
Definition: scheduleeditor.h:80
RecordingRule
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:28
RecordingDupMethodType
RecordingDupMethodType
Definition: recordingtypes.h:57
RecordingRule::m_endOffset
int m_endOffset
Definition: recordingrule.h:108
PostProcEditor::TranscodeChanged
void TranscodeChanged(bool enable)
Definition: scheduleeditor.cpp:1226
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:608
MetadataOptions::m_fanart
MythUIImage * m_fanart
Definition: scheduleeditor.h:406
StoreOptMixin::Create
void Create(bool *err)
Definition: scheduleeditor.cpp:2337
GuessLookupType
LookupType GuessLookupType(ProgramInfo *pginfo)
Definition: metadatafactory.cpp:650
ImageDLEvent
Definition: metadataimagedownload.h:18
MetadataDownload
Definition: metadatadownload.h:35
MetadataFactoryNoResult::kEventType
static Type kEventType
Definition: metadatafactory.h:65
ScheduleEditor::ShowPostProc
void ShowPostProc(void)
Definition: scheduleeditor.cpp:471
MetadataLookup::GetArtwork
ArtworkList GetArtwork(VideoArtworkType type) const
Definition: metadatacommon.cpp:330
ScheduleCommon::ShowGuide
virtual void ShowGuide(void) const
Show the program guide.
Definition: schedulecommon.cpp:132
PostProcMixin::m_userjob1Check
MythUICheckBox * m_userjob1Check
Definition: scheduleeditor.h:105
PostProcMixin::m_commflagCheck
MythUICheckBox * m_commflagCheck
Definition: scheduleeditor.h:102
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
playgroup.h
PostProcEditor::Load
void Load(void) override
Definition: scheduleeditor.cpp:1220
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MetadataFactoryMultiResult::kEventType
static Type kEventType
Definition: metadatafactory.h:29
mythuistatetype.h
InputFilter
InputFilter
Definition: mythuitextedit.h:19
SchedOptMixin::m_rule
RecordingRule * m_rule
Definition: scheduleeditor.h:51
SchedEditChild
Definition: scheduleeditor.h:241
ScheduleEditor::kMainView
@ kMainView
Definition: scheduleeditor.h:229
SchedFilterEditor::ToggleSelected
static void ToggleSelected(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:1084
RecordingRule::IsLoaded
bool IsLoaded() const
Definition: recordingrule.h:53
ScheduleEditor::ruleSaved
void ruleSaved(int ruleId)
MythUITextEdit::GetText
QString GetText(void) const
Definition: mythuitextedit.h:50
MetadataOptions::m_coverart
MythUIImage * m_coverart
Definition: scheduleeditor.h:407
MetadataOptions::MetadataOptions
MetadataOptions(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:1243
MetadataOptions::Load
void Load(void) override
Definition: scheduleeditor.cpp:1363
recordingtypes.h
RecordingRule::m_dupIn
RecordingDupInType m_dupIn
Definition: recordingrule.h:112
AutoExtendType
AutoExtendType
Definition: recordingtypes.h:84
StoreOptMixin::m_recgroupList
MythUIButtonList * m_recgroupList
Definition: scheduleeditor.h:75
fs10
static QString fs10(QT_TRANSLATE_NOOP("SchedFilterEditor", "This channel"))
RecordingRule::m_isInactive
bool m_isInactive
Recording rule is enabled?
Definition: recordingrule.h:72
ScheduleEditor::DeleteRule
void DeleteRule(void)
Definition: scheduleeditor.cpp:416
ENUM_TO_QVARIANT
#define ENUM_TO_QVARIANT(a)
Definition: scheduleeditor.cpp:42
StoreOptMixin::m_playgroupList
MythUIButtonList * m_playgroupList
Definition: scheduleeditor.h:77
StoreOptMixin::m_maxbehaviourList
MythUIButtonList * m_maxbehaviourList
Definition: scheduleeditor.h:79
MetadataOptions::HandleDownloadedImages
void HandleDownloadedImages(MetadataLookup *lookup)
Definition: scheduleeditor.cpp:1648
RecordingRule::m_season
uint m_season
Definition: recordingrule.h:92
MythUISpinBox::SetRange
void SetRange(int low, int high, int step, uint pageMultiple=5)
Set the lower and upper bounds of the spinbox, the interval and page amount.
Definition: mythuispinbox.cpp:26
ScheduleEditor::m_rulesList
MythUIButtonList * m_rulesList
Definition: scheduleeditor.h:213
mythuibuttonlist.h
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
mythuiimage.h
MythUIButtonList::GetCount
int GetCount() const
Definition: mythuibuttonlist.cpp:1652
ScheduleCommon::ShowDetails
virtual void ShowDetails(void) const
Show the Program Details screen.
Definition: schedulecommon.cpp:27
ScheduleEditor::ChildClosing
void ChildClosing(void)
Definition: scheduleeditor.cpp:778
mythprogressdialog.h
kDupsInAll
@ kDupsInAll
Definition: recordingtypes.h:47
MetadataLookup::toMap
void toMap(InfoMap &map)
Definition: metadatacommon.cpp:347
ScheduleEditor::ShowStoreOpt
void ShowStoreOpt(void)
Definition: scheduleeditor.cpp:446
MetadataOptions::Save
void Save(void) override
Definition: scheduleeditor.cpp:1478
ScheduleEditor::ShowMetadataOptions
void ShowMetadataOptions(void)
Definition: scheduleeditor.cpp:689
MetadataFactoryNoResult
Definition: metadatafactory.h:50
kLookupSearch
@ kLookupSearch
Definition: metadatacommon.h:28
proglist.h
AutoExtendType::None
@ None
PostProcMixin
Mixin for post processing.
Definition: scheduleeditor.h:89
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:113
PostProcMixin::m_rule
RecordingRule * m_rule
Definition: scheduleeditor.h:113
programtypes.h
MetadataLookup
Definition: metadatacommon.h:87
MythUICheckBox::toggled
void toggled(bool)
PostProcEditor::PostProcEditor
PostProcEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:1182
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MetadataOptions::m_banner
MythUIImage * m_banner
Definition: scheduleeditor.h:408
ProgramInfo::kCategoryMovie
@ kCategoryMovie
Definition: programinfo.h:76
ScheduleEditor::ShowSchedInfo
void ShowSchedInfo(void)
Definition: scheduleeditor.cpp:496
PlayGroup::GetNames
static QStringList GetNames(void)
Definition: playgroup.cpp:206
FilterOptMixin::m_other
FilterOptMixin * m_other
Definition: scheduleeditor.h:137
kDupsInRecorded
@ kDupsInRecorded
Definition: recordingtypes.h:45
MetadataOptions::PerformQuery
void PerformQuery()
Definition: scheduleeditor.cpp:1388
SchedEditChild::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: scheduleeditor.cpp:880
MetadataLookupFailure::kEventType
static Type kEventType
Definition: metadatadownload.h:32
mythuiutils.h
RecordingRule::Load
bool Load(bool asTemplate=false)
Load a single rule from the recorded table.
Definition: recordingrule.cpp:56
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
RecordingRule::m_startOffset
int m_startOffset
Definition: recordingrule.h:107
MetadataOptions::CreateBusyDialog
void CreateBusyDialog(const QString &title)
Definition: scheduleeditor.cpp:1368
ProgramInfo::GetYearOfInitialRelease
uint GetYearOfInitialRelease(void) const
Definition: programinfo.h:423
SchedEditChild::m_recInfo
RecordingInfo * m_recInfo
Definition: scheduleeditor.h:267
RecordingDupInType
RecordingDupInType
Definition: recordingtypes.h:42
RecordingRule::GetTemplateNames
static QStringList GetTemplateNames(void)
Definition: recordingrule.cpp:825
MythUISpinBox::SetValue
void SetValue(int val) override
Definition: mythuispinbox.h:26
viewschedulediff.h
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:219
SchedOptMixin::m_haveRepeats
bool m_haveRepeats
Definition: scheduleeditor.h:54
ScheduleCommon::ShowPrevious
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
Definition: schedulecommon.cpp:248
MetadataOptions::m_popupStack
MythScreenStack * m_popupStack
Definition: scheduleeditor.h:403
FilterOptMixin::m_loaded
bool m_loaded
Definition: scheduleeditor.h:138
MetadataLookup::GetDownloads
DownloadMap GetDownloads() const
Definition: metadatacommon.h:372
RecordingRule::m_isTemplate
bool m_isTemplate
Definition: recordingrule.h:154
MythUIButtonList::IsEmpty
bool IsEmpty() const
Definition: mythuibuttonlist.cpp:1668
FilterOptMixin::m_descriptions
QStringList m_descriptions
Definition: scheduleeditor.h:140
ScheduleEditor::ShowPreview
void ShowPreview(void)
Definition: scheduleeditor.cpp:653
SchedOptMixin::m_screen
MythScreenType * m_screen
Definition: scheduleeditor.h:50
MetadataOptions::m_onlineBannerButton
MythUIButton * m_onlineBannerButton
Definition: scheduleeditor.h:422
ScheduleEditor::m_schedOptButton
MythUIButton * m_schedOptButton
Definition: scheduleeditor.h:215
RecordingRule::m_episode
uint m_episode
Definition: recordingrule.h:93
ScheduleEditor::FilterChanged
static void FilterChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:371
MetadataOptions::SelectOnlineCoverart
void SelectOnlineCoverart()
Definition: scheduleeditor.cpp:1468
SchedOptMixin::Save
void Save(void)
Definition: scheduleeditor.cpp:2119
SchedEditChild::Closing
void Closing(void)
ScheduleEditor::kSchedOptView
@ kSchedOptView
Definition: scheduleeditor.h:230
ScheduleEditor::m_saveButton
MythUIButton * m_saveButton
Definition: scheduleeditor.h:210
MetadataLookup::GetEpisode
uint GetEpisode() const
Definition: metadatacommon.h:315
SchedOptMixin::m_startoffsetSpin
MythUISpinBox * m_startoffsetSpin
Definition: scheduleeditor.h:40
ScheduleEditor::ShowSchedOpt
void ShowSchedOpt(void)
Definition: scheduleeditor.cpp:421
SchedOptMixin::DupMethodChanged
void DupMethodChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:2192
MythUIButtonListItem::setCheckable
void setCheckable(bool flag)
Definition: mythuibuttonlist.cpp:3640
SchedFilterEditor
Select schedule filters.
Definition: scheduleeditor.h:294
MythUIButtonList::itemClicked
void itemClicked(MythUIButtonListItem *item)
RecordingRule::m_autoUserJob4
bool m_autoUserJob4
Definition: recordingrule.h:134
StoreOptMixin::CreateRecordingGroup
static int CreateRecordingGroup(const QString &groupName)
Definition: scheduleeditor.cpp:2641
MetadataOptions::m_onlineCoverartButton
MythUIButton * m_onlineCoverartButton
Definition: scheduleeditor.h:421
MetadataLookupFailure
Definition: metadatadownload.h:23
SchedEditChild::CreateEditChild
virtual bool CreateEditChild(const QString &xmlfile, const QString &winname, bool isTemplate)
Definition: scheduleeditor.cpp:916
ArtworkInfo
Definition: metadataimagehelper.h:21
PostProcMixin::RuleChanged
void RuleChanged(void)
Definition: scheduleeditor.cpp:2835
ImageSearchResultsDialog
Definition: mythuiimageresults.h:11
hardwareprofile.config.p
p
Definition: config.py:33
MetadataOptions::m_artworkMap
ArtworkMap m_artworkMap
Definition: scheduleeditor.h:424
kTemplateRecord
@ kTemplateRecord
Definition: recordingtypes.h:32
RefCountedList< MetadataLookup >
MetadataOptions::m_seasonSpin
MythUISpinBox * m_seasonSpin
Definition: scheduleeditor.h:412
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
MetadataLookup::GetData
QVariant GetData() const
Definition: metadatacommon.h:288
SetArtwork
bool SetArtwork(const QString &inetref, uint season, const QString &host, const QString &coverart, const QString &fanart, const QString &banner)
Definition: metadataimagehelper.cpp:93
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:540
RecordingRule::m_autoUserJob2
bool m_autoUserJob2
Definition: recordingrule.h:132
ScheduleEditor::ruleDeleted
void ruleDeleted(int ruleId)
ScheduleEditor::kStoreOptView
@ kStoreOptView
Definition: scheduleeditor.h:232
MythUISpinBox::GetIntValue
int GetIntValue(void) const override
Definition: mythuispinbox.h:33
ScheduleEditor::m_schedInfoButton
MythUIButton * m_schedInfoButton
Definition: scheduleeditor.h:218
MetadataFactorySingleResult::kEventType
static Type kEventType
Definition: metadatafactory.h:47
MetadataOptions::m_localBannerButton
MythUIButton * m_localBannerButton
Definition: scheduleeditor.h:419
FilterPunct
@ FilterPunct
Definition: mythuitextedit.h:26
kDupsInOldRecorded
@ kDupsInOldRecorded
Definition: recordingtypes.h:46
StoreOptEditor::StoreOptEditor
StoreOptEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:1096
fs8
static QString fs8(QT_TRANSLATE_NOOP("SchedFilterEditor", "This time"))
ScheduleEditor::showMenu
void showMenu(void)
Definition: scheduleeditor.cpp:793
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:206
ScheduleEditor::m_previewButton
MythUIButton * m_previewButton
Definition: scheduleeditor.h:219
RecordingRule::m_autoExpire
bool m_autoExpire
Definition: recordingrule.h:124
FilterOptMixin::m_filtersList
MythUIButtonList * m_filtersList
Definition: scheduleeditor.h:131
StoreOptMixin::MaxEpisodesChanged
void MaxEpisodesChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:2583
RecordingRule::m_recProfile
QString m_recProfile
Definition: recordingrule.h:118
PostProcEditor
Select post-processing options.
Definition: scheduleeditor.h:332
ScheduleEditor::m_metadataButton
MythUIButton * m_metadataButton
Definition: scheduleeditor.h:220
StoreOptMixin::Save
void Save(void)
Definition: scheduleeditor.cpp:2523
RecordingRule::m_tempID
int m_tempID
Definition: recordingrule.h:146
MythErrorNotification
Definition: mythnotification.h:198
StoreOptMixin::RuleChanged
void RuleChanged(void)
Definition: scheduleeditor.cpp:2556
mythtypes.h
kArtworkFanart
@ kArtworkFanart
Definition: metadataimagehelper.h:12
RecordingRule::m_searchType
RecSearchType m_searchType
Definition: recordingrule.h:110
FilterSymbols
@ FilterSymbols
Definition: mythuitextedit.h:25
MythUIComposite::SetTextFromMap
virtual void SetTextFromMap(const InfoMap &infoMap)
Definition: mythuicomposite.cpp:9
ScheduleCommon
Definition: schedulecommon.h:15
MetadataOptions::m_imageLookup
MetadataDownload * m_imageLookup
Definition: scheduleeditor.h:400
RecordingRule::m_type
RecordingType m_type
Definition: recordingrule.h:109
ScheduleEditor::m_player
TV * m_player
Definition: scheduleeditor.h:223
MetadataOptions::GetSupportedImageExtensionFilter
static QStringList GetSupportedImageExtensionFilter()
Definition: scheduleeditor.cpp:1538
ScheduleEditor::RunScheduleEditor
static void * RunScheduleEditor(ProgramInfo *proginfo, void *player=nullptr)
Callback.
Definition: scheduleeditor.cpp:61
RecordingRule::m_subtitle
QString m_subtitle
Definition: recordingrule.h:77
ScheduleEditor::m_loaded
bool m_loaded
Definition: scheduleeditor.h:225
MythUIButtonList::GetDataValue
QVariant GetDataValue() const
Definition: mythuibuttonlist.cpp:1616
RecordingRule::UseTempTable
void UseTempTable(bool usetemp, const QString &table="record_tmp")
Definition: recordingrule.cpp:667
ScheduleEditor::kMetadataView
@ kMetadataView
Definition: scheduleeditor.h:234
ProgramInfo::ToMap
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
Definition: programinfo.cpp:1556
MetadataOptions::m_onlineFanartButton
MythUIButton * m_onlineFanartButton
Definition: scheduleeditor.h:420
PostProcMixin::TranscodeChanged
void TranscodeChanged(bool enable)
Definition: scheduleeditor.cpp:2862
ScheduleEditor::PromptForRecGroup
void PromptForRecGroup(void)
Definition: scheduleeditor.cpp:381
fs5
static QString fs5(QT_TRANSLATE_NOOP("SchedFilterEditor", "High definition"))
PostProcMixin::Save
void Save(void)
Definition: scheduleeditor.cpp:2811
storagegroup.h
MythUIBusyDialog
Definition: mythprogressdialog.h:36
MythUIType::SetEnabled
void SetEnabled(bool enable)
Definition: mythuitype.cpp:1133
fs9
static QString fs9(QT_TRANSLATE_NOOP("SchedFilterEditor", "This day and time"))
MetadataOptions::SelectOnlineBanner
void SelectOnlineBanner()
Definition: scheduleeditor.cpp:1473
MetadataDownload::addLookup
void addLookup(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_lookupList takes ownership of the gi...
Definition: metadatadownload.cpp:39
mythuifilebrowser.h
kNoSearch
@ kNoSearch
Definition: recordingtypes.h:73
RecordingRule::m_filter
unsigned m_filter
Definition: recordingrule.h:113
SchedEditChild::Close
void Close(void) override
Definition: scheduleeditor.cpp:955
SchedEditChild::m_saveButton
MythUIButton * m_saveButton
Definition: scheduleeditor.h:270
SchedEditChild::Load
void Load(void) override=0
ScheduleEditor::templateLoaded
void templateLoaded(void)
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3665
FilterOptMixin::Create
void Create(bool *err)
Definition: scheduleeditor.cpp:2211
PostProcMixin::Load
void Load(void)
Definition: scheduleeditor.cpp:2711
kManualSearch
@ kManualSearch
Definition: recordingtypes.h:78
MetadataOptions
Select artwork and inetref for recordings.
Definition: scheduleeditor.h:350
PostProcMixin::SetRule
void SetRule(RecordingRule *rule)
Definition: scheduleeditor.h:95
uint
unsigned int uint
Definition: compat.h:79
SchedEditChild::m_previewButton
MythUIButton * m_previewButton
Definition: scheduleeditor.h:271
FilterOptMixin::m_screen
MythScreenType * m_screen
Definition: scheduleeditor.h:135
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:61
ScheduleEditor::m_recInfo
RecordingInfo * m_recInfo
Definition: scheduleeditor.h:205
toDescription
QString toDescription(RecordingType rectype)
Converts "rectype" into a human readable description.
Definition: recordingtypes.cpp:50
ScheduleEditor::m_cancelButton
MythUIButton * m_cancelButton
Definition: scheduleeditor.h:211
MetadataFactoryMultiResult
Definition: metadatafactory.h:20
MythUIFileBrowser
Definition: mythuifilebrowser.h:76
StoreOptMixin::m_maxepSpin
MythUISpinBox * m_maxepSpin
Definition: scheduleeditor.h:78
MythScreenType::GetScreenStack
MythScreenStack * GetScreenStack() const
Definition: mythscreentype.cpp:217
RecordingRule::m_maxEpisodes
int m_maxEpisodes
Definition: recordingrule.h:123
kOneRecord
@ kOneRecord
Definition: recordingtypes.h:27
MetadataFactory
Definition: metadatafactory.h:85
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
MetadataLookup::GetSeason
uint GetSeason() const
Definition: metadatacommon.h:314
SchedEditChild::m_backButton
MythUIButton * m_backButton
Definition: scheduleeditor.h:269
MetadataOptions::SelectLocalFanart
void SelectLocalFanart()
Definition: scheduleeditor.cpp:1430
StoreOptMixin
Mixin for storage options.
Definition: scheduleeditor.h:57
MetadataOptions::Create
bool Create(void) override
Definition: scheduleeditor.cpp:1276
SchedOptMixin::RuleChanged
void RuleChanged(void)
Definition: scheduleeditor.cpp:2158
AutoExtendType::MLB
@ MLB
StoreOptEditor::PromptForRecGroup
void PromptForRecGroup(void)
Definition: scheduleeditor.cpp:1148
kUnknownVideo
@ kUnknownVideo
Definition: metadatacommon.h:54
RecordingRule::m_recGroupID
uint m_recGroupID
Definition: recordingrule.h:121
SchedFilterEditor::SchedFilterEditor
SchedFilterEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:1036
fs11
static QString fs11(QT_TRANSLATE_NOOP("SchedFilterEditor", "No episodes"))
MetadataOptions::m_localCoverartButton
MythUIButton * m_localCoverartButton
Definition: scheduleeditor.h:418
ScheduleEditor::ShowNextView
void ShowNextView(void)
Definition: scheduleeditor.cpp:758
mythuispinbox.h
ScheduleEditor::m_storeOptButton
MythUIButton * m_storeOptButton
Definition: scheduleeditor.h:216
ViewScheduleDiff
Definition: viewschedulediff.h:22
mythuihelper.h
kWeeklyRecord
@ kWeeklyRecord
Definition: recordingtypes.h:26
MetadataResultsDialog::haveResult
void haveResult(RefCountHandler< MetadataLookup >)
ScheduleEditor::LoadTemplate
void LoadTemplate(const QString &name)
Definition: scheduleeditor.cpp:330
RecordingRule::m_storageGroup
QString m_storageGroup
Definition: recordingrule.h:119
fs1
static QString fs1(QT_TRANSLATE_NOOP("SchedFilterEditor", "Identifiable episode"))
StoreOptEditor::Load
void Load(void) override
Definition: scheduleeditor.cpp:1137
fs3
static QString fs3(QT_TRANSLATE_NOOP("SchedFilterEditor", "Prime time"))
ProgramInfo::GetEpisode
uint GetEpisode(void) const
Definition: programinfo.h:367
RecordingRule::m_transcoder
int m_transcoder
Definition: recordingrule.h:128
RecordingRule::m_autoUserJob1
bool m_autoUserJob1
Definition: recordingrule.h:131
MetadataFactorySingleResult
Definition: metadatafactory.h:32
StoreOptMixin::m_screen
MythScreenType * m_screen
Definition: scheduleeditor.h:83
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:404
RecordingRule::m_recordID
int m_recordID
Unique Recording Rule ID.
Definition: recordingrule.h:68
MetadataLookupEvent::kEventType
static Type kEventType
Definition: metadatadownload.h:20
MetadataLookup::SetData
void SetData(QVariant data)
Definition: metadatacommon.h:242
MetadataOptions::SelectLocalCoverart
void SelectLocalCoverart()
Definition: scheduleeditor.cpp:1441
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:272
AutoExtendType::ESPN
@ ESPN
ProgramInfo::GetSeason
uint GetSeason(void) const
Definition: programinfo.h:366
mythcorecontext.h
SchedOptMixin::m_loaded
bool m_loaded
Definition: scheduleeditor.h:53
StoreOptEditor::Save
void Save(void) override
Definition: scheduleeditor.cpp:1170
ScheduleEditor::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: scheduleeditor.cpp:523
SchedOptMixin::m_other
SchedOptMixin * m_other
Definition: scheduleeditor.h:52
MetadataOptions::ValuesChanged
void ValuesChanged()
Definition: scheduleeditor.cpp:1677
MetadataLookup::SetAutomatic
void SetAutomatic(bool autom)
Definition: metadatacommon.h:246
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:695
cardutil.h
kOverrideRecord
@ kOverrideRecord
Definition: recordingtypes.h:28
FilterOptMixin::RuleChanged
void RuleChanged(void)
Definition: scheduleeditor.cpp:2309
ImageSearchResultsDialog::haveResult
void haveResult(ArtworkInfo, VideoArtworkType)
RecordingRule::m_dupMethod
RecordingDupMethodType m_dupMethod
Definition: recordingrule.h:111
MetadataLookup::GetInetref
QString GetInetref() const
Definition: metadatacommon.h:356
fs2
static QString fs2(QT_TRANSLATE_NOOP("SchedFilterEditor", "First showing"))
SchedOptMixin::m_dupscopeList
MythUIButtonList * m_dupscopeList
Definition: scheduleeditor.h:43
MetadataOptions::OnSearchListSelection
void OnSearchListSelection(const RefCountHandler< MetadataLookup > &lookup)
Definition: scheduleeditor.cpp:1399
FilterOptMixin::Load
void Load(void)
Definition: scheduleeditor.cpp:2226
StoreOptMixin::Load
void Load(void)
Definition: scheduleeditor.cpp:2378
SchedOptMixin::Create
void Create(bool *err)
Definition: scheduleeditor.cpp:1924
kNotRecording
@ kNotRecording
Definition: recordingtypes.h:21
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:883
kDupCheckNone
@ kDupCheckNone
Definition: recordingtypes.h:60
SchedOptMixin::Load
void Load(void)
Definition: scheduleeditor.cpp:1972
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
StoreOptMixin::PromptForRecGroup
void PromptForRecGroup(void)
Definition: scheduleeditor.cpp:2594
kSingleRecord
@ kSingleRecord
Definition: recordingtypes.h:22
ScheduleEditor::ShowFilters
void ShowFilters(void)
Definition: scheduleeditor.cpp:713
SchedEditChild::m_editor
ScheduleEditor * m_editor
Definition: scheduleeditor.h:265
SchedOptMixin::m_ruleactiveCheck
MythUICheckBox * m_ruleactiveCheck
Definition: scheduleeditor.h:46
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:132
MythUIButtonListItem::state
CheckState state() const
Definition: mythuibuttonlist.cpp:3619
LookupType
LookupType
Definition: metadatacommon.h:50
GetNotificationCenter
MythNotificationCenter * GetNotificationCenter(void)
Definition: mythmainwindow.cpp:122
MythScreenStack::PopScreen
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
Definition: mythscreenstack.cpp:84
ScheduleCommon::ShowUpcoming
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
Definition: schedulecommon.cpp:67
RecordingRule::m_autoExtend
AutoExtendType m_autoExtend
Definition: recordingrule.h:114
PostProcMixin::m_userjob4Check
MythUICheckBox * m_userjob4Check
Definition: scheduleeditor.h:108
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:116
mythuiimageresults.h
SchedOptEditor::SchedOptEditor
SchedOptEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:969
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:102
SchedOptMixin::m_dupmethodList
MythUIButtonList * m_dupmethodList
Definition: scheduleeditor.h:42
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1554
CardUtil::GetSchedInputList
static std::vector< uint > GetSchedInputList(void)
Definition: cardutil.cpp:2761
build_compdb.action
action
Definition: build_compdb.py:9
PostProcMixin::m_other
PostProcMixin * m_other
Definition: scheduleeditor.h:114
kArtworkBanner
@ kArtworkBanner
Definition: metadataimagehelper.h:13
SchedOptEditor
Select schedule options.
Definition: scheduleeditor.h:274
PostProcEditor::Save
void Save(void) override
Definition: scheduleeditor.cpp:1231
SchedFilterEditor::Save
void Save(void) override
Definition: scheduleeditor.cpp:1079
SchedOptMixin
Mixin for schedule options.
Definition: scheduleeditor.h:27
mythuibutton.h
RecordingRule::Delete
bool Delete(bool sendSig=true)
Definition: recordingrule.cpp:501
plRecordid
@ plRecordid
Definition: proglist.h:28
SchedOptMixin::m_inputList
MythUIButtonList * m_inputList
Definition: scheduleeditor.h:45
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:320
StoreOptMixin::m_other
StoreOptMixin * m_other
Definition: scheduleeditor.h:85
DownloadMap
QMap< VideoArtworkType, ArtworkInfo > DownloadMap
Definition: metadatacommon.h:84
MetadataOptions::m_localFanartButton
MythUIButton * m_localFanartButton
Definition: scheduleeditor.h:417
kAllRecord
@ kAllRecord
Definition: recordingtypes.h:25
recordingprofile.h
StoreOptEditor
Select storage options.
Definition: scheduleeditor.h:312
StoreOptMixin::m_recprofileList
MythUIButtonList * m_recprofileList
Definition: scheduleeditor.h:74
MetadataOptions::FindNetArt
void FindNetArt(VideoArtworkType type)
Definition: scheduleeditor.cpp:1603
StoreOptMixin::SetRecGroup
void SetRecGroup(int recgroupID, QString recgroup)
Definition: scheduleeditor.cpp:2616
ScheduleEditor::showUpcomingByTitle
void showUpcomingByTitle(void)
Definition: scheduleeditor.cpp:635
kDupsNewEpi
@ kDupsNewEpi
Definition: recordingtypes.h:48
StoreOptMixin::SetRule
void SetRule(RecordingRule *rule)
Definition: scheduleeditor.h:63
RecordingRule::m_station
QString m_station
Definition: recordingrule.h:96
MythTextInputDialog
Dialog prompting the user to enter a text string.
Definition: mythdialogbox.h:314
MetadataOptions::m_busyPopup
MythUIBusyDialog * m_busyPopup
Definition: scheduleeditor.h:404
MetadataOptions::m_inetrefEdit
MythUITextEdit * m_inetrefEdit
Definition: scheduleeditor.h:410
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:449
ScheduleEditor::m_filtersButton
MythUIButton * m_filtersButton
Definition: scheduleeditor.h:221
mythuicheckbox.h
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:677
FilterOptMixin::ToggleSelected
static void ToggleSelected(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:2322
FilterOptMixin
Mixin for Filters.
Definition: scheduleeditor.h:118
MythUIType::LosingFocus
void LosingFocus()
ScheduleEditor::m_recordingRule
RecordingRule * m_recordingRule
Definition: scheduleeditor.h:206
PostProcMixin::m_transcodeprofileList
MythUIButtonList * m_transcodeprofileList
Definition: scheduleeditor.h:104
RecordingRule::m_recPriority
int m_recPriority
Definition: recordingrule.h:105
SchedOptEditor::Load
void Load(void) override
Definition: scheduleeditor.cpp:1013
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
StoreOptEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:1105
StoreOptMixin::m_loaded
bool m_loaded
Definition: scheduleeditor.h:86
RecordingRule::m_autoUserJob3
bool m_autoUserJob3
Definition: recordingrule.h:133
SchedOptEditor::Save
void Save(void) override
Definition: scheduleeditor.cpp:1019
kProbableMovie
@ kProbableMovie
Definition: metadatacommon.h:53
SchedOptMixin::m_endoffsetSpin
MythUISpinBox * m_endoffsetSpin
Definition: scheduleeditor.h:41
mythmainwindow.h
MythUIButtonListItem::setChecked
void setChecked(CheckState state)
Definition: mythuibuttonlist.cpp:3629
ProgramInfo::GetCategoryType
CategoryType GetCategoryType(void) const
Definition: programinfo.h:438
fs7
static QString fs7(QT_TRANSLATE_NOOP("SchedFilterEditor", "This series"))
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
ScheduleEditor::m_postProcButton
MythUIButton * m_postProcButton
Definition: scheduleeditor.h:217
StoreOptMixin::m_storagegroupList
MythUIButtonList * m_storagegroupList
Definition: scheduleeditor.h:76
ScheduleEditor
Construct a recording schedule.
Definition: scheduleeditor.h:143
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:563
MetadataLookupEvent
Definition: metadatadownload.h:11
RecordingType
RecordingType
Definition: recordingtypes.h:19
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
kDupCheckSubDesc
@ kDupCheckSubDesc
Definition: recordingtypes.h:63
ScheduleEditor::showUpcomingByRule
void showUpcomingByRule(void)
Definition: scheduleeditor.cpp:613
kDontRecord
@ kDontRecord
Definition: recordingtypes.h:29
PostProcEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:1191
ScheduleEditor::m_child
SchedEditChild * m_child
Definition: scheduleeditor.h:238
videoutils.h
RecordingRule::m_autoMetadataLookup
bool m_autoMetadataLookup
Definition: recordingrule.h:135
FilterOptMixin::m_rule
RecordingRule * m_rule
Definition: scheduleeditor.h:136
RecordingRule::m_prefInput
int m_prefInput
Definition: recordingrule.h:106
SchedOptMixin::m_autoExtendList
MythUIButtonList * m_autoExtendList
Definition: scheduleeditor.h:44
ImageDLEvent::kEventType
static Type kEventType
Definition: metadataimagedownload.h:41
ScheduleEditor::kPostProcView
@ kPostProcView
Definition: scheduleeditor.h:233
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:921
ArtworkInfo::url
QString url
Definition: metadataimagehelper.h:25
MythUIButtonListItem::NotChecked
@ NotChecked
Definition: mythuibuttonlist.h:46
MetadataOptions::OnArtworkSearchDone
void OnArtworkSearchDone(MetadataLookup *lookup)
Definition: scheduleeditor.cpp:1618
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:832
SchedFilterEditor::Load
void Load(void) override
Definition: scheduleeditor.cpp:1073
PostProcMixin::Create
void Create(bool *err)
Definition: scheduleeditor.cpp:2668
MetadataDownload::cancel
void cancel()
Definition: metadatadownload.cpp:65
tv_play.h
MetadataImageDownload::addDownloads
void addDownloads(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_downloadList takes ownership of the ...
Definition: metadataimagedownload.cpp:54
MythNotificationCenter::Queue
bool Queue(const MythNotification &notification)
Queue a notification Queue() is thread-safe and can be called from anywhere.
Definition: mythnotificationcenter.cpp:1350
ScheduleEditor::TranscodeChanged
void TranscodeChanged(bool enable)
Definition: scheduleeditor.cpp:386
TV
Control TV playback.
Definition: tv_play.h:154
ScheduleEditor::kFilterView
@ kFilterView
Definition: scheduleeditor.h:231