From ae256b152b16a4e84ca4cf4c4d59c188377259e6 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 14 Aug 2011 12:19:43 +0200 Subject: [PATCH] correctly set transient window for muc error dialogs. Fixes #6943 --- src/gui_interface.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/gui_interface.py b/src/gui_interface.py index b5761c5d4..b027130c3 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -244,8 +244,15 @@ class Interface: gc_control.error_dialog = None gc_control.error_dialog = dialogs.ErrorDialog(pritext, sectext, on_response_ok=on_close, on_response_cancel=on_close) + gc_control.error_dialog.set_modal(False) + if gc_control.parent_win: + gc_control.error_dialog.set_transient_for( + gc_control.parent_win.window) else: - dialogs.ErrorDialog(pritext, sectext) + d = dialogs.ErrorDialog(pritext, sectext) + if gc_control and gc_control.parent_win: + d.set_transient_for(gc_control.parent_win.window) + d.set_modal(False) def handle_gc_password_required(self, account, room_jid, nick): def on_ok(text): @@ -281,8 +288,8 @@ class Interface: # maximum user number reached self.handle_gc_error(gc_control, _('Unable to join group chat'), - _('Maximum number of users for %s has been reached') % \ - obj.room_jid) + _('Maximum number of users for %s has been reached')\ + % obj.room_jid) elif (obj.errcode == '401') or (obj.errcon == 'not-authorized'): # password required to join self.handle_gc_password_required(obj.conn.name, obj.room_jid, @@ -290,19 +297,20 @@ class Interface: elif (obj.errcode == '403') or (obj.errcon == 'forbidden'): # we are banned self.handle_gc_error(gc_control, _('Unable to join group chat'), - _('You are banned from group chat %s.') % obj.room_jid) + _('You are banned from group chat %s.') % \ + obj.room_jid) elif (obj.errcode == '404') or (obj.errcon in ('item-not-found', 'remote-server-not-found')): # group chat does not exist self.handle_gc_error(gc_control, _('Unable to join group chat'), - _('Group chat %s does not exist.') % obj.room_jid) + _('Group chat %s does not exist.') % obj.room_jid) elif (obj.errcode == '405') or (obj.errcon == 'not-allowed'): self.handle_gc_error(gc_control, _('Unable to join group chat'), _('Group chat creation is restricted.')) elif (obj.errcode == '406') or (obj.errcon == 'not-acceptable'): self.handle_gc_error(gc_control, _('Unable to join group chat'), _('Your registered nickname must be used in group chat ' - '%s.') % obj.room_jid) + '%s.') % obj.room_jid) elif (obj.errcode == '407') or (obj.errcon == \ 'registration-required'): self.handle_gc_error(gc_control, _('Unable to join group chat'), -- 2.11.4.GIT