aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-05-08 05:13:53 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-05-08 05:13:53 +0200
commita6f821ff833171da62a25ad24fd85bc7834f1961 (patch)
treeb9210fe6c9c9e4eea397026d3fa38d38e01d5ecf
parent8f2799acdbc3049b88758205bd921c7f8697a0ee (diff)
downloadexperiment-player-a6f821ff833171da62a25ad24fd85bc7834f1961.tar.gz
support for opening the HTML manual from the experiment player help menu
URI is configurable (--with-help-uri)
-rw-r--r--configure.ac8
-rw-r--r--src/Makefile.am3
-rw-r--r--src/default.ui14
-rw-r--r--src/main.c7
4 files changed, 31 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 943dfab..d330e1d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,6 +109,14 @@ AC_ARG_WITH(default-ui,
# must be expanded by the Makefiles
AC_SUBST(DEFAULT_UI)
+AC_ARG_WITH(help-uri,
+ AS_HELP_STRING([--with-help-uri=URI],
+ [Specify help (manual) URI [default=file://DOCDIR/experiment-player.html]]),
+ [HELP_URI=$withval], [HELP_URI=file://$docdir/experiment-player.html])
+# NOTE: cannot use AC_DEFINE_UNQUOTED since installation directories
+# must be expanded by the Makefiles
+AC_SUBST(HELP_URI)
+
AC_ARG_ENABLE(doxygen-doc,
AS_HELP_STRING([--enable-doxygen-doc],
[Generate Doxygen documentation [default=no]]),
diff --git a/src/Makefile.am b/src/Makefile.am
index f69a513..8915af2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,8 @@ bin_PROGRAMS = experiment-player
experiment_player_SOURCES = main.c
experiment_player_CFLAGS = $(AM_CFLAGS)
-experiment_player_CPPFLAGS = -DDEFAULT_UI='"@DEFAULT_UI@"'
+experiment_player_CPPFLAGS = -DDEFAULT_UI='"@DEFAULT_UI@"' \
+ -DHELP_URI='"@HELP_URI@"'
experiment_player_LDFLAGS =
experiment_player_LDADD =
diff --git a/src/default.ui b/src/default.ui
index 85f4be4..7f74228 100644
--- a/src/default.ui
+++ b/src/default.ui
@@ -112,6 +112,16 @@
<object class="GtkMenu" id="help_menu">
<property name="visible">True</property>
<child>
+ <object class="GtkImageMenuItem" id="help_menu_manual_item">
+ <property name="label" translatable="yes">Read _Manual...</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="image">image4</property>
+ <property name="use_stock">False</property>
+ <signal name="activate" handler="help_menu_manual_item_activate_cb"/>
+ </object>
+ </child>
+ <child>
<object class="GtkImageMenuItem" id="help_menu_about_item">
<property name="label">gtk-about</property>
<property name="visible">True</property>
@@ -236,4 +246,8 @@ audio-volume-medium</property>
<property name="visible">True</property>
<property name="stock">gtk-directory</property>
</object>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-help</property>
+ </object>
</interface>
diff --git a/src/main.c b/src/main.c
index e71914b..af75dfb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -137,6 +137,13 @@ quickopen_menu_refresh_item_activate_cb(GtkWidget *widget,
}
void
+help_menu_manual_item_activate_cb(GtkWidget *widget __attribute__((unused)),
+ gpointer data __attribute__((unused)))
+{
+ gtk_show_uri(NULL, HELP_URI, GDK_CURRENT_TIME, NULL);
+}
+
+void
generic_quit_cb(GtkWidget *widget __attribute__((unused)),
gpointer data __attribute__((unused)))
{