[evolution] Bug 759493 - Provide keyboard shortcuts window



commit f41a317fb478a2a27529648c154d0a9c5113000b
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 21 17:18:02 2019 +0200

    Bug 759493 - Provide keyboard shortcuts window
    
    Closes https://bugzilla.gnome.org/show_bug.cgi?id=759493

 data/ui/CMakeLists.txt             |   1 +
 data/ui/evolution-shell.ui         |   1 +
 data/ui/evolution-shortcuts.ui     | 346 +++++++++++++++++++++++++++++++++++++
 po/POTFILES.in                     |   1 +
 src/shell/e-shell-window-actions.c |  25 +++
 src/shell/e-shell-window-actions.h |   2 +
 6 files changed, 376 insertions(+)
---
diff --git a/data/ui/CMakeLists.txt b/data/ui/CMakeLists.txt
index 996d072575..7f383b142d 100644
--- a/data/ui/CMakeLists.txt
+++ b/data/ui/CMakeLists.txt
@@ -5,5 +5,6 @@ install(FILES   evolution-calendars.ui
                evolution-memos.ui
                evolution-shell.ui
                evolution-tasks.ui
+               evolution-shortcuts.ui
        DESTINATION ${uidir}
 )
diff --git a/data/ui/evolution-shell.ui b/data/ui/evolution-shell.ui
index c2face2d43..ac634aa0cf 100644
--- a/data/ui/evolution-shell.ui
+++ b/data/ui/evolution-shell.ui
@@ -76,6 +76,7 @@
     </menu>
     <menu action='help-menu'>
       <menuitem action='contents'/>
+      <menuitem action='shortcuts'/>
       <separator/>
       <menuitem action='submit-bug'/>
       <separator/>
diff --git a/data/ui/evolution-shortcuts.ui b/data/ui/evolution-shortcuts.ui
new file mode 100644
index 0000000000..180980e2f2
--- /dev/null
+++ b/data/ui/evolution-shortcuts.ui
@@ -0,0 +1,346 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!--<requires lib="gtk+" version="3.22"/>-->
+  <object class="GtkShortcutsWindow" id="evolution-shortcuts">
+    <property name="modal">1</property>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="section-name">general</property>
+        <property name="title" translatable="yes" context="shortcut window">Keyboard Shortcuts</property>
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="title" translatable="yes" context="shortcut window">General</property>
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;1</property>
+                <property name="title" translatable="yes" context="shortcut window">Select Mail 
component</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;2</property>
+                <property name="title" translatable="yes" context="shortcut window">Select Contacts 
component</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;3</property>
+                <property name="title" translatable="yes" context="shortcut window">Select Calendar 
component</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;4</property>
+                <property name="title" translatable="yes" context="shortcut window">Select Tasks 
component</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;5</property>
+                <property name="title" translatable="yes" context="shortcut window">Select Memos 
component</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;n</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new item in 
current component</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">F6</property>
+                <property name="title" translatable="yes" context="shortcut window">Cycle focus between 
panes</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">F1</property>
+                <property name="title" translatable="yes" context="shortcut window">Open the Evolution user 
guide</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="title" translatable="yes" context="shortcut window">Keyboard 
Shortcuts</property>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;question</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;q</property>
+                <property name="title" translatable="yes" context="shortcut window">Clear search 
bar</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;v</property>
+                <property name="title" translatable="yes" context="shortcut window">Move mails or contacts 
to folder</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;y</property>
+                <property name="title" translatable="yes" context="shortcut window">Copy mails or contacts 
to folder</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;s</property>
+                <property name="title" translatable="yes" context="shortcut window">Preferences</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;w</property>
+                <property name="title" translatable="yes" context="shortcut window">Open new 
window</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;w</property>
+                <property name="title" translatable="yes" context="shortcut window">Close window</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;q</property>
+                <property name="title" translatable="yes" context="shortcut window">Quit Evolution</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="title" translatable="yes" context="shortcut window">Mail</property>
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;m</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new 
message</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">F12</property>
+                <property name="title" translatable="yes" context="shortcut window">Send and receive 
messages</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;y</property>
+                <property name="title" translatable="yes" context="shortcut window">Apply filters to 
selection</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;o Return</property>
+                <property name="title" translatable="yes" context="shortcut window">Open selection in new 
window</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;g</property>
+                <property name="title" translatable="yes" context="shortcut window">Go to folder</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;k</property>
+                <property name="title" translatable="yes" context="shortcut window">Mark selected messages 
as read</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;k</property>
+                <property name="title" translatable="yes" context="shortcut window">Mark selected messages 
as unread</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">period bracketright</property>
+                <property name="title" translatable="yes" context="shortcut window">Jump to the next unread 
message</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">comma bracketleft</property>
+                <property name="title" translatable="yes" context="shortcut window">Jump to the previous 
unread message</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;f</property>
+                <property name="title" translatable="yes" context="shortcut window">Forward selected 
messages</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;r</property>
+                <property name="title" translatable="yes" context="shortcut window">Reply to 
sender</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;l</property>
+                <property name="title" translatable="yes" context="shortcut window">Reply to list</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;r</property>
+                <property name="title" translatable="yes" context="shortcut window">Reply to all 
recipients</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">BackSpace</property>
+                <property name="title" translatable="yes" context="shortcut window">Scroll up</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">space</property>
+                <property name="title" translatable="yes" context="shortcut window">Scroll down</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="title" translatable="yes" context="shortcut window">Calendar</property>
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;a</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new 
appointment</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;e</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new 
meeting</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;t</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new 
task</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;o</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new 
memo</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;t</property>
+                <property name="title" translatable="yes" context="shortcut window">Go to today</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;g</property>
+                <property name="title" translatable="yes" context="shortcut window">Go to date</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;y</property>
+                <property name="title" translatable="yes" context="shortcut window">Day View</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;j</property>
+                <property name="title" translatable="yes" context="shortcut window">Work Week View</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;k</property>
+                <property name="title" translatable="yes" context="shortcut window">Week View</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;m</property>
+                <property name="title" translatable="yes" context="shortcut window">Month View</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;l</property>
+                <property name="title" translatable="yes" context="shortcut window">List View</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="title" translatable="yes" context="shortcut window">Contacts</property>
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;c</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new 
contact</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;l</property>
+                <property name="title" translatable="yes" context="shortcut window">Create a new contact 
list</property>
+                <property name="visible">True</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b9d5d9488f..3ebf40b265 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -21,6 +21,7 @@ data/org.gnome.evolution.spamassassin.gschema.xml.in
 data/org.gnome.evolution.text-highlight.gschema.xml.in
 data/org.gnome.Evolution.appdata.xml.in.in
 data/org.gnome.Evolution.desktop.in.in
+[type: gettext/glade]data/ui/evolution-shortcuts.ui
 data/views/addressbook/galview.xml
 data/views/calendar/galview.xml
 data/views/mail/galview.xml
diff --git a/src/shell/e-shell-window-actions.c b/src/shell/e-shell-window-actions.c
index 7e38da48bc..346eaf5382 100644
--- a/src/shell/e-shell-window-actions.c
+++ b/src/shell/e-shell-window-actions.c
@@ -98,6 +98,24 @@ action_contents_cb (GtkAction *action,
        e_shell_utils_run_help_contents (e_shell_window_get_shell (shell_window));
 }
 
+static void
+action_shortcuts_cb (GtkAction *action,
+                    EShellWindow *shell_window)
+{
+       GtkBuilder *builder;
+       GtkWidget *widget;
+
+       builder = gtk_builder_new ();
+       e_load_ui_builder_definition (builder, "evolution-shortcuts.ui");
+
+       widget = e_builder_get_widget (builder, "evolution-shortcuts");
+       gtk_window_set_transient_for (GTK_WINDOW (widget), GTK_WINDOW (shell_window));
+
+       gtk_widget_show (widget);
+
+       g_object_unref (builder);
+}
+
 static void
 action_custom_rule_cb (GtkAction *action,
                        EShellWindow *shell_window)
@@ -952,6 +970,13 @@ static GtkActionEntry shell_entries[] = {
          N_("Select all text"),
          NULL },  /* Handled by EFocusTracker */
 
+       { "shortcuts",
+         NULL,
+         N_("_Keyboard Shortcuts"),
+         "<Control><Shift>question",
+         N_("Show keyboard shortcuts"),
+         G_CALLBACK (action_shortcuts_cb) },
+
        { "submit-bug",
          NULL,
          N_("Submit _Bug Report..."),
diff --git a/src/shell/e-shell-window-actions.h b/src/shell/e-shell-window-actions.h
index 534f6601ab..1f6fa89fb9 100644
--- a/src/shell/e-shell-window-actions.h
+++ b/src/shell/e-shell-window-actions.h
@@ -74,6 +74,8 @@
        E_SHELL_WINDOW_ACTION ((window), "search-save")
 #define E_SHELL_WINDOW_ACTION_SELECT_ALL(window) \
        E_SHELL_WINDOW_ACTION ((window), "select-all")
+#define E_SHELL_WINDOW_ACTION_SHORTCUTS(window) \
+       E_SHELL_WINDOW_ACTION ((window), "shortcuts")
 #define E_SHELL_WINDOW_ACTION_SHOW_MENUBAR(window) \
        E_SHELL_WINDOW_ACTION ((window), "show-menubar")
 #define E_SHELL_WINDOW_ACTION_SHOW_SIDEBAR(window) \


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