[gnome-documents] application: add an Help action to the app menu



commit 788d106fd75fb8a14ed2f0d114512bb23a4eed00
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Sep 12 15:00:42 2012 -0400

    application: add an Help action to the app menu
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683835

 src/application.js        |   12 ++++++++++++
 src/resources/app-menu.ui |    4 ++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index aebfcd4..4308cab 100644
--- a/src/application.js
+++ b/src/application.js
@@ -92,6 +92,16 @@ const Application = new Lang.Class({
         this._mainWindow.showAbout();
     },
 
+    _onActionHelp: function() {
+        try {
+            Gtk.show_uri(this._mainWindow.window.get_screen(),
+                         'help:gnome-help/documents',
+                         Gtk.get_current_event_time());
+        } catch (e) {
+            log('Unable to display help: ' + e.message);
+        }
+    },
+
     _onActionFullscreen: function() {
         Global.modeController.toggleFullscreen();
     },
@@ -124,6 +134,8 @@ const Application = new Lang.Class({
               accel: '<Primary>q' },
             { name: 'about',
               callback: this._onActionAbout },
+            { name: 'help',
+              callback: this._onActionHelp },
             { name: 'fullscreen',
               callback: this._onActionFullscreen,
               create_hook: this._fullscreenCreateHook,
diff --git a/src/resources/app-menu.ui b/src/resources/app-menu.ui
index 2425a2f..d466443 100644
--- a/src/resources/app-menu.ui
+++ b/src/resources/app-menu.ui
@@ -25,6 +25,10 @@
         <attribute name="label" translatable="yes">About Documents</attribute>
       </item>
       <item>
+        <attribute name="action">app.help</attribute>
+        <attribute name="label" translatable="yes">Help</attribute>
+      </item>
+      <item>
         <attribute name="action">app.quit</attribute>
         <attribute name="label" translatable="yes">Quit</attribute>
       </item>



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