diff options
author | Cole Robinson <crobinso@redhat.com> | 2013-06-13 17:35:48 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-06-13 17:35:48 -0400 |
commit | 1c22ea92dff3e1d652ef3149b23e90f60d8d96e1 (patch) | |
tree | 8c437c55b44c01a5d6c69b9b89c1cbf1cd26c2c3 | |
parent | e2435b6d02ec2fe571d13849ea3de2fa08f473f6 (diff) | |
download | virt-manager-1c22ea92dff3e1d652ef3149b23e90f60d8d96e1.tar.gz |
engine: Close packagekit dialog before connecting to libvirt
We are bunching up a slew of hefty operations, split things up a bit
so the UI has a change to catchup.
-rw-r--r-- | virtManager/engine.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/virtManager/engine.py b/virtManager/engine.py index 2a9a1764..c0585e15 100644 --- a/virtManager/engine.py +++ b/virtManager/engine.py @@ -205,17 +205,22 @@ class vmmEngine(vmmGObject): manager.set_startup_error(msg) return - do_start = packageutils.start_libvirtd() - warnmsg = _( - "Libvirt was just installed, so the 'libvirtd' service will\n" - "will need to be started.\n" - "virt-manager will connect to libvirt on the next application\n" - "start up.") - - if not do_start: - manager.err.ok(_("Libvirt service must be started"), warnmsg) - - self.connect_to_uri(tryuri, autoconnect=True, do_start=do_start) + warnmsg = _("virt-manager will connect to libvirt on the next\n" + "application start up.") + if any(["libvirt" in p for p in ret or []]): + warnmsg = _( + "Libvirt was just installed, so the 'libvirtd' service will\n" + "will need to be started.") + "\n\n" + warnmsg + + # Do the initial connection in an idle callback, so the + # packagekit async dialog has a chance to go away + def idle_connect(): + do_start = packageutils.start_libvirtd() + if not do_start: + manager.err.ok(_("Libvirt service must be started"), warnmsg) + + self.connect_to_uri(tryuri, autoconnect=True, do_start=do_start) + self.idle_add(idle_connect) def load_stored_uris(self): |