landry f30cbfe2b9 Update to puzzles 20141206.
- Adds two new puzzles, unruly and undead
- Add a convenience dist target to fetch a tarball from gitweb and
  repackage it, with Makefile.gtk and icons properly generated from the
source. Selfhost the resulting distfiles.
2014-12-06 23:05:11 +00:00

41 lines
1.5 KiB
Plaintext

$OpenBSD: patch-gtk_c,v 1.3 2014/12/06 23:05:11 landry Exp $
Add 'online help' menu entry to open help in browser
--- gtk.c.orig Mon Dec 1 22:26:05 2014
+++ gtk.c Mon Dec 1 22:37:19 2014
@@ -2039,6 +2039,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;
@@ -2322,6 +2329,12 @@ static frontend *new_window(char *arg, int argtype, ch
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
menuitem=gtk_button_new_with_mnemonic("_Redo");
gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
@@ -2480,7 +2493,7 @@ char *fgetline(FILE *fp)
int main(int argc, char **argv)
{
char *pname = argv[0];
- char *error;
+ char *error = "";
int ngenerate = 0, print = FALSE, px = 1, py = 1;
int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE;
int soln = FALSE, colour = FALSE;