From 05f0498d870365917d183da3296137e42c4e40c1 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 16 Jul 2007 20:07:54 +0000 Subject: [PATCH] Make the trust dialog box a transient for the main window. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/trunk/0launch@1940 9f8c893c-44ee-0310-b757-c8ca8341c71e --- zeroinstall/0launch-gui/gui.py | 2 +- zeroinstall/0launch-gui/trust_box.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zeroinstall/0launch-gui/gui.py b/zeroinstall/0launch-gui/gui.py index 021cc3d..75bc13a 100644 --- a/zeroinstall/0launch-gui/gui.py +++ b/zeroinstall/0launch-gui/gui.py @@ -126,7 +126,7 @@ class GUIHandler(object): def confirm_trust_keys(self, interface, sigs, iface_xml): import trust_box - trust_box.confirm_trust(interface, sigs, iface_xml) + trust_box.confirm_trust(interface, sigs, iface_xml, parent = self.policy.checking or self.policy.window.window) def report_error(self, ex): dialog.alert(None, str(ex)) diff --git a/zeroinstall/0launch-gui/trust_box.py b/zeroinstall/0launch-gui/trust_box.py index 0e2becc..bfd3536 100644 --- a/zeroinstall/0launch-gui/trust_box.py +++ b/zeroinstall/0launch-gui/trust_box.py @@ -19,9 +19,11 @@ class TrustBox(dialog.Dialog): sigs = None iface_xml = None valid_sigs = None + parent = None - def __init__(self, interface, sigs, iface_xml): + def __init__(self, interface, sigs, iface_xml, parent): dialog.Dialog.__init__(self) + self.set_transient_for(parent) domain = trust.domain_from_url(interface.uri) assert domain @@ -168,7 +170,7 @@ class TrustBox(dialog.Dialog): raise _queue = [] -def confirm_trust(interface, sigs, iface_xml): +def confirm_trust(interface, sigs, iface_xml, parent): """Display a dialog box asking the user to confirm that one of the keys is trusted for this domain. If a trust box is already visible, this one is queued until the existing one is closed. @@ -179,7 +181,7 @@ def confirm_trust(interface, sigs, iface_xml): @param iface_xml: the downloaded (untrusted) XML document @type iface_xml: str """ - _queue.append(TrustBox(interface, sigs, iface_xml)) + _queue.append(TrustBox(interface, sigs, iface_xml, parent)) if len(_queue) == 1: _queue[0].show() -- 2.11.4.GIT