From a5584151c2af88955092d200e8bcf9d75804b5ac Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 31 Jul 2008 06:23:03 +0000 Subject: [PATCH] Use InvitationReceivedDialog asynchronously. see #4147 --- src/dialogs.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index 8f0c4cd47..ef605291a 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -2927,8 +2927,8 @@ class PrivacyListsWindow: PrivacyListWindow(self.account, name, 'EDIT') class InvitationReceivedDialog: - def __init__(self, account, room_jid, contact_jid, password = None, - comment = None, is_continued = False): + def __init__(self, account, room_jid, contact_jid, password=None, + comment=None, is_continued=False): self.room_jid = room_jid self.account = account @@ -2951,9 +2951,8 @@ class InvitationReceivedDialog: comment = _('Comment: %s') % comment sectext += '\n\n%s' % comment sectext += '\n\n' + _('Do you want to accept the invitation?') - - dialog = YesNoDialog(pritext, sectext) - if dialog.get_response() == gtk.RESPONSE_YES: + + def on_yes(checked): try: if self.is_continued: gajim.interface.join_gc_room(self.account, self.room_jid, @@ -2963,6 +2962,8 @@ class InvitationReceivedDialog: except GajimGeneralException: pass + dialog = YesNoDialog(pritext, sectext, on_response_yes=on_yes) + class ProgressDialog: def __init__(self, title_text, during_text, messages_queue): '''during text is what to show during the procedure,