[gnome-boxes] UnattendedInstaller.populate_setup_vbox -> InstallerMedia
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] UnattendedInstaller.populate_setup_vbox -> InstallerMedia
- Date: Wed, 11 Jul 2012 17:01:43 +0000 (UTC)
commit f62e971e775978525b0cb697d80db91bb724f1ab
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Jul 11 12:01:22 2012 +0300
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
src/installer-media.vala | 1 +
src/unattended-installer.vala | 11 ++++++-----
src/wizard.vala | 9 +--------
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]