changeset 117:0cf705af755c

NotificationBar: fixed removePopUp
author Goffi <goffi@goffi.org>
date Wed, 25 Nov 2015 13:04:56 +0100
parents 8e9a6a9c727e
children 7a6598df39ad
files urwid_satext/sat_widgets.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/urwid_satext/sat_widgets.py	Tue Nov 17 12:29:14 2015 +0100
+++ b/urwid_satext/sat_widgets.py	Wed Nov 25 13:04:56 2015 +0100
@@ -809,8 +809,13 @@
 
     def removePopUp(self, pop_up_widget):
         """Remove a popup from the waiting queue"""
-        self.notifs.remove(pop_up_widget)
-        self._modQueue()
+        for idx, (wid_type, widget) in enumerate(self.notifs):
+            if widget == pop_up_widget:
+                del self.notifs[idx]
+                self._modQueue()
+                return
+
+        raise ValueError(u"trying to remove an unknown pop_up_widget")
 
     def addMessage(self, message):
         "Add a message to the notificatio bar"