diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-11-26 16:18:52 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-11-26 16:18:52 +0100 |
commit | 79a353c8b9b42922c5a4cf193539c6de658a65d0 (patch) | |
tree | 573bda67df80993e8d4eaabb758c2cbfbde49e09 /menu.c | |
parent | ad8610d5d0b78fccdb0576ab49fb84706477cd1e (diff) | |
download | vdr-79a353c8b9b42922c5a4cf193539c6de658a65d0.tar.gz vdr-79a353c8b9b42922c5a4cf193539c6de658a65d0.tar.bz2 |
Fixed 'Switch' in the now/next menu
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -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(); } } |