diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2011-03-21 11:55:36 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2011-03-21 11:55:36 +0100 |
| commit | 61111fab026bb61d70ffcf74c36e51da56aa7ad2 (patch) | |
| tree | 1c9c2da856e17b503af8ee04531ab971fce0f4a6 | |
| parent | 35b79c13bc95e26dfae5cb1cda2eef2f265ad9db (diff) | |
| parent | 10f779bd487379e0a9aec80e586c562e2ac71273 (diff) | |
| download | enigma2-61111fab026bb61d70ffcf74c36e51da56aa7ad2.tar.gz enigma2-61111fab026bb61d70ffcf74c36e51da56aa7ad2.zip | |
Merge branch 'bug_713_fix_timerlist_sort'
| -rwxr-xr-x | data/setup.xml | 1 | ||||
| -rw-r--r-- | lib/python/Components/UsageConfig.py | 2 | ||||
| -rw-r--r-- | lib/python/Screens/TimerEdit.py | 12 |
3 files changed, 14 insertions, 1 deletions
diff --git a/data/setup.xml b/data/setup.xml index c5eb07f5..5f7cbf60 100755 --- a/data/setup.xml +++ b/data/setup.xml @@ -32,6 +32,7 @@ <item level="1" text="Alternative radio mode">config.usage.e1like_radio_mode</item> <item level="1" text="Action on long powerbutton press">config.usage.on_long_powerpress</item> <item level="1" text="Action on short powerbutton press">config.usage.on_short_powerpress</item> + <item level="1" text="Position of finished Timers in Timerlist">config.usage.timerlist_finished_timer_position</item> <item level="0" text="Infobar timeout">config.usage.infobar_timeout</item> <item level="1" text="12V output" requires="12V_Output">config.usage.output_12V</item> <item level="0" text="Show event-progress in channel selection">config.usage.show_event_progress_in_servicelist</item> 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 572f14b5..8f742b8c 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 as RealTimerEntry class TimerEditList(Screen): EMPTY = 0 @@ -174,11 +175,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 == RealTimerEntry.StateEnded or y[0].state == RealTimerEntry.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() |
