summaryrefslogtreecommitdiff
path: root/src/app-window.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2019-10-08 07:29:21 +0200
committerJörg Frings-Fürst <debian@jff.email>2019-10-08 07:29:21 +0200
commitddd56c71512f618e516d7f1060db7d36dc70b944 (patch)
tree9830417574b4c8b15447992072baa2b77195a55a /src/app-window.vala
parentd3b3513c5f264d5d9b61f036e40fba818d2279c5 (diff)
parent05cb1275dfd46886ca7826344e10502dc9562b72 (diff)
Merge branch 'release/debian/3.34.1-1'debian/3.34.1-1
Diffstat (limited to 'src/app-window.vala')
-rw-r--r--src/app-window.vala58
1 files changed, 49 insertions, 9 deletions
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);