From 73e26df9fd730e1b8af92a79402b832aba5da9e9 Mon Sep 17 00:00:00 2001
From: angelaschmid <angela.schmid@wolke7.net>
Date: Mon, 2 Jun 2014 22:40:16 +0200
Subject: [PATCH] List recorded episodes
Pressing the LISTRECORDEDEPISODES (TV Frontend) key for a selected
recording in the view recordings list, lists the episodes based
on the recordings title.
The NEXTVIEW and PREVVIEW (Global) keys scroll through the display
groups, focus remains in the recordings list or in the group list (then
behaving the same as UP/DOWN).
---
mythtv/libs/libmythtv/tv_actions.h | 2 ++
mythtv/libs/libmythtv/tv_play.cpp | 2 ++
mythtv/programs/mythfrontend/playbackbox.cpp | 40 ++++++++++++++++++++++++++++
mythtv/programs/mythfrontend/playbackbox.h | 2 ++
4 files changed, 46 insertions(+)
diff --git a/mythtv/libs/libmythtv/tv_actions.h b/mythtv/libs/libmythtv/tv_actions.h
index 061c174..995d221 100644
a
|
b
|
|
22 | 22 | #define ACTION_TOGGLERECCONTROLS "TOGGLERECCONTROLS" |
23 | 23 | #define ACTION_TOGGLEINPUTS "TOGGLEINPUTS" |
24 | 24 | |
| 25 | #define ACTION_LISTRECORDEDEPISODES "LISTRECORDEDEPISODES" |
| 26 | |
25 | 27 | #define ACTION_GUIDE "GUIDE" |
26 | 28 | #define ACTION_FINDER "FINDER" |
27 | 29 | #define ACTION_TOGGLESLEEP QString("TOGGLESLEEP") |
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index 41e5241..3d33363
a
|
b
|
void TV::InitKeys(void) |
577 | 577 | "Change Recording Group"), ""); |
578 | 578 | REG_KEY("TV Frontend", "CHANGEGROUPVIEW", QT_TRANSLATE_NOOP("MythControls", |
579 | 579 | "Change Group View"), ""); |
| 580 | REG_KEY("TV Frontend", ACTION_LISTRECORDEDEPISODES, QT_TRANSLATE_NOOP("MythControls", |
| 581 | "List recorded episodes"), ""); |
580 | 582 | |
581 | 583 | REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls", |
582 | 584 | "Exit or return to DVD menu"), "Esc"); |
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
index 95b083e..ead7fe2 100644
a
|
b
|
void PlaybackBox::ShowActionPopup(const ProgramInfo &pginfo) |
3157 | 3157 | |
3158 | 3158 | m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu()); |
3159 | 3159 | |
| 3160 | if (m_groupList->GetItemPos(m_groupList->GetItemCurrent()) == 0) |
| 3161 | m_popupMenu->AddItem(tr("List Recorded Episodes"), SLOT(ShowRecordedEpisodes())); |
| 3162 | |
3160 | 3163 | m_popupMenu->AddItem(tr("Delete"), SLOT(askDelete())); |
3161 | 3164 | |
3162 | 3165 | DisplayPopupMenu(); |
… |
… |
void PlaybackBox::ShowActionPopup(const ProgramInfo &pginfo) |
3210 | 3213 | m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu()); |
3211 | 3214 | m_popupMenu->AddItem(tr("Job Options"), NULL, createJobMenu()); |
3212 | 3215 | |
| 3216 | if (m_groupList->GetItemPos(m_groupList->GetItemCurrent()) == 0) |
| 3217 | m_popupMenu->AddItem(tr("List Recorded Episodes"), SLOT(ShowRecordedEpisodes())); |
| 3218 | |
3213 | 3219 | if (!sameProgram) |
3214 | 3220 | { |
3215 | 3221 | if (pginfo.GetRecordingGroup() == "Deleted") |
… |
… |
void PlaybackBox::Delete(DeleteFlags flags) |
3510 | 3516 | } |
3511 | 3517 | } |
3512 | 3518 | |
| 3519 | void PlaybackBox::ShowRecordedEpisodes(void) |
| 3520 | { |
| 3521 | ProgramInfo *pginfo = CurrentItem(); |
| 3522 | if (pginfo) { |
| 3523 | QString title = pginfo->GetTitle().toLower(); |
| 3524 | MythUIButtonListItem* group = m_groupList->GetItemByData(qVariantFromValue(title)); |
| 3525 | if (group) |
| 3526 | { |
| 3527 | m_groupList->SetItemCurrent(group); |
| 3528 | // set focus back to previous item |
| 3529 | MythUIButtonListItem *previousitem = m_recordingList->GetItemByData(qVariantFromValue(pginfo)); |
| 3530 | m_recordingList->SetItemCurrent(previousitem); |
| 3531 | } |
| 3532 | } |
| 3533 | } |
| 3534 | |
3513 | 3535 | ProgramInfo *PlaybackBox::FindProgramInUILists(const ProgramInfo &pginfo) |
3514 | 3536 | { |
3515 | 3537 | return FindProgramInUILists( |
… |
… |
bool PlaybackBox::keyPressEvent(QKeyEvent *event) |
3878 | 3900 | if (!nextGroup.isEmpty()) |
3879 | 3901 | displayRecGroup(nextGroup); |
3880 | 3902 | } |
| 3903 | else if (action == "NEXTVIEW") |
| 3904 | { |
| 3905 | int curpos = m_groupList->GetItemPos(m_groupList->GetItemCurrent()); |
| 3906 | if(++curpos >= m_groupList->GetCount()) |
| 3907 | curpos = 0; |
| 3908 | m_groupList->SetItemCurrent(curpos); |
| 3909 | } |
| 3910 | else if (action == "PREVVIEW") |
| 3911 | { |
| 3912 | int curpos = m_groupList->GetItemPos(m_groupList->GetItemCurrent()); |
| 3913 | if(--curpos < 0) |
| 3914 | curpos = m_groupList->GetCount() - 1; |
| 3915 | m_groupList->SetItemCurrent(curpos); |
| 3916 | } |
| 3917 | else if (action == ACTION_LISTRECORDEDEPISODES) |
| 3918 | { |
| 3919 | ShowRecordedEpisodes(); |
| 3920 | } |
3881 | 3921 | else if (action == "CHANGERECGROUP") |
3882 | 3922 | showGroupFilter(); |
3883 | 3923 | else if (action == "CHANGEGROUPVIEW") |
diff --git a/mythtv/programs/mythfrontend/playbackbox.h b/mythtv/programs/mythfrontend/playbackbox.h
index 0da39a4..bcd4893 100644
a
|
b
|
class PlaybackBox : public ScheduleCommon |
190 | 190 | void DeleteIgnoreAllRemaining(void) |
191 | 191 | { Delete((DeleteFlags)((int)kIgnore|(int)kAllRemaining)); } |
192 | 192 | |
| 193 | void ShowRecordedEpisodes(void); |
| 194 | |
193 | 195 | void toggleWatched(); |
194 | 196 | void toggleAutoExpire(); |
195 | 197 | void togglePreserveEpisode(); |