From fc1424f83b97fe2155af5ebfb70c59d3bc8092b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 1 Aug 2018 13:08:35 +0200 Subject: [PATCH] Manage parent keyword argument in common.warning call The keyword is used by the DBLogin when test version failed and no GtkApplication is yet available. --- tryton/common/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index 5e3b677b39..b245a651cd 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -490,7 +490,7 @@ class UniqueDialog(object): if self.running: return - parent = kwargs.get('parent') + parent = kwargs.pop('parent', None) if not parent: parent = get_toplevel_window() dialog = self.build_dialog(parent, *args, **kwargs) @@ -526,8 +526,9 @@ message = MessageDialog() class WarningDialog(MessageDialog): - def __call__(self, message, title, buttons=gtk.BUTTONS_OK): - return super().__call__(title, gtk.MESSAGE_WARNING, buttons, message) + def __call__(self, message, title, buttons=gtk.BUTTONS_OK, **kwargs): + return super().__call__( + title, gtk.MESSAGE_WARNING, buttons, message, **kwargs) warning = WarningDialog()