diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2011-03-18 01:03:09 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2011-03-18 01:03:09 +0100 |
| commit | 33a8f42447b5f3655b47f15f7c2a4cf45af5c4bb (patch) | |
| tree | 29327b7aed5d6511e3f96c1096582f4c9b951575 /lib | |
| parent | 891da2ac4faa83f3af25d5deaa2176e424e5fba3 (diff) | |
| download | enigma2-33a8f42447b5f3655b47f15f7c2a4cf45af5c4bb.tar.gz enigma2-33a8f42447b5f3655b47f15f7c2a4cf45af5c4bb.zip | |
add possibility to choose the finished timer timerlist position in usage config
refs bug #713
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/python/Components/UsageConfig.py | 2 | ||||
| -rw-r--r-- | lib/python/Screens/TimerEdit.py | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index a265a169..acbc3425 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -113,6 +113,8 @@ def InitUsageConfig(): ("step", _("Singlestep (GOP)")), ("last", _("Last speed")) ]) + config.usage.timerlist_finished_timer_position = ConfigSelection(default = "beginning", choices = [("beginning", _("at beginning")), ("end", _("at end"))]) + def updateEnterForward(configElement): if not configElement.value: configElement.value = [2] diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index bf60496f..6e8859ee 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -13,6 +13,7 @@ from ServiceReference import ServiceReference from TimerEntry import TimerEntry, TimerLog from Tools.BoundFunction import boundFunction from time import time +from timer import TimerEntry class TimerEditList(Screen): EMPTY = 0 @@ -172,11 +173,20 @@ class TimerEditList(Screen): self.key_blue_choice = self.EMPTY def fillTimerList(self): + #helper function to move finished timers to end of list + def eol_compare(x, y): + if x[0].state != y[0].state and x[0].state == TimerEntry.StateEnded or y[0].state == TimerEntry.StateEnded: + return cmp(x[0].state, y[0].state) + return cmp(x[0].begin, x[1].begin) + list = self.list del list[:] list.extend([(timer, False) for timer in self.session.nav.RecordTimer.timer_list]) list.extend([(timer, True) for timer in self.session.nav.RecordTimer.processed_timers]) - list.sort(key = lambda x: x[0].begin) + if config.usage.timerlist_finished_timer_position.index: #end of list + list.sort(cmp = eol_compare) + else: + list.sort(key = lambda x: x[0].begin) def showLog(self): cur=self["timerlist"].getCurrent() |
