aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-09-04 09:54:35 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-09-04 09:54:35 +0200
commitd346ab822b4b0206bfc22c5c294b9d609248372f (patch)
tree989d230c3cf8bd65caea2e2da1f23660c3e5d65c
parent657eaefb193b86bbf2cb5ef994e0a00e474cee41 (diff)
downloadvconsole-d346ab822b4b0206bfc22c5c294b9d609248372f.tar.gz
add menu item to show manual page
-rw-r--r--vconsole.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vconsole.c b/vconsole.c
index 3f01887..2e73119 100644
--- a/vconsole.c
+++ b/vconsole.c
@@ -290,6 +290,14 @@ static void menu_cb_about(GtkAction *action, gpointer userdata)
NULL);
}
+static void menu_cb_manual(GtkAction *action, gpointer userdata)
+{
+ if (fork() <= 0)
+ return;
+ /* child */
+ execlp("xdg-open", "xdg-open", "man:vconsole(1)", NULL);
+}
+
/* ------------------------------------------------------------------ */
static void menu_cb_blink_cursor(GtkToggleAction *action, gpointer userdata)
@@ -404,6 +412,10 @@ static const GtkActionEntry entries[] = {
.stock_id = GTK_STOCK_ABOUT,
.label = "_About ...",
.callback = G_CALLBACK(menu_cb_about),
+ },{
+ .name = "Manual",
+ .label = "_Manual page",
+ .callback = G_CALLBACK(menu_cb_manual),
},
};
@@ -455,6 +467,7 @@ static char ui_xml[] =
" <menuitem action='GuestKill'/>\n"
" </menu>\n"
" <menu action='HelpMenu'>\n"
+" <menuitem action='Manual'/>\n"
" <menuitem action='About'/>\n"
" </menu>\n"
" </menubar>\n"