Commit fda881c5 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

g_strdup (g_get_temp_dir ()), may fix an unseen crash.

2001-08-01  Michael Natterer  <mitch@gimp.org>

	* app/base/base.c: g_strdup (g_get_temp_dir ()), may fix an unseen
	crash.

	* libgimpwidgets/gimphelpui.[ch]: fixed the help stuff by using
	GtkWidget's new "show_help" signal, which is exactly what we did
	before, only without badly hacking around.
	Renamed gimp_help_connect_help_accel() to gimp_help_connect()
	because that's what it does.

	* app/devices.c
	* app/errorconsole.c
	* app/interface.c
	* app/gui/about-dialog.c
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/file-new-dialog.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/gradients-commands.c
	* app/gui/gui.c
	* app/gui/info-dialog.c
	* app/gui/palettes-commands.c
	* app/gui/paths-dialog.c
	* app/gui/select-commands.c
	* app/gui/tips-dialog.c
	* app/gui/toolbox.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimplevelstool.c
	* app/widgets/gimpdatafactoryview.c
	* libgimpwidgets/gimpdialog.c
	* plug-ins/FractalExplorer/FractalExplorer.c
	* plug-ins/common/CEL.c
	* plug-ins/common/CML_explorer.c
	* plug-ins/common/gee.c
	* plug-ins/common/gee_zoom.c
	* plug-ins/common/gqbist.c
	* plug-ins/flame/flame.c
	* plug-ins/fp/fp_gtk.c
	* plug-ins/script-fu/script-fu-scripts.c: changed accordingly,
	GObject stuff, sprinkled some GTK_STOCK_FOOs, minor cleanups.
parent fc2ab585
2001-08-01 Michael Natterer <mitch@gimp.org>
* app/base/base.c: g_strdup (g_get_temp_dir ()), may fix an unseen
crash.
* libgimpwidgets/gimphelpui.[ch]: fixed the help stuff by using
GtkWidget's new "show_help" signal, which is exactly what we did
before, only without badly hacking around.
Renamed gimp_help_connect_help_accel() to gimp_help_connect()
because that's what it does.
* app/devices.c
* app/errorconsole.c
* app/interface.c
* app/gui/about-dialog.c
* app/gui/edit-commands.c
* app/gui/file-commands.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c
* app/gui/gradients-commands.c
* app/gui/gui.c
* app/gui/info-dialog.c
* app/gui/palettes-commands.c
* app/gui/paths-dialog.c
* app/gui/select-commands.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpcurvestool.c
* app/tools/gimplevelstool.c
* app/widgets/gimpdatafactoryview.c
* libgimpwidgets/gimpdialog.c
* plug-ins/FractalExplorer/FractalExplorer.c
* plug-ins/common/CEL.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/gee.c
* plug-ins/common/gee_zoom.c
* plug-ins/common/gqbist.c
* plug-ins/flame/flame.c
* plug-ins/fp/fp_gtk.c
* plug-ins/script-fu/script-fu-scripts.c: changed accordingly,
GObject stuff, sprinkled some GTK_STOCK_FOOs, minor cleanups.
2001-07-31 Michael Natterer <mitch@gimp.org>
* gtkrc: eek, my last change changed the width of all GtkRange
......
......@@ -193,7 +193,7 @@ edit_named_cut_cmd_callback (GtkWidget *widget,
"dialogs/cut_named.html",
_("Enter a name for this buffer"),
NULL,
GTK_OBJECT (gdisp->gimage), "destroy",
G_OBJECT (gdisp->gimage), "destroy",
cut_named_buffer_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
......@@ -212,7 +212,7 @@ edit_named_copy_cmd_callback (GtkWidget *widget,
"dialogs/copy_named.html",
_("Enter a name for this buffer"),
NULL,
GTK_OBJECT (gdisp->gimage), "destroy",
G_OBJECT (gdisp->gimage), "destroy",
copy_named_buffer_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
......
......@@ -234,7 +234,7 @@ file_revert_cmd_callback (GtkWidget *widget,
FALSE,
text,
GTK_STOCK_YES, GTK_STOCK_NO,
GTK_OBJECT (gdisp->gimage), "destroy",
G_OBJECT (gdisp->gimage), "destroy",
file_revert_confirm_callback,
gdisp->gimage);
......
......@@ -152,8 +152,8 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
G_CONNECT_SWAPPED);
/* Connect the "F1" help key */
gimp_help_connect_help_accel (GTK_WIDGET (filesel), gimp_standard_help_func,
"dialogs/save_as_povray.html");
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
"dialogs/save_as_povray.html");
gtk_widget_show (GTK_WIDGET (filesel));
}
......
......@@ -134,7 +134,7 @@ palettes_merge_palettes_query (GimpContainerEditor *editor)
"dialogs/palette_editor/merge_palette.html",
_("Enter a name for merged palette"),
NULL,
GTK_OBJECT (editor), "destroy",
G_OBJECT (editor), "destroy",
palettes_merge_palettes_callback,
editor);
gtk_widget_show (qbox);
......
......@@ -131,7 +131,7 @@ select_feather_cmd_callback (GtkWidget *widget,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
G_OBJECT (gdisp->gimage), "destroy",
gimage_mask_feather_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
......@@ -167,7 +167,7 @@ select_shrink_cmd_callback (GtkWidget *widget,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
G_OBJECT (gdisp->gimage), "destroy",
gimage_mask_shrink_callback, gdisp->gimage);
edge_lock = gtk_check_button_new_with_label (_("Shrink from image border"));
......@@ -201,7 +201,7 @@ select_grow_cmd_callback (GtkWidget *widget,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
G_OBJECT (gdisp->gimage), "destroy",
gimage_mask_grow_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
......@@ -224,7 +224,7 @@ select_border_cmd_callback (GtkWidget *widget,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
G_OBJECT (gdisp->gimage), "destroy",
gimage_mask_border_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
......
......@@ -66,7 +66,7 @@ base_init (void)
/* Add the swap file */
if (base_config->swap_path == NULL)
base_config->swap_path = g_get_tmp_dir ();
base_config->swap_path = g_strdup (g_get_tmp_dir ());
path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "gimpswap.%lu",
base_config->swap_path,
......
......@@ -1779,7 +1779,7 @@ file_dialog_create (GtkWidget *parent)
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_dlg), temp);
g_free (temp);
gimp_help_connect_help_accel (file_dlg, tool_manager_help_func, NULL);
gimp_help_connect (file_dlg, tool_manager_help_func, NULL);
}
static void
......
......@@ -243,9 +243,9 @@ input_dialog_create (void)
NULL);
/* Connect the "F1" help key */
gimp_help_connect_help_accel (inputd,
gimp_standard_help_func,
"dialogs/input_devices.html");
gimp_help_connect (inputd,
gimp_standard_help_func,
"dialogs/input_devices.html");
return inputd;
}
......
......@@ -138,8 +138,8 @@ about_dialog_create (void)
gtk_window_set_policy (GTK_WINDOW (about_dialog), FALSE, FALSE, FALSE);
gtk_window_set_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
gimp_help_connect_help_accel (about_dialog, gimp_standard_help_func,
"dialogs/about.html");
gimp_help_connect (about_dialog, gimp_standard_help_func,
"dialogs/about.html");
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
GTK_SIGNAL_FUNC (about_dialog_destroy),
......
......@@ -236,9 +236,9 @@ file_open_dialog_create (void)
fileload);
/* Connect the "F1" help key */
gimp_help_connect_help_accel (fileload,
gimp_standard_help_func,
"open/dialogs/file_open.html");
gimp_help_connect (fileload,
gimp_standard_help_func,
"open/dialogs/file_open.html");
{
GtkWidget *frame;
......
......@@ -261,9 +261,9 @@ file_save_dialog_create (void)
gtk_quit_add_destroy (1, GTK_OBJECT (filesave));
/* Connect the "F1" help key */
gimp_help_connect_help_accel (filesave,
gimp_standard_help_func,
"save/dialogs/file_save.html");
gimp_help_connect (filesave,
gimp_standard_help_func,
"save/dialogs/file_save.html");
{
GtkWidget *frame;
......
......@@ -41,32 +41,37 @@
typedef struct
{
GtkWidget *dlg;
GtkWidget *dialog;
GtkWidget *confirm_dlg;
GtkWidget *confirm_dialog;
GtkWidget *size_frame;
GtkWidget *size_se;
GtkWidget *resolution_se;
GtkWidget *couple_resolutions;
GtkWidget *size_frame;
GtkWidget *size_se;
GtkWidget *resolution_se;
GtkWidget *couple_resolutions;
/* this should be a list */
GtkWidget *type_w[2];
GtkWidget *fill_type_w[4];
GtkWidget *type_w[2];
GtkWidget *fill_type_w[4];
GimpImageNewValues *values;
gdouble size;
gdouble size;
} NewImageInfo;
/* new image local functions */
static void file_new_confirm_dialog (NewImageInfo *);
static void file_new_confirm_dialog (NewImageInfo *info);
static void file_new_ok_callback (GtkWidget *, gpointer);
static void file_new_reset_callback (GtkWidget *, gpointer);
static void file_new_cancel_callback (GtkWidget *, gpointer);
static void file_new_resolution_callback (GtkWidget *, gpointer);
static void file_new_image_size_callback (GtkWidget *, gpointer);
static void file_new_ok_callback (GtkWidget *widget,
gpointer data);
static void file_new_reset_callback (GtkWidget *widget,
gpointer data);
static void file_new_cancel_callback (GtkWidget *widget,
gpointer data);
static void file_new_resolution_callback (GtkWidget *widget,
gpointer data);
static void file_new_image_size_callback (GtkWidget *widget,
gpointer data);
static void
......@@ -103,7 +108,7 @@ file_new_ok_callback (GtkWidget *widget,
}
else
{
gtk_widget_destroy (info->dlg);
gtk_widget_destroy (info->dialog);
gimp_image_new_create_image (the_gimp, values);
gimp_image_new_values_free (values);
g_free (info);
......@@ -159,7 +164,7 @@ file_new_cancel_callback (GtkWidget *widget,
info = (NewImageInfo*) data;
gtk_widget_destroy (info->dlg);
gtk_widget_destroy (info->dialog);
gimp_image_new_values_free (info->values);
g_free (info);
}
......@@ -174,18 +179,18 @@ file_new_confirm_dialog_callback (GtkWidget *widget,
info = (NewImageInfo*) data;
info->confirm_dlg = NULL;
info->confirm_dialog = NULL;
if (create)
{
gtk_widget_destroy (info->dlg);
gtk_widget_destroy (info->dialog);
gimp_image_new_create_image (the_gimp, info->values);
gimp_image_new_values_free (info->values);
g_free (info);
}
else
{
gtk_widget_set_sensitive (info->dlg, TRUE);
gtk_widget_set_sensitive (info->dialog, TRUE);
}
}
......@@ -196,7 +201,7 @@ file_new_confirm_dialog (NewImageInfo *info)
gchar *max_size;
gchar *text;
gtk_widget_set_sensitive (info->dlg, FALSE);
gtk_widget_set_sensitive (info->dialog, FALSE);
size = gimp_image_new_get_size_string (info->size);
max_size = gimp_image_new_get_size_string (gimprc.max_new_image_size);
......@@ -214,7 +219,7 @@ file_new_confirm_dialog (NewImageInfo *info)
"preferences dialog."),
size, max_size);
info->confirm_dlg =
info->confirm_dialog =
gimp_query_boolean_box (_("Confirm Image Size"),
gimp_standard_help_func,
"dialogs/file_new.html#confirm_size",
......@@ -229,7 +234,7 @@ file_new_confirm_dialog (NewImageInfo *info)
g_free (max_size);
g_free (size);
gtk_widget_show (info->confirm_dlg);
gtk_widget_show (info->confirm_dialog);
}
static void
......@@ -334,28 +339,28 @@ file_new_dialog_create (GimpImage *gimage)
info->values = gimp_image_new_values_new (the_gimp, gimage);
info->confirm_dlg = NULL;
info->size = 0.0;
info->confirm_dialog = NULL;
info->size = 0.0;
info->dlg = gimp_dialog_new (_("New Image"), "new_image",
gimp_standard_help_func,
"dialogs/file_new.html",
GTK_WIN_POS_MOUSE,
FALSE, FALSE, TRUE,
info->dialog = gimp_dialog_new (_("New Image"), "new_image",
gimp_standard_help_func,
"dialogs/file_new.html",
GTK_WIN_POS_MOUSE,
FALSE, FALSE, TRUE,
GTK_STOCK_OK, file_new_ok_callback,
info, NULL, NULL, TRUE, FALSE,
_("Reset"), file_new_reset_callback,
info, NULL, NULL, FALSE, FALSE,
GTK_STOCK_CANCEL, file_new_cancel_callback,
info, NULL, NULL, FALSE, TRUE,
GTK_STOCK_OK, file_new_ok_callback,
info, NULL, NULL, TRUE, FALSE,
_("Reset"), file_new_reset_callback,
info, NULL, NULL, FALSE, FALSE,
GTK_STOCK_CANCEL, file_new_cancel_callback,
info, NULL, NULL, FALSE, TRUE,
NULL);
NULL);
/* vbox holding the rest of the dialog */
top_vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (top_vbox), 4);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->dlg)->vbox),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->dialog)->vbox),
top_vbox, TRUE, TRUE, 0);
gtk_widget_show (top_vbox);
......@@ -497,12 +502,12 @@ file_new_dialog_create (GimpImage *gimage)
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), 1,
info->values->height);
gtk_signal_connect (GTK_OBJECT (info->size_se), "refval_changed",
GTK_SIGNAL_FUNC (file_new_image_size_callback),
info);
gtk_signal_connect (GTK_OBJECT (info->size_se), "value_changed",
GTK_SIGNAL_FUNC (file_new_image_size_callback),
info);
g_signal_connect (G_OBJECT (info->size_se), "refval_changed",
G_CALLBACK (file_new_image_size_callback),
info);
g_signal_connect (G_OBJECT (info->size_se), "value_changed",
G_CALLBACK (file_new_image_size_callback),
info);
/* initialize the size label */
file_new_image_size_callback (info->size_se, info);
......@@ -554,9 +559,9 @@ file_new_dialog_create (GimpImage *gimage)
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), 1,
info->values->yresolution);
gtk_signal_connect (GTK_OBJECT (info->resolution_se), "value_changed",
GTK_SIGNAL_FUNC (file_new_resolution_callback),
info);
g_signal_connect (G_OBJECT (info->resolution_se), "value_changed",
G_CALLBACK (file_new_resolution_callback),
info);
/* the resolution chainbutton */
info->couple_resolutions = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
......@@ -598,15 +603,17 @@ file_new_dialog_create (GimpImage *gimage)
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) name_info->type);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (gimp_radio_button_update),
&info->values->type);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (file_new_image_size_callback),
info);
gtk_widget_show (button);
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (gimp_radio_button_update),
&info->values->type);
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (file_new_image_size_callback),
info);
if (info->values->type == name_info->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_widget_show (button);
info->type_w[name_info->type] = button;
}
......@@ -636,20 +643,22 @@ file_new_dialog_create (GimpImage *gimage)
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) name_info->type);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (gimp_radio_button_update),
&info->values->fill_type);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (file_new_image_size_callback),
info);
gtk_widget_show (button);
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (gimp_radio_button_update),
&info->values->fill_type);
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (file_new_image_size_callback),
info);
if (info->values->fill_type == name_info->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_widget_show (button);
info->fill_type_w[name_info->type] = button;
}
gimp_size_entry_grab_focus (GIMP_SIZE_ENTRY (info->size_se));
gtk_widget_show (info->dlg);
gtk_widget_show (info->dialog);
}
......@@ -179,7 +179,7 @@ info_dialog_new_extended (gchar *title,
g_signal_connect (G_OBJECT (shell), "delete_event",
G_CALLBACK (info_dialog_delete_callback),
idialog);
idialog);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
......@@ -202,9 +202,9 @@ info_dialog_new_extended (gchar *title,
gtk_box_pack_start (GTK_BOX (vbox), info_table, FALSE, FALSE, 0);
}
idialog->shell = shell;
idialog->vbox = vbox;
idialog->info_table = info_table;
idialog->shell = shell;
idialog->vbox = vbox;
idialog->info_table = info_table;
idialog->info_notebook = info_notebook;
if (in_notebook)
......@@ -214,7 +214,7 @@ info_dialog_new_extended (gchar *title,
gtk_widget_show (idialog->vbox);
/* Connect the "F1" help key */
gimp_help_connect_help_accel (idialog->shell, help_func, help_data);
gimp_help_connect (idialog->shell, help_func, help_data);
return idialog;
}
......
......@@ -187,9 +187,9 @@ tips_dialog_create (void)
gtk_widget_show (button);
/* Connect the "F1" help key */
gimp_help_connect_help_accel (tips_dialog,
gimp_standard_help_func,
"dialogs/tip_of_the_day.html");
gimp_help_connect (tips_dialog,
gimp_standard_help_func,
"dialogs/tip_of_the_day.html");
return tips_dialog;
}
......
......@@ -217,9 +217,9 @@ create_display_shell (GDisplay *gdisp,
gdisp);
/* connect the "F1" help key */
gimp_help_connect_help_accel (gdisp->shell,
gimp_standard_help_func,
"image/image_window.html");
gimp_help_connect (gdisp->shell,
gimp_standard_help_func,
"image/image_window.html");
/* GtkTable widgets are not able to shrink a row/column correctly if
* widgets are attached with GTK_EXPAND even if those widgets have
......
......@@ -217,9 +217,9 @@ create_display_shell (GDisplay *gdisp,
gdisp);
/* connect the "F1" help key */
gimp_help_connect_help_accel (gdisp->shell,
gimp_standard_help_func,
"image/image_window.html");
gimp_help_connect (gdisp->shell,
gimp_standard_help_func,
"image/image_window.html");
/* GtkTable widgets are not able to shrink a row/column correctly if
* widgets are attached with GTK_EXPAND even if those widgets have
......
......@@ -222,9 +222,9 @@ error_console_menu_callback (gint textscope)
filesel);
/* Connect the "F1" help key */
gimp_help_connect_help_accel (filesel,
gimp_standard_help_func,
"dialogs/error_console.html");
gimp_help_connect (filesel,
gimp_standard_help_func,
"dialogs/error_console.html");
gtk_widget_show (filesel);
}
......
......@@ -138,8 +138,8 @@ about_dialog_create (void)
gtk_window_set_policy (GTK_WINDOW (about_dialog), FALSE, FALSE, FALSE);
gtk_window_set_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
gimp_help_connect_help_accel (about_dialog, gimp_standard_help_func,
"dialogs/about.html");
gimp_help_connect (about_dialog, gimp_standard_help_func,
"dialogs/about.html");
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
GTK_SIGNAL_FUNC (about_dialog_destroy),
......
......@@ -243,9 +243,9 @@ input_dialog_create (void)
NULL);
/* Connect the "F1" help key */
gimp_help_connect_help_accel (inputd,
gimp_standard_help_func,
"dialogs/input_devices.html");
gimp_help_connect (inputd,
gimp_standard_help_func,
"dialogs/input_devices.html");
return inputd;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment