From d2064fc175d7ccea95d939adedc56bb820560044 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 19 Jul 2019 23:04:35 +0200 Subject: [PATCH] core: fixed handling of button callback in popups: Button use themselve as callback, and this was causing troubles in the removePopUp method. This patch work around this by considering a Button widget in the same way as None (we never use Button directly in popups). fix 183 --- sat_frontends/primitivus/primitivus | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sat_frontends/primitivus/primitivus b/sat_frontends/primitivus/primitivus index 0d230f2c..6544b9f8 100755 --- a/sat_frontends/primitivus/primitivus +++ b/sat_frontends/primitivus/primitivus @@ -595,7 +595,9 @@ class PrimitivusApp(QuickApp, InputHistory): @param widget(None, urwid.Widget): if not None remove this popup from front or queue """ # TODO: refactor popup management in a cleaner way - if widget is not None: + # buttons' callback use themselve as first argument, and we never use + # a Button directly in a popup, so we consider urwid.Button as None + if widget is not None and not isinstance(widget, urwid.Button): if isinstance(self.loop.widget, urwid.Overlay): current_popup = self.loop.widget.top_w if not current_popup == widget: