[gnome-boxes] wizard-source: Add bool for system libvirt import
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] wizard-source: Add bool for system libvirt import
- Date: Fri, 22 Nov 2013 00:14:18 +0000 (UTC)
commit 3a4a02689651c2f8d3cd29a9e7390f380d7b8211
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri Nov 22 00:04:15 2013 +0000
wizard-source: Add bool for system libvirt import
Add a boolean field to indicate user chose system libvirt import.
This fixes the regression of system libvirt import getting wrongly
activated, from commit 6804083.
src/wizard-source.vala | 2 ++
src/wizard.vala | 12 +++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 62237ee..ea7add2 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -79,6 +79,7 @@ private class Boxes.WizardSource: GLib.Object {
}
public InstallerMedia? install_media { get; private set; }
public LibvirtSystemImporter libvirt_sys_importer { get; private set; }
+ public bool libvirt_sys_import;
private Gtk.Box main_vbox;
private Gtk.Box media_vbox;
@@ -281,6 +282,7 @@ private class Boxes.WizardSource: GLib.Object {
}
var hbox = add_entry (main_vbox, () => {
+ libvirt_sys_import = true;
activate ();
return true;
diff --git a/src/wizard.vala b/src/wizard.vala
index 211d97c..90aedf2 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -211,10 +211,11 @@ private class Boxes.Wizard: Boxes.UI {
vm_creator.install_media.clean_up_preparation_cache ();
vm_creator = null;
wizard_source.uri = "";
+ wizard_source.libvirt_sys_import = false;
} else if (source != null) {
source.save ();
App.app.add_collection_source.begin (source);
- } else if (wizard_source.libvirt_sys_importer != null) {
+ } else if (wizard_source.libvirt_sys_import) {
wizard_source.libvirt_sys_importer.import.begin ();
} else {
return_val_if_reached (false); // Shouldn't arrive here with no source
@@ -322,7 +323,7 @@ private class Boxes.Wizard: Boxes.UI {
prep_status_label.label = _("Analyzing...");
prepare_media.begin (wizard_source.install_media);
return true;
- } else if (this.wizard_source.libvirt_sys_importer != null) {
+ } else if (this.wizard_source.libvirt_sys_import) {
return true;
} else {
try {
@@ -339,7 +340,7 @@ private class Boxes.Wizard: Boxes.UI {
private bool setup () {
// there is no setup yet for direct source nor libvirt system imports
- if (source != null || this.wizard_source.libvirt_sys_importer != null)
+ if (source != null || this.wizard_source.libvirt_sys_import)
return true;
return_if_fail (vm_creator != null);
@@ -465,7 +466,7 @@ private class Boxes.Wizard: Boxes.UI {
}
nokvm_box.visible = (libvirt_machine.domain_config.get_virt_type () !=
GVirConfig.DomainVirtType.KVM);
- } else if (this.wizard_source.libvirt_sys_importer != null) {
+ } else if (this.wizard_source.libvirt_sys_import) {
review_label.set_text (this.wizard_source.libvirt_sys_importer.wizard_review_label);
}
@@ -521,7 +522,7 @@ private class Boxes.Wizard: Boxes.UI {
&& vm_creator.install_media.live
&& skip_review_for_live)
skip_to += 1;
- } else if (wizard_source.libvirt_sys_importer != null) {
+ } else if (wizard_source.libvirt_sys_import) {
if (page == Boxes.WizardPage.PREPARATION)
skip_to = forwards ? page + 2 : page - 1;
else if (page == Boxes.WizardPage.SETUP)
@@ -744,6 +745,7 @@ private class Boxes.Wizard: Boxes.UI {
review.begin ();
else {
wizard_source.uri = "";
+ wizard_source.libvirt_sys_import = false;
page = WizardPage.INTRODUCTION;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]