Permalink
Browse files

Add a "TV Frontend:VIEWSCHEDULED" keybinding

Adds a new keybinding which shows upcoming episodes which match a recording rule, instead of a show title.

Note: A VIEWSCHEDULED keybinding already exists under "TV Playback" which is used to bring up the "To Do" list while watching.
  • Loading branch information...
1 parent 73b3551 commit 9ec36ea86e51014301bdc2adcdac3d98fcbcad4a @jpoet jpoet committed Dec 19, 2010
View
@@ -10,8 +10,10 @@ mythfrontend
- D to delete in both "Watch a Recording" and "Delete a Recording".
- E to edit recording options from any of the pages for scheduling
recordings, the Program Finder, the EPG, and the Watch and Delete screens.
-- O to list the upcoming episodes for the currently selected show
- on any page where a show title may be highlighed.
+- O to list the upcoming episodes for the currently selected show on
+ any page where a show title may be highlighed. Note: the "TV
+ Frontend:VIEWSCHEDULED" keybinding is also available, which shows
+ only scheduled episodes.
- I to get additional information about the currently selected item
- Y on the "Upcoming Recordings" page switches which capture cards'
items are displayed in the highlight color.
@@ -452,6 +452,8 @@ void TV::InitKeys(void)
"Decrease program or channel rank"), "Left");
REG_KEY("TV Frontend", "UPCOMING", QT_TRANSLATE_NOOP("MythControls",
"List upcoming episodes"), "O");
+ REG_KEY("TV Frontend", "VIEWSCHEDULED", QT_TRANSLATE_NOOP("MythControls",
+ "List scheduled upcoming episodes"), "");
REG_KEY("TV Frontend", "DETAILS", QT_TRANSLATE_NOOP("MythControls",
"Show program details"), "U");
REG_KEY("TV Frontend", "VIEWCARD", QT_TRANSLATE_NOOP("MythControls",
@@ -2167,6 +2167,13 @@ void PlaybackBox::upcoming()
ShowUpcoming(pginfo);
}
+void PlaybackBox::upcomingScheduled()
+{
+ ProgramInfo *pginfo = CurrentItem();
+ if (pginfo)
+ ShowUpcomingScheduled(pginfo);
+}
+
ProgramInfo *PlaybackBox::CurrentItem(void)
{
ProgramInfo *pginfo = NULL;
@@ -3735,6 +3742,8 @@ bool PlaybackBox::keyPressEvent(QKeyEvent *event)
customEdit();
else if (action == "UPCOMING")
upcoming();
+ else if (action == "VIEWSCHEDULED")
+ upcomingScheduled();
else
handled = false;
}
@@ -150,6 +150,7 @@ class PlaybackBox : public ScheduleCommon
void ShowGroupPopup(void);
void customEdit();
void upcoming();
+ void upcomingScheduled();
void details();
void StopSelected(void);
void showMetadataEditor();
@@ -74,6 +74,30 @@ void ScheduleCommon::ShowUpcoming(ProgramInfo *pginfo) const
}
/**
+* \brief Show the upcoming recordings for this recording rule
+*/
+void ScheduleCommon::ShowUpcomingScheduled(ProgramInfo *pginfo) const
+{
+ if (!pginfo)
+ return;
+
+ RecordingInfo ri(*pginfo);
+ uint id;
+
+ if ((id = ri.GetRecordingRuleID()) <= 0)
+ return ShowUpcoming(pginfo->GetTitle());
+
+ MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+ ProgLister *pl = new ProgLister(mainStack, plRecordid,
+ QString::number(id), "");
+
+ if (pl->Create())
+ mainStack->AddScreen(pl);
+ else
+ delete pl;
+}
+
+/**
* \brief Creates a dialog for editing the recording status,
* blocking until user leaves dialog.
*/
@@ -24,6 +24,7 @@ class ScheduleCommon : public MythScreenType
void ShowDetails(ProgramInfo *pginfo) const;
void ShowUpcoming(const QString &title) const;
void ShowUpcoming(ProgramInfo *pginfo) const;
+ void ShowUpcomingScheduled(ProgramInfo *pginfo) const;
void EditRecording(ProgramInfo *pginfo);
void EditScheduled(ProgramInfo *pginfo);
void EditScheduled(RecordingInfo *recinfo);
@@ -168,6 +168,8 @@ bool ViewScheduled::keyPressEvent(QKeyEvent *event)
deleteRule();
else if (action == "UPCOMING")
upcoming();
+ else if (action == "VIEWSCHEDULED")
+ upcomingScheduled();
else if (action == "DETAILS" || action == "INFO")
details();
else if (action == "1")
@@ -211,7 +213,8 @@ void ViewScheduled::ShowMenu(void)
else
menuPopup->AddButton(tr("Show All"));
menuPopup->AddButton(tr("Program Details"));
- menuPopup->AddButton(tr("Upcoming"));
+ menuPopup->AddButton(tr("Upcoming by title"));
+ menuPopup->AddButton(tr("Upcoming scheduled"));
menuPopup->AddButton(tr("Custom Edit"));
menuPopup->AddButton(tr("Delete Rule"));
menuPopup->AddButton(tr("Show Cards"));
@@ -589,6 +592,20 @@ void ViewScheduled::upcoming()
//EmbedTVWindow();
}
+void ViewScheduled::upcomingScheduled()
+{
+ MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
+ if (!item)
+ return;
+
+ ProgramInfo *pginfo = qVariantValue<ProgramInfo*>(item->GetData());
+
+ ShowUpcomingScheduled(pginfo);
+
+ //FIXME:
+ //EmbedTVWindow();
+}
+
void ViewScheduled::details()
{
MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
@@ -718,10 +735,14 @@ void ViewScheduled::customEvent(QEvent *event)
{
details();
}
- else if (resulttext == tr("Upcoming"))
+ else if (resulttext == tr("Upcoming by title"))
{
upcoming();
}
+ else if (resulttext == tr("Upcoming scheduled"))
+ {
+ upcomingScheduled();
+ }
else if (resulttext == tr("Custom Edit"))
{
customEdit();
@@ -44,6 +44,7 @@ class ViewScheduled : public ScheduleCommon
void customEdit();
void deleteRule();
void upcoming();
+ void upcomingScheduled();
void details();
void selected(MythUIButtonListItem *);
void updateInfo(MythUIButtonListItem *);

0 comments on commit 9ec36ea

Please sign in to comment.