summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-11-26 16:18:52 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2000-11-26 16:18:52 +0100
commit79a353c8b9b42922c5a4cf193539c6de658a65d0 (patch)
tree573bda67df80993e8d4eaabb758c2cbfbde49e09
parentad8610d5d0b78fccdb0576ab49fb84706477cd1e (diff)
downloadvdr-79a353c8b9b42922c5a4cf193539c6de658a65d0.tar.gz
vdr-79a353c8b9b42922c5a4cf193539c6de658a65d0.tar.bz2
Fixed 'Switch' in the now/next menu
-rw-r--r--HISTORY3
-rw-r--r--menu.c22
2 files changed, 22 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 27634ec5..35faeded 100644
--- a/HISTORY
+++ b/HISTORY
@@ -317,4 +317,5 @@ Video Disk Recorder Revision History
- The EPG data is now dumped into the file /video/epg.data every ten minutes.
Use the Perl script 'epg2html.pl' to convert the raw EPG data into a simple
HTML programme listing.
-
+- Fixed handling of channel switching with the "Blue" button in the "What's on
+ now/next?" menus.
diff --git a/menu.c b/menu.c
index 3cf83281..273cb22f 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.52 2000/11/18 16:30:13 kls Exp $
+ * $Id: menu.c 1.53 2000/11/26 16:15:30 kls Exp $
*/
#include "menu.h"
@@ -1310,7 +1310,9 @@ private:
cThreadLock threadLock;
const cSchedules *schedules;
bool now, next;
+ int otherChannel;
eOSState Record(void);
+ eOSState Switch(void);
void PrepareSchedule(cChannel *Channel);
void PrepareWhatsOnNext(bool On);
public:
@@ -1322,6 +1324,7 @@ cMenuSchedule::cMenuSchedule(void)
:cOsdMenu("", 6, 6)
{
now = next = false;
+ otherChannel = 0;
cChannel *channel = Channels.GetByNumber(cDvbApi::CurrentChannel());
if (channel) {
schedules = cDvbApi::PrimaryDvbApi->Schedules(&threadLock);
@@ -1383,6 +1386,16 @@ eOSState cMenuSchedule::Record(void)
return osContinue;
}
+eOSState cMenuSchedule::Switch(void)
+{
+ if (otherChannel) {
+ if (Channels.SwitchTo(otherChannel))
+ return osEnd;
+ }
+ Interface->Error(tr("Can't switch channel!"));
+ return osContinue;
+}
+
eOSState cMenuSchedule::ProcessKey(eKeys Key)
{
eOSState state = cOsdMenu::ProcessKey(Key);
@@ -1398,8 +1411,9 @@ eOSState cMenuSchedule::ProcessKey(eKeys Key)
next = !next;
return AddSubMenu(new cMenuWhatsOn(schedules, now));
case kYellow: return AddSubMenu(new cMenuWhatsOn(schedules, false));
+ case kBlue: return Switch();
case kOk: if (Count())
- return AddSubMenu(new cMenuEvent(((cMenuScheduleItem *)Get(Current()))->eventInfo));
+ return AddSubMenu(new cMenuEvent(((cMenuScheduleItem *)Get(Current()))->eventInfo, otherChannel));
break;
default: break;
}
@@ -1411,6 +1425,10 @@ eOSState cMenuSchedule::ProcessKey(eKeys Key)
cChannel *channel = Channels.GetByServiceID(ei->GetServiceID());
if (channel) {
PrepareSchedule(channel);
+ if (channel->number != cDvbApi::CurrentChannel()) {
+ otherChannel = channel->number;
+ SetHelp(tr("Record"), tr("Now"), tr("Next"), tr("Switch"));
+ }
Display();
}
}