Ticket #12287: watch_jump.patch

File watch_jump.patch, 7.0 KB (added by Roger Siddons <dizygotheca@…>, 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  
    2222#define ACTION_TOGGLERECCONTROLS  "TOGGLERECCONTROLS"
    2323#define ACTION_TOGGLEINPUTS       "TOGGLEINPUTS"
    2424
    25 #define ACTION_LISTRECORDEDEPISODES "LISTRECORDEDEPISODES"
     25#define ACTION_SHOWNEXTGROUP     "SHOWNEXTGROUP"
    2626
    2727#define ACTION_GUIDE             "GUIDE"
    2828#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)  
    577577            "Change Recording Group"), "");
    578578    REG_KEY("TV Frontend", "CHANGEGROUPVIEW", QT_TRANSLATE_NOOP("MythControls",
    579579            "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"), "");
    582582
    583583    REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls",
    584584            "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)  
    31293129
    31303130        m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu());
    31313131
    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()));
    31383133
    31393134        m_popupMenu->AddItem(tr("Delete"), SLOT(askDelete()));
    31403135
    void PlaybackBox::ShowActionPopup(const ProgramInfo &pginfo)  
    31893184    m_popupMenu->AddItem(tr("Recording Options"), NULL, createRecordingMenu());
    31903185    m_popupMenu->AddItem(tr("Job Options"), NULL, createJobMenu());
    31913186
    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()));
    31983188
    31993189    if (!sameProgram)
    32003190    {
    void PlaybackBox::Delete(DeleteFlags flags)  
    34823472    }
    34833473}
    34843474
    3485 void PlaybackBox::ShowRecordedEpisodes()
     3475/// Find next ocurrence of selected prog in subsequent groups
     3476void PlaybackBox::ShowNextGroup()
    34863477{
    34873478    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 item
    3495             MythUIButtonListItem *previousItem = m_recordingList->GetItemByData(qVariantFromValue(pginfo));
    3496             m_recordingList->SetItemCurrent(previousItem);
    3497         }
    3498     }
    3499 }
    35003479
    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)
    35063482    {
    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        }
    35113525    }
    35123526}
    35133527
    bool PlaybackBox::keyPressEvent(QKeyEvent *event)  
    38833897                curpos = m_groupList->GetCount() - 1;
    38843898            m_groupList->SetItemCurrent(curpos);
    38853899        }
    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();
    38933902        else if (action == "CHANGERECGROUP")
    38943903            showGroupFilter();
    38953904        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  
    185185    void DeleteIgnoreAllRemaining(void)
    186186        { Delete((DeleteFlags)((int)kIgnore|(int)kAllRemaining)); }
    187187
    188     void ShowRecordedEpisodes();
    189     void ShowAllRecordings();
     188    void ShowNextGroup();
    190189
    191190    void toggleWatched();
    192191    void toggleAutoExpire();