summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2012-07-11 11:55:41 +0300
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2012-07-11 20:00:04 +0300
commit27050e84a75c50f2245358759557aa94d03e3b3e (patch)
treee227c745a9517fb7c375de567d09cc4f3e327685
parentd57cdbb5346897a3ed25754eadfb77c9062e0080 (diff)
Move SPICE password setup to InstallerMedia
Let InstallerMedia and its subclasses handle setup of SPICE password in the domain config. https://bugzilla.gnome.org/show_bug.cgi?id=679706
-rw-r--r--src/installer-media.vala2
-rw-r--r--src/unattended-installer.vala8
-rw-r--r--src/vm-configurator.vala9
3 files changed, 10 insertions, 9 deletions
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 5b1a4bf..b014bca 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -79,6 +79,8 @@ private class Boxes.InstallerMedia : GLib.Object {
domain.add_device (disk);
}
+ public virtual void setup_spice_config (DomainGraphicsSpice graphics) {}
+
public bool is_architecture_compatible (string architecture) {
return os_media == null || // Unknown media
os_media.architecture == architecture ||
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 1bfdb2b..4c69429 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -32,10 +32,10 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
}
}
- public bool password_mandatory { get; protected set; }
public DataStreamNewlineType newline_type;
public File? disk_file;
+ protected bool password_mandatory;
protected GLib.List<UnattendedFile> unattended_files;
protected Gtk.Table setup_table;
@@ -150,6 +150,12 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
domain.add_device (disk);
}
+ public override void setup_spice_config (DomainGraphicsSpice graphics) {
+ // If guest requires password, we let it take care of authentications and free the user from one
+ // authentication layer.
+ if (express_install && !password_mandatory && password != "")
+ graphics.set_password (password);
+ }
}
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index fb98b62..c4af285 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -64,14 +64,7 @@ private class Boxes.VMConfigurator {
var graphics = new DomainGraphicsSpice ();
graphics.set_autoport (true);
- if (install_media is UnattendedInstaller) {
- var unattended = install_media as UnattendedInstaller;
-
- // If guest requires password, we let it take care of authentications and free the user from one
- // authentication layer.
- if (unattended.express_install && !unattended.password_mandatory && unattended.password != "")
- graphics.set_password (unattended.password);
- }
+ install_media.setup_spice_config (graphics);
domain.add_device (graphics);
// SPICE agent channel. This is needed for features like copy&paste between host and guest etc to work.