[gnome-boxes] installer: Setup drivers in construction method



commit abadcee3e03be16f6bc11997c69ead2fb2b163c4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Dec 6 02:40:36 2012 +0200

    installer: Setup drivers in construction method
    
    This implies moving of drivers setup (which may involve downloading)
    from wizard's setup-to-review transition to preparing stage. For media
    automatically found by Boxes, drivers setup will happen even before user
    sees it listed in wizard's 'source' page.
    
    This should probably be squashed into patch:
    
    "installer: Download & Install pre-installation drivers"
    
    but i wanted to get feedback on this before I squash it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676537

 src/unattended-installer.vala |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 5e115e2..b9f42e7 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -131,6 +131,8 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         product_key_format = get_product_key_format ();
 
         setup_ui ();
+
+        yield setup_pre_install_drivers ();
     }
 
     public override async void prepare_for_installation (string vm_name, Cancellable? cancellable) throws GLib.Error {
@@ -144,8 +146,6 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         try {
             yield create_disk_image (cancellable);
 
-            yield setup_pre_install_drivers (cancellable);
-
             foreach (var unattended_file in unattended_files)
                 yield unattended_file.copy (cancellable);
 
@@ -584,7 +584,7 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         return null;
     }
 
-    private async void setup_pre_install_drivers (Cancellable? cancellable) {
+    private async void setup_pre_install_drivers (Cancellable? cancellable = null) {
         foreach (var d in os.get_device_drivers ().get_elements ()) {
             var driver = d as DeviceDriver;
             if (driver.get_architecture () != os_media.architecture || !driver.get_pre_installable ())
@@ -615,8 +615,6 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
             var file = File.new_for_uri (file_uri);
             var cached_path = get_drivers_cache (os.short_id + "-" + file.get_basename ());
 
-            // FIXME: Although this will only download a driver once (on first usage), this should be done at the
-            //        'preparation' phase of wizard and not when going from 'setup' to 'review'.
             file = yield downloader.download (file, cached_path);
 
             add_unattended_file (new UnattendedRawFile (this, cached_path, filename));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]