From cad1a88a7b5826ce2a03f4853a5c204c066a8ec4 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 15 Jan 2006 13:44:55 +0100 Subject: The status markers in the "Schedule" menu are now only updated if a submenu is closed in which a timer has been modified --- menu.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'menu.c') diff --git a/menu.c b/menu.c index af9cebf8..ba0a7a03 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.394 2006/01/15 12:46:07 kls Exp $ + * $Id: menu.c 1.395 2006/01/15 13:35:05 kls Exp $ */ #include "menu.h" @@ -1030,6 +1030,7 @@ class cMenuWhatsOn : public cOsdMenu { private: bool now; int helpKeys; + int timerState; eOSState Record(void); eOSState Switch(void); static int currentChannel; @@ -1052,6 +1053,8 @@ cMenuWhatsOn::cMenuWhatsOn(const cSchedules *Schedules, bool Now, int CurrentCha { now = Now; helpKeys = -1; + timerState = 0; + Timers.Modified(timerState); for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { if (!Channel->GroupSep()) { const cSchedule *Schedule = Schedules->GetSchedule(Channel); @@ -1069,10 +1072,12 @@ cMenuWhatsOn::cMenuWhatsOn(const cSchedules *Schedules, bool Now, int CurrentCha bool cMenuWhatsOn::Update(void) { bool result = false; - for (cOsdItem *item = First(); item; item = Next(item)) { - if (((cMenuScheduleItem *)item)->Update()) - result = true; - } + if (Timers.Modified(timerState)) { + for (cOsdItem *item = First(); item; item = Next(item)) { + if (((cMenuScheduleItem *)item)->Update()) + result = true; + } + } return result; } @@ -1188,6 +1193,7 @@ private: bool now, next; int otherChannel; int helpKeys; + int timerState; eOSState Number(void); eOSState Record(void); eOSState Switch(void); @@ -1209,6 +1215,8 @@ cMenuSchedule::cMenuSchedule(void) now = next = false; otherChannel = 0; helpKeys = -1; + timerState = 0; + Timers.Modified(timerState); cMenuScheduleItem::SetSortMode(cMenuScheduleItem::ssmAllThis); cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); if (channel) { @@ -1306,10 +1314,12 @@ void cMenuSchedule::PrepareScheduleAllAll(const cEvent *Event, const cChannel *C bool cMenuSchedule::Update(void) { bool result = false; - for (cOsdItem *item = First(); item; item = Next(item)) { - if (((cMenuScheduleItem *)item)->Update()) - result = true; - } + if (Timers.Modified(timerState)) { + for (cOsdItem *item = First(); item; item = Next(item)) { + if (((cMenuScheduleItem *)item)->Update()) + result = true; + } + } return result; } -- cgit v1.2.3