Commit 2b52f8a8 authored by Tim Janik's avatar Tim Janik

fixed a lot of the destroy handlers and delete_event handlers, still

        not everything perfect, though.
-timj
parent 1fe238af
......@@ -122,8 +122,6 @@ about_dialog_create (int timeout)
gtk_window_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
(GtkSignalFunc) about_dialog_destroy, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "delete_event",
(GtkSignalFunc) about_dialog_destroy, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "unmap_event",
(GtkSignalFunc) about_dialog_unmap, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
......
......@@ -232,7 +232,7 @@ file_new_delete_callback (GtkWidget *widget,
{
file_new_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
......@@ -751,7 +751,7 @@ file_prefs_delete_callback (GtkWidget *widget,
file_prefs_cancel_callback (widget, dlg);
/* the widget is already destroyed here no need to try again */
return FALSE;
return TRUE;
}
static void
......@@ -2457,7 +2457,7 @@ image_delete_callback (GtkWidget *w,
{
image_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -318,6 +318,9 @@ make_initialization_status_window(void)
GtkWidget *vbox;
win_initstatus = gtk_window_new(GTK_WINDOW_DIALOG);
gtk_signal_connect (GTK_OBJECT (win_initstatus), "delete_event",
GTK_SIGNAL_FUNC (gtk_true),
NULL);
gtk_window_set_wmclass (GTK_WINDOW(win_initstatus), "gimp_startup", "Gimp");
gtk_window_set_title(GTK_WINDOW(win_initstatus),
"GIMP Startup");
......@@ -584,7 +587,7 @@ really_quit_delete_callback (GtkWidget *widget,
{
really_quit_cancel_callback (GTK_BUTTON(widget), (GtkWidget *) client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -643,7 +643,7 @@ color_balance_delete_callback (GtkWidget *w,
{
color_balance_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -1001,7 +1001,7 @@ curves_delete_callback (GtkWidget *w,
{
curves_cancel_callback (w, data);
return FALSE;
return TRUE;
}
static void
curves_preview_update (GtkWidget *w,
......
......@@ -754,7 +754,7 @@ hue_saturation_delete_callback (GtkWidget *w,
{
hue_saturation_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -512,7 +512,7 @@ threshold_delete_callback (GtkWidget *w,
{
threshold_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -505,7 +505,7 @@ brightness_contrast_delete_callback (GtkWidget *w,
{
brightness_contrast_cancel_callback (w, d);
return FALSE;
return TRUE;
}
static void
......
......@@ -734,7 +734,7 @@ brush_select_delete_callback (GtkWidget *w, GdkEvent *e, gpointer data)
{
brush_select_close_callback (w, data);
return FALSE;
return TRUE;
}
static void
......
......@@ -852,7 +852,7 @@ by_color_select_delete_callback (GtkWidget *w,
{
by_color_select_close_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -485,7 +485,7 @@ offset_delete_callback (GtkWidget *widget,
{
offset_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
static void
......
......@@ -1689,7 +1689,7 @@ new_channel_query_delete_callback (GtkWidget *w,
{
new_channel_query_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......@@ -1868,7 +1868,7 @@ edit_channel_query_delete_callback (GtkWidget *w,
{
edit_channel_query_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -643,7 +643,7 @@ color_balance_delete_callback (GtkWidget *w,
{
color_balance_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -788,7 +788,7 @@ color_select_delete_callback (GtkWidget *w,
{
color_select_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -232,7 +232,7 @@ file_new_delete_callback (GtkWidget *widget,
{
file_new_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
......@@ -751,7 +751,7 @@ file_prefs_delete_callback (GtkWidget *widget,
file_prefs_cancel_callback (widget, dlg);
/* the widget is already destroyed here no need to try again */
return FALSE;
return TRUE;
}
static void
......@@ -2457,7 +2457,7 @@ image_delete_callback (GtkWidget *w,
{
image_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -529,6 +529,7 @@ indexed_ok_callback (GtkWidget *widget,
gtk_widget_destroy (dialog->shell);
g_free (dialog);
dialog = NULL;
}
static gint
......@@ -538,7 +539,7 @@ indexed_delete_callback (GtkWidget *w,
{
indexed_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......@@ -550,6 +551,7 @@ indexed_cancel_callback (GtkWidget *widget,
dialog = (IndexedDialog *) client_data;
gtk_widget_destroy (dialog->shell);
g_free (dialog);
dialog = NULL;
}
static void
......
......@@ -552,7 +552,7 @@ named_buffer_dialog_delete_callback (GtkWidget *w,
{
named_buffer_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -485,7 +485,7 @@ offset_delete_callback (GtkWidget *widget,
{
offset_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
static void
......
......@@ -552,7 +552,7 @@ named_buffer_dialog_delete_callback (GtkWidget *w,
{
named_buffer_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -529,6 +529,7 @@ indexed_ok_callback (GtkWidget *widget,
gtk_widget_destroy (dialog->shell);
g_free (dialog);
dialog = NULL;
}
static gint
......@@ -538,7 +539,7 @@ indexed_delete_callback (GtkWidget *w,
{
indexed_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......@@ -550,6 +551,7 @@ indexed_cancel_callback (GtkWidget *widget,
dialog = (IndexedDialog *) client_data;
gtk_widget_destroy (dialog->shell);
g_free (dialog);
dialog = NULL;
}
static void
......
......@@ -485,7 +485,7 @@ offset_delete_callback (GtkWidget *widget,
{
offset_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
static void
......
......@@ -1001,7 +1001,7 @@ curves_delete_callback (GtkWidget *w,
{
curves_cancel_callback (w, data);
return FALSE;
return TRUE;
}
static void
curves_preview_update (GtkWidget *w,
......
......@@ -122,8 +122,6 @@ about_dialog_create (int timeout)
gtk_window_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
(GtkSignalFunc) about_dialog_destroy, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "delete_event",
(GtkSignalFunc) about_dialog_destroy, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "unmap_event",
(GtkSignalFunc) about_dialog_unmap, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
......
......@@ -200,11 +200,11 @@ info_dialog_update (InfoDialog *idialog)
static gint
info_dialog_delete_callback (GtkWidget *w,
GdkEvent *e,
gpointer client_data) {
gpointer client_data)
{
info_dialog_popdown ((InfoDialog *) client_data);
return FALSE;
return TRUE;
}
......
......@@ -57,6 +57,8 @@ tips_dialog_create ()
gtk_window_position (GTK_WINDOW (tips_dialog), GTK_WIN_POS_CENTER);
gtk_signal_connect (GTK_OBJECT (tips_dialog), "delete_event",
GTK_SIGNAL_FUNC (tips_dialog_hide), NULL);
/* destroy the tips window if the mainlevel gtk_main() function is left */
gtk_quit_add (1, (GtkFunction) gtk_widget_destroy, tips_dialog);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (tips_dialog), vbox);
......@@ -160,7 +162,7 @@ tips_dialog_hide (GtkWidget *widget,
g_list_free (update);
g_list_free (remove);
return FALSE;
return TRUE;
}
static int
......
......@@ -97,6 +97,9 @@ install_help (InstallCallback callback)
GdkFont *font;
help_widget = gtk_dialog_new ();
gtk_signal_connect (GTK_OBJECT (help_widget), "delete_event",
GTK_SIGNAL_FUNC (gtk_true),
NULL);
gtk_window_set_wmclass (GTK_WINDOW (help_widget), "gimp_installation", "Gimp");
gtk_window_set_title (GTK_WINDOW (help_widget), "GIMP Installation");
gtk_window_position (GTK_WINDOW (help_widget), GTK_WIN_POS_CENTER);
......@@ -340,6 +343,9 @@ install_run (InstallCallback callback)
int executable = TRUE;
install_widget = gtk_dialog_new ();
gtk_signal_connect (GTK_OBJECT (install_widget), "delete_event",
GTK_SIGNAL_FUNC (gtk_true),
NULL);
gtk_window_set_wmclass (GTK_WINDOW (install_widget), "installation_log", "Gimp");
gtk_window_set_title (GTK_WINDOW (install_widget), "Installation Log");
gtk_window_position (GTK_WINDOW (install_widget), GTK_WIN_POS_CENTER);
......
......@@ -289,7 +289,7 @@ gdisplay_delete_warning_callback (GtkWidget *widget,
{
gdisplay_cancel_warning_callback (widget, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -820,7 +820,7 @@ query_box_delete_callback (GtkWidget *w,
{
query_box_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......@@ -957,7 +957,7 @@ message_box_delete_callback (GtkWidget *w, GdkEvent *e, gpointer client_data)
{
message_box_close_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -820,7 +820,7 @@ query_box_delete_callback (GtkWidget *w,
{
query_box_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......@@ -957,7 +957,7 @@ message_box_delete_callback (GtkWidget *w, GdkEvent *e, gpointer client_data)
{
message_box_close_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -68,12 +68,6 @@ static void file_open_ok_callback (GtkWidget *w,
gpointer client_data);
static void file_save_ok_callback (GtkWidget *w,
gpointer client_data);
static void file_cancel_callback (GtkWidget *w,
gpointer client_data);
static gint file_delete_callback (GtkWidget *w,
GdkEvent *e,
gpointer client_data);
static void file_dialog_show (GtkWidget *filesel);
static void file_dialog_hide (GtkWidget *filesel);
......@@ -478,10 +472,14 @@ file_open_callback (GtkWidget *w,
fileload = gtk_file_selection_new ("Load Image");
gtk_window_position (GTK_WINDOW (fileload), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (fileload), "load_image", "Gimp");
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (fileload)->cancel_button), "clicked",
(GtkSignalFunc) file_cancel_callback, fileload);
gtk_signal_connect (GTK_OBJECT (fileload), "delete_event",
(GtkSignalFunc) file_delete_callback, fileload);
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (fileload)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_hide),
GTK_OBJECT (fileload));
gtk_signal_connect (GTK_OBJECT (fileload),
"delete_event",
GTK_SIGNAL_FUNC (gtk_widget_delete_hides),
NULL);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (fileload)->ok_button), "clicked", (GtkSignalFunc) file_open_ok_callback, fileload);
}
else
......@@ -563,10 +561,14 @@ file_save_as_callback (GtkWidget *w,
filesave = gtk_file_selection_new ("Save Image");
gtk_window_set_wmclass (GTK_WINDOW (filesave), "save_image", "Gimp");
gtk_window_position (GTK_WINDOW (filesave), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesave)->cancel_button), "clicked",
(GtkSignalFunc) file_cancel_callback, filesave);
gtk_signal_connect (GTK_OBJECT (filesave), "delete_event",
(GtkSignalFunc) file_delete_callback, filesave);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesave)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_hide),
GTK_OBJECT (filesave));
gtk_signal_connect (GTK_OBJECT (filesave),
"delete_event",
GTK_SIGNAL_FUNC (gtk_widget_delete_hides),
NULL);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesave)->ok_button), "clicked", (GtkSignalFunc) file_save_ok_callback, filesave);
}
else
......@@ -882,7 +884,7 @@ file_save_ok_callback (GtkWidget *w,
else
{
s = g_string_new (NULL);
g_string_sprintf (s, "%s is an irregular file", raw_filename, g_strerror(errno));
g_string_sprintf (s, "%s is an irregular file (%s)", raw_filename, g_strerror(errno));
}
}
else if (file_save (image_ID, filename, raw_filename))
......@@ -901,23 +903,6 @@ file_save_ok_callback (GtkWidget *w,
g_string_free (s, TRUE);
}
static gint
file_delete_callback (GtkWidget *w,
GdkEvent *e,
gpointer client_data)
{
file_cancel_callback (w, client_data);
return FALSE;
}
static void
file_cancel_callback (GtkWidget *w,
gpointer client_data)
{
file_dialog_hide (client_data);
}
static void
file_dialog_show (GtkWidget *filesel)
{
......@@ -965,7 +950,8 @@ file_overwrite (char *filename, char* raw_filename)
gtk_window_set_title (GTK_WINDOW (overwrite_box->obox), "File Exists!");
gtk_window_position (GTK_WINDOW (overwrite_box->obox), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (overwrite_box->obox), "delete_event",
gtk_signal_connect (GTK_OBJECT (overwrite_box->obox),
"delete_event",
(GtkSignalFunc) file_overwrite_delete_callback,
overwrite_box);
......@@ -1028,7 +1014,7 @@ file_overwrite_delete_callback (GtkWidget *w,
{
file_overwrite_no_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -289,7 +289,7 @@ gdisplay_delete_warning_callback (GtkWidget *widget,
{
gdisplay_cancel_warning_callback (widget, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -485,7 +485,7 @@ offset_delete_callback (GtkWidget *widget,
{
offset_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
static void
......
......@@ -529,6 +529,7 @@ indexed_ok_callback (GtkWidget *widget,
gtk_widget_destroy (dialog->shell);
g_free (dialog);
dialog = NULL;
}
static gint
......@@ -538,7 +539,7 @@ indexed_delete_callback (GtkWidget *w,
{
indexed_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......@@ -550,6 +551,7 @@ indexed_cancel_callback (GtkWidget *widget,
dialog = (IndexedDialog *) client_data;
gtk_widget_destroy (dialog->shell);
g_free (dialog);
dialog = NULL;
}
static void
......
......@@ -485,7 +485,7 @@ offset_delete_callback (GtkWidget *widget,
{
offset_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
static void
......
......@@ -552,7 +552,7 @@ named_buffer_dialog_delete_callback (GtkWidget *w,
{
named_buffer_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -1255,7 +1255,7 @@ ed_close_callback(GtkWidget *widget, gpointer client_data)
if (GTK_WIDGET_VISIBLE(g_editor->shell))
gtk_widget_hide(g_editor->shell);
return FALSE;
return TRUE;
} /* ed_close_callback */
......
......@@ -1255,7 +1255,7 @@ ed_close_callback(GtkWidget *widget, gpointer client_data)
if (GTK_WIDGET_VISIBLE(g_editor->shell))
gtk_widget_hide(g_editor->shell);
return FALSE;
return TRUE;
} /* ed_close_callback */
......
......@@ -122,8 +122,6 @@ about_dialog_create (int timeout)
gtk_window_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
(GtkSignalFunc) about_dialog_destroy, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "delete_event",
(GtkSignalFunc) about_dialog_destroy, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "unmap_event",
(GtkSignalFunc) about_dialog_unmap, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
......
......@@ -734,7 +734,7 @@ brush_select_delete_callback (GtkWidget *w, GdkEvent *e, gpointer data)
{
brush_select_close_callback (w, data);
return FALSE;
return TRUE;
}
static void
......
......@@ -1689,7 +1689,7 @@ new_channel_query_delete_callback (GtkWidget *w,
{
new_channel_query_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......@@ -1868,7 +1868,7 @@ edit_channel_query_delete_callback (GtkWidget *w,
{
edit_channel_query_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
static void
......
......@@ -788,7 +788,7 @@ color_select_delete_callback (GtkWidget *w,
{
color_select_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -232,7 +232,7 @@ file_new_delete_callback (GtkWidget *widget,
{
file_new_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
......@@ -751,7 +751,7 @@ file_prefs_delete_callback (GtkWidget *widget,
file_prefs_cancel_callback (widget, dlg);
/* the widget is already destroyed here no need to try again */
return FALSE;
return TRUE;
}
static void
......@@ -2457,7 +2457,7 @@ image_delete_callback (GtkWidget *w,
{
image_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -1255,7 +1255,7 @@ ed_close_callback(GtkWidget *widget, gpointer client_data)
if (GTK_WIDGET_VISIBLE(g_editor->shell))
gtk_widget_hide(g_editor->shell);
return FALSE;
return TRUE;
} /* ed_close_callback */
......
......@@ -232,7 +232,7 @@ file_new_delete_callback (GtkWidget *widget,
{
file_new_cancel_callback (widget, data);
return FALSE;
return TRUE;
}
......@@ -751,7 +751,7 @@ file_prefs_delete_callback (GtkWidget *widget,
file_prefs_cancel_callback (widget, dlg);
/* the widget is already destroyed here no need to try again */
return FALSE;
return TRUE;
}
static void
......@@ -2457,7 +2457,7 @@ image_delete_callback (GtkWidget *w,
{
image_cancel_callback (w, client_data);
return FALSE;
return TRUE;
}
......
......@@ -200,11 +200,11 @@ info_dialog_update (InfoDialog *idialog)
static gint
info_dialog_delete_callback (GtkWidget *w,
GdkEvent *e,
gpointer client_data) {
gpointer client_data)
{
info_dialog_popdown ((InfoDialog *) client_data);
return FALSE;
return TRUE;
}
......
......@@ -1809,7 +1809,7 @@ lc_dialog_close_callback (GtkWidget *w,
gpointer client_data)
{
if (!lc_shell)
return TRUE;
return FALSE;
if (GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_hide (lc_shell);
......@@ -1817,7 +1817,7 @@ lc_dialog_close_callback (GtkWidget *w,
if (layersD)
layersD->gimage_id = -1;