summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/menu.c b/menu.c
index d15c017..f3c9fab 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.422 2006/02/25 15:41:40 kls Exp $
+ * $Id: menu.c 1.424 2006/02/28 13:58:00 kls Exp $
*/
#include "menu.h"
@@ -500,12 +500,10 @@ eOSState cMenuChannels::Delete(void)
cChannel *channel = GetChannel(Current());
int DeletedChannel = channel->Number();
// Check if there is a timer using this channel:
- for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) {
- if (ti->Channel() == channel) {
- Skins.Message(mtError, tr("Channel is being used by a timer!"));
- return osContinue;
- }
- }
+ if (channel->HasTimer()) {
+ Skins.Message(mtError, tr("Channel is being used by a timer!"));
+ return osContinue;
+ }
if (Interface->Confirm(tr("Delete channel?"))) {
Channels.Del(channel);
cOsdMenu::Del(Index);
@@ -690,8 +688,8 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key)
*timer = data;
if (addIfConfirmed)
Timers.Add(timer);
- timer->Matches();
timer->SetEventFromSchedule();
+ timer->Matches();
Timers.SetModified();
isyslog("timer %s %s (%s)", *timer->ToDescr(), addIfConfirmed ? "added" : "modified", timer->HasFlags(tfActive) ? "active" : "inactive");
addIfConfirmed = false;
@@ -787,8 +785,10 @@ cMenuTimers::cMenuTimers(void)
:cOsdMenu(tr("Timers"), 2, CHNUMWIDTH, 10, 6, 6)
{
helpKeys = -1;
- for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer))
+ for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
+ timer->SetEventFromSchedule(); // make sure the event is current
Add(new cMenuTimerItem(timer));
+ }
Sort();
SetCurrent(First());
SetHelpKeys();
@@ -900,7 +900,7 @@ eOSState cMenuTimers::ProcessKey(eKeys Key)
case kOk: return Edit();
case kRed: state = OnOff(); break; // must go through SetHelpKeys()!
case kGreen: return New();
- case kYellow: return Delete();
+ case kYellow: state = Delete(); break;
case kBlue: return Info();
break;
default: break;