diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2019-10-03 14:31:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2019-10-03 14:31:52 +0200 |
commit | 6e3f340511b86d9f883b75ae9c154dbb28a91425 (patch) | |
tree | 74051fa0f719d8e2cfe42e1a67165911860d37b6 /src | |
parent | b0bef4d2c6d7ece3e80573ff3c0842600684bd29 (diff) |
New upstream version 3.34.0upstream/3.34.0
Diffstat (limited to 'src')
-rw-r--r-- | src/app-window.ui | 2 | ||||
-rw-r--r-- | src/app-window.vala | 58 | ||||
-rw-r--r-- | src/preferences-dialog.vala | 2 | ||||
-rw-r--r-- | src/simple-scan.vala | 4 |
4 files changed, 53 insertions, 13 deletions
diff --git a/src/app-window.ui b/src/app-window.ui index fbde173..b34c07e 100644 --- a/src/app-window.ui +++ b/src/app-window.ui @@ -178,7 +178,7 @@ </child> </object> <template class="AppWindow" parent="GtkApplicationWindow"> - <property name="title" translatable="yes" comments="Title of scan window">Simple Scan</property> + <property name="title" translatable="yes" comments="Title of scan window">Document Scanner</property> <property name="icon_name">org.gnome.SimpleScan</property> <signal name="delete-event" handler="window_delete_event_cb" swapped="no"/> <child> diff --git a/src/app-window.vala b/src/app-window.vala index efcaaf2..7901cd7 100644 --- a/src/app-window.vala +++ b/src/app-window.vala @@ -19,6 +19,10 @@ public class AppWindow : Gtk.ApplicationWindow private const GLib.ActionEntry[] action_entries = { { "new_document", new_document_cb }, + { "scan_single", scan_single_cb }, + { "scan_adf", scan_adf_cb }, + { "scan_batch", scan_batch_cb }, + { "scan_stop", scan_stop_cb }, { "reorder", reorder_document_cb }, { "save", save_document_activate_cb }, { "email", email_document_cb }, @@ -607,7 +611,41 @@ public class AppWindow : Gtk.ApplicationWindow private void new_document_cb () { - new_document(); + new_document (); + } + + private void scan (ScanOptions options) + { + status_primary_label.set_text (/* Label shown when scan started */ + _("Contacting scanner…")); + start_scan (selected_device, options); + } + + private void scan_single_cb () + { + var options = make_scan_options (); + options.type = ScanType.SINGLE; + scan (options); + } + + private void scan_adf_cb () + { + var options = make_scan_options (); + options.type = ScanType.ADF_BOTH; + options.type = preferences_dialog.get_page_side (); + scan (options); + } + + private void scan_batch_cb () + { + var options = make_scan_options (); + options.type = ScanType.BATCH; + scan (options); + } + + private void scan_stop_cb () + { + stop_scan (); } private void set_scan_type (ScanType scan_type) @@ -713,9 +751,7 @@ public class AppWindow : Gtk.ApplicationWindow options.type = scan_type; if (options.type == ScanType.ADF_BOTH) options.type = preferences_dialog.get_page_side (); - status_primary_label.set_text (/* Label shown when scan started */ - _("Contacting scanner…")); - start_scan (selected_device, options); + scan (options); } [GtkCallback] @@ -1256,14 +1292,14 @@ public class AppWindow : Gtk.ApplicationWindow string license = _("This program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <http://www.gnu.org/licenses/>."); /* Title of about dialog */ - string title = _("About Simple Scan"); + string title = _("About Document Scanner"); /* Description of program */ string description = _("Simple document scanning tool"); Gtk.show_about_dialog (this, "title", title, - "program-name", _("Simple Scan"), + "program-name", _("Document Scanner"), "version", VERSION, "comments", description, "logo-icon-name", "org.gnome.SimpleScan", @@ -1383,7 +1419,7 @@ public class AppWindow : Gtk.ApplicationWindow instructions_box.add (instructions_label); label = new Gtk.Label (/* Message in driver install dialog */ - _("Once installed you will need to restart Simple Scan.")); + _("Once installed you will need to restart this app.")); label.visible = true; label.xalign = 0f; label.vexpand = true; @@ -1517,11 +1553,15 @@ public class AppWindow : Gtk.ApplicationWindow /* Set HeaderBar title here because Glade doesn't keep it translated */ /* https://bugzilla.gnome.org/show_bug.cgi?id=782753 */ /* Title of scan window */ - header_bar.title = _("Simple Scan"); + header_bar.title = _("Document Scanner"); app.add_action_entries (action_entries, this); app.set_accels_for_action ("app.new_document", { "<Ctrl>N" }); + app.set_accels_for_action ("app.scan_single", { "<Ctrl>1" }); + app.set_accels_for_action ("app.scan_adf", { "<Ctrl>F" }); + app.set_accels_for_action ("app.scan_batch", { "<Ctrl>M" }); + app.set_accels_for_action ("app.scan_stop", { "Escape" }); app.set_accels_for_action ("app.save", { "<Ctrl>S" }); app.set_accels_for_action ("app.email", { "<Ctrl>E" }); app.set_accels_for_action ("app.print", { "<Ctrl>P" }); @@ -1538,7 +1578,7 @@ public class AppWindow : Gtk.ApplicationWindow section.append (_("Preferences"), "app.preferences"); section.append (_("Keyboard Shortcuts"), "win.show-help-overlay"); section.append (_("Help"), "app.help"); - section.append (_("About Simple Scan"), "app.about"); + section.append (_("About Document Scanner"), "app.about"); menu_button.set_menu_model (gear_menu); app.add_window (this); diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala index 43f49af..1533541 100644 --- a/src/preferences-dialog.vala +++ b/src/preferences-dialog.vala @@ -411,7 +411,7 @@ private class PreferencesDialog : Gtk.Dialog { if (page_delay >= 15000) page_delay_15s_button.active = true; - else if (page_delay >= 1000) + else if (page_delay >= 10000) page_delay_10s_button.active = true; else if (page_delay >= 7000) page_delay_7s_button.active = true; diff --git a/src/simple-scan.vala b/src/simple-scan.vala index 0c263f0..6175a8e 100644 --- a/src/simple-scan.vala +++ b/src/simple-scan.vala @@ -23,7 +23,7 @@ public class SimpleScan : Gtk.Application /* Help string for command line --debug flag */ N_("Print debugging messages"), null}, { "fix-pdf", 0, 0, OptionArg.STRING, ref fix_pdf_filename, - N_("Fix PDF files generated with older versions of Simple Scan"), "FILENAME…"}, + N_("Fix PDF files generated with older versions of this app"), "FILENAME…"}, { null } }; private static Timer log_timer; @@ -635,7 +635,7 @@ public class SimpleScan : Gtk.Application log_file = FileStream.open (path, "w"); Log.set_default_handler (log_cb); - debug ("Starting Simple Scan %s, PID=%i", VERSION, Posix.getpid ()); + debug ("Starting %s %s, PID=%i", args[0], VERSION, Posix.getpid ()); Gtk.init (ref args); |