Ticket #12287: watch_jump.patch
| File watch_jump.patch, 7.0 KB (added by , 12 years ago) |
|---|
-
mythtv/libs/libmythtv/tv_actions.h
diff --git a/mythtv/libs/libmythtv/tv_actions.h b/mythtv/libs/libmythtv/tv_actions.h index 1629ffc..aad35d7 100644
a b 22 22 #define ACTION_TOGGLERECCONTROLS "TOGGLERECCONTROLS" 23 23 #define ACTION_TOGGLEINPUTS "TOGGLEINPUTS" 24 24 25 #define ACTION_ LISTRECORDEDEPISODES "LISTRECORDEDEPISODES"25 #define ACTION_SHOWNEXTGROUP "SHOWNEXTGROUP" 26 26 27 27 #define ACTION_GUIDE "GUIDE" 28 28 #define ACTION_FINDER "FINDER" -
mythtv/libs/libmythtv/tv_play.cpp
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp index 2a0c7b8..37963f9 100644
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 REG_KEY("TV Frontend", ACTION_SHOWNEXTGROUP, QT_TRANSLATE_NOOP("MythControls", 581 "Show Next Group"), ""); 582 582 583 583 REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls", 584 584 "Exit or return to DVD menu"), "Esc"); -
mythtv/programs/mythfrontend/playbackbox.cpp
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp index 165250b..ab70199 100644
a b void PlaybackBox::ShowActionPopup(const ProgramInfo &pginfo) 3129 3129 3130 3130 m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu()); 3131 3131 3132 if (m_groupList->GetItemPos(m_groupList->GetItemCurrent()) == 0) 3133 m_popupMenu->AddItem(tr("List Recorded Episodes"), 3134 SLOT(ShowRecordedEpisodes())); 3135 else 3136 m_popupMenu->AddItem(tr("List All Recordings"), 3137 SLOT(ShowAllRecordings())); 3132 m_popupMenu->AddItem(tr("Show Next Group"), SLOT(ShowNextGroup())); 3138 3133 3139 3134 m_popupMenu->AddItem(tr("Delete"), SLOT(askDelete())); 3140 3135 … … void PlaybackBox::ShowActionPopup(const ProgramInfo &pginfo) 3189 3184 m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu()); 3190 3185 m_popupMenu->AddItem(tr("Job Options"), NULL, createJobMenu()); 3191 3186 3192 if (m_groupList->GetItemPos(m_groupList->GetItemCurrent()) == 0) 3193 m_popupMenu->AddItem(tr("List Recorded Episodes"), 3194 SLOT(ShowRecordedEpisodes())); 3195 else 3196 m_popupMenu->AddItem(tr("List All Recordings"), 3197 SLOT(ShowAllRecordings())); 3187 m_popupMenu->AddItem(tr("Show Next Group"), SLOT(ShowNextGroup())); 3198 3188 3199 3189 if (!sameProgram) 3200 3190 { … … void PlaybackBox::Delete(DeleteFlags flags) 3482 3472 } 3483 3473 } 3484 3474 3485 void PlaybackBox::ShowRecordedEpisodes() 3475 /// Find next ocurrence of selected prog in subsequent groups 3476 void PlaybackBox::ShowNextGroup() 3486 3477 { 3487 3478 ProgramInfo *pginfo = GetCurrentProgram(); 3488 if (pginfo) {3489 QString title = pginfo->GetTitle().toLower();3490 MythUIButtonListItem* group = m_groupList->GetItemByData(qVariantFromValue(title));3491 if (group)3492 {3493 m_groupList->SetItemCurrent(group);3494 // set focus back to previous item3495 MythUIButtonListItem *previousItem = m_recordingList->GetItemByData(qVariantFromValue(pginfo));3496 m_recordingList->SetItemCurrent(previousItem);3497 }3498 }3499 }3500 3479 3501 void PlaybackBox::ShowAllRecordings(void) 3502 { 3503 ProgramInfo *pginfo = GetCurrentProgram(); 3504 m_groupList->SetItemCurrent(0); 3505 if (pginfo) 3480 // only applicable when recording list is focussed and a recording is selected 3481 if (pginfo && GetFocusWidget() == m_recordingList) 3506 3482 { 3507 // set focus back to previous item 3508 MythUIButtonListItem *previousitem = 3509 m_recordingList->GetItemByData(qVariantFromValue(pginfo)); 3510 m_recordingList->SetItemCurrent(previousitem); 3483 // determine the focussed group (m_current_group uses wrong case) 3484 MythUIButtonListItem *currentGroup = m_groupList->GetItemCurrent(); 3485 if (!currentGroup) 3486 return; // no groups 3487 3488 // determine position within group list 3489 int ixCurrentGroup = m_titleList.indexOf(currentGroup->GetText("groupname")); 3490 if (ixCurrentGroup < 0) 3491 return; // no groups 3492 3493 // search from the subsequent group to the previous group, wrapping at the end 3494 QStringList::iterator itCurrentGroup = m_titleList.begin() + ixCurrentGroup; 3495 bool found = false; 3496 3497 for (QStringList::iterator itGroup = itCurrentGroup + 1; !found && itGroup != itCurrentGroup; ++itGroup) 3498 { 3499 // wrap at end 3500 if (itGroup == m_titleList.end()) 3501 itGroup = m_titleList.begin(); 3502 3503 // get recordings for this group 3504 QString groupLabel = (*itGroup).toLower(); 3505 ProgramList progList = m_progLists[groupLabel]; 3506 3507 // locate the recording within this group 3508 for (ProgramList::iterator itProg = progList.begin(); itProg != progList.end(); ++itProg) 3509 { 3510 if (*itProg == pginfo) 3511 { 3512 // focus group 3513 MythUIButtonListItem* group = m_groupList->GetItemByData(qVariantFromValue(groupLabel)); 3514 m_groupList->SetItemCurrent(group); 3515 3516 // focus recording 3517 MythUIButtonListItem *prog = m_recordingList->GetItemByData(qVariantFromValue(pginfo)); 3518 m_recordingList->SetItemCurrent(prog); 3519 3520 found = true; 3521 break; 3522 } 3523 } 3524 } 3511 3525 } 3512 3526 } 3513 3527 … … bool PlaybackBox::keyPressEvent(QKeyEvent *event) 3883 3897 curpos = m_groupList->GetCount() - 1; 3884 3898 m_groupList->SetItemCurrent(curpos); 3885 3899 } 3886 else if (action == ACTION_LISTRECORDEDEPISODES) 3887 { 3888 if (m_groupList->GetItemPos(m_groupList->GetItemCurrent()) == 0) 3889 ShowRecordedEpisodes(); 3890 else 3891 ShowAllRecordings(); 3892 } 3900 else if (action == ACTION_SHOWNEXTGROUP) 3901 ShowNextGroup(); 3893 3902 else if (action == "CHANGERECGROUP") 3894 3903 showGroupFilter(); 3895 3904 else if (action == "CHANGEGROUPVIEW") -
mythtv/programs/mythfrontend/playbackbox.h
diff --git a/mythtv/programs/mythfrontend/playbackbox.h b/mythtv/programs/mythfrontend/playbackbox.h index a88439e..0a02cc8 100644
a b class PlaybackBox : public ScheduleCommon 185 185 void DeleteIgnoreAllRemaining(void) 186 186 { Delete((DeleteFlags)((int)kIgnore|(int)kAllRemaining)); } 187 187 188 void ShowRecordedEpisodes(); 189 void ShowAllRecordings(); 188 void ShowNextGroup(); 190 189 191 190 void toggleWatched(); 192 191 void toggleAutoExpire();
