[nautilus] application: add app menu entry for shortcuts



commit 93527eaac1d0da43c53bea1b11ba3b55719333b4
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Nov 23 11:31:59 2015 +0100

    application: add app menu entry for shortcuts

 src/nautilus-application-actions.c    |   12 ++++++++++++
 src/resources/ui/nautilus-app-menu.ui |    4 ++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-application-actions.c b/src/nautilus-application-actions.c
index 0f30071..b5c5134 100644
--- a/src/nautilus-application-actions.c
+++ b/src/nautilus-application-actions.c
@@ -182,6 +182,17 @@ action_show_hide_sidebar (GSimpleAction *action,
        g_simple_action_set_state (action, state);
 }
 
+static void
+action_show_help_overlay (GSimpleAction *action,
+                          GVariant      *state,
+                          gpointer       user_data)
+{
+        GtkApplication *application = user_data;
+        GtkWindow *window = gtk_application_get_active_window (application);
+
+        g_action_group_activate_action (G_ACTION_GROUP (window), "show-help-overlay", NULL);
+}
+
 static GActionEntry app_entries[] = {
        { "new-window", action_new_window, NULL, NULL, NULL },
        { "bookmarks", action_bookmarks, NULL, NULL, NULL },
@@ -193,6 +204,7 @@ static GActionEntry app_entries[] = {
        { "kill", action_kill, NULL, NULL, NULL },
        { "open-desktop", action_open_desktop, NULL, NULL, NULL },
        { "close-desktop", action_close_desktop, NULL, NULL, NULL },
+       { "show-help-overlay", action_show_help_overlay, NULL, NULL, NULL },
 };
 
 void
diff --git a/src/resources/ui/nautilus-app-menu.ui b/src/resources/ui/nautilus-app-menu.ui
index ced0d77..5385406 100644
--- a/src/resources/ui/nautilus-app-menu.ui
+++ b/src/resources/ui/nautilus-app-menu.ui
@@ -23,6 +23,10 @@
     </section>
     <section>
       <item>
+        <attribute name="action">app.show-help-overlay</attribute>
+        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+      </item>
+      <item>
        <attribute name="action">app.help</attribute>
        <attribute name="label" translatable="yes">_Help</attribute>
        <attribute name="accel">F1</attribute>


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