comparison urwid_satext/sat_widgets.py @ 117:0cf705af755c

NotificationBar: fixed removePopUp
author Goffi <goffi@goffi.org>
date Wed, 25 Nov 2015 13:04:56 +0100
parents 8e9a6a9c727e
children 00b012549f88
comparison
equal deleted inserted replaced
116:8e9a6a9c727e 117:0cf705af755c
807 self.notifs.append(('popup',pop_up_widget)) 807 self.notifs.append(('popup',pop_up_widget))
808 self._modQueue() 808 self._modQueue()
809 809
810 def removePopUp(self, pop_up_widget): 810 def removePopUp(self, pop_up_widget):
811 """Remove a popup from the waiting queue""" 811 """Remove a popup from the waiting queue"""
812 self.notifs.remove(pop_up_widget) 812 for idx, (wid_type, widget) in enumerate(self.notifs):
813 self._modQueue() 813 if widget == pop_up_widget:
814 del self.notifs[idx]
815 self._modQueue()
816 return
817
818 raise ValueError(u"trying to remove an unknown pop_up_widget")
814 819
815 def addMessage(self, message): 820 def addMessage(self, message):
816 "Add a message to the notificatio bar" 821 "Add a message to the notificatio bar"
817 if not self.message.get_text(): 822 if not self.message.get_text():
818 self.message.set_text(('notifs',message)) 823 self.message.set_text(('notifs',message))