From 6ed0c6d0970228825c63658fc1271f97d1b64085 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 3 Mar 2005 22:15:45 +0000 Subject: [PATCH] do not use a second loop to print dialogs (do not use run) --- plugins/gtkgui/dialogs.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index 4deaa4a3d..08239eadd 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -489,33 +489,39 @@ class confirm_dialog: class warning_dialog: """Class for warning dialog""" + def on_response(self, dialog, response_id): + dialog.destroy() + def __init__(self, label): dialog = gtk.MessageDialog(None,\ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\ gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, label) - - dialog.run() - dialog.destroy() + dialog.connect('response', self.on_response) + dialog.show() class information_dialog: """Class for information dialog""" + def on_response(self, dialog, response_id): + dialog.destroy() + def __init__(self, label): dialog = gtk.MessageDialog(None,\ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\ gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, label) - - dialog.run() - dialog.destroy() + dialog.connect('response', self.on_response) + dialog.show() class error_dialog: """Class for error dialog""" + def on_response(self, dialog, response_id): + dialog.destroy() + def __init__(self, label): dialog = gtk.MessageDialog(None,\ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\ gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, label) - - dialog.run() - dialog.destroy() + dialog.connect('response', self.on_response) + dialog.show() class subscription_request_window: """Class for authorization window :