[simple-scan] Add a shortcut window



commit 3dd8211a66d4867dec33cc80737b03292876f76f
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Jun 22 16:46:17 2017 +1200

    Add a shortcut window

 help/C/index.page             |    4 -
 help/C/shortcuts.page         |   94 ------------------------------
 help/meson.build              |    1 -
 po/POTFILES.in                |    1 +
 src/app-window.vala           |    1 +
 src/help-overlay.ui           |  128 +++++++++++++++++++++++++++++++++++++++++
 src/simple-scan.gresource.xml |    3 +
 7 files changed, 133 insertions(+), 99 deletions(-)
---
diff --git a/help/C/index.page b/help/C/index.page
index c9d8425..9ddb34f 100644
--- a/help/C/index.page
+++ b/help/C/index.page
@@ -27,8 +27,4 @@
     <section id="use" style="2column">
         <title>Using the Document</title>
     </section>
-
-    <section id="shortcuts" style="2column">
-       <title>Simple Scan Shortcuts</title>
-    </section>
 </page>
diff --git a/help/meson.build b/help/meson.build
index 56cdc9b..52276d4 100644
--- a/help/meson.build
+++ b/help/meson.build
@@ -18,7 +18,6 @@ languages = [ 'ar',
 
 # 'delete.page'
 # 'external.page'
-# 'shortcuts.page'
 
 gnome.yelp ('simple-scan',
             sources: [ 'adf.page',
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7956857..b99bb37 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -7,6 +7,7 @@ src/app-window.ui
 src/app-window.vala
 src/authorize-dialog.ui
 src/book.vala
+src/help-overlay.ui
 src/page.vala
 src/preferences-dialog.ui
 src/preferences-dialog.vala
diff --git a/src/app-window.vala b/src/app-window.vala
index 1fb207d..2cd75ee 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -1569,6 +1569,7 @@ public class AppWindow : Gtk.ApplicationWindow
 
             section = new Menu ();
             appmenu.append_section (null, section);
+            section.append (_("Keyboard Shortcuts"), "win.show-help-overlay");
             section.append (_("Help"), "app.help");
             section.append (_("About"), "app.about");
             section.append (_("Quit"), "app.quit");
diff --git a/src/help-overlay.ui b/src/help-overlay.ui
new file mode 100644
index 0000000..dabec9f
--- /dev/null
+++ b/src/help-overlay.ui
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.17 -->
+  <object class="GtkShortcutsWindow" id="help_overlay">
+    <property name="modal">1</property>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes" context="shortcut window">Scanning</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;1</property>
+                <property name="title" translatable="yes" context="shortcut window">Scan a single 
page</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;f</property>
+                <property name="title" translatable="yes" context="shortcut window">Scan all pages from 
document feeder</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;m</property>
+                <property name="title" translatable="yes" context="shortcut window">Scan continuously from a 
flatbed scanner</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">Escape</property>
+                <property name="title" translatable="yes" context="shortcut window">Stop scan in 
progress</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes" context="shortcut window">Document 
Modification</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">less</property>
+                <property name="title" translatable="yes" context="shortcut window">Move page left</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">greater</property>
+                <property name="title" translatable="yes" context="shortcut window">Move page 
right</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">bracketleft</property>
+                <property name="title" translatable="yes" context="shortcut window">Rotate page to the left 
(anti-clockwise)</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">bracketright</property>
+                <property name="title" translatable="yes" context="shortcut window">Rotate page to the right 
(clockwise)</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">Delete</property>
+                <property name="title" translatable="yes" context="shortcut window">Delete page</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes" context="shortcut window">Document 
Management</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;n</property>
+                <property name="title" translatable="yes" context="shortcut window">Start new 
document</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;s</property>
+                <property name="title" translatable="yes" context="shortcut window">Save scanned 
document</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;e</property>
+                <property name="title" translatable="yes" context="shortcut window">Email scanned 
document</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;p</property>
+                <property name="title" translatable="yes" context="shortcut window">Print scanned 
document</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;c</property>
+                <property name="title" translatable="yes" context="shortcut window">Copy current page to 
clipboard</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/src/simple-scan.gresource.xml b/src/simple-scan.gresource.xml
index 4100994..a62619e 100644
--- a/src/simple-scan.gresource.xml
+++ b/src/simple-scan.gresource.xml
@@ -5,4 +5,7 @@
     <file preprocess="xml-stripblanks">preferences-dialog.ui</file>
     <file preprocess="xml-stripblanks">authorize-dialog.ui</file>
   </gresource>
+  <gresource prefix="/org/gnome/SimpleScan/gtk">
+    <file preprocess="xml-stripblanks">help-overlay.ui</file>
+  </gresource>
 </gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]