[gnome-boxes] installer: Update progress on error to setup driver
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] installer: Update progress on error to setup driver
- Date: Tue, 19 Feb 2013 20:27:32 +0000 (UTC)
commit 443af23e652d80e0f454a7bf7c91860671b4dcbd
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri Jan 25 17:50:35 2013 +0200
installer: Update progress on error to setup driver
Ensure driver installation progress always reaches 100% even if an error
occurs during the installation.
https://bugzilla.gnome.org/show_bug.cgi?id=691546
src/unattended-installer.vala | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index ef6dd2f..1a74fa3 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -594,20 +594,23 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
var drivers = get_pre_installable_drivers ();
var scripts = get_pre_installer_scripts ();
- if (drivers.length () == 0 || scripts.length () == 0)
+ if (drivers.length () == 0 || scripts.length () == 0) {
+ progress.progress = 1.0;
return;
+ }
progress.info = _("Downloading device drivers...");
var driver_progress_scale = 1d / drivers.length () / scripts.length ();
foreach (var driver in drivers) {
foreach (var script in scripts) {
+ var driver_progress = progress.add_child_activity (driver_progress_scale);
try {
- var driver_progress = progress.add_child_activity (driver_progress_scale);
yield setup_pre_install_driver_for_script (driver, script, driver_progress, cancellable);
- driver_progress.progress = 1.0; // Ensure progress reaches 100%
} catch (GLib.Error e) {
debug ("Failed to make use of drivers at '%s': %s", driver.get_location (), e.message);
+ } finally {
+ driver_progress.progress = 1.0; // Ensure progress reaches 100%
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]