summaryrefslogtreecommitdiff
path: root/menuitems.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-08 13:51:00 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-08 13:51:00 +0100
commitbaf473aedf9289180efa6c28b15be30c831b2f5d (patch)
tree7f45d520396f4a946e418aa86bede0ca4dc63154 /menuitems.c
parent120fb54d495f3770dad3ea7d98b7abaacfc6bb0e (diff)
downloadvdr-baf473aedf9289180efa6c28b15be30c831b2f5d.tar.gz
vdr-baf473aedf9289180efa6c28b15be30c831b2f5d.tar.bz2
The Green button in the "Edit timer" menu can now be used to toggle between single shot and repeating timers
Diffstat (limited to 'menuitems.c')
-rw-r--r--menuitems.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/menuitems.c b/menuitems.c
index dc3ea715..6a6d88d6 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 2.11 2012/03/02 15:49:57 kls Exp $
+ * $Id: menuitems.c 2.12 2012/03/08 13:22:22 kls Exp $
*/
#include "menuitems.h"
@@ -886,6 +886,24 @@ void cMenuEditDateItem::Set(void)
SetValue(buf);
}
+void cMenuEditDateItem::ToggleRepeating(void)
+{
+ if (weekdays) {
+ if (*weekdays) {
+ *value = cTimer::SetTime(oldvalue ? oldvalue : time(NULL), 0);
+ oldvalue = 0;
+ *weekdays = 0;
+ }
+ else {
+ *weekdays = days[cTimer::GetWDay(*value)];
+ dayindex = FindDayIndex(*weekdays);
+ oldvalue = *value;
+ *value = 0;
+ }
+ Set();
+ }
+}
+
eOSState cMenuEditDateItem::ProcessKey(eKeys Key)
{
eOSState state = cMenuEditItem::ProcessKey(Key);
@@ -937,17 +955,8 @@ eOSState cMenuEditDateItem::ProcessKey(eKeys Key)
else if (weekdays) {
if (Key == k0) {
// Toggle between weekdays and single day:
- if (*weekdays) {
- *value = cTimer::SetTime(oldvalue ? oldvalue : now, 0);
- oldvalue = 0;
- *weekdays = 0;
- }
- else {
- *weekdays = days[cTimer::GetWDay(*value)];
- dayindex = FindDayIndex(*weekdays);
- oldvalue = *value;
- *value = 0;
- }
+ ToggleRepeating();
+ return osContinue; // ToggleRepeating) has already called Set()
}
else if (k1 <= Key && Key <= k7) {
// Toggle individual weekdays: