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.
This commit is contained in:
Cole Robinson 2013-06-13 17:35:48 -04:00
parent e2435b6d02
commit 1c22ea92df
1 changed files with 14 additions and 9 deletions

View File

@ -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):