32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
$OpenBSD: patch-gtk_c,v 1.2 2012/04/02 10:06:13 sthen Exp $
|
|
Add 'online help' menu entry to open help in browser
|
|
--- gtk.c.orig Wed Dec 28 19:17:30 2011
|
|
+++ gtk.c Mon Apr 2 10:14:24 2012
|
|
@@ -1977,6 +1977,13 @@ static void menu_config_event(GtkMenuItem *menuitem, g
|
|
resize_fe(fe);
|
|
}
|
|
|
|
+static void menu_help_event(GtkMenuItem *menuitem, gpointer data)
|
|
+{
|
|
+ gchar *cmd = g_strconcat("xdg-open http://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/" ,thegame.htmlhelp_topic, ".html" , NULL);
|
|
+ g_spawn_command_line_async(cmd, NULL);
|
|
+ g_free(cmd);
|
|
+}
|
|
+
|
|
static void menu_about_event(GtkMenuItem *menuitem, gpointer data)
|
|
{
|
|
frontend *fe = (frontend *)data;
|
|
@@ -2258,6 +2265,12 @@ static frontend *new_window(char *arg, int argtype, ch
|
|
gtk_container_add(GTK_CONTAINER(menu), menuitem);
|
|
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
|
|
GTK_SIGNAL_FUNC(menu_about_event), fe);
|
|
+ gtk_widget_show(menuitem);
|
|
+
|
|
+ menuitem = gtk_menu_item_new_with_label("Online Help");
|
|
+ gtk_container_add(GTK_CONTAINER(menu), menuitem);
|
|
+ gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
|
|
+ GTK_SIGNAL_FUNC(menu_help_event), fe);
|
|
gtk_widget_show(menuitem);
|
|
|
|
#ifdef STYLUS_BASED
|