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