summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2012-07-11 12:01:22 +0300
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2012-07-11 20:00:04 +0300
commitf62e971e775978525b0cb697d80db91bb724f1ab (patch)
tree8c50d2d7ef5df35ebf9c4afae30ce463fe0e42e9
parent27050e84a75c50f2245358759557aa94d03e3b3e (diff)
UnattendedInstaller.populate_setup_vbox -> InstallerMedia
Move populate_setup_vbox from UnattendedInstaller to parent InstallerMedia so that users of this function don't need type checks and casting to be able to use it. https://bugzilla.gnome.org/show_bug.cgi?id=679706
-rw-r--r--src/installer-media.vala1
-rw-r--r--src/unattended-installer.vala11
-rw-r--r--src/wizard.vala9
3 files changed, 8 insertions, 13 deletions
diff --git a/src/installer-media.vala b/src/installer-media.vala
index b014bca..3ae0a84 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -80,6 +80,7 @@ private class Boxes.InstallerMedia : GLib.Object {
}
public virtual void setup_spice_config (DomainGraphicsSpice graphics) {}
+ public virtual void populate_setup_vbox (Gtk.VBox setup_vbox) {}
public bool is_architecture_compatible (string architecture) {
return os_media == null || // Unknown media
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 4c69429..1b6f03c 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -135,11 +135,6 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
}
}
- public virtual void populate_setup_vbox (Gtk.VBox setup_vbox) {
- setup_vbox.pack_start (setup_label, false, false);
- setup_vbox.pack_start (setup_hbox, false, false);
- }
-
public override void setup_domain_config (Domain domain) {
base.setup_domain_config (domain);
@@ -157,7 +152,13 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
graphics.set_password (password);
}
+ public override void populate_setup_vbox (Gtk.VBox setup_vbox) {
+ foreach (var child in setup_vbox.get_children ())
+ setup_vbox.remove (child);
+ setup_vbox.pack_start (setup_label, false, false);
+ setup_vbox.pack_start (setup_hbox, false, false);
+ setup_vbox.show_all ();
}
// Ensure needed information was provided by user
diff --git a/src/wizard.vala b/src/wizard.vala
index 03822de..a022b8b 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -292,15 +292,8 @@ private class Boxes.Wizard: Boxes.UI {
return true;
return_if_fail (vm_creator != null);
- // Setup only needed for Unattended installers
- if (!(vm_creator.install_media is UnattendedInstaller))
- return true;
-
- foreach (var child in setup_vbox.get_children ())
- setup_vbox.remove (child);
- (vm_creator.install_media as UnattendedInstaller).populate_setup_vbox (setup_vbox);
- setup_vbox.show_all ();
+ vm_creator.install_media.populate_setup_vbox (setup_vbox);
return true;
}