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



commit 02c5ab4a8d0404407500b9fc16843f93d9435fd1
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 |   13 +++++++++++++
 5 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c55c782..14b8fa5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4 -I libgd ${ACLOCAL_FLAGS}
 
-SUBDIRS = . data libgd src po tests
+SUBDIRS = . data libgd src po tests help
 
 INTLTOOL_FILES = \
        intltool-extract.in \
diff --git a/configure.ac b/configure.ac
index dd5e936..5729fe9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,11 +136,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
 tests/Makefile
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 9ed6d88..7a04ce1 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -133,6 +133,13 @@ photos_application_refresh_data_free (PhotosApplicationRefreshData *data)
   g_slice_free (PhotosApplicationRefreshData, data);
 }
 
+static void photos_application_help()
+{
+  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)
@@ -693,6 +700,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);
@@ -754,6 +762,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]