aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gui/elistbox.cpp5
-rw-r--r--lib/gui/elistboxcontent.cpp9
-rw-r--r--lib/gui/elistboxcontent.h1
-rw-r--r--lib/python/Components/TimerList.py4
-rw-r--r--lib/python/Screens/TimerEdit.py9
5 files changed, 25 insertions, 3 deletions
diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp
index 383ac42d..73fbff3b 100644
--- a/lib/gui/elistbox.cpp
+++ b/lib/gui/elistbox.cpp
@@ -432,7 +432,10 @@ void eListbox::entryRemoved(int index)
if (index == m_selected && m_content)
m_selected = m_content->cursorGet();
- moveSelection(justCheck);
+ if (m_content && m_content->cursorGet() >= m_content->size())
+ moveSelection(moveUp);
+ else
+ moveSelection(justCheck);
if ((m_top <= index) && (index < (m_top + m_items_per_page)))
{
diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp
index fd7341a9..191bc7e1 100644
--- a/lib/gui/elistboxcontent.cpp
+++ b/lib/gui/elistboxcontent.cpp
@@ -262,7 +262,8 @@ void eListboxPythonStringContent::invalidate()
int s = size();
if ( m_cursor >= s )
m_listbox->moveSelectionTo(s?s-1:0);
- m_listbox->invalidate();
+ else
+ m_listbox->invalidate();
}
}
@@ -1021,3 +1022,9 @@ void eListboxPythonMultiContent::updateClip(gRegion &clip)
else
m_old_clip = m_clip = gRegion::invalidRegion();
}
+
+void eListboxPythonMultiContent::entryRemoved(int idx)
+{
+ if (m_listbox)
+ m_listbox->entryRemoved(idx);
+}
diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h
index 118ed302..277899e7 100644
--- a/lib/gui/elistboxcontent.h
+++ b/lib/gui/elistboxcontent.h
@@ -78,6 +78,7 @@ public:
void setItemHeight(int height);
void setSelectionClip(eRect &rect, bool update=false);
void updateClip(gRegion &);
+ void entryRemoved(int idx);
private:
std::map<int, ePtr<gFont> > m_font;
};
diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py
index d3c20eca..b1d9ba02 100644
--- a/lib/python/Components/TimerList.py
+++ b/lib/python/Components/TimerList.py
@@ -98,3 +98,7 @@ class TimerList(HTMLComponent, GUIComponent, object):
def invalidate(self):
self.l.invalidate()
+
+ def entryRemoved(self, idx):
+ self.l.entryRemoved(idx)
+
diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py
index 8d8d9ac1..5a7109f2 100644
--- a/lib/python/Screens/TimerEdit.py
+++ b/lib/python/Screens/TimerEdit.py
@@ -148,8 +148,15 @@ class TimerEditList(Screen):
self.refill()
def refill(self):
+ oldsize = len(self.list)
self.fillTimerList()
- self["timerlist"].invalidate()
+ lst = self["timerlist"]
+ newsize = len(self.list)
+ if oldsize and oldsize != newsize:
+ idx = lst.getCurrentIndex()
+ lst.entryRemoved(idx)
+ else:
+ lst.invalidate()
def addCurrentTimer(self):
event = None