From a1f5eabb6c4cfa9618fad6fbe58c31cad6148c80 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 18 Nov 2004 08:59:56 +0000 Subject: [PATCH] plug-ins/maze/maze.[ch] removed the extra help button from the Maze 2004-11-18 Sven Neumann * plug-ins/maze/maze.[ch] * plug-ins/maze/maze_face.c: removed the extra help button from the Maze plug-in. Fixes bug #158605. --- ChangeLog | 6 +++ plug-ins/maze/maze.c | 13 ++--- plug-ins/maze/maze.h | 5 +- plug-ins/maze/maze_face.c | 102 +++++++------------------------------- 4 files changed, 29 insertions(+), 97 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9fb80db005..0be83b20f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-18 Sven Neumann + + * plug-ins/maze/maze.[ch] + * plug-ins/maze/maze_face.c: removed the extra help button from + the Maze plug-in. Fixes bug #158605. + 2004-11-18 Michael Natterer The following fixes have no visible effect because nobody diff --git a/plug-ins/maze/maze.c b/plug-ins/maze/maze.c index ec97348bbd..bfdbb17b8c 100644 --- a/plug-ins/maze/maze.c +++ b/plug-ins/maze/maze.c @@ -152,16 +152,11 @@ query (void) { GIMP_PDB_INT16, "offset", "Offset (use 1)" } }; - gchar *help; - - help = g_strdup_printf ("Generates a maze using either the depth-first " - "search method or Prim's algorithm. Can make " - "tileable mazes too. See %s for more help.", - MAZE_URL); - gimp_install_procedure ("plug_in_maze", "Draws a maze.", - help, + "Generates a maze using either the depth-first " + "search method or Prim's algorithm. Can make " + "tileable mazes too.", "Kevin Turner ", "Kevin Turner", "1997, 1998", @@ -173,8 +168,6 @@ query (void) gimp_plugin_menu_register ("plug_in_maze", "/Filters/Render/Pattern"); - - g_free (help); } static void diff --git a/plug-ins/maze/maze.h b/plug-ins/maze/maze.h index 6836ffaa37..02de3c6538 100644 --- a/plug-ins/maze/maze.h +++ b/plug-ins/maze/maze.h @@ -1,6 +1,5 @@ -/* $Id$ */ + #define MAZE_TITLE N_("Maze") -#define MAZE_URL "http://gimp-plug-ins.sourceforge.net/maze/help.html" #define HELP_OPENS_NEW_WINDOW FALSE @@ -13,7 +12,7 @@ Instead, update every . . . */ #define PRIMS_PROGRESS_UPDATE 256 -/* Don't draw in anything that has less than +/* Don't draw in anything that has less than this value in the selection channel. */ #define MAZE_ALPHA_THRESHOLD 127 diff --git a/plug-ins/maze/maze_face.c b/plug-ins/maze/maze_face.c index 6ed86e6d6a..73adb8eaf1 100644 --- a/plug-ins/maze/maze_face.c +++ b/plug-ins/maze/maze_face.c @@ -1,5 +1,5 @@ /* -*- mode: C; c-file-style: "gnu"; c-basic-offset: 2; -*- */ -/* $Id$ +/* * User interface for plug-in-maze. * * Implemented as a GIMP 0.99 Plugin by @@ -74,11 +74,6 @@ gboolean maze_dialog (void); static void maze_msg (const gchar *format, ...) G_GNUC_PRINTF (1, 2); -static void maze_response (GtkWidget *widget, - gint response_id, - gpointer data); -static void maze_help (void); - #ifdef SHOW_PRNG_PRIVATES static void maze_entry_callback (GtkWidget *widget, gpointer data); @@ -162,43 +157,36 @@ static void entscale_int_entry_update (GtkWidget *widget, extern MazeValues mvals; extern guint sel_w, sel_h; -static gint maze_run = FALSE; static GtkWidget *msg_label; gboolean maze_dialog (void) { - GtkWidget *dlg; + GtkWidget *dialog; GtkWidget *vbox; GtkWidget *table; GtkWidget *tilecheck; GtkWidget *entry; GtkWidget *hbox; GtkWidget *frame; + gboolean run; gint trow = 0; gimp_ui_init ("maze", FALSE); - dlg = gimp_dialog_new (_(MAZE_TITLE), "maze", + dialog = gimp_dialog_new (_(MAZE_TITLE), "maze", NULL, 0, gimp_standard_help_func, "plug-in-maze", - GTK_STOCK_HELP, GTK_RESPONSE_HELP, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - g_signal_connect (dlg, "response", - G_CALLBACK (maze_response), - NULL); - g_signal_connect (dlg, "destroy", - G_CALLBACK (gtk_main_quit), - NULL); - vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dlg)->vbox), vbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), + vbox, FALSE, FALSE, 0); #ifdef SHOW_PRNG_PRIVATES table = gtk_table_new (8, 3, FALSE); @@ -291,14 +279,15 @@ maze_dialog (void) trow++; /* Algorithm Choice */ - frame = gimp_int_radio_group_new (FALSE, NULL, - G_CALLBACK (gimp_radio_button_update), - &mvals.algorithm, mvals.algorithm, + frame = + gimp_int_radio_group_new (FALSE, NULL, + G_CALLBACK (gimp_radio_button_update), + &mvals.algorithm, mvals.algorithm, - _("Depth first"), DEPTH_FIRST, NULL, - _("Prim's algorithm"), PRIMS_ALGORITHM, NULL, + _("Depth first"), DEPTH_FIRST, NULL, + _("Prim's algorithm"), PRIMS_ALGORITHM, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); @@ -308,11 +297,13 @@ maze_dialog (void) -1); gtk_box_pack_start (GTK_BOX (vbox), msg_label, FALSE, FALSE, 0); - gtk_widget_show_all (dlg); + gtk_widget_show_all (dialog); - gtk_main (); + run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK); - return maze_run; + gtk_widget_destroy (dialog); + + return run; } static GtkWidget* @@ -543,44 +534,6 @@ height_width_callback (gint width, data); } -static void -maze_help (void) -{ - gchar *proc_blurb; - gchar *proc_help; - gchar *proc_author; - gchar *proc_copyright; - gchar *proc_date; - GimpPDBProcType proc_type; - gint nparams; - gint nreturn_vals; - GimpParamDef *params; - GimpParamDef *return_vals; - - if (gimp_procedural_db_proc_info ("plug_in_web_browser", - &proc_blurb, - &proc_help, - &proc_author, - &proc_copyright, - &proc_date, - &proc_type, - &nparams, &nreturn_vals, - ¶ms, &return_vals)) - { - gint baz; - - maze_msg (_("Opening %s"), MAZE_URL); - - gimp_run_procedure ("plug_in_web_browser", &baz, - GIMP_PDB_STRING, MAZE_URL, - GIMP_PDB_END); - } - else - { - maze_msg (_("See %s"), MAZE_URL); - } -} - static void maze_msg (const gchar *format, ...) @@ -598,25 +551,6 @@ maze_msg (const gchar *format, g_free (message); } -static void -maze_response (GtkWidget *widget, - gint response_id, - gpointer data) -{ - switch (response_id) - { - case GTK_RESPONSE_HELP: - maze_help (); - break; - - case GTK_RESPONSE_OK: - maze_run = TRUE; - - default: - gtk_widget_destroy (widget); - } -} - #ifdef SHOW_PRNG_PRIVATES static void maze_entry_callback (GtkWidget *widget,