fix E2E / GPG information dialog and another information dialog transient_for property. Fixes #7185

This commit is contained in:
Yann Leboulanger 2013-09-09 17:36:21 +02:00
parent 5a6030116e
commit 888c4a2446
3 changed files with 7 additions and 5 deletions

View File

@ -2309,9 +2309,9 @@ class ChatControl(ChatControlBase):
def _on_authentication_button_clicked(self, widget):
if self.gpg_is_active:
dialogs.GPGInfoWindow(self)
dialogs.GPGInfoWindow(self, self.parent_win.window)
elif self.session and self.session.enable_encryption:
dialogs.ESessionInfoWindow(self.session)
dialogs.ESessionInfoWindow(self.session, self.parent_win.window)
def send_message(self, message, keyID='', chatstate=None, xhtml=None,
process_commands=True, attention=False):

View File

@ -5097,7 +5097,7 @@ class ESessionInfoWindow:
"""
Class for displaying information about a XEP-0116 encrypted session
"""
def __init__(self, session):
def __init__(self, session, transient_for=None):
self.session = session
self.xml = gtkgui_helpers.get_gtk_builder('esession_info_window.ui')
@ -5108,7 +5108,7 @@ class ESessionInfoWindow:
self.button_label = self.xml.get_object('button_label')
self.window = self.xml.get_object('esession_info_window')
self.update_info()
self.window.set_transient_for(transient_for)
self.window.show_all()
@ -5219,6 +5219,7 @@ class GPGInfoWindow:
path = gtkgui_helpers.get_icon_path(image, 32)
security_image.set_from_file(path)
self.window.set_transient_for(transient_for)
xml.connect_signals(self)
self.window.show_all()

View File

@ -219,7 +219,8 @@ class MessageWindow(object):
dialogs.YesNoDialog(
_('You are going to close several tabs'),
_('Do you really want to close them all?'),
checktext=_('_Do not ask me again'), on_response_yes=on_yes1)
checktext=_('_Do not ask me again'), on_response_yes=on_yes1,
transient_for=self.window)
return True
def on_yes(ctrl):