[gnome-boxes] Handle non-pure live & unknown media like pure live
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Handle non-pure live & unknown media like pure live
- Date: Wed, 7 Dec 2011 13:09:50 +0000 (UTC)
commit 61803588cc990d6c16f25f7774d763b808462a5c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Dec 1 00:59:42 2011 +0200
Handle non-pure live & unknown media like pure live
Handle live+installer and unknown media just like pure live media.
https://bugzilla.gnome.org/show_bug.cgi?id=665254
src/installer-media.vala | 2 ++
src/unattended-installer.vala | 2 +-
src/vm-creator.vala | 13 +++++++------
src/wizard.vala | 25 +++++++++++--------------
4 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 83417de..e7ab93a 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -11,6 +11,8 @@ private class Boxes.InstallerMedia : Object {
public string mount_point;
public bool from_image;
+ public bool live { get { return os_media == null || os_media.live; } }
+
public static async InstallerMedia instantiate (string path,
OSDatabase os_db,
Client client,
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index fe181f3..0b03a68 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -109,7 +109,7 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
table.attach_defaults (label, 1, 2, 0, 1);
express_toggle = new Gtk.Switch ();
- express_toggle.active = os_media.installer;
+ express_toggle.active = !os_media.live;
express_toggle.halign = Gtk.Align.START;
express_toggle.valign = Gtk.Align.CENTER;
table.attach_defaults (express_toggle, 2, 3, 0, 1);
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index 34cdef6..ec0c56c 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -41,20 +41,21 @@ private class Boxes.VMCreator {
var config = new GVirConfig.Domain.from_xml (xml);
Domain domain;
- if (install_media.os_media.installer) {
+ if (install_media.live)
+ // We create a (initially) transient domain for live and unknown media
+ domain = connection.start_domain (config, 0);
+ else {
domain = connection.create_domain (config);
domain.start (0);
config = domain.get_config (0);
- } else
- // We create a transient domain for media w/o an installer
- domain = connection.start_domain (config, 0);
+ }
ulong id = 0;
id = domain.stopped.connect (() => {
if (guest_installed_os (volume)) {
- post_install_setup (domain, config, install_media.os_media.installer);
+ post_install_setup (domain, config, !install_media.live);
domain.disconnect (id);
- } else if (!install_media.os_media.installer)
+ } else if (install_media.live)
domain.disconnect (id);
});
diff --git a/src/wizard.vala b/src/wizard.vala
index efa4b3a..0ce0fa3 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -227,28 +227,25 @@ private class Boxes.Wizard: Boxes.UI {
foreach (var child in setup_vbox.get_children ())
setup_vbox.remove (child);
- if (install_media == null || !(install_media is UnattendedInstaller)) {
+ var skip_to = page;
+ if (install_media == null || install_media.live)
+ // No setup or review required for unknown and live media
+ skip_to = WizardPage.LAST;
+ else if (!(install_media is UnattendedInstaller))
// Nothing to do so just skip to the next page but let the current page change complete first
+ skip_to = page + 1;
+
+ if (skip_to != page)
Idle.add (() => {
- page = page + 1;
+ page = skip_to;
return false;
});
-
- return;
- }
-
- if (install_media.os_media.installer) {
+ else {
var installer = install_media as UnattendedInstaller;
installer.populate_setup_vbox (setup_vbox);
setup_vbox.show_all ();
- } else
- // No setup or review required for pure (no installer) live medias
- Idle.add (() => {
- page = WizardPage.LAST;
-
- return false;
- });
+ }
}
private void review () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]