primitivus: a warning is loggued when trying to remove an unknown popup, instead of an error raised

This commit is contained in:
Goffi 2015-11-25 13:03:44 +01:00
commit 42b64871a8

View file

@ -502,7 +502,10 @@ class PrimitivusApp(QuickApp, InputHistory):
if isinstance(self.loop.widget, urwid.Overlay):
current_popup = self.loop.widget.top_w
if not current_popup == widget:
self.notif_bar.removePopUp(widget)
try:
self.notif_bar.removePopUp(widget)
except ValueError:
log.warning(u"Trying to remove an unknown widget {}".format(widget))
return
self.loop.widget = self.main_widget
next_popup = self.notif_bar.getNextPopup()