summaryrefslogtreecommitdiff
path: root/src/ui.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 14:23:25 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 14:23:25 +0200
commit44022b2df3c23dd172d9a13c414fcf83501e8e41 (patch)
treed11cfe3806e7b048a2294d56b8c2d890d1654192 /src/ui.vala
parent51f7a798cff874829e10a8c19d3da4ea293b6593 (diff)
parentf64f5d0c9e37828bc1a42f8e69bbc4d3d8c549f5 (diff)
Merge tag 'upstream/3.18.0'
Upstream version 3.18.0
Diffstat (limited to 'src/ui.vala')
-rw-r--r--src/ui.vala28
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);