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
11 #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 //static const QString _Location = QObject::tr("Schedule Editor");
43 
44 // Define the strings inserted into the recordfilter table in the
45 // database. This should make them available to the translators.
46 static QString fs0(QT_TRANSLATE_NOOP("SchedFilterEditor", "New episode"));
47 static QString fs1(QT_TRANSLATE_NOOP("SchedFilterEditor", "Identifiable episode"));
48 static QString fs2(QT_TRANSLATE_NOOP("SchedFilterEditor", "First showing"));
49 static QString fs3(QT_TRANSLATE_NOOP("SchedFilterEditor", "Prime time"));
50 static QString fs4(QT_TRANSLATE_NOOP("SchedFilterEditor", "Commercial free"));
51 static QString fs5(QT_TRANSLATE_NOOP("SchedFilterEditor", "High definition"));
52 static QString fs6(QT_TRANSLATE_NOOP("SchedFilterEditor", "This episode"));
53 static QString fs7(QT_TRANSLATE_NOOP("SchedFilterEditor", "This series"));
54 static QString fs8(QT_TRANSLATE_NOOP("SchedFilterEditor", "This time"));
55 static QString fs9(QT_TRANSLATE_NOOP("SchedFilterEditor", "This day and time"));
56 static QString fs10(QT_TRANSLATE_NOOP("SchedFilterEditor", "This channel"));
57 static QString fs11(QT_TRANSLATE_NOOP("SchedFilterEditor", "No episodes"));
58 
59 void *ScheduleEditor::RunScheduleEditor(ProgramInfo *proginfo, void *player)
60 {
61  auto *rule = new RecordingRule();
62  rule->LoadByProgram(proginfo);
63 
65  auto *se = new ScheduleEditor(mainStack, rule, static_cast<TV*>(player));
66 
67  if (se->Create())
68  mainStack->AddScreen(se, (player == nullptr));
69  else
70  delete se;
71 
72  return nullptr;
73 }
74 
81  RecordingInfo *recInfo, TV *player)
82  : ScheduleCommon(parent, "ScheduleEditor"),
83  SchedOptMixin(*this, nullptr), FilterOptMixin(*this, nullptr),
84  StoreOptMixin(*this, nullptr), PostProcMixin(*this, nullptr),
85  m_recInfo(new RecordingInfo(*recInfo)),
86  m_player(player)
87 {
94 
95  if (m_player)
96  m_player->IncrRef();
97 }
98 
100  RecordingRule *recRule, TV *player)
101  : ScheduleCommon(parent, "ScheduleEditor"),
102  SchedOptMixin(*this, recRule),
103  FilterOptMixin(*this, recRule),
104  StoreOptMixin(*this, recRule),
105  PostProcMixin(*this, recRule),
106  m_recordingRule(recRule),
107  m_player(player)
108 {
109  if (m_player)
110  m_player->IncrRef();
111 }
112 
114 {
115  delete m_recordingRule;
116 
117  // if we have a player, we need to tell we are done
118  if (m_player)
119  {
120  emit m_player->RequestEmbedding(false);
121  m_player->DecrRef();
122  }
123 }
124 
126 {
127  if (!LoadWindowFromXML("schedule-ui.xml", "scheduleeditor", this))
128  return false;
129 
130  bool err = false;
131 
132  UIUtilE::Assign(this, m_rulesList, "rules", &err);
133 
134  UIUtilW::Assign(this, m_schedOptButton, "schedoptions");
135  UIUtilW::Assign(this, m_storeOptButton, "storeoptions");
136  UIUtilW::Assign(this, m_postProcButton, "postprocessing");
137  UIUtilW::Assign(this, m_metadataButton, "metadata");
138  UIUtilW::Assign(this, m_schedInfoButton, "schedinfo");
139  UIUtilW::Assign(this, m_previewButton, "preview");
140  UIUtilW::Assign(this, m_filtersButton, "filters");
141 
142  SchedOptMixin::Create(&err);
144  StoreOptMixin::Create(&err);
145  PostProcMixin::Create(&err);
146 
147  UIUtilW::Assign(this, m_cancelButton, "cancel");
148  UIUtilE::Assign(this, m_saveButton, "save", &err);
149 
150  if (err)
151  {
152  LOG(VB_GENERAL, LOG_ERR, "ScheduleEditor, theme is missing "
153  "required elements");
154  return false;
155  }
156 
159 
160  if (m_schedOptButton)
162  if (m_filtersButton)
164  if (m_storeOptButton)
166  if (m_postProcButton)
168  if (m_schedInfoButton)
170  if (m_previewButton)
172  if (m_metadataButton)
174 
175  if (m_cancelButton)
178 
179  if (m_schedInfoButton)
181  if (m_previewButton)
183 
184  if (m_dupmethodList)
187  if (m_filtersList)
190  if (m_maxepSpin)
193  if (m_recgroupList)
196  if (m_transcodeCheck)
199 
200  BuildFocusList();
201 
202  if (!m_recordingRule->IsLoaded())
203  {
204  if (m_recInfo)
206  else if (m_recordingRule->m_recordID)
208 
209  if (!m_recordingRule->IsLoaded())
210  {
211  LOG(VB_GENERAL, LOG_ERR,
212  "ScheduleEditor::Create() - Failed to load recording rule");
213  return false;
214  }
215  }
216 
217  if (m_player)
218  emit m_player->RequestEmbedding(true);
219 
220  return true;
221 }
222 
224 {
225  if (m_child)
226  m_child->Close();
227 
228  // don't fade the screen if we are returning to the player
229  if (m_player)
230  GetScreenStack()->PopScreen(this, false);
231  else
232  GetScreenStack()->PopScreen(this, true);
233 }
234 
236 {
241 
242  if (!m_loaded)
243  {
244  // Copy this now, it will change briefly after the first item
245  // is inserted into the list by design of
246  // MythUIButtonList::itemSelected()
248 
249  // Rules List
251  {
253  .compare("Default", Qt::CaseInsensitive) != 0)
254  {
256  tr("Delete this recording rule template"),
258  }
262  }
263  else if (m_recordingRule->m_isOverride)
264  {
266  tr("Record this showing with normal options"),
274  }
275  else
276  {
277  bool hasChannel = !m_recordingRule->m_station.isEmpty();
278  bool isManual = (m_recordingRule->m_searchType == kManualSearch);
279 
283  if (hasChannel)
284  {
288  }
289  if (!isManual)
290  {
294  }
295  if (!hasChannel || isManual)
296  {
303  }
304  if (!isManual)
305  {
309  }
310  }
311 
313  }
315 
316  InfoMap progMap;
317 
318  m_recordingRule->ToMap(progMap);
319 
320  if (m_recInfo)
321  m_recInfo->ToMap(progMap);
322 
323  SetTextFromMap(progMap);
324 
325  m_loaded = true;
326 }
327 
328 void ScheduleEditor::LoadTemplate(const QString& name)
329 {
331  Load();
332  emit templateLoaded();
333 }
334 
336 {
337  if (!item)
338  return;
339 
340  m_recordingRule->m_type = static_cast<RecordingType>
341  (item->GetData().toInt());
342 
343  bool isScheduled = (m_recordingRule->m_type != kNotRecording &&
345 
346  if (m_schedOptButton)
347  m_schedOptButton->SetEnabled(isScheduled);
348  if (m_filtersButton)
349  m_filtersButton->SetEnabled(isScheduled);
350  if (m_storeOptButton)
351  m_storeOptButton->SetEnabled(isScheduled);
352  if (m_postProcButton)
353  m_postProcButton->SetEnabled(isScheduled);
354  if (m_metadataButton)
355  m_metadataButton->SetEnabled(isScheduled &&
357 
362 }
363 
365 {
367 }
368 
370 {
372 }
373 
375 {
377 }
378 
380 {
382 }
383 
385 {
387 }
388 
390 {
391  if (m_child)
392  m_child->Close();
393 
395  {
396  int recid = m_recordingRule->m_recordID;
397  DeleteRule();
398  if (recid)
399  emit ruleDeleted(recid);
400  Close();
401  return;
402  }
403 
408  m_recordingRule->Save(true);
410 
411  Close();
412 }
413 
415 {
417 }
418 
420 {
423  return;
424 
425  if (m_child)
426  m_child->Close();
427 
429 
431  auto *schedoptedit = new SchedOptEditor(mainStack, *this,
433  if (!schedoptedit->Create())
434  {
435  delete schedoptedit;
436  return;
437  }
438 
440  m_child = schedoptedit;
441  mainStack->AddScreen(schedoptedit);
442 }
443 
445 {
448  return;
449 
450  if (m_child)
451  m_child->Close();
452 
454 
456  auto *storeoptedit = new StoreOptEditor(mainStack, *this,
458  if (!storeoptedit->Create())
459  {
460  delete storeoptedit;
461  return;
462  }
463 
465  m_child = storeoptedit;
466  mainStack->AddScreen(storeoptedit);
467 }
468 
470 {
473  return;
474 
475  if (m_child)
476  m_child->Close();
477 
479 
481  auto *ppedit = new PostProcEditor(mainStack, *this,
483  if (!ppedit->Create())
484  {
485  delete ppedit;
486  return;
487  }
488 
490  m_child = ppedit;
491  mainStack->AddScreen(ppedit);
492 }
493 
495 {
497  return;
498 
499  QString label = tr("Schedule Information");
500 
501  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
502  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
503 
504  if (menuPopup->Create())
505  {
506  menuPopup->SetReturnEvent(this, "schedinfo");
507 
508  if (m_recInfo)
509  menuPopup->AddButton(tr("Program Details"));
510  menuPopup->AddButton(tr("Upcoming Episodes"));
511  menuPopup->AddButton(tr("Upcoming Recordings"));
513  menuPopup->AddButton(tr("Previously Recorded"));
514 
515  popupStack->AddScreen(menuPopup);
516  }
517  else
518  delete menuPopup;
519 }
520 
521 bool ScheduleEditor::keyPressEvent(QKeyEvent *event)
522 {
523  if (GetFocusWidget()->keyPressEvent(event))
524  return true;
525 
526  QStringList actions;
527  bool handled = GetMythMainWindow()->
528  TranslateKeyPress("TV Frontend", event, actions);
529 
530  for (int i = 0; i < actions.size() && !handled; i++)
531  {
532  QString action = actions[i];
533  handled = true;
534 
535  if (action == "MENU")
536  showMenu();
537  else if (action == "INFO")
538  ShowDetails();
539  else if (action == "GUIDE")
540  ShowGuide();
541  else if (action == "UPCOMING")
543  else if (action == "PREVVIEW")
545  else if (action == "NEXTVIEW")
546  ShowNextView();
547  else
548  handled = false;
549  }
550 
551  if (!handled && MythScreenType::keyPressEvent(event))
552  handled = true;
553 
554  return handled;
555 }
556 
557 void ScheduleEditor::customEvent(QEvent *event)
558 {
559  if (event->type() == DialogCompletionEvent::kEventType)
560  {
561  auto *dce = (DialogCompletionEvent*)(event);
562 
563  QString resultid = dce->GetId();
564  QString resulttext = dce->GetResultText();
565 
566  if (resultid == "menu")
567  {
568  if (resulttext == tr("Main Options"))
569  m_child->Close();
570  if (resulttext == tr("Schedule Options"))
571  ShowSchedOpt();
572  else if (resulttext == tr("Filter Options"))
573  ShowFilters();
574  else if (resulttext == tr("Storage Options"))
575  ShowStoreOpt();
576  else if (resulttext == tr("Post Processing"))
577  ShowPostProc();
578  else if (resulttext == tr("Metadata Options"))
580  else if (resulttext == tr("Use Template"))
582  else if (resulttext == tr("Schedule Info"))
583  ShowSchedInfo();
584  else if (resulttext == tr("Preview Changes"))
585  ShowPreview();
586  }
587  else if (resultid == "templatemenu")
588  {
589  LoadTemplate(resulttext);
590  }
591  else if (resultid == "schedinfo")
592  {
593  if (resulttext == tr("Program Details"))
594  ShowDetails();
595  else if (resulttext == tr("Upcoming Episodes"))
597  else if (resulttext == tr("Upcoming Recordings"))
599  else if (resulttext == tr("Previously Recorded"))
602  }
603  else if (resultid == "newrecgroup")
604  {
605  int groupID = CreateRecordingGroup(resulttext);
606  StoreOptMixin::SetRecGroup(groupID, resulttext);
607  }
608  }
609 }
610 
612 {
614  return;
615 
616  // No rule? Search by title
617  if (m_recordingRule->m_recordID <= 0)
618  {
620  return;
621  }
622 
624  auto *pl = new ProgLister(mainStack, plRecordid,
625  QString::number(m_recordingRule->m_recordID), "");
626 
627  if (pl->Create())
628  mainStack->AddScreen(pl);
629  else
630  delete pl;
631 }
632 
634 {
636  return;
637 
638  // Existing rule and search? Search by rule
639  if (m_recordingRule->m_recordID > 0 &&
642 
643  QString title = m_recordingRule->m_title;
644 
646  title.remove(RecordingInfo::kReSearchTypeName);
647 
649 }
650 
652 {
654  return;
655 
656  if (m_child)
657  {
658  m_child->Save();
659  if (m_view == kSchedOptView)
661  else if (m_view == kStoreOptView)
663  else if (m_view == kPostProcView)
665  }
666 
671 
672  QString ttable = "record_tmp";
673  m_recordingRule->UseTempTable(true, ttable);
674 
676  auto *vsd = new ViewScheduleDiff(mainStack, ttable,
679  if (vsd->Create())
680  mainStack->AddScreen(vsd);
681  else
682  delete vsd;
683 
685 }
686 
688 {
692  return;
693 
694  if (m_child)
695  m_child->Close();
696 
698  auto *rad = new MetadataOptions(mainStack, *this,
700  if (!rad->Create())
701  {
702  delete rad;
703  return;
704  }
705 
707  m_child = rad;
708  mainStack->AddScreen(rad);
709 }
710 
712 {
715  return;
716 
717  if (m_child)
718  m_child->Close();
719 
721 
723  auto *schedfilteredit = new SchedFilterEditor(mainStack, *this,
725  if (!schedfilteredit->Create())
726  {
727  delete schedfilteredit;
728  return;
729  }
730 
732  m_child = schedfilteredit;
733  mainStack->AddScreen(schedfilteredit);
734 }
735 
737 {
740  return;
741 
744  else if ((m_view == kMainView) || (m_view == kMetadataView))
745  ShowPostProc();
746  else if (m_view == kSchedOptView)
747  m_child->Close();
748  else if (m_view == kFilterView)
749  ShowSchedOpt();
750  else if (m_view == kStoreOptView)
751  ShowFilters();
752  else if (m_view == kPostProcView)
753  ShowStoreOpt();
754 }
755 
757 {
760  return;
761 
762  if (m_view == kMainView)
763  ShowSchedOpt();
764  else if (m_view == kSchedOptView)
765  ShowFilters();
766  else if (m_view == kFilterView)
767  ShowStoreOpt();
768  else if (m_view == kStoreOptView)
769  ShowPostProc();
772  else if ((m_view == kPostProcView) || (m_view == kMetadataView))
773  m_child->Close();
774 }
775 
777 {
778  if (m_view == kSchedOptView)
780  else if (m_view == kFilterView)
782  else if (m_view == kStoreOptView)
784  else if (m_view == kPostProcView)
786 
787  m_child = nullptr;
788  m_view = kMainView;
789 }
790 
792 {
793  QString label = tr("Options");
794  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
795  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
796 
798  RecordingType type = static_cast<RecordingType>(item->GetData().toInt());
799  bool isScheduled = (type != kNotRecording && type != kDontRecord);
800 
801  if (menuPopup->Create())
802  {
803  menuPopup->SetReturnEvent(this, "menu");
804  if (m_view != kMainView)
805  menuPopup->AddButton(tr("Main Options"));
806  if (isScheduled && m_view != kSchedOptView)
807  menuPopup->AddButton(tr("Schedule Options"));
808  if (isScheduled && m_view != kFilterView)
809  menuPopup->AddButton(tr("Filter Options"));
810  if (isScheduled && m_view != kStoreOptView)
811  menuPopup->AddButton(tr("Storage Options"));
812  if (isScheduled && m_view != kPostProcView)
813  menuPopup->AddButton(tr("Post Processing"));
814  if (isScheduled && !m_recordingRule->m_isTemplate &&
816  menuPopup->AddButton(tr("Metadata Options"));
818  {
819  menuPopup->AddButton(tr("Schedule Info"));
820  menuPopup->AddButton(tr("Preview Changes"));
821  }
822  menuPopup->AddButton(tr("Use Template"));
823  popupStack->AddScreen(menuPopup);
824  }
825  else
826  {
827  delete menuPopup;
828  }
829 }
830 
832 {
833  QStringList templates = RecordingRule::GetTemplateNames();
834  if (templates.empty())
835  {
836  ShowOkPopup(tr("No templates available"));
837  return;
838  }
839 
840  QString label = tr("Template Options");
841  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
842  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
843 
844  if (menuPopup->Create())
845  {
846  menuPopup->SetReturnEvent(this, "templatemenu");
847  while (!templates.empty())
848  {
849  QString name = templates.front();
850  if (name == "Default")
851  menuPopup->AddButton(tr("Default"));
852  else
853  menuPopup->AddButton(name);
854  templates.pop_front();
855  }
856  popupStack->AddScreen(menuPopup);
857  }
858  else
859  {
860  delete menuPopup;
861  }
862 }
863 
865 
870 SchedEditChild::SchedEditChild(MythScreenStack *parent, const QString &name,
871  ScheduleEditor &editor, RecordingRule &rule,
872  RecordingInfo *recInfo)
873  : MythScreenType(parent, name),
874  m_editor(&editor), m_recordingRule(&rule), m_recInfo(recInfo)
875 {
876 }
877 
878 bool SchedEditChild::keyPressEvent(QKeyEvent *event)
879 {
880  if (GetFocusWidget()->keyPressEvent(event))
881  return true;
882 
883  QStringList actions;
884  bool handled = GetMythMainWindow()->
885  TranslateKeyPress("TV Frontend", event, actions);
886 
887  for (int i = 0; i < actions.size() && !handled; i++)
888  {
889  QString action = actions[i];
890  handled = true;
891 
892  if (action == "MENU")
893  m_editor->showMenu();
894  else if (action == "INFO")
896  else if (action == "UPCOMING")
898  if (action == "ESCAPE")
899  Close();
900  else if (action == "PREVVIEW")
902  else if (action == "NEXTVIEW")
904  else
905  handled = false;
906  }
907 
908  if (!handled && MythScreenType::keyPressEvent(event))
909  handled = true;
910 
911  return handled;
912 }
913 
915  const QString &xmlfile, const QString &winname, bool isTemplate)
916 {
917  if (!LoadWindowFromXML(xmlfile, winname, this))
918  return false;
919 
920  UIUtilW::Assign(this, m_backButton, "back");
921  UIUtilW::Assign(this, m_saveButton, "save");
922  UIUtilW::Assign(this, m_previewButton, "preview");
923 
926 
927  if (m_backButton)
929  if (m_saveButton)
931  if (m_previewButton)
932  {
935  m_previewButton->SetEnabled(!isTemplate);
936  }
937 
938  return true;
939 }
940 
942 {
943  InfoMap progMap;
944 
945  m_recordingRule->ToMap(progMap);
946 
947  if (m_recInfo)
948  m_recInfo->ToMap(progMap);
949 
950  SetTextFromMap(progMap);
951 }
952 
954 {
955  Save();
956  emit Closing();
958 }
959 
961 
968  ScheduleEditor &editor,
969  RecordingRule &rule,
970  RecordingInfo *recInfo)
971  : SchedEditChild(parent, "ScheduleOptionsEditor", editor, rule, recInfo),
972  SchedOptMixin(*this, &rule, &editor)
973 {
974 }
975 
977 {
979  "schedule-ui.xml", "scheduleoptionseditor",
981  {
982  return false;
983  }
984 
985  bool err = false;
986 
987  SchedOptMixin::Create(&err);
988 
989  UIUtilW::Assign(this, m_filtersButton, "filters");
990 
991  if (err)
992  {
993  LOG(VB_GENERAL, LOG_ERR, "SchedOptEditor, theme is missing "
994  "required elements");
995  return false;
996  }
997 
998  if (m_dupmethodList)
1001 
1002  if (m_filtersButton)
1005 
1006  BuildFocusList();
1007 
1008  return true;
1009 }
1010 
1012 {
1014  SetTextFromMaps();
1015 }
1016 
1018 {
1020 }
1021 
1023 {
1025 }
1026 
1028 
1035  ScheduleEditor &editor,
1036  RecordingRule &rule,
1037  RecordingInfo *recInfo)
1038  : SchedEditChild(parent, "ScheduleFilterEditor", editor, rule, recInfo),
1039  FilterOptMixin(*this, &rule, &editor)
1040 {
1041 }
1042 
1044 {
1046  "schedule-ui.xml", "schedulefiltereditor",
1048  {
1049  return false;
1050  }
1051 
1052  bool err = false;
1053 
1054  FilterOptMixin::Create(&err);
1055 
1056  if (err)
1057  {
1058  LOG(VB_GENERAL, LOG_ERR, "SchedFilterEditor, theme is missing "
1059  "required elements");
1060  return false;
1061  }
1062 
1065 
1066  BuildFocusList();
1067 
1068  return true;
1069 }
1070 
1072 {
1074  SetTextFromMaps();
1075 }
1076 
1078 {
1080 }
1081 
1083 {
1085 }
1086 
1088 
1095  ScheduleEditor &editor,
1096  RecordingRule &rule,
1097  RecordingInfo *recInfo)
1098  : SchedEditChild(parent, "StorageOptionsEditor", editor, rule, recInfo),
1099  StoreOptMixin(*this, &rule, &editor)
1100 {
1101 }
1102 
1104 {
1106  "schedule-ui.xml", "storageoptionseditor",
1108  {
1109  return false;
1110  }
1111 
1112  bool err = false;
1113 
1114  StoreOptMixin::Create(&err);
1115 
1116  if (err)
1117  {
1118  LOG(VB_GENERAL, LOG_ERR, "StoreOptEditor, theme is missing "
1119  "required elements");
1120  return false;
1121  }
1122 
1123  if (m_maxepSpin)
1126  if (m_recgroupList)
1129 
1130  BuildFocusList();
1131 
1132  return true;
1133 }
1134 
1136 {
1138  SetTextFromMaps();
1139 }
1140 
1142 {
1144 }
1145 
1147 {
1149 }
1150 
1151 void StoreOptEditor::customEvent(QEvent *event)
1152 {
1153  if (event->type() == DialogCompletionEvent::kEventType)
1154  {
1155  auto *dce = (DialogCompletionEvent*)(event);
1156 
1157  QString resultid = dce->GetId();
1158  QString resulttext = dce->GetResultText();
1159 
1160  if (resultid == "newrecgroup")
1161  {
1162  int groupID = CreateRecordingGroup(resulttext);
1163  StoreOptMixin::SetRecGroup(groupID, resulttext);
1164  }
1165  }
1166 }
1167 
1169 {
1171 }
1172 
1174 
1181  ScheduleEditor &editor,
1182  RecordingRule &rule,
1183  RecordingInfo *recInfo)
1184  : SchedEditChild(parent, "PostProcOptionsEditor", editor, rule, recInfo),
1185  PostProcMixin(*this, &rule, &editor)
1186 {
1187 }
1188 
1190 {
1192  "schedule-ui.xml", "postproceditor",
1194  {
1195  return false;
1196  }
1197 
1198  bool err = false;
1199 
1200  PostProcMixin::Create(&err);
1201 
1202  if (err)
1203  {
1204  LOG(VB_GENERAL, LOG_ERR, "PostProcEditor, theme is missing "
1205  "required elements");
1206  return false;
1207  }
1208 
1209  if (m_transcodeCheck)
1212 
1213  BuildFocusList();
1214 
1215  return true;
1216 }
1217 
1219 {
1221  SetTextFromMaps();
1222 }
1223 
1225 {
1227 }
1228 
1230 {
1232 }
1233 
1235 
1242  ScheduleEditor &editor,
1243  RecordingRule &rule,
1244  RecordingInfo *recInfo)
1245  : SchedEditChild(parent, "MetadataOptions", editor, rule, recInfo)
1246 {
1247  m_popupStack = GetMythMainWindow()->GetStack("popup stack");
1248 
1249  m_metadataFactory = new MetadataFactory(this);
1250  m_imageLookup = new MetadataDownload(this);
1252 
1255 }
1256 
1258 {
1259  if (m_imageLookup)
1260  {
1261  m_imageLookup->cancel();
1262  delete m_imageLookup;
1263  m_imageLookup = nullptr;
1264  }
1265 
1266  if (m_imageDownload)
1267  {
1269  delete m_imageDownload;
1270  m_imageDownload = nullptr;
1271  }
1272 }
1273 
1275 {
1277  "schedule-ui.xml", "metadataoptions",
1279  {
1280  return false;
1281  }
1282 
1283  bool err = false;
1284 
1285  UIUtilE::Assign(this, m_inetrefEdit, "inetref_edit", &err);
1286  UIUtilW::Assign(this, m_inetrefClear, "inetref_clear", &err);
1287  UIUtilE::Assign(this, m_seasonSpin, "season_spinbox", &err);
1288  UIUtilE::Assign(this, m_episodeSpin, "episode_spinbox", &err);
1289  UIUtilE::Assign(this, m_queryButton, "query_button", &err);
1290  UIUtilE::Assign(this, m_localFanartButton, "local_fanart_button", &err);
1291  UIUtilE::Assign(this, m_localCoverartButton, "local_coverart_button", &err);
1292  UIUtilE::Assign(this, m_localBannerButton, "local_banner_button", &err);
1293  UIUtilE::Assign(this, m_onlineFanartButton, "online_fanart_button", &err);
1294  UIUtilE::Assign(this, m_onlineCoverartButton, "online_coverart_button", &err);
1295  UIUtilE::Assign(this, m_onlineBannerButton, "online_banner_button", &err);
1296  UIUtilW::Assign(this, m_fanart, "fanart");
1297  UIUtilW::Assign(this, m_coverart, "coverart");
1298  UIUtilW::Assign(this, m_banner, "banner");
1299 
1300  if (err)
1301  {
1302  LOG(VB_GENERAL, LOG_ERR, "MetadataOptions, theme is missing "
1303  "required elements");
1304  return false;
1305  }
1306 
1323 
1326 
1327  // InetRef
1329 
1330  // Season
1331  m_seasonSpin->SetRange(0,9999,1,5);
1333 
1334  // Episode
1335  m_episodeSpin->SetRange(0,9999,1,10);
1337 
1338  if (m_coverart)
1339  {
1341  m_coverart->Load();
1342  }
1343 
1344  if (m_fanart)
1345  {
1347  m_fanart->Load();
1348  }
1349 
1350  if (m_banner)
1351  {
1353  m_banner->Load();
1354  }
1355 
1356  BuildFocusList();
1357 
1358  return true;
1359 }
1360 
1362 {
1363  SetTextFromMaps();
1364 }
1365 
1366 void MetadataOptions::CreateBusyDialog(const QString& title)
1367 {
1368  if (m_busyPopup)
1369  return;
1370 
1371  const QString& message = title;
1372 
1373  m_busyPopup = new MythUIBusyDialog(message, m_popupStack,
1374  "metaoptsdialog");
1375 
1376  if (m_busyPopup->Create())
1378 }
1379 
1381 {
1382  m_recordingRule->m_inetref.clear();
1384 }
1385 
1387 {
1388  CreateBusyDialog(tr("Trying to manually find this "
1389  "recording online..."));
1390 
1392 
1393  lookup->SetAutomatic(false);
1394  m_metadataFactory->Lookup(lookup);
1395 }
1396 
1398 {
1399  QueryComplete(lookup);
1400 }
1401 
1404 {
1405  QString msg = tr("Downloading selected artwork...");
1406  CreateBusyDialog(msg);
1407 
1408  auto *lookup = new MetadataLookup();
1409 
1410  lookup->SetType(kMetadataVideo);
1411  lookup->SetHost(gCoreContext->GetMasterHostName());
1412  lookup->SetAutomatic(true);
1413  lookup->SetData(QVariant::fromValue<VideoArtworkType>(type));
1414 
1415  DownloadMap downloads;
1416  downloads.insert(type, info);
1417  lookup->SetDownloads(downloads);
1418  lookup->SetAllowOverwrites(true);
1419  lookup->SetTitle(m_recordingRule->m_title);
1420  lookup->SetSubtitle(m_recordingRule->m_subtitle);
1421  lookup->SetInetref(m_inetrefEdit->GetText());
1422  lookup->SetSeason(m_seasonSpin->GetIntValue());
1423  lookup->SetEpisode(m_episodeSpin->GetIntValue());
1424 
1425  m_imageDownload->addDownloads(lookup);
1426 }
1427 
1429 {
1430  if (!CanSetArtwork())
1431  return;
1432 
1433  QString url = generate_file_url("Fanart",
1435  "");
1436  FindImagePopup(url,"",*this, "fanart");
1437 }
1438 
1440 {
1441  if (!CanSetArtwork())
1442  return;
1443 
1444  QString url = generate_file_url("Coverart",
1446  "");
1447  FindImagePopup(url,"",*this, "coverart");
1448 }
1449 
1451 {
1452  if (!CanSetArtwork())
1453  return;
1454 
1455  QString url = generate_file_url("Banners",
1457  "");
1458  FindImagePopup(url,"",*this, "banner");
1459 }
1460 
1462 {
1464 }
1465 
1467 {
1469 }
1470 
1472 {
1474 }
1475 
1477 {
1478  // Season
1479  if (m_seasonSpin)
1481 
1482  // Episode
1483  if (m_episodeSpin)
1485 
1486  // InetRef
1487  if (m_inetrefEdit)
1489 }
1490 
1492 {
1493  if (!lookup)
1494  return;
1495 
1496  // InetRef
1497  m_inetrefEdit->SetText(lookup->GetInetref());
1498 
1499  // Season
1500  m_seasonSpin->SetValue(lookup->GetSeason());
1501 
1502  // Episode
1503  m_episodeSpin->SetValue(lookup->GetEpisode());
1504 
1505  InfoMap metadataMap;
1506  lookup->toMap(metadataMap);
1507  SetTextFromMap(metadataMap);
1508 }
1509 
1511  const QString &prefixAlt,
1512  QObject &inst,
1513  const QString &returnEvent)
1514 {
1515  QString fp;
1516 
1517  if (prefix.startsWith("myth://"))
1518  fp = prefix;
1519  else
1520  fp = prefix.isEmpty() ? prefixAlt : prefix;
1521 
1522  MythScreenStack *popupStack =
1523  GetMythMainWindow()->GetStack("popup stack");
1524 
1525  auto *fb = new MythUIFileBrowser(popupStack, fp);
1526  fb->SetNameFilter(GetSupportedImageExtensionFilter());
1527  if (fb->Create())
1528  {
1529  fb->SetReturnEvent(&inst, returnEvent);
1530  popupStack->AddScreen(fb);
1531  }
1532  else
1533  delete fb;
1534 }
1535 
1537 {
1538  QStringList ret;
1539 
1540  QList<QByteArray> exts = QImageReader::supportedImageFormats();
1541  for (const auto & ext : qAsConst(exts))
1542  {
1543  ret.append(QString("*.").append(ext));
1544  }
1545 
1546  return ret;
1547 }
1548 
1550 {
1551  if (m_inetrefEdit->GetText().isEmpty())
1552  {
1553  ShowOkPopup(tr("You must set a reference number "
1554  "on this rule to set artwork. For items "
1555  "without a metadata source, you can set "
1556  "any unique value."));
1557  return false;
1558  }
1559 
1560  return true;
1561 }
1562 
1564 {
1565  auto *lookup = new MetadataLookup();
1566  lookup->SetStep(kLookupSearch);
1567  lookup->SetType(mtype);
1569 
1570  if (type == kUnknownVideo)
1571  {
1573  (m_seasonSpin->GetIntValue() == 0 &&
1574  m_episodeSpin->GetIntValue() == 0))
1575  {
1576  lookup->SetSubtype(kProbableMovie);
1577  }
1578  else
1579  {
1580  lookup->SetSubtype(kProbableTelevision);
1581  }
1582  }
1583  else
1584  {
1585  // we could determine the type from the inetref
1586  lookup->SetSubtype(type);
1587  }
1588  lookup->SetAllowGeneric(true);
1589  lookup->SetHandleImages(false);
1590  lookup->SetHost(gCoreContext->GetMasterHostName());
1591  lookup->SetTitle(m_recordingRule->m_title);
1592  lookup->SetSubtitle(m_recordingRule->m_subtitle);
1593  lookup->SetInetref(m_inetrefEdit->GetText());
1594  lookup->SetCollectionref(m_inetrefEdit->GetText());
1595  lookup->SetSeason(m_seasonSpin->GetIntValue());
1596  lookup->SetEpisode(m_episodeSpin->GetIntValue());
1597 
1598  return lookup;
1599 }
1600 
1602 {
1603  if (!CanSetArtwork())
1604  return;
1605 
1606  QString msg = tr("Searching for available artwork...");
1607  CreateBusyDialog(msg);
1608 
1610 
1611  lookup->SetAutomatic(true);
1612  lookup->SetData(QVariant::fromValue<VideoArtworkType>(type));
1613  m_imageLookup->addLookup(lookup);
1614 }
1615 
1617 {
1618  if (!lookup)
1619  return;
1620 
1621  if (m_busyPopup)
1622  {
1623  m_busyPopup->Close();
1624  m_busyPopup = nullptr;
1625  }
1626 
1627  auto type = lookup->GetData().value<VideoArtworkType>();
1628  ArtworkList list = lookup->GetArtwork(type);
1629 
1630  if (list.isEmpty())
1631  {
1632  MythWarningNotification n(tr("No image found"), tr("Schedule Editor"));
1634  return;
1635  }
1636 
1637  auto *resultsdialog = new ImageSearchResultsDialog(m_popupStack, list, type);
1638 
1639  connect(resultsdialog, &ImageSearchResultsDialog::haveResult,
1641 
1642  if (resultsdialog->Create())
1643  m_popupStack->AddScreen(resultsdialog);
1644 }
1645 
1647 {
1648  if (!lookup)
1649  return;
1650 
1651  DownloadMap map = lookup->GetDownloads();
1652 
1653  if (map.isEmpty())
1654  return;
1655 
1656  for (DownloadMap::const_iterator i = map.cbegin(); i != map.cend(); ++i)
1657  {
1658  VideoArtworkType type = i.key();
1659  const ArtworkInfo& info = i.value();
1660 
1661  if (type == kArtworkCoverart)
1662  m_artworkMap.replace(kArtworkCoverart, info);
1663  else if (type == kArtworkFanart)
1664  m_artworkMap.replace(kArtworkFanart, info);
1665  else if (type == kArtworkBanner)
1666  m_artworkMap.replace(kArtworkBanner, info);
1667  }
1668 
1671 
1672  ValuesChanged();
1673 }
1674 
1676 {
1679 
1680  if (m_coverart)
1681  {
1683  m_coverart->Load();
1684  }
1685 
1686  if (m_fanart)
1687  {
1689  m_fanart->Load();
1690  }
1691 
1692  if (m_banner)
1693  {
1695  m_banner->Load();
1696  }
1697 }
1698 
1699 void MetadataOptions::customEvent(QEvent *levent)
1700 {
1701  if (levent->type() == MetadataFactoryMultiResult::kEventType)
1702  {
1703  if (m_busyPopup)
1704  {
1705  m_busyPopup->Close();
1706  m_busyPopup = nullptr;
1707  }
1708 
1709  auto *mfmr = dynamic_cast<MetadataFactoryMultiResult*>(levent);
1710  if (!mfmr)
1711  return;
1712 
1713  MetadataLookupList list = mfmr->m_results;
1714 
1715  if (list.count() > 1)
1716  {
1717  int yearindex = -1;
1718 
1719  for (int p = 0; p != list.size(); ++p)
1720  {
1721  if (!m_recordingRule->m_seriesid.isEmpty() &&
1722  m_recordingRule->m_seriesid == (list[p])->GetTMSref())
1723  {
1724  MetadataLookup *lookup = list[p];
1725  QueryComplete(lookup);
1726  return;
1727  }
1728  if (m_recInfo &&
1730  (list[p])->GetYear() != 0 &&
1731  m_recInfo->GetYearOfInitialRelease() == (list[p])->GetYear())
1732  {
1733  if (yearindex > -1)
1734  {
1735  LOG(VB_GENERAL, LOG_INFO, "Multiple results matched on year. No definite "
1736  "match could be found based on year alone.");
1737  yearindex = -2;
1738  }
1739  else if (yearindex == -1)
1740  {
1741  LOG(VB_GENERAL, LOG_INFO, "Matched based on year. ");
1742  yearindex = p;
1743  }
1744  }
1745  }
1746 
1747  if (yearindex > -1)
1748  {
1749  MetadataLookup *lookup = list[yearindex];
1750  QueryComplete(lookup);
1751  return;
1752  }
1753 
1754  LOG(VB_GENERAL, LOG_INFO, "Falling through to selection dialog.");
1755  auto *resultsdialog = new MetadataResultsDialog(m_popupStack, list);
1756 
1757  connect(resultsdialog, &MetadataResultsDialog::haveResult,
1759  Qt::QueuedConnection);
1760 
1761  if (resultsdialog->Create())
1762  m_popupStack->AddScreen(resultsdialog);
1763  }
1764  }
1765  else if (levent->type() == MetadataFactorySingleResult::kEventType)
1766  {
1767  if (m_busyPopup)
1768  {
1769  m_busyPopup->Close();
1770  m_busyPopup = nullptr;
1771  }
1772 
1773  auto *mfsr = dynamic_cast<MetadataFactorySingleResult*>(levent);
1774  if (!mfsr)
1775  return;
1776 
1777  MetadataLookup *lookup = mfsr->m_result;
1778 
1779  if (!lookup)
1780  return;
1781 
1782  QueryComplete(lookup);
1783  }
1784  else if (levent->type() == MetadataFactoryNoResult::kEventType)
1785  {
1786  if (m_busyPopup)
1787  {
1788  m_busyPopup->Close();
1789  m_busyPopup = nullptr;
1790  }
1791 
1792  auto *mfnr = dynamic_cast<MetadataFactoryNoResult*>(levent);
1793  if (!mfnr)
1794  return;
1795 
1796  QString title = tr("No match found for this recording. You can "
1797  "try entering a TVDB/TMDB number, season, and "
1798  "episode manually.");
1799 
1800  auto *okPopup = new MythConfirmationDialog(m_popupStack, title, false);
1801 
1802  if (okPopup->Create())
1803  m_popupStack->AddScreen(okPopup);
1804  }
1805  else if (levent->type() == MetadataLookupEvent::kEventType)
1806  {
1807  if (m_busyPopup)
1808  {
1809  m_busyPopup->Close();
1810  m_busyPopup = nullptr;
1811  }
1812 
1813  auto *lue = (MetadataLookupEvent *)levent;
1814 
1815  MetadataLookupList lul = lue->m_lookupList;
1816 
1817  if (lul.isEmpty())
1818  return;
1819 
1820  if (lul.count() >= 1)
1821  {
1822  OnArtworkSearchDone(lul[0]);
1823  }
1824  }
1825  else if (levent->type() == MetadataLookupFailure::kEventType)
1826  {
1827  if (m_busyPopup)
1828  {
1829  m_busyPopup->Close();
1830  m_busyPopup = nullptr;
1831  }
1832 
1833  auto *luf = (MetadataLookupFailure *)levent;
1834 
1835  MetadataLookupList lul = luf->m_lookupList;
1836 
1837  if (!lul.empty())
1838  {
1839  QString title = tr("This number, season, and episode combination "
1840  "does not appear to be valid (or the site may "
1841  "be down). Check your information and try "
1842  "again.");
1843 
1844  auto *okPopup = new MythConfirmationDialog(m_popupStack, title, false);
1845 
1846  if (okPopup->Create())
1847  m_popupStack->AddScreen(okPopup);
1848  }
1849  }
1850  else if (levent->type() == ImageDLEvent::kEventType)
1851  {
1852  if (m_busyPopup)
1853  {
1854  m_busyPopup->Close();
1855  m_busyPopup = nullptr;
1856  }
1857 
1858  auto *ide = (ImageDLEvent *)levent;
1859 
1860  MetadataLookup *lookup = ide->m_item;
1861 
1862  if (!lookup)
1863  return;
1864 
1865  HandleDownloadedImages(lookup);
1866  }
1867  else if (levent->type() == ImageDLFailureEvent::kEventType)
1868  {
1869  if (m_busyPopup)
1870  {
1871  m_busyPopup->Close();
1872  m_busyPopup = nullptr;
1873  }
1874  MythErrorNotification n(tr("Failed to retrieve image(s)"),
1875  tr("Schedule Editor"),
1876  tr("Check logs"));
1878  }
1879  else if (levent->type() == DialogCompletionEvent::kEventType)
1880  {
1881  auto *dce = (DialogCompletionEvent*)(levent);
1882 
1883  const QString resultid = dce->GetId();
1884  ArtworkInfo info;
1885  info.url = dce->GetResultText();
1886 
1887  if (resultid == "coverart")
1888  {
1889  m_artworkMap.replace(kArtworkCoverart, info);
1890  }
1891  else if (resultid == "fanart")
1892  {
1893  m_artworkMap.replace(kArtworkFanart, info);
1894  }
1895  else if (resultid == "banner")
1896  {
1897  m_artworkMap.replace(kArtworkBanner, info);
1898  }
1899 
1902 
1903  ValuesChanged();
1904  }
1905 
1906 }
1907 
1909 
1916  SchedOptMixin *other)
1917  : m_screen(&screen), m_rule(rule), m_other(other),
1918  m_haveRepeats(gCoreContext->GetBoolSetting("HaveRepeats", false))
1919 {
1920 }
1921 
1922 void SchedOptMixin::Create(bool *err)
1923 {
1924  if (!m_rule)
1925  return;
1926 
1927  if (m_other && !m_other->m_prioritySpin)
1928  UIUtilE::Assign(m_screen, m_prioritySpin, "priority", err);
1929  else
1930  UIUtilW::Assign(m_screen, m_prioritySpin, "priority");
1931 
1933  UIUtilE::Assign(m_screen, m_startoffsetSpin, "startoffset", err);
1934  else
1935  UIUtilW::Assign(m_screen, m_startoffsetSpin, "startoffset");
1936 
1937  if (m_other && !m_other->m_endoffsetSpin)
1938  UIUtilE::Assign(m_screen, m_endoffsetSpin, "endoffset", err);
1939  else
1940  UIUtilW::Assign(m_screen, m_endoffsetSpin, "endoffset");
1941 
1942  if (m_other && !m_other->m_dupmethodList)
1943  UIUtilE::Assign(m_screen, m_dupmethodList, "dupmethod", err);
1944  else
1945  UIUtilW::Assign(m_screen, m_dupmethodList, "dupmethod");
1946 
1947  if (m_other && !m_other->m_dupscopeList)
1948  UIUtilE::Assign(m_screen, m_dupscopeList, "dupscope", err);
1949  else
1950  UIUtilW::Assign(m_screen, m_dupscopeList, "dupscope");
1951 
1952  if (m_other && !m_other->m_autoExtendList)
1953  UIUtilE::Assign(m_screen, m_autoExtendList, "autoextend", err);
1954  else
1955  UIUtilW::Assign(m_screen, m_autoExtendList, "autoextend");
1956 
1957  if (m_other && !m_other->m_inputList)
1958  UIUtilE::Assign(m_screen, m_inputList, "input", err);
1959  else
1961 
1963  UIUtilE::Assign(m_screen, m_ruleactiveCheck, "ruleactive", err);
1964  else
1965  UIUtilW::Assign(m_screen, m_ruleactiveCheck, "ruleactive");
1966 
1967  UIUtilW::Assign(m_screen, m_newrepeatList, "newrepeat");
1968 }
1969 
1971 {
1972  if (!m_rule)
1973  return;
1974 
1975  // Priority
1976  if (m_prioritySpin)
1977  {
1978  if (!m_loaded)
1979  m_prioritySpin->SetRange(-99,99,1,5);
1981  }
1982 
1983  // Start Offset
1984  if (m_startoffsetSpin)
1985  {
1986  if (!m_loaded)
1987  m_startoffsetSpin->SetRange(480,-480,1,10);
1989  }
1990 
1991  // End Offset
1992  if (m_endoffsetSpin)
1993  {
1994  if (!m_loaded)
1995  m_endoffsetSpin->SetRange(-480,480,1,10);
1997  }
1998 
1999  // Duplicate Match Type
2000  if (m_dupmethodList)
2001  {
2002  if (!m_loaded)
2003  {
2005 
2021 
2022  m_rule->m_dupMethod = dupMethod;
2023  }
2025  }
2026 
2027  // Duplicate Matching Scope
2028  if (m_dupscopeList)
2029  {
2030  if (!m_loaded)
2031  {
2041  if (m_haveRepeats && !m_newrepeatList &&
2043  {
2044  int value = static_cast<int>(kDupsNewEpi|kDupsInAll);
2047  QVariant::fromValue(value));
2048  }
2049  }
2051  }
2052 
2053  // Auto Extend Services
2054  if (m_autoExtendList)
2055  {
2056  if (!m_loaded)
2057  {
2067  }
2069  }
2070 
2071  // Preferred Input
2072  if (m_inputList)
2073  {
2074  if (!m_loaded)
2075  {
2077  QObject::tr("Use any available input"),
2078  QVariant::fromValue(0));
2079 
2080  std::vector<uint> inputids = CardUtil::GetSchedInputList();
2081  for (uint id : inputids)
2082  {
2084  QObject::tr("Prefer input %1")
2085  .arg(CardUtil::GetDisplayName(id)), id);
2086  }
2087  }
2089  }
2090 
2091  // Active/Disabled
2092  if (m_ruleactiveCheck)
2093  {
2095  }
2096 
2097  // Record new and repeat
2098  if (m_newrepeatList)
2099  {
2100  if (!m_loaded)
2101  {
2103  QObject::tr("Record new and repeat "
2104  "episodes"), toVariant(kDupsUnset));
2106  QObject::tr("Record new episodes only"),
2108  }
2109  RecordingDupInType value =
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:152
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:1257
MythUIButton::Clicked
void Clicked()
ScheduleEditor::m_view
int m_view
Definition: scheduleeditor.h:237
scheduleeditor.h
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:67
mythuimetadataresults.h
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:128
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:132
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:235
MetadataOptions::CanSetArtwork
bool CanSetArtwork(void)
Definition: scheduleeditor.cpp:1549
SchedOptEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:976
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:1402
RecordingRule::m_playGroup
QString m_playGroup
Definition: recordingrule.h:122
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:1510
RecordingRule::m_seriesid
QString m_seriesid
Definition: recordingrule.h:84
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1587
RefCountHandler
Definition: referencecounterlist.h:17
MythCoreContext::GetMasterHostName
QString GetMasterHostName(void)
Definition: mythcorecontext.cpp:805
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:1835
MythUIButtonList::SetValueByData
void SetValueByData(const QVariant &data)
Definition: mythuibuttonlist.cpp:1539
mythuitext.h
ScheduleEditor::Close
void Close(void) override
Definition: scheduleeditor.cpp:223
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:131
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:87
MetadataOptions::SelectOnlineFanart
void SelectOnlineFanart()
Definition: scheduleeditor.cpp:1461
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:1563
ScheduleEditor::customEvent
void customEvent(QEvent *event) override
Definition: scheduleeditor.cpp:557
RecordingRule::m_maxNewest
bool m_maxNewest
Definition: recordingrule.h:127
fs6
static QString fs6(QT_TRANSLATE_NOOP("SchedFilterEditor", "This episode"))
SchedOptEditor::DupMethodChanged
void DupMethodChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:1022
MetadataOptions::ClearInetref
void ClearInetref()
Definition: scheduleeditor.cpp:1380
MetadataType
MetadataType
Definition: metadatacommon.h:42
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:89
RecordingRule::m_category
QString m_category
Definition: recordingrule.h:82
RecordingRule::Save
bool Save(bool sendSig=true)
Definition: recordingrule.cpp:388
MetadataOptions::customEvent
void customEvent(QEvent *event) override
Definition: scheduleeditor.cpp:1699
SchedEditChild::SetTextFromMaps
void SetTextFromMaps(void)
Definition: scheduleeditor.cpp:941
PostProcMixin::m_userjob3Check
MythUICheckBox * m_userjob3Check
Definition: scheduleeditor.h:107
SchedOptMixin::SchedOptMixin
SchedOptMixin(MythScreenType &screen, RecordingRule *rule, SchedOptMixin *other=nullptr)
Definition: scheduleeditor.cpp:1915
StoreOptEditor::MaxEpisodesChanged
void MaxEpisodesChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:1141
MetadataOptions::QueryComplete
void QueryComplete(MetadataLookup *lookup)
Definition: scheduleeditor.cpp:1491
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:125
StoreOptMixin::m_rule
RecordingRule * m_rule
Definition: scheduleeditor.h:84
MetadataResultsDialog
Definition: mythuimetadataresults.h:10
kDailyRecord
@ kDailyRecord
Definition: recordingtypes.h:24
kDupCheckSubThenDesc
@ kDupCheckSubThenDesc
Definition: recordingtypes.h:69
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:374
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:1450
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:1043
StoreOptEditor::customEvent
void customEvent(QEvent *event) override
Definition: scheduleeditor.cpp:1151
ScheduleEditor::Save
void Save(void)
Definition: scheduleeditor.cpp:389
ScheduleEditor::ScheduleEditor
ScheduleEditor(MythScreenStack *parent, RecordingInfo *recinfo, TV *player=nullptr)
Definition: scheduleeditor.cpp:80
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:66
ScheduleEditor::~ScheduleEditor
~ScheduleEditor() override
Definition: scheduleeditor.cpp:113
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:550
kProbableTelevision
@ kProbableTelevision
Definition: metadatacommon.h:51
ScheduleEditor::DupMethodChanged
void DupMethodChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:364
SchedEditChild::SchedEditChild
SchedEditChild(MythScreenStack *parent, const QString &name, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:870
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:77
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:831
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:205
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:736
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:357
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:62
RecordingRule::m_endOffset
int m_endOffset
Definition: recordingrule.h:110
PostProcEditor::TranscodeChanged
void TranscodeChanged(bool enable)
Definition: scheduleeditor.cpp:1224
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:469
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:39
playgroup.h
PostProcEditor::Load
void Load(void) override
Definition: scheduleeditor.cpp:1218
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:1082
RecordingRule::IsLoaded
bool IsLoaded() const
Definition: recordingrule.h:55
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:1241
MetadataOptions::Load
void Load(void) override
Definition: scheduleeditor.cpp:1361
recordingtypes.h
RecordingRule::m_dupIn
RecordingDupInType m_dupIn
Definition: recordingrule.h:114
AutoExtendType
AutoExtendType
Definition: recordingtypes.h:93
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:74
ScheduleEditor::DeleteRule
void DeleteRule(void)
Definition: scheduleeditor.cpp:414
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:1646
RecordingRule::m_season
uint m_season
Definition: recordingrule.h:94
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:776
mythprogressdialog.h
kDupsInAll
@ kDupsInAll
Definition: recordingtypes.h:50
MetadataLookup::toMap
void toMap(InfoMap &map)
Definition: metadatacommon.cpp:347
ScheduleEditor::ShowStoreOpt
void ShowStoreOpt(void)
Definition: scheduleeditor.cpp:444
MetadataOptions::Save
void Save(void) override
Definition: scheduleeditor.cpp:1476
ScheduleEditor::ShowMetadataOptions
void ShowMetadataOptions(void)
Definition: scheduleeditor.cpp:687
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:1180
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:494
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:48
MetadataOptions::PerformQuery
void PerformQuery()
Definition: scheduleeditor.cpp:1386
SchedEditChild::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: scheduleeditor.cpp:878
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:109
MetadataOptions::CreateBusyDialog
void CreateBusyDialog(const QString &title)
Definition: scheduleeditor.cpp:1366
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:45
RecordingRule::GetTemplateNames
static QStringList GetTemplateNames(void)
Definition: recordingrule.cpp:831
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:156
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:651
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:95
ScheduleEditor::FilterChanged
static void FilterChanged(MythUIButtonListItem *item)
Definition: scheduleeditor.cpp:369
MetadataOptions::SelectOnlineCoverart
void SelectOnlineCoverart()
Definition: scheduleeditor.cpp:1466
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:419
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:136
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:914
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:33
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:134
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:49
StoreOptEditor::StoreOptEditor
StoreOptEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:1094
fs8
static QString fs8(QT_TRANSLATE_NOOP("SchedFilterEditor", "This time"))
ScheduleEditor::showMenu
void showMenu(void)
Definition: scheduleeditor.cpp:791
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:126
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:120
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:148
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:112
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:111
ScheduleEditor::m_player
TV * m_player
Definition: scheduleeditor.h:223
MetadataOptions::GetSupportedImageExtensionFilter
static QStringList GetSupportedImageExtensionFilter()
Definition: scheduleeditor.cpp:1536
ScheduleEditor::RunScheduleEditor
static void * RunScheduleEditor(ProgramInfo *proginfo, void *player=nullptr)
Callback.
Definition: scheduleeditor.cpp:59
RecordingRule::m_subtitle
QString m_subtitle
Definition: recordingrule.h:79
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:673
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:1542
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:379
toVariant
static QVariant toVariant(RecordingType rectype)
Definition: recordingtypes.h:40
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:1131
fs9
static QString fs9(QT_TRANSLATE_NOOP("SchedFilterEditor", "This day and time"))
MetadataOptions::SelectOnlineBanner
void SelectOnlineBanner()
Definition: scheduleeditor.cpp:1471
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:80
RecordingRule::m_filter
unsigned m_filter
Definition: recordingrule.h:115
SchedEditChild::Close
void Close(void) override
Definition: scheduleeditor.cpp:953
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:85
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:54
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:125
kOneRecord
@ kOneRecord
Definition: recordingtypes.h:28
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:1428
StoreOptMixin
Mixin for storage options.
Definition: scheduleeditor.h:57
MetadataOptions::Create
bool Create(void) override
Definition: scheduleeditor.cpp:1274
SchedOptMixin::RuleChanged
void RuleChanged(void)
Definition: scheduleeditor.cpp:2158
AutoExtendType::MLB
@ MLB
StoreOptEditor::PromptForRecGroup
void PromptForRecGroup(void)
Definition: scheduleeditor.cpp:1146
kUnknownVideo
@ kUnknownVideo
Definition: metadatacommon.h:54
RecordingRule::m_recGroupID
uint m_recGroupID
Definition: recordingrule.h:123
SchedFilterEditor::SchedFilterEditor
SchedFilterEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
Definition: scheduleeditor.cpp:1034
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:756
mythuispinbox.h
ScheduleEditor::m_storeOptButton
MythUIButton * m_storeOptButton
Definition: scheduleeditor.h:216
ViewScheduleDiff
Definition: viewschedulediff.h:22
mythuihelper.h
kWeeklyRecord
@ kWeeklyRecord
Definition: recordingtypes.h:27
MetadataResultsDialog::haveResult
void haveResult(RefCountHandler< MetadataLookup >)
ScheduleEditor::LoadTemplate
void LoadTemplate(const QString &name)
Definition: scheduleeditor.cpp:328
RecordingRule::m_storageGroup
QString m_storageGroup
Definition: recordingrule.h:121
fs1
static QString fs1(QT_TRANSLATE_NOOP("SchedFilterEditor", "Identifiable episode"))
StoreOptEditor::Load
void Load(void) override
Definition: scheduleeditor.cpp:1135
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:130
RecordingRule::m_autoUserJob1
bool m_autoUserJob1
Definition: recordingrule.h:133
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
RecordingRule::LoadTemplate
bool LoadTemplate(const QString &title, const QString &category="Default", const QString &categoryType="Default")
Definition: recordingrule.cpp:274
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:70
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:1439
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:1168
ScheduleEditor::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: scheduleeditor.cpp:521
SchedOptMixin::m_other
SchedOptMixin * m_other
Definition: scheduleeditor.h:52
MetadataOptions::ValuesChanged
void ValuesChanged()
Definition: scheduleeditor.cpp:1675
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:29
FilterOptMixin::RuleChanged
void RuleChanged(void)
Definition: scheduleeditor.cpp:2309
ImageSearchResultsDialog::haveResult
void haveResult(ArtworkInfo, VideoArtworkType)
RecordingRule::m_dupMethod
RecordingDupMethodType m_dupMethod
Definition: recordingrule.h:113
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:1397
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:1922
kNotRecording
@ kNotRecording
Definition: recordingtypes.h:22
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:883
kDupCheckNone
@ kDupCheckNone
Definition: recordingtypes.h:65
SchedOptMixin::Load
void Load(void)
Definition: scheduleeditor.cpp:1970
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:23
ScheduleEditor::ShowFilters
void ShowFilters(void)
Definition: scheduleeditor.cpp:711
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:116
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:967
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:2877
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:1229
SchedFilterEditor::Save
void Save(void) override
Definition: scheduleeditor.cpp:1077
SchedOptMixin
Mixin for schedule options.
Definition: scheduleeditor.h:27
mythuibutton.h
RecordingRule::Delete
bool Delete(bool sendSig=true)
Definition: recordingrule.cpp:507
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:26
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:1601
StoreOptMixin::SetRecGroup
void SetRecGroup(int recgroupID, QString recgroup)
Definition: scheduleeditor.cpp:2616
ScheduleEditor::showUpcomingByTitle
void showUpcomingByTitle(void)
Definition: scheduleeditor.cpp:633
kDupsNewEpi
@ kDupsNewEpi
Definition: recordingtypes.h:51
StoreOptMixin::SetRule
void SetRule(RecordingRule *rule)
Definition: scheduleeditor.h:63
RecordingRule::m_station
QString m_station
Definition: recordingrule.h:98
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:107
SchedOptEditor::Load
void Load(void) override
Definition: scheduleeditor.cpp:1011
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
StoreOptEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:1103
StoreOptMixin::m_loaded
bool m_loaded
Definition: scheduleeditor.h:86
RecordingRule::m_autoUserJob3
bool m_autoUserJob3
Definition: recordingrule.h:135
SchedOptEditor::Save
void Save(void) override
Definition: scheduleeditor.cpp:1017
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:20
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
kDupCheckSubDesc
@ kDupCheckSubDesc
Definition: recordingtypes.h:68
ScheduleEditor::showUpcomingByRule
void showUpcomingByRule(void)
Definition: scheduleeditor.cpp:611
kDontRecord
@ kDontRecord
Definition: recordingtypes.h:30
PostProcEditor::Create
bool Create(void) override
Definition: scheduleeditor.cpp:1189
ScheduleEditor::m_child
SchedEditChild * m_child
Definition: scheduleeditor.h:238
videoutils.h
RecordingRule::m_autoMetadataLookup
bool m_autoMetadataLookup
Definition: recordingrule.h:137
kDupsUnset
@ kDupsUnset
Definition: recordingtypes.h:47
FilterOptMixin::m_rule
RecordingRule * m_rule
Definition: scheduleeditor.h:136
RecordingRule::m_prefInput
int m_prefInput
Definition: recordingrule.h:108
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:896
ArtworkInfo::url
QString url
Definition: metadataimagehelper.h:25
MythUIButtonListItem::NotChecked
@ NotChecked
Definition: mythuibuttonlist.h:46
MetadataOptions::OnArtworkSearchDone
void OnArtworkSearchDone(MetadataLookup *lookup)
Definition: scheduleeditor.cpp:1616
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:1071
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:1349
ScheduleEditor::TranscodeChanged
void TranscodeChanged(bool enable)
Definition: scheduleeditor.cpp:384
TV
Control TV playback.
Definition: tv_play.h:154
ScheduleEditor::kFilterView
@ kFilterView
Definition: scheduleeditor.h:231