Ticket #11496: previous-scheduled.diff

File previous-scheduled.diff, 4.6 KB (added by amb@…, 11 years ago)

Patch for this new function

  • mythtv/programs/mythfrontend/schedulecommon.cpp

    diff --git a/mythtv/programs/mythfrontend/schedulecommon.cpp b/mythtv/programs/mythfrontend/schedulecommon.cpp
    index cfca9e0..6840a37 100644
    a b  
    9999}
    100100
    101101/**
     102*  \brief Show the previous recordings for this recording rule
     103*/
     104void ScheduleCommon::ShowPrevious(RecordingInfo *recinfo) const
     105{
     106    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     107    ProgLister *pl = new ProgLister(mainStack, recinfo->GetRecordingRuleID(),
     108                                    recinfo->GetTitle());
     109    if (pl->Create())
     110        mainStack->AddScreen(pl);
     111    else
     112        delete pl;
     113}
     114
     115/**
     116*  \brief Show the previous recordings for this recording rule
     117*/
     118void ScheduleCommon::ShowPrevious(ProgramInfo *pginfo) const
     119{
     120    if (!pginfo)
     121        return;
     122
     123    RecordingInfo ri(*pginfo);
     124
     125    ShowPrevious(&ri);
     126}
     127
     128/**
    102129*  \brief Creates a dialog for editing the recording status,
    103130*         blocking until user leaves dialog.
    104131*/
  • mythtv/programs/mythfrontend/schedulecommon.h

    diff --git a/mythtv/programs/mythfrontend/schedulecommon.h b/mythtv/programs/mythfrontend/schedulecommon.h
    index 3f348f3..31998ad 100644
    a b  
    2525    void ShowUpcoming(const QString &title, const QString &seriesid) const;
    2626    void ShowUpcoming(ProgramInfo *pginfo) const;
    2727    void ShowUpcomingScheduled(ProgramInfo *pginfo) const;
     28    void ShowPrevious(RecordingInfo *recinfo) const;
     29    void ShowPrevious(ProgramInfo *pginfo) const;
    2830    void EditRecording(ProgramInfo *pginfo);
    2931    void EditScheduled(ProgramInfo *pginfo);
    3032    void EditScheduled(RecordingInfo *recinfo);
  • mythtv/programs/mythfrontend/scheduleeditor.cpp

    diff --git a/mythtv/programs/mythfrontend/scheduleeditor.cpp b/mythtv/programs/mythfrontend/scheduleeditor.cpp
    index 09881bc..65ec4fe 100644
    a b  
    606606    if (m_recordingRule->m_type == kTemplateRecord)
    607607        return;
    608608
    609     QString title;
    610     if (m_recInfo)
    611         title = m_recInfo->GetTitle();
    612     MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    613     ProgLister *pl = new ProgLister(mainStack, m_recordingRule->m_recordID,
    614                                     title);
    615     if (pl->Create())
    616         mainStack->AddScreen(pl);
    617     else
    618         delete pl;
     609    ShowPrevious(m_recInfo);
    619610}
    620611
    621612void ScheduleEditor::showUpcomingByRule(void)
  • mythtv/programs/mythfrontend/viewscheduled.cpp

    diff --git a/mythtv/programs/mythfrontend/viewscheduled.cpp b/mythtv/programs/mythfrontend/viewscheduled.cpp
    index 5f100f2..51acdbc 100644
    a b  
    168168            upcoming();
    169169        else if (action == "VIEWSCHEDULED")
    170170            upcomingScheduled();
     171        else if (action == "PREVIOUS")
     172            previous();
    171173        else if (action == "DETAILS" || action == "INFO")
    172174            details();
    173175        else if (action == "1")
     
    214216        menuPopup->AddButton(tr("Program Details"));
    215217        menuPopup->AddButton(tr("Upcoming by title"));
    216218        menuPopup->AddButton(tr("Upcoming scheduled"));
     219        menuPopup->AddButton(tr("Previously scheduled"));
    217220        menuPopup->AddButton(tr("Custom Edit"));
    218221        menuPopup->AddButton(tr("Delete Rule"));
    219222        menuPopup->AddButton(tr("Show Cards"));
     
    606609    //EmbedTVWindow();
    607610}
    608611
     612void ViewScheduled::previous()
     613{
     614    MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
     615    if (!item)
     616        return;
     617
     618    ProgramInfo *pginfo = qVariantValue<ProgramInfo*>(item->GetData());
     619
     620    ShowPrevious(pginfo);
     621
     622    //FIXME:
     623    //EmbedTVWindow();
     624}
     625
    609626void ViewScheduled::details()
    610627{
    611628    MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
     
    742759            {
    743760                upcomingScheduled();
    744761            }
     762            else if (resulttext == tr("Previously scheduled"))
     763            {
     764                previous();
     765            }
    745766            else if (resulttext == tr("Custom Edit"))
    746767            {
    747768                customEdit();
  • mythtv/programs/mythfrontend/viewscheduled.h

    diff --git a/mythtv/programs/mythfrontend/viewscheduled.h b/mythtv/programs/mythfrontend/viewscheduled.h
    index 787f1d3..bf9aa8d 100644
    a b  
    4646    void deleteRule();
    4747    void upcoming();
    4848    void upcomingScheduled();
     49    void previous();
    4950    void details();
    5051    void selected(MythUIButtonListItem *);
    5152    void updateInfo(MythUIButtonListItem *);