summaryrefslogtreecommitdiff
path: root/menuitems.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-11-14 16:27:27 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-11-14 16:27:27 +0100
commitac8e03a89cb86e2f68924533d53a3c93f7c972c9 (patch)
treed0a5ef85f87cae71c85c0512668db07c5395e7f9 /menuitems.c
parent1ed36b04bc06f73abea7b774ae9990d4e4ec671c (diff)
downloadvdr-ac8e03a89cb86e2f68924533d53a3c93f7c972c9.tar.gz
vdr-ac8e03a89cb86e2f68924533d53a3c93f7c972c9.tar.bz2
Implemented handling of number keys in the 'Timers' menu for toggling days1.3.16
Diffstat (limited to 'menuitems.c')
-rw-r--r--menuitems.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/menuitems.c b/menuitems.c
index ee92dc9f..dea20295 100644
--- a/menuitems.c
+++ b/menuitems.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menuitems.c 1.19 2004/06/19 09:45:45 kls Exp $
+ * $Id: menuitems.c 1.20 2004/11/14 16:16:21 kls Exp $
*/
#include "menuitems.h"
@@ -495,7 +495,7 @@ eOSState cMenuEditChanItem::ProcessKey(eKeys Key)
}
}
break;
- default : return cMenuEditIntItem::ProcessKey(Key);
+ default: return cMenuEditIntItem::ProcessKey(Key);
}
return osContinue;
}
@@ -606,7 +606,33 @@ eOSState cMenuEditDayItem::ProcessKey(eKeys Key)
return cMenuEditIntItem::ProcessKey(Key);
Set();
break;
- default : return cMenuEditIntItem::ProcessKey(Key);
+ default: {
+ if (d >= 0) {
+ if (k1 <= Key && Key <= k7) {
+ int v = *value ^ (1 << (Key - k1));
+ if ((v & 0xFF) != 0) {
+ *value = v; // can't let this become all 0
+ Set();
+ }
+ break;
+ }
+ }
+ int v = *value;
+ eOSState result = cMenuEditIntItem::ProcessKey(Key);
+ if (result == osContinue && Key == k0) {
+ if (d >= 0) {
+ *value = cTimer::GetMDay(time(NULL));
+ d = -1;
+ Set();
+ }
+ else if (*value == 0 || *value == v) {
+ d = cTimer::GetWDay(time(NULL));
+ *value = days[d];
+ Set();
+ }
+ }
+ return result;
+ }
}
return osContinue;
}