Go to the documentation of this file.
5 #include <QCoreApplication>
31 auto *vsb =
new ViewScheduled(mainStack,
static_cast<TV*
>(player), showTV);
34 mainStack->
AddScreen(vsb, (player ==
nullptr));
75 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
85 "shortstarttimedate|channel|titlesubtitle|card");
150 for (
int i = 0; i < actions.size() && !handled; i++)
152 const QString&
action = actions[i];
157 else if (
action ==
"CUSTOMEDIT")
159 else if (
action ==
"DELETE")
161 else if (
action ==
"UPCOMING")
163 else if (
action ==
"VIEWSCHEDULED")
165 else if (
action ==
"PREVRECORDED")
169 else if (
action ==
"GUIDE")
179 else if (
action ==
"VIEWINPUT")
198 QString label = tr(
"Options");
201 auto *menuPopup =
new MythDialogBox(label, popupStack,
"menuPopup");
203 if (menuPopup->Create())
205 menuPopup->SetReturnEvent(
this,
"menu");
208 menuPopup->AddButton(tr(
"Show Important"));
210 menuPopup->AddButton(tr(
"Show All"));
211 menuPopup->AddButton(tr(
"Program Details"));
212 menuPopup->AddButton(tr(
"Program Guide"));
213 menuPopup->AddButton(tr(
"Channel Search"));
214 menuPopup->AddButton(tr(
"Upcoming by title"));
215 menuPopup->AddButton(tr(
"Upcoming scheduled"));
216 menuPopup->AddButton(tr(
"Previously Recorded"));
217 menuPopup->AddButton(tr(
"Custom Edit"));
218 menuPopup->AddButton(tr(
"Delete Rule"));
219 menuPopup->AddButton(tr(
"Show Inputs"));
240 QDateTime recstartts;
249 startts = currentpginfo->GetScheduledStartTime();
250 recstartts = currentpginfo->GetRecordingStartTime();
256 QMap<int, int> toomanycounts;
264 if (!useExistingData)
274 if (pginfo ==
nullptr)
319 QMap<QDate,ProgramList>::iterator dateit =
m_recgroupList.begin();
322 if (dateit.key().isNull())
329 QVariant::fromValue(dateit.key()));
345 if (!callsign.isEmpty())
349 int listPos = ((int) plist.
size()) - 1;
350 for (
int i = listPos; i >= 0; --i)
353 if (pginfo ==
nullptr)
361 if (recstartts <= pginfo->GetRecordingStartTime())
377 auto group = item->
GetData().value<QDate>();
427 pginfo->
ToMap(infoMap);
457 auto pit = plist.
begin();
458 while (pit != plist.
end())
464 QVariant::fromValue(pginfo));
476 for (
auto & conflict : plist)
481 .toLocalTime().date();
488 QString cstring = tr(
"Conflict %1")
496 statusText->
SetText(tr(
"No Conflicts"));
504 filterText->
SetText(tr(
"All"));
506 filterText->
SetText(tr(
"Important"));
522 pginfo->
ToMap(infoMap);
531 QString
rating = QString::number(pginfo->GetStars(10));
549 if (!record->LoadByProgram(pginfo))
555 QString message = tr(
"Delete '%1' %2 rule?")
556 .arg(record->m_title,
toString(pginfo->GetRecordingRuleType()));
562 okPopup->SetReturnEvent(
this,
"deleterule");
563 okPopup->SetData(QVariant::fromValue(record));
565 if (okPopup->Create())
601 auto *me =
dynamic_cast<MythEvent *
>(event);
605 const QString& message = me->
Message();
606 if (message ==
"SCHEDULE_CHANGE")
619 else if (message.startsWith(
"UPDATE_FILE_SIZE"))
621 QStringList tokens = message.simplified().split(
" ");
622 if (tokens.size() < 3)
626 uint recordingID = tokens[1].toUInt();
627 uint64_t filesize = tokens[2].toLongLong(&ok);
645 GetItemByData(QVariant::fromValue(pginfo));
653 if (item == selected)
667 QString resultid = dce->GetId();
668 QString resulttext = dce->GetResultText();
669 int buttonnum = dce->GetResult();
671 if (resultid ==
"deleterule")
678 if (!record->Delete())
679 LOG(VB_GENERAL, LOG_ERR,
680 "Failed to delete recording rule");
687 else if (resultid ==
"menu")
689 if (resulttext == tr(
"Show Important"))
693 else if (resulttext == tr(
"Show All"))
697 else if (resulttext == tr(
"Program Details"))
701 else if (resulttext == tr(
"Program Guide"))
705 else if (resulttext == tr(
"Channel Search"))
709 else if (resulttext == tr(
"Upcoming by title"))
713 else if (resulttext == tr(
"Upcoming scheduled"))
717 else if (resulttext == tr(
"Previously Recorded"))
721 else if (resulttext == tr(
"Custom Edit"))
725 else if (resulttext == tr(
"Delete Rule"))
729 else if (resulttext == tr(
"Show Inputs"))
void LoadInBackground(const QString &message="")
ProgramInfo * GetCurrentProgram(void) const override
MythScreenStack * GetMainStack()
void RequestEmbedding(bool Embed, const QRect &Rect={}, const QStringList &Data={})
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
static const Type kMythEventMessage
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
void Close(void) override
void customEvent(QEvent *event) override
QMap< int, int > m_inputref
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
virtual void ShowUpcomingScheduled(void) const
Show the upcoming recordings for this recording rule.
uint GetRecordingID(void) const
ViewScheduled(MythScreenStack *parent, TV *player=nullptr, bool showTV=false)
This class is used as a container for messages.
QString GetChannelSchedulingID(void) const
This is the unique programming identifier of a channel.
Internal representation of a recording rule, mirrors the record table.
virtual void ShowGuide(void) const
Show the program guide.
MythUIProgressBar * m_progressBar
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
#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.
const QString & Message() const
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.
MythUIType * GetFocusWidget(void) const
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
QHash< QString, QString > InfoMap
void addListener(QObject *listener)
Add a listener to the observable.
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
MythUIButtonList * m_schedulesList
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 Create(void) override
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
void Set(int start, int total, int used)
bool SetFocusWidget(MythUIType *widget=nullptr)
Basic menu dialog, message and a list of options.
void BuildFocusList(void)
def rating(profile, smoonURL, gate)
#define ACTION_CHANNELSEARCH
virtual void SetTextFromMap(const InfoMap &infoMap)
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
QMap< QDate, ProgramList > m_recgroupList
virtual void SetFilesize(uint64_t sz)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythUIButtonList * m_groupList
uint GetRecordedPercent() const
void ShowMenu(void) override
MythScreenStack * GetScreenStack() const
static void * RunViewScheduled(void *player, bool showTv)
void setShowAll(bool all)
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
uint GetInputID(void) const
AutoDeleteDeque< ProgramInfo * > ProgramList
Holds information on recordings and videos.
All purpose text widget, displays a text string.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void customEvent(QEvent *event) override
Dialog asking for user confirmation. Ok and optional Cancel button.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
~ViewScheduled() override
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
void LoadList(bool useExistingData=false)
static const Type kEventType
void CalculateRecordedProgress()
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
@ kDateFull
Default local time.
virtual void ShowChannelSearch(void) const
Show the channel search.
void UpdateUIListItem(MythUIButtonListItem *item, ProgramInfo *pginfo) const
iterator erase(iterator it)
int GetRecordingPriority2(void) const
uint GetRecordingRuleID(void) const
void updateInfo(MythUIButtonListItem *item)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
virtual int IncrRef(void)
Increments reference count.
void ChangeGroup(MythUIButtonListItem *item)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void removeListener(QObject *listener)
Remove a listener to the observable.
This widget is used for grouping other widgets for display when a particular named state is called....
void SaveBoolSetting(const QString &key, bool newValue)
bool DisplayState(const QString &name)
float GetStars(void) const