From 2e5c13aebb389a6d74e4130658ccee6a863d01f6 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 3 Dec 2008 17:40:25 +0100 Subject: add possibility to change start/end time in timer edit with Vol/Bouquet +/- (thx to Moritz Venn) --- lib/python/Components/config.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 4d57bbb9..d79337ba 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -604,6 +604,34 @@ class ConfigClock(ConfigSequence): t = time.localtime(default) ConfigSequence.__init__(self, seperator = ":", limits = [(0,23),(0,59)], default = [t.tm_hour, t.tm_min]) + def increment(self): + # Check if Minutes maxed out + if self._value[1] == 59: + # Check if Hours not maxed out + if self._value[0] < 23: + # Increment Hour, reset Minutes to 0 + self._value[0] += 1 + self._value[1] = 0 + else: + # Increment Minutes + self._value[1] += 1 + # Trigger change + self.changed() + + def decrement(self): + # Check if Minutes is minimum + if self._value[1] == 0: + # Check if Hour is greater than 0 + if self._value[0] > 0: + # Decrement Hour, set Minutes to 59 + self._value[0] -= 1 + self._value[1] = 59 + else: + # Decrement Minutes + self._value[1] -= 1 + # Trigger change + self.changed() + class ConfigInteger(ConfigSequence): def __init__(self, default, limits = (0, 9999999999)): ConfigSequence.__init__(self, seperator = ":", limits = [limits], default = default) -- cgit v1.2.3