Ticket #12180: 0001-Add-Show-Channel-Search-in-several-Lists.patch

File 0001-Add-Show-Channel-Search-in-several-Lists.patch, 14.1 KB (added by angela.schmid@…, 10 years ago)
  • mythtv/libs/libmythtv/tv_actions.h

    From eda0e1b9f1477c77d27847d5d6e2aea3a9530731 Mon Sep 17 00:00:00 2001
    From: angelaschmid <angela.schmid@wolke7.net>
    Date: Tue, 17 Jun 2014 02:03:51 +0200
    Subject: [PATCH] Add "Show Channel Search" in several Lists.
    
     Add "Show Channel Search" key/menu to Guide Grid, Program Finder,
    Upcoming Recordings, and all Program Search Lists.
    It takes the current Program and shows the Channel Search at the
    specific channel and program.
    ---
     mythtv/libs/libmythtv/tv_actions.h             |  1 -
     mythtv/libs/libmythtv/tv_play.cpp              |  2 -
     mythtv/programs/mythfrontend/guidegrid.cpp     | 23 --------
     mythtv/programs/mythfrontend/guidegrid.h       |  1 -
     mythtv/programs/mythfrontend/progfind.cpp      | 25 --------
     mythtv/programs/mythfrontend/progfind.h        |  1 -
     mythtv/programs/mythfrontend/proglist.cpp      | 82 +-------------------------
     mythtv/programs/mythfrontend/proglist.h        |  5 --
     mythtv/programs/mythfrontend/viewscheduled.cpp | 25 --------
     mythtv/programs/mythfrontend/viewscheduled.h   |  1 -
     10 files changed, 2 insertions(+), 164 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/tv_actions.h b/mythtv/libs/libmythtv/tv_actions.h
    index 1629ffc..995d221
    a b  
    2626
    2727#define ACTION_GUIDE             "GUIDE"
    2828#define ACTION_FINDER            "FINDER"
    29 #define ACTION_CHANNELSEARCH     "CHANNELSEARCH"
    3029#define ACTION_TOGGLESLEEP       QString("TOGGLESLEEP")
    3130#define ACTION_PLAY              "PLAY"
    3231#define ACTION_VIEWSCHEDULED     "VIEWSCHEDULED"
  • mythtv/libs/libmythtv/tv_play.cpp

    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index 8137eee..3d33363
    a b void TV::InitKeys(void) 
    542542            "Show the Program Guide"), "S");
    543543    REG_KEY("TV Frontend", ACTION_FINDER, QT_TRANSLATE_NOOP("MythControls",
    544544            "Show the Program Finder"), "#");
    545     REG_KEY("TV Frontend", ACTION_CHANNELSEARCH, QT_TRANSLATE_NOOP("MythControls",
    546             "Show the Channel Search"), "");
    547545    REG_KEY("TV Frontend", "NEXTFAV", QT_TRANSLATE_NOOP("MythControls",
    548546            "Cycle through channel groups and all channels in the "
    549547            "program guide."), "/");
  • mythtv/programs/mythfrontend/guidegrid.cpp

    diff --git a/mythtv/programs/mythfrontend/guidegrid.cpp b/mythtv/programs/mythfrontend/guidegrid.cpp
    index 9f1a9f4..2b76928
    a b using namespace std; 
    3131#include "mythuiguidegrid.h"
    3232#include "mythdialogbox.h"
    3333#include "progfind.h"
    34 #include "proglist.h"
    3534
    3635QWaitCondition epgIsVisibleCond;
    3736
    bool GuideGrid::keyPressEvent(QKeyEvent *event) 
    761760            toggleGuideListing();
    762761        else if (action == ACTION_FINDER)
    763762            showProgFinder();
    764         else if (action == ACTION_CHANNELSEARCH)
    765             showChannelSearch();
    766763        else if (action == "MENU")
    767764            ShowMenu();
    768765        else if (action == "ESCAPE" || action == ACTION_GUIDE)
    void GuideGrid::ShowMenu(void) 
    864861
    865862        menuPopup->AddButton(tr("Reverse Channel Order"));
    866863
    867         menuPopup->AddButton(tr("Channel Search"));
    868 
    869864        if (!m_changrplist.empty())
    870865        {
    871866            menuPopup->AddButton(tr("Choose Channel Group"));
    void GuideGrid::customEvent(QEvent *event) 
    17111706                generateListings();
    17121707                updateChannels();
    17131708            }
    1714             else if (resulttext == tr("Channel Search"))
    1715             {
    1716                 showChannelSearch();
    1717             }
    17181709            else if (resulttext == tr("Add To Channel Group"))
    17191710            {
    17201711                if (m_changrpid == -1)
    void GuideGrid::showProgFinder() 
    23072298        RunProgramFinder(m_player, m_embedVideo, false);
    23082299}
    23092300
    2310 void GuideGrid::showChannelSearch()
    2311 {
    2312     ProgramInfo *pginfo = m_programInfos[m_currentRow][m_currentCol];
    2313     if (!pginfo)
    2314         return;
    2315 
    2316     MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    2317     ProgLister *pl = new ProgLister(mainStack, pginfo);
    2318     if (pl->Create())
    2319         mainStack->AddScreen(pl);
    2320     else
    2321         delete pl;
    2322 }
    2323 
    23242301void GuideGrid::enter()
    23252302{
    23262303    if (!m_player)
  • mythtv/programs/mythfrontend/guidegrid.h

    diff --git a/mythtv/programs/mythfrontend/guidegrid.h b/mythtv/programs/mythfrontend/guidegrid.h
    index 9bf8100..94dbd8c
    a b class GuideGrid : public ScheduleCommon, public JumpToChannelListener 
    148148    void enter();
    149149
    150150    void showProgFinder();
    151     void showChannelSearch();
    152151    void channelUpdate();
    153152    void volumeUpdate(bool);
    154153    void toggleMute(const bool muteIndividualChannels = false);
  • mythtv/programs/mythfrontend/progfind.cpp

    diff --git a/mythtv/programs/mythfrontend/progfind.cpp b/mythtv/programs/mythfrontend/progfind.cpp
    index 65fcbfa..30b4143
    a b  
    2626#include "guidegrid.h"
    2727#include "customedit.h"
    2828#include "progfind.h"
    29 #include "proglist.h"
    3029
    3130#define LOC      QString("ProgFinder: ")
    3231#define LOC_ERR  QString("ProgFinder, Error: ")
    bool ProgFinder::keyPressEvent(QKeyEvent *event) 
    201200            quickRecord();
    202201        else if (action == "GUIDE" || action == "4")
    203202            showGuide();
    204         else if (action == ACTION_CHANNELSEARCH)
    205             showChannelSearch();
    206203        else if (action == "ESCAPE")
    207204        {
    208205            // don't fade the screen if we are returning to the player
    void ProgFinder::ShowMenu(void) 
    245242            menuPopup->AddButton(tr("Previously Recorded"));
    246243            menuPopup->AddButton(tr("Custom Edit"));
    247244            menuPopup->AddButton(tr("Program Guide"));
    248             menuPopup->AddButton(tr("Channel Search"));
    249245        }
    250246
    251247        popupStack->AddScreen(menuPopup);
    void ProgFinder::customEvent(QEvent *event) 
    327323            {
    328324                showGuide();
    329325            }
    330             else if (resulttext == tr("Channel Search"))
    331             {
    332                 showChannelSearch();
    333             }
    334326        }
    335327        else if (resultid == "searchtext")
    336328        {
    void ProgFinder::showGuide() 
    431423    }
    432424}
    433425
    434 void ProgFinder::showChannelSearch()
    435 {
    436     if (GetFocusWidget() == m_timesList)
    437     {
    438         ProgramInfo *pginfo = m_showData[m_timesList->GetCurrentPos()];
    439         if (!pginfo)
    440            return;
    441 
    442         MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    443         ProgLister *pl = new ProgLister(mainStack, pginfo);
    444         if (pl->Create())
    445             mainStack->AddScreen(pl);
    446         else
    447             delete pl;
    448     }
    449 }
    450 
    451426void ProgFinder::getInfo(bool toggle)
    452427{
    453428    if (GetFocusWidget() == m_timesList)
  • mythtv/programs/mythfrontend/progfind.h

    diff --git a/mythtv/programs/mythfrontend/progfind.h b/mythtv/programs/mythfrontend/progfind.h
    index 76a42ff..b94724c
    a b class ProgFinder : public ScheduleCommon 
    3838    void timesListLosingFocus(void);
    3939
    4040    void showGuide();
    41     void showChannelSearch();
    4241    void select();
    4342    void customEdit();
    4443    void upcoming();
  • mythtv/programs/mythfrontend/proglist.cpp

    diff --git a/mythtv/programs/mythfrontend/proglist.cpp b/mythtv/programs/mythfrontend/proglist.cpp
    index 1a32447..753f0d6
    a b ProgLister::ProgLister(MythScreenStack *parent, ProgListType pltype, 
    6464    m_progList(NULL),
    6565    m_messageText(NULL),
    6666
    67     m_allowViewDialog(true),
    68     m_pginfo(NULL)
     67    m_allowViewDialog(true)
    6968{
    7069    if (pltype == plMovies)
    7170    {
    ProgLister::ProgLister( 
    132131    m_progList(NULL),
    133132    m_messageText(NULL),
    134133
    135     m_allowViewDialog(true),
    136     m_pginfo(NULL)
    137 
     134    m_allowViewDialog(true)
    138135{
    139136}
    140137
    141 // channel lister ctor
    142 ProgLister::ProgLister(
    143     MythScreenStack *parent, ProgramInfo *pginfo) :
    144     ScheduleCommon(parent, "ProgLister"),
    145     m_type(plChannel),
    146     m_recid(0),
    147     m_title(),
    148     m_extraArg(),
    149     m_startTime(MythDate::current()),
    150     m_searchTime(m_startTime),
    151     m_channelOrdering(gCoreContext->GetSetting("ChannelOrdering", "channum")),
    152 
    153     m_searchType(kNoSearch),
    154 
    155     m_view(),
    156     m_curView(),
    157     m_viewList(),
    158     m_viewTextList(),
    159 
    160     m_itemList(),
    161     m_itemListSave(),
    162     m_schedList(),
    163 
    164     m_typeList(),
    165     m_genreList(),
    166     m_stationList(),
    167 
    168     m_allowEvents(true),
    169     m_titleSort(false),
    170     m_reverseSort(false),
    171     m_useGenres(false),
    172 
    173     m_schedText(NULL),
    174     m_curviewText(NULL),
    175     m_positionText(NULL),
    176     m_progList(NULL),
    177     m_messageText(NULL),
    178 
    179     m_allowViewDialog(true),
    180 
    181     m_pginfo(pginfo)
    182 {
    183     uint chanid = m_pginfo->GetChanID();
    184 
    185     FillViewList(QString::number(chanid));
    186 }
    187 
    188138ProgLister::~ProgLister()
    189139{
    190140    m_itemList.clear();
    bool ProgLister::keyPressEvent(QKeyEvent *e) 
    316266            ShowDetails();
    317267        else if (action == "GUIDE")
    318268            ShowGuide();
    319         else if (action == ACTION_CHANNELSEARCH)
    320             ShowChannelSearch();
    321269        else if (action == "TOGGLERECORD")
    322270            RecordSelected();
    323271        else if (action == "1")
    void ProgLister::ShowGuide(void) 
    853801    }
    854802}
    855803
    856 void ProgLister::ShowChannelSearch()
    857 {
    858     ProgramInfo *pi = GetCurrent();
    859     if(pi)
    860     {
    861         MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    862         ProgLister *pl = new ProgLister(mainStack, pi);
    863         if (pl->Create())
    864             mainStack->AddScreen(pl);
    865         else
    866             delete pl;
    867     }
    868 }
    869 
    870804void ProgLister::ShowUpcoming(void)
    871805{
    872806    ProgramInfo *pi = GetCurrent();
    void ProgLister::customEvent(QEvent *event) 
    18021736            if (m_curView < 0 && m_type != plPreviouslyRecorded)
    18031737                ShowChooseViewMenu();
    18041738        }
    1805         if (m_pginfo)   // set position on first call of ChannelSearch when called from GuideGrid
    1806         {
    1807            for (int pos = 0; pos < (int) m_itemList.size(); pos++)
    1808             {
    1809                 if (m_pginfo->GetScheduledEndTime() == m_itemList[pos]->GetScheduledEndTime())
    1810                 {
    1811                     m_progList->SetItemCurrent(pos);
    1812                     break;
    1813                 }
    1814             }
    1815             m_pginfo = NULL;
    1816         }
    18171739    }
    18181740    else if ((MythEvent::Type)(event->type()) == MythEvent::MythEventMessage)
    18191741    {
  • mythtv/programs/mythfrontend/proglist.h

    diff --git a/mythtv/programs/mythfrontend/proglist.h b/mythtv/programs/mythfrontend/proglist.h
    index cfc1cba..981d377
    a b class ProgLister : public ScheduleCommon 
    4242               const QString &view, const QString &extraArg);
    4343    explicit ProgLister(MythScreenStack *parent, uint recid = 0,
    4444                        const QString &title = QString());
    45     explicit ProgLister(MythScreenStack *parent,
    46                         ProgramInfo *pginfo);
    4745    ~ProgLister();
    4846
    4947    bool Create(void);
    class ProgLister : public ScheduleCommon 
    6765
    6866    void ShowDetails(void)   { ScheduleCommon::ShowDetails(GetCurrent());   }
    6967    void ShowGuide(void);
    70     void ShowChannelSearch(void);
    7168    void ShowUpcoming(void);
    7269    void ShowPrevious(void);
    7370    void ShowDeleteRuleMenu(void);
    class ProgLister : public ScheduleCommon 
    140137    MythUIText       *m_messageText;
    141138
    142139    bool              m_allowViewDialog;
    143 
    144     ProgramInfo      *m_pginfo;
    145140};
    146141
    147142#endif
  • mythtv/programs/mythfrontend/viewscheduled.cpp

    diff --git a/mythtv/programs/mythfrontend/viewscheduled.cpp b/mythtv/programs/mythfrontend/viewscheduled.cpp
    index 3192090..43ad43e
    a b  
    1616#include "mythdialogbox.h"
    1717#include "mythmainwindow.h"
    1818#include "guidegrid.h"
    19 #include "proglist.h"
    2019
    2120void *ViewScheduled::RunViewScheduled(void *player, bool showTV)
    2221{
    bool ViewScheduled::keyPressEvent(QKeyEvent *event) 
    177176            details();
    178177        else if (action == "GUIDE")
    179178            showGuide();
    180         else if (action == ACTION_CHANNELSEARCH)
    181             showChannelSearch();
    182179        else if (action == "1")
    183180            setShowAll(true);
    184181        else if (action == "2")
    void ViewScheduled::ShowMenu(void) 
    222219            menuPopup->AddButton(tr("Show All"));
    223220        menuPopup->AddButton(tr("Program Details"));
    224221        menuPopup->AddButton(tr("Program Guide"));
    225         menuPopup->AddButton(tr("Channel Search"));
    226222        menuPopup->AddButton(tr("Upcoming by title"));
    227223        menuPopup->AddButton(tr("Upcoming scheduled"));
    228224        menuPopup->AddButton(tr("Previously Recorded"));
    void ViewScheduled::showGuide() 
    608604    GuideGrid::RunProgramGuide(startchanid, startchannel, starttime);
    609605}
    610606
    611 void ViewScheduled::showChannelSearch()
    612 {
    613     MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
    614 
    615     if (!item)
    616         return;
    617 
    618     ProgramInfo *pginfo = qVariantValue<ProgramInfo*>(item->GetData());
    619 
    620     MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    621     ProgLister *pl = new ProgLister(mainStack, pginfo);
    622     if (pl->Create())
    623         mainStack->AddScreen(pl);
    624     else
    625         delete pl;
    626 }
    627 
    628607void ViewScheduled::upcoming()
    629608{
    630609    MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
    void ViewScheduled::customEvent(QEvent *event) 
    799778            {
    800779                showGuide();
    801780            }
    802             else if (resulttext == tr("Channel Search"))
    803             {
    804                 showChannelSearch();
    805             }
    806781            else if (resulttext == tr("Upcoming by title"))
    807782            {
    808783                upcoming();
  • mythtv/programs/mythfrontend/viewscheduled.h

    diff --git a/mythtv/programs/mythfrontend/viewscheduled.h b/mythtv/programs/mythfrontend/viewscheduled.h
    index 5fb5e4d..b59c43f
    a b class ViewScheduled : public ScheduleCommon 
    4242  protected slots:
    4343    void ChangeGroup(MythUIButtonListItem *item);
    4444    void showGuide();
    45     void showChannelSearch();
    4645    void edit();
    4746    void customEdit();
    4847    void deleteRule();