Skip to content

Commit

Permalink
In the playbackbox, allow jumping to an episode's display group.
Browse files Browse the repository at this point in the history
Provides keybindings and a menu entry such that if you've highlighted
an episode in the All Programs view, you can see that episode
highlighted within its title's display group.  For example, you see
that a new episode has recorded, and you can quickly jump to the
episode's display group to see if there are any other episodes you
should catch up on first.

Thanks to Angela Schmid for the patch.

Fixes #12157

Signed-off-by: Jim Stichnoth <jstichnoth@mythtv.org>
(cherry picked from commit a375bcc)
  • Loading branch information
angelaschmid authored and jyavenard committed Jun 7, 2014
1 parent 881284c commit e63cade
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mythtv/libs/libmythtv/tv_actions.h
Expand Up @@ -22,6 +22,8 @@
#define ACTION_TOGGLERECCONTROLS "TOGGLERECCONTROLS"
#define ACTION_TOGGLEINPUTS "TOGGLEINPUTS"

#define ACTION_LISTRECORDEDEPISODES "LISTRECORDEDEPISODES"

#define ACTION_GUIDE "GUIDE"
#define ACTION_FINDER "FINDER"
#define ACTION_TOGGLESLEEP QString("TOGGLESLEEP")
Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -577,6 +577,8 @@ void TV::InitKeys(void)
"Change Recording Group"), "");
REG_KEY("TV Frontend", "CHANGEGROUPVIEW", QT_TRANSLATE_NOOP("MythControls",
"Change Group View"), "");
REG_KEY("TV Frontend", ACTION_LISTRECORDEDEPISODES, QT_TRANSLATE_NOOP("MythControls",
"List recorded episodes"), "");

REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls",
"Exit or return to DVD menu"), "Esc");
Expand Down
Empty file modified mythtv/programs/mythfrontend/globalsettings.cpp 100755 → 100644
Empty file.
40 changes: 40 additions & 0 deletions mythtv/programs/mythfrontend/playbackbox.cpp
Expand Up @@ -3157,6 +3157,9 @@ void PlaybackBox::ShowActionPopup(const ProgramInfo &pginfo)

m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu());

if (m_groupList->GetItemPos(m_groupList->GetItemCurrent()) == 0)
m_popupMenu->AddItem(tr("List Recorded Episodes"), SLOT(ShowRecordedEpisodes()));

m_popupMenu->AddItem(tr("Delete"), SLOT(askDelete()));

DisplayPopupMenu();
Expand Down Expand Up @@ -3210,6 +3213,9 @@ void PlaybackBox::ShowActionPopup(const ProgramInfo &pginfo)
m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu());
m_popupMenu->AddItem(tr("Job Options"), NULL, createJobMenu());

if (m_groupList->GetItemPos(m_groupList->GetItemCurrent()) == 0)
m_popupMenu->AddItem(tr("List Recorded Episodes"), SLOT(ShowRecordedEpisodes()));

if (!sameProgram)
{
if (pginfo.GetRecordingGroup() == "Deleted")
Expand Down Expand Up @@ -3510,6 +3516,22 @@ void PlaybackBox::Delete(DeleteFlags flags)
}
}

void PlaybackBox::ShowRecordedEpisodes()
{
ProgramInfo *pginfo = CurrentItem();
if (pginfo) {
QString title = pginfo->GetTitle().toLower();
MythUIButtonListItem* group = m_groupList->GetItemByData(qVariantFromValue(title));
if (group)
{
m_groupList->SetItemCurrent(group);
// set focus back to previous item
MythUIButtonListItem *previousItem = m_recordingList->GetItemByData(qVariantFromValue(pginfo));
m_recordingList->SetItemCurrent(previousItem);
}
}
}

ProgramInfo *PlaybackBox::FindProgramInUILists(const ProgramInfo &pginfo)
{
return FindProgramInUILists(
Expand Down Expand Up @@ -3878,6 +3900,24 @@ bool PlaybackBox::keyPressEvent(QKeyEvent *event)
if (!nextGroup.isEmpty())
displayRecGroup(nextGroup);
}
else if (action == "NEXTVIEW")
{
int curpos = m_groupList->GetItemPos(m_groupList->GetItemCurrent());
if (++curpos >= m_groupList->GetCount())
curpos = 0;
m_groupList->SetItemCurrent(curpos);
}
else if (action == "PREVVIEW")
{
int curpos = m_groupList->GetItemPos(m_groupList->GetItemCurrent());
if (--curpos < 0)
curpos = m_groupList->GetCount() - 1;
m_groupList->SetItemCurrent(curpos);
}
else if (action == ACTION_LISTRECORDEDEPISODES)
{
ShowRecordedEpisodes();
}
else if (action == "CHANGERECGROUP")
showGroupFilter();
else if (action == "CHANGEGROUPVIEW")
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythfrontend/playbackbox.h
Expand Up @@ -190,6 +190,8 @@ class PlaybackBox : public ScheduleCommon
void DeleteIgnoreAllRemaining(void)
{ Delete((DeleteFlags)((int)kIgnore|(int)kAllRemaining)); }

void ShowRecordedEpisodes();

void toggleWatched();
void toggleAutoExpire();
void togglePreserveEpisode();
Expand Down

0 comments on commit e63cade

Please sign in to comment.