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
|
|
26 | 26 | |
27 | 27 | #define ACTION_GUIDE "GUIDE" |
28 | 28 | #define ACTION_FINDER "FINDER" |
29 | | #define ACTION_CHANNELSEARCH "CHANNELSEARCH" |
30 | 29 | #define ACTION_TOGGLESLEEP QString("TOGGLESLEEP") |
31 | 30 | #define ACTION_PLAY "PLAY" |
32 | 31 | #define ACTION_VIEWSCHEDULED "VIEWSCHEDULED" |
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) |
542 | 542 | "Show the Program Guide"), "S"); |
543 | 543 | REG_KEY("TV Frontend", ACTION_FINDER, QT_TRANSLATE_NOOP("MythControls", |
544 | 544 | "Show the Program Finder"), "#"); |
545 | | REG_KEY("TV Frontend", ACTION_CHANNELSEARCH, QT_TRANSLATE_NOOP("MythControls", |
546 | | "Show the Channel Search"), ""); |
547 | 545 | REG_KEY("TV Frontend", "NEXTFAV", QT_TRANSLATE_NOOP("MythControls", |
548 | 546 | "Cycle through channel groups and all channels in the " |
549 | 547 | "program guide."), "/"); |
diff --git a/mythtv/programs/mythfrontend/guidegrid.cpp b/mythtv/programs/mythfrontend/guidegrid.cpp
index 9f1a9f4..2b76928
a
|
b
|
using namespace std; |
31 | 31 | #include "mythuiguidegrid.h" |
32 | 32 | #include "mythdialogbox.h" |
33 | 33 | #include "progfind.h" |
34 | | #include "proglist.h" |
35 | 34 | |
36 | 35 | QWaitCondition epgIsVisibleCond; |
37 | 36 | |
… |
… |
bool GuideGrid::keyPressEvent(QKeyEvent *event) |
761 | 760 | toggleGuideListing(); |
762 | 761 | else if (action == ACTION_FINDER) |
763 | 762 | showProgFinder(); |
764 | | else if (action == ACTION_CHANNELSEARCH) |
765 | | showChannelSearch(); |
766 | 763 | else if (action == "MENU") |
767 | 764 | ShowMenu(); |
768 | 765 | else if (action == "ESCAPE" || action == ACTION_GUIDE) |
… |
… |
void GuideGrid::ShowMenu(void) |
864 | 861 | |
865 | 862 | menuPopup->AddButton(tr("Reverse Channel Order")); |
866 | 863 | |
867 | | menuPopup->AddButton(tr("Channel Search")); |
868 | | |
869 | 864 | if (!m_changrplist.empty()) |
870 | 865 | { |
871 | 866 | menuPopup->AddButton(tr("Choose Channel Group")); |
… |
… |
void GuideGrid::customEvent(QEvent *event) |
1711 | 1706 | generateListings(); |
1712 | 1707 | updateChannels(); |
1713 | 1708 | } |
1714 | | else if (resulttext == tr("Channel Search")) |
1715 | | { |
1716 | | showChannelSearch(); |
1717 | | } |
1718 | 1709 | else if (resulttext == tr("Add To Channel Group")) |
1719 | 1710 | { |
1720 | 1711 | if (m_changrpid == -1) |
… |
… |
void GuideGrid::showProgFinder() |
2307 | 2298 | RunProgramFinder(m_player, m_embedVideo, false); |
2308 | 2299 | } |
2309 | 2300 | |
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 | | |
2324 | 2301 | void GuideGrid::enter() |
2325 | 2302 | { |
2326 | 2303 | if (!m_player) |
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 |
148 | 148 | void enter(); |
149 | 149 | |
150 | 150 | void showProgFinder(); |
151 | | void showChannelSearch(); |
152 | 151 | void channelUpdate(); |
153 | 152 | void volumeUpdate(bool); |
154 | 153 | void toggleMute(const bool muteIndividualChannels = false); |
diff --git a/mythtv/programs/mythfrontend/progfind.cpp b/mythtv/programs/mythfrontend/progfind.cpp
index 65fcbfa..30b4143
a
|
b
|
|
26 | 26 | #include "guidegrid.h" |
27 | 27 | #include "customedit.h" |
28 | 28 | #include "progfind.h" |
29 | | #include "proglist.h" |
30 | 29 | |
31 | 30 | #define LOC QString("ProgFinder: ") |
32 | 31 | #define LOC_ERR QString("ProgFinder, Error: ") |
… |
… |
bool ProgFinder::keyPressEvent(QKeyEvent *event) |
201 | 200 | quickRecord(); |
202 | 201 | else if (action == "GUIDE" || action == "4") |
203 | 202 | showGuide(); |
204 | | else if (action == ACTION_CHANNELSEARCH) |
205 | | showChannelSearch(); |
206 | 203 | else if (action == "ESCAPE") |
207 | 204 | { |
208 | 205 | // don't fade the screen if we are returning to the player |
… |
… |
void ProgFinder::ShowMenu(void) |
245 | 242 | menuPopup->AddButton(tr("Previously Recorded")); |
246 | 243 | menuPopup->AddButton(tr("Custom Edit")); |
247 | 244 | menuPopup->AddButton(tr("Program Guide")); |
248 | | menuPopup->AddButton(tr("Channel Search")); |
249 | 245 | } |
250 | 246 | |
251 | 247 | popupStack->AddScreen(menuPopup); |
… |
… |
void ProgFinder::customEvent(QEvent *event) |
327 | 323 | { |
328 | 324 | showGuide(); |
329 | 325 | } |
330 | | else if (resulttext == tr("Channel Search")) |
331 | | { |
332 | | showChannelSearch(); |
333 | | } |
334 | 326 | } |
335 | 327 | else if (resultid == "searchtext") |
336 | 328 | { |
… |
… |
void ProgFinder::showGuide() |
431 | 423 | } |
432 | 424 | } |
433 | 425 | |
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 | | |
451 | 426 | void ProgFinder::getInfo(bool toggle) |
452 | 427 | { |
453 | 428 | if (GetFocusWidget() == m_timesList) |
diff --git a/mythtv/programs/mythfrontend/progfind.h b/mythtv/programs/mythfrontend/progfind.h
index 76a42ff..b94724c
a
|
b
|
class ProgFinder : public ScheduleCommon |
38 | 38 | void timesListLosingFocus(void); |
39 | 39 | |
40 | 40 | void showGuide(); |
41 | | void showChannelSearch(); |
42 | 41 | void select(); |
43 | 42 | void customEdit(); |
44 | 43 | void upcoming(); |
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, |
64 | 64 | m_progList(NULL), |
65 | 65 | m_messageText(NULL), |
66 | 66 | |
67 | | m_allowViewDialog(true), |
68 | | m_pginfo(NULL) |
| 67 | m_allowViewDialog(true) |
69 | 68 | { |
70 | 69 | if (pltype == plMovies) |
71 | 70 | { |
… |
… |
ProgLister::ProgLister( |
132 | 131 | m_progList(NULL), |
133 | 132 | m_messageText(NULL), |
134 | 133 | |
135 | | m_allowViewDialog(true), |
136 | | m_pginfo(NULL) |
137 | | |
| 134 | m_allowViewDialog(true) |
138 | 135 | { |
139 | 136 | } |
140 | 137 | |
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 | | |
188 | 138 | ProgLister::~ProgLister() |
189 | 139 | { |
190 | 140 | m_itemList.clear(); |
… |
… |
bool ProgLister::keyPressEvent(QKeyEvent *e) |
316 | 266 | ShowDetails(); |
317 | 267 | else if (action == "GUIDE") |
318 | 268 | ShowGuide(); |
319 | | else if (action == ACTION_CHANNELSEARCH) |
320 | | ShowChannelSearch(); |
321 | 269 | else if (action == "TOGGLERECORD") |
322 | 270 | RecordSelected(); |
323 | 271 | else if (action == "1") |
… |
… |
void ProgLister::ShowGuide(void) |
853 | 801 | } |
854 | 802 | } |
855 | 803 | |
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 | | |
870 | 804 | void ProgLister::ShowUpcoming(void) |
871 | 805 | { |
872 | 806 | ProgramInfo *pi = GetCurrent(); |
… |
… |
void ProgLister::customEvent(QEvent *event) |
1802 | 1736 | if (m_curView < 0 && m_type != plPreviouslyRecorded) |
1803 | 1737 | ShowChooseViewMenu(); |
1804 | 1738 | } |
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 | | } |
1817 | 1739 | } |
1818 | 1740 | else if ((MythEvent::Type)(event->type()) == MythEvent::MythEventMessage) |
1819 | 1741 | { |
diff --git a/mythtv/programs/mythfrontend/proglist.h b/mythtv/programs/mythfrontend/proglist.h
index cfc1cba..981d377
a
|
b
|
class ProgLister : public ScheduleCommon |
42 | 42 | const QString &view, const QString &extraArg); |
43 | 43 | explicit ProgLister(MythScreenStack *parent, uint recid = 0, |
44 | 44 | const QString &title = QString()); |
45 | | explicit ProgLister(MythScreenStack *parent, |
46 | | ProgramInfo *pginfo); |
47 | 45 | ~ProgLister(); |
48 | 46 | |
49 | 47 | bool Create(void); |
… |
… |
class ProgLister : public ScheduleCommon |
67 | 65 | |
68 | 66 | void ShowDetails(void) { ScheduleCommon::ShowDetails(GetCurrent()); } |
69 | 67 | void ShowGuide(void); |
70 | | void ShowChannelSearch(void); |
71 | 68 | void ShowUpcoming(void); |
72 | 69 | void ShowPrevious(void); |
73 | 70 | void ShowDeleteRuleMenu(void); |
… |
… |
class ProgLister : public ScheduleCommon |
140 | 137 | MythUIText *m_messageText; |
141 | 138 | |
142 | 139 | bool m_allowViewDialog; |
143 | | |
144 | | ProgramInfo *m_pginfo; |
145 | 140 | }; |
146 | 141 | |
147 | 142 | #endif |
diff --git a/mythtv/programs/mythfrontend/viewscheduled.cpp b/mythtv/programs/mythfrontend/viewscheduled.cpp
index 3192090..43ad43e
a
|
b
|
|
16 | 16 | #include "mythdialogbox.h" |
17 | 17 | #include "mythmainwindow.h" |
18 | 18 | #include "guidegrid.h" |
19 | | #include "proglist.h" |
20 | 19 | |
21 | 20 | void *ViewScheduled::RunViewScheduled(void *player, bool showTV) |
22 | 21 | { |
… |
… |
bool ViewScheduled::keyPressEvent(QKeyEvent *event) |
177 | 176 | details(); |
178 | 177 | else if (action == "GUIDE") |
179 | 178 | showGuide(); |
180 | | else if (action == ACTION_CHANNELSEARCH) |
181 | | showChannelSearch(); |
182 | 179 | else if (action == "1") |
183 | 180 | setShowAll(true); |
184 | 181 | else if (action == "2") |
… |
… |
void ViewScheduled::ShowMenu(void) |
222 | 219 | menuPopup->AddButton(tr("Show All")); |
223 | 220 | menuPopup->AddButton(tr("Program Details")); |
224 | 221 | menuPopup->AddButton(tr("Program Guide")); |
225 | | menuPopup->AddButton(tr("Channel Search")); |
226 | 222 | menuPopup->AddButton(tr("Upcoming by title")); |
227 | 223 | menuPopup->AddButton(tr("Upcoming scheduled")); |
228 | 224 | menuPopup->AddButton(tr("Previously Recorded")); |
… |
… |
void ViewScheduled::showGuide() |
608 | 604 | GuideGrid::RunProgramGuide(startchanid, startchannel, starttime); |
609 | 605 | } |
610 | 606 | |
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 | | |
628 | 607 | void ViewScheduled::upcoming() |
629 | 608 | { |
630 | 609 | MythUIButtonListItem *item = m_schedulesList->GetItemCurrent(); |
… |
… |
void ViewScheduled::customEvent(QEvent *event) |
799 | 778 | { |
800 | 779 | showGuide(); |
801 | 780 | } |
802 | | else if (resulttext == tr("Channel Search")) |
803 | | { |
804 | | showChannelSearch(); |
805 | | } |
806 | 781 | else if (resulttext == tr("Upcoming by title")) |
807 | 782 | { |
808 | 783 | upcoming(); |
diff --git a/mythtv/programs/mythfrontend/viewscheduled.h b/mythtv/programs/mythfrontend/viewscheduled.h
index 5fb5e4d..b59c43f
a
|
b
|
class ViewScheduled : public ScheduleCommon |
42 | 42 | protected slots: |
43 | 43 | void ChangeGroup(MythUIButtonListItem *item); |
44 | 44 | void showGuide(); |
45 | | void showChannelSearch(); |
46 | 45 | void edit(); |
47 | 46 | void customEdit(); |
48 | 47 | void deleteRule(); |