Go to the documentation of this file.
2 #include <QCoreApplication>
34 auto *details_dialog =
new ProgDetails(mainStack, pginfo);
36 if (!details_dialog->Create())
38 delete details_dialog;
49 const QString &seriesid)
123 QString::number(pginfo->
GetChanID()),
"",
192 if (schededit->Create())
228 if (!recrule->LoadByProgram(recinfo))
229 LOG(VB_GENERAL, LOG_ERR,
"Failed to load by program info");
231 if (!recrule->MakeOverride())
233 LOG(VB_GENERAL, LOG_ERR,
"Failed to make Override");
241 if (schededit->Create())
286 QString message = QString(
"%1 - %2 %3\n")
296 QString messageConflict;
304 for (
auto *
p : *confList)
306 if (sourceid ==
p->GetSourceID())
308 messageConflict += QString(
"%1 - %2 %3\n")
309 .arg(
p->GetRecordingStartTime().toLocalTime().toString(timeFormat),
310 p->GetRecordingEndTime().toLocalTime().toString(timeFormat),
318 if (!messageConflict.isEmpty())
321 message += tr(
"The following programs will be recorded instead:");
323 message += messageConflict;
328 auto *menuPopup =
new MythDialogBox(message, popupStack,
"recOptionPopup",
true);
330 if (!menuPopup->Create())
335 menuPopup->SetReturnEvent(
this,
"editrecording");
340 menuPopup->AddButton(tr(
"Watch This Channel"));
345 menuPopup->AddButtonV(tr(
"Record this showing"),
346 QVariant::fromValue(recinfo));
347 menuPopup->AddButtonV(tr(
"Record all showings"),
348 QVariant::fromValue(recinfo));
353 menuPopup->AddButtonV(tr(
"Record one showing"),
354 QVariant::fromValue(recinfo));
358 menuPopup->AddButtonV(tr(
"Record one showing (this episode)"),
359 QVariant::fromValue(recinfo));
363 menuPopup->AddButtonV(tr(
"Record all showings (this channel)"),
364 QVariant::fromValue(recinfo));
365 menuPopup->AddButtonV(tr(
"Edit recording rule"),
366 QVariant::fromValue(recinfo));
374 menuPopup->AddButtonV(tr(
"Stop this recording"),
375 QVariant::fromValue(recinfo));
376 menuPopup->AddButtonV(tr(
"Modify recording options"),
377 QVariant::fromValue(recinfo));
386 menuPopup->AddButtonV(tr(
"Restart this recording"),
387 QVariant::fromValue(recinfo));
403 menuPopup->AddButtonV(tr(
"Record this showing"),
404 QVariant::fromValue(recinfo));
409 menuPopup->AddButtonV(tr(
"Forget previous recording"),
410 QVariant::fromValue(recinfo));
426 menuPopup->AddButtonV(tr(
"Don't record this showing"),
427 QVariant::fromValue(recinfo));
431 static const QRegularExpression kGenericEpisodeRE {
"0000$" };
449 menuPopup->AddButtonV(tr(
"Never record this episode"),
450 QVariant::fromValue(recinfo));
457 menuPopup->AddButtonV(tr(
"Edit override rule"),
458 QVariant::fromValue(recinfo));
459 menuPopup->AddButtonV(tr(
"Delete override rule"),
460 QVariant::fromValue(recinfo));
466 menuPopup->AddButtonV(tr(
"Add override rule"),
467 QVariant::fromValue(recinfo));
468 menuPopup->AddButtonV(tr(
"Edit recording rule"),
469 QVariant::fromValue(recinfo));
470 menuPopup->AddButtonV(tr(
"Delete recording rule"),
471 QVariant::fromValue(recinfo));
489 QString resultid = dce->GetId();
490 QString resulttext = dce->GetResultText();
492 if (resultid ==
"editrecording")
499 if (resulttext == tr(
"Record this showing"))
507 recInfo.ReactivateRecording();
510 else if (resulttext == tr(
"Record all showings"))
514 else if (resulttext == tr(
"Record one showing (this episode)") ||
515 resulttext == tr(
"Record one showing"))
517 recInfo.ApplyRecordStateChange(
kOneRecord,
false);
518 recInfo.GetRecordingRule()->m_filter |= 64;
519 recInfo.GetRecordingRule()->Save();
521 else if (resulttext == tr(
"Record all showings (this channel)"))
523 recInfo.ApplyRecordStateChange(
kAllRecord,
false);
524 recInfo.GetRecordingRule()->m_filter |= 1024;
525 recInfo.GetRecordingRule()->Save();
527 else if (resulttext == tr(
"Stop this recording"))
531 else if (resulttext == tr(
"Modify recording options") ||
532 resulttext == tr(
"Add override rule"))
541 else if (resulttext == tr(
"Restart this recording"))
543 recInfo.ReactivateRecording();
545 else if (resulttext == tr(
"Forget previous recording"))
547 recInfo.ForgetHistory();
549 else if (resulttext == tr(
"Don't record this showing"))
553 else if (resulttext == tr(
"Never record this episode"))
555 recInfo.ApplyNeverRecord();
557 else if (resulttext == tr(
"Edit recording rule") ||
558 resulttext == tr(
"Edit override rule"))
562 else if (resulttext == tr(
"Delete recording rule") ||
563 resulttext == tr(
"Delete override rule"))
MythScreenStack * GetMainStack()
static void RunProgramGuide(uint startChanId, const QString &startChanNum, const QDateTime &startTime, TV *player=nullptr, bool embedVideo=false, bool allowFinder=true, int changrpid=-1)
void ApplyRecordStateChange(RecordingType newstate, bool save=true)
Sets RecordingType of "record", creating "record" if it does not exist.
void customEvent(QEvent *event) override
Holds information on a TV Program one might wish to record.
virtual void ShowUpcomingScheduled(void) const
Show the upcoming recordings for this recording rule.
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
Internal representation of a recording rule, mirrors the record table.
virtual void ShowGuide(void) const
Show the program guide.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
virtual void ShowDetails(void) const
Show the Program Details screen.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
virtual void EditRecording(bool may_watch_now=false)
Creates a dialog for editing the recording status, blocking until user leaves dialog.
virtual void EditScheduled(void)
Creates a dialog for editing the recording schedule.
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
virtual void EditCustom(void)
Creates a dialog for creating a custom recording rule.
RecStatus::Type GetRecordingStatus(void) const
bool RemoteStopRecording(uint inputid)
static bool IsFindApplicable(const RecordingInfo &recInfo)
Returns true if a search should be employed to find a matching program.
static QString toDescription(Type recstatus, RecordingType rectype, const QDateTime &recstartts)
Converts "recstatus" into a long human readable description.
Basic menu dialog, message and a list of options.
QString GetTitle(void) const
QString GetDescription(void) const
virtual ProgramInfo * GetCurrentProgram(void) const
void QuickRecord(void)
Create a kSingleRecord if not already scheduled.
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
uint GetFindID(void) const
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QString GetSeriesID(void) const
A screen to create a fully custom recording.
RecordingDupMethodType GetDuplicateCheckMethod(void) const
What should be compared to determine if two programs are the same?
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
RecordingType GetRecordingRuleType(void) const
Holds information on recordings and videos.
static uint GetSourceIDForChannel(uint chanid)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
static const Type kEventType
virtual void QuickRecord(void)
Create a kSingleRecord or bring up recording dialog.
MythMainWindow * GetMythMainWindow(void)
static void MakeOverride(RecordingInfo *recinfo)
Creates a dialog for editing an override recording schedule.
std::vector< ProgramInfo * > * RemoteGetConflictList(const ProgramInfo *pginfo)
MythScreenStack * GetStack(const QString &Stackname)
virtual void ShowChannelSearch(void) const
Show the channel search.
QString GetProgramID(void) const
uint GetRecordingRuleID(void) const
CategoryType GetCategoryType(void) const
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
bool IsGeneric(void) const
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Construct a recording schedule.
QString GetSetting(const QString &key, const QString &defaultval="")
QString GetSubtitle(void) const