[gnome-photos/gnome-3-12] Build and integrate the help with the application



commit 9c31d671e480d9c180d606603a81cc51a678a610
Author: Aruna Sankaranarayanan <arunasank src gnome org>
Date:   Thu Mar 20 17:32:28 2014 +0530

    Build and integrate the help with the application
    
    Integrate the help with the rest of the application.

 Makefile.am              |    2 +-
 configure.ac             |    7 +++++++
 help/Makefile.am         |    9 +++++++++
 src/photos-app-menu.ui   |    4 ++++
 src/photos-application.c |   15 +++++++++++++++
 5 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 622fbf7..3be4d9b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4 -I libgd ${ACLOCAL_FLAGS}
 
-SUBDIRS = . data libgd src po
+SUBDIRS = . data libgd src po help
 
 INTLTOOL_FILES = \
        intltool-extract.in \
diff --git a/configure.ac b/configure.ac
index ac692ee..c6193e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,11 +128,18 @@ if test -z "$DESKTOP_FILE_VALIDATE"; then
   AC_MSG_ERROR([desktop-file-validate not found])
 fi
 
+##############
+#Documentation
+##############
+
+YELP_HELP_INIT
+
 AC_CONFIG_FILES([
 Makefile
 data/Makefile
 data/org.gnome.Photos.desktop.in
 data/icons/Makefile
+help/Makefile
 libgd/Makefile
 src/Makefile
 po/Makefile.in
diff --git a/help/Makefile.am b/help/Makefile.am
new file mode 100644
index 0000000..859332d
--- /dev/null
+++ b/help/Makefile.am
@@ -0,0 +1,9 @@
+ YELP_HELP_RULES@
+
+HELP_ID = gnome-photos
+
+HELP_FILES = 
+
+HELP_MEDIA =
+
+HELP_LINGUAS =
diff --git a/src/photos-app-menu.ui b/src/photos-app-menu.ui
index b9f4d63..bc9bd37 100644
--- a/src/photos-app-menu.ui
+++ b/src/photos-app-menu.ui
@@ -8,6 +8,10 @@
     </section>
     <section>
       <item>
+        <attribute name="action">app.help</attribute>
+        <attribute name="label" translatable="yes">_Help</attribute>
+      </item>
+      <item>
         <attribute name="action">app.about</attribute>
         <attribute name="label" translatable="yes">About</attribute>
       </item>
diff --git a/src/photos-application.c b/src/photos-application.c
index 4a05a49..855ebbb 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -125,6 +125,15 @@ photos_application_refresh_data_free (PhotosApplicationRefreshData *data)
   g_slice_free (PhotosApplicationRefreshData, data);
 }
 
+static void
+photos_application_help (PhotosApplication *self, GVariant *parameter)
+{
+  GtkWindow *parent;
+
+  parent = gtk_application_get_active_window (GTK_APPLICATION (self));
+  gtk_show_uri (gtk_window_get_screen (parent), "help:gnome-photos",
+                GDK_CURRENT_TIME, NULL);
+}
 
 static void
 photos_application_about (PhotosApplication *self, GVariant *parameter)
@@ -683,6 +692,7 @@ photos_application_startup (GApplication *application)
   priv->mode_cntrlr = photos_mode_controller_dup_singleton ();
 
   action = g_simple_action_new ("about", NULL);
+
   g_signal_connect_swapped (action, "activate", G_CALLBACK (photos_application_about), self);
   g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
   g_object_unref (action);
@@ -744,6 +754,11 @@ photos_application_startup (GApplication *application)
 
   photos_application_init_app_menu (self);
 
+  action = g_simple_action_new ("help", NULL);
+  g_signal_connect_swapped (action, "activate", G_CALLBACK (photos_application_help), self);
+  g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
+  g_object_unref (action);
+
   gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>q", "app.quit", NULL);
   gtk_application_add_accelerator (GTK_APPLICATION (self), "F11", "app.fullscreen", NULL);
   gtk_application_add_accelerator (GTK_APPLICATION (self), "F10", "app.gear-menu", NULL);


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