From 7c961a72f320fb95a6a751f0a6ce7456bf9ce14a Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Fri, 20 Jan 2006 23:00:24 +0000 Subject: [PATCH] fix selection when delete latest timer in list --- lib/python/Components/TimerList.py | 11 ++++++++++- lib/python/Screens/TimerEdit.py | 9 +++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index d79187d1..8bb6a0d9 100644 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -76,7 +76,16 @@ class TimerList(HTMLComponent, GUIComponent): self.instance = eListbox(parent) self.instance.setContent(self.l) self.instance.setItemHeight(70) - + + def moveToIndex(self, index): + self.instance.moveSelectionTo(index) + + def getCurrentIndex(self): + return self.instance.getCurrentIndex() + + def moveDown(self): + self.instance.moveSelection(self.instance.moveDown) + def GUIdelete(self): self.instance.setContent(None) self.instance = None diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 560ec942..c0896f41 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -48,8 +48,13 @@ class TimerEditList(Screen): #self.session.open(TimerEdit, self["timerlist"].getCurrent()[0]) def removeTimer(self): - # FIXME doesn't work... - self.session.nav.RecordTimer.removeEntry(self["timerlist"].getCurrent()[0]) + list = self["timerlist"] + currentIndex = list.getCurrentIndex() + list.moveDown() + if list.getCurrentIndex() == currentIndex: + currentIndex -= 1 + list.moveToIndex(currentIndex) + self.session.nav.RecordTimer.removeEntry(list.getCurrent()[0]) self.refill() def refill(self): -- 2.30.2