diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-09-27 14:23:15 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-09-27 14:23:15 +0200 |
commit | f64f5d0c9e37828bc1a42f8e69bbc4d3d8c549f5 (patch) | |
tree | 4b288591003df04deea71d2acfb71f81849ea2f2 /src/ui.vala | |
parent | 05e2631353c9f9522564ca06efc8fc5ba3a863cb (diff) |
Imported Upstream version 3.18.0upstream/3.18.0
Diffstat (limited to 'src/ui.vala')
-rw-r--r-- | src/ui.vala | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/ui.vala b/src/ui.vala index 17392bc..ab1cfd4 100644 --- a/src/ui.vala +++ b/src/ui.vala @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2011 Canonical Ltd. + * Copyright (C) 2009-2015 Canonical Ltd. * Author: Robert Ancell <robert.ancell@canonical.com>, * Eduard Gotwig <g@ox.io> * @@ -467,9 +467,15 @@ public class UserInterface : Gtk.ApplicationWindow while (device_model.iter_nth_child (out iter, null, index)) device_model.remove (iter); - /* Select the first available device */ - if (!have_selection && devices != null) - device_combo.set_active (0); + /* Select the previously selected device or the first available device */ + if (!have_selection) + { + var device = settings.get_string ("selected-device"); + if (device != null && find_scan_device (device, out iter)) + device_combo.set_active_iter (iter); + else + device_combo.set_active (0); + } setting_devices = false; @@ -1479,7 +1485,7 @@ public class UserInterface : Gtk.ApplicationWindow "authors", authors, "translator-credits", _("translator-credits"), "website", "https://launchpad.net/simple-scan", - "copyright", "Copyright © 2009-2011 Canonical Ltd.", + "copyright", "Copyright © 2009-2015 Canonical Ltd.", "license", license, "wrap-license", true, null); @@ -1654,14 +1660,13 @@ public class UserInterface : Gtk.ApplicationWindow { var e = results.get_error_code (); /* Label shown if failed to install drivers */ - var error_text = _("Failed to install drivers (error code %d).").printf (e.code); + result_text = _("Failed to install drivers (error code %d).").printf (e.code); } - } catch (Error e) { /* Label shown if failed to install drivers */ - error_text = _("Failed to install drivers."); + result_text = _("Failed to install drivers."); warning ("Failed to install drivers: %s", e.message); } instructions_label.set_text (result_text); @@ -1952,13 +1957,6 @@ public class UserInterface : Gtk.ApplicationWindow quality = settings.get_int ("jpeg-quality"); quality_adjustment.value_changed.connect (() => { settings.set_int ("jpeg-quality", quality); }); - var device = settings.get_string ("selected-device"); - if (device != null) - { - if (find_scan_device (device, out iter)) - device_combo.set_active_iter (iter); - } - var document_type = settings.get_string ("document-type"); if (document_type != null) set_document_hint (document_type); |