From 1c22ea92dff3e1d652ef3149b23e90f60d8d96e1 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 13 Jun 2013 17:35:48 -0400 Subject: [PATCH] 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. --- virtManager/engine.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/virtManager/engine.py b/virtManager/engine.py index 2a9a1764d..c0585e15d 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.") + 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 - if not do_start: - manager.err.ok(_("Libvirt service must be started"), 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.connect_to_uri(tryuri, autoconnect=True, do_start=do_start) + self.idle_add(idle_connect) def load_stored_uris(self):