Revision: 1209 http://svn.sourceforge.net/geany/?rev=1209&view=rev Author: eht16 Date: 2007-01-19 15:17:40 -0800 (Fri, 19 Jan 2007)
Log Message: ----------- Fixed crashes when using some dialogs after they were closed before.
Modified Paths: -------------- trunk/ChangeLog trunk/src/dialogs.c trunk/src/prefs.c trunk/src/prefs.h trunk/src/search.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-01-19 18:19:58 UTC (rev 1208) +++ trunk/ChangeLog 2007-01-19 23:17:40 UTC (rev 1209) @@ -4,6 +4,8 @@ available on all systems. * geany.desktop.in: Added more mimetypes supplied by Nick Schermer. * doc/geany.docbook: Documented GEANY_PROJECT_EXT. + * src/dialogs.c, src/prefs.c, src/prefs.h, src/search.c: + Fixed crashes when using some dialogs after they were closed before.
2007-01-18 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2007-01-19 18:19:58 UTC (rev 1208) +++ trunk/src/dialogs.c 2007-01-19 23:17:40 UTC (rev 1209) @@ -127,7 +127,7 @@ g_signal_connect((gpointer) app->open_filesel, "selection-changed", G_CALLBACK(on_file_open_selection_changed), NULL); g_signal_connect ((gpointer) app->open_filesel, "delete_event", - G_CALLBACK(gtk_widget_hide), NULL); + G_CALLBACK(gtk_widget_hide_on_delete), NULL); g_signal_connect((gpointer) app->open_filesel, "response", G_CALLBACK(on_file_open_dialog_response), NULL); } @@ -267,8 +267,10 @@ gtk_window_set_type_hint(GTK_WINDOW(app->save_filesel), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_dialog_set_default_response(GTK_DIALOG(app->save_filesel), GTK_RESPONSE_ACCEPT);
- g_signal_connect((gpointer) app->save_filesel, "delete_event", G_CALLBACK(gtk_widget_hide), NULL); - g_signal_connect((gpointer) app->save_filesel, "response", G_CALLBACK(on_file_save_dialog_response), NULL); + g_signal_connect((gpointer) app->save_filesel, "delete_event", + G_CALLBACK(gtk_widget_hide_on_delete), NULL); + g_signal_connect((gpointer) app->save_filesel, "response", + G_CALLBACK(on_file_save_dialog_response), NULL);
gtk_window_set_transient_for(GTK_WINDOW(app->save_filesel), GTK_WINDOW(app->window)); } @@ -415,7 +417,7 @@ gtk_widget_show(GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->apply_button);
g_signal_connect((gpointer) app->open_fontsel, - "delete_event", G_CALLBACK(gtk_widget_hide), NULL); + "delete_event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->ok_button, "clicked", G_CALLBACK(on_font_ok_button_clicked), NULL); g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->cancel_button, @@ -423,7 +425,8 @@ g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->apply_button, "clicked", G_CALLBACK(on_font_apply_button_clicked), NULL);
- gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(app->open_fontsel), app->editor_font); + gtk_font_selection_dialog_set_font_name( + GTK_FONT_SELECTION_DIALOG(app->open_fontsel), app->editor_font); gtk_window_set_transient_for(GTK_WINDOW(app->open_fontsel), GTK_WINDOW(app->window)); } /* We make sure the dialog is visible. */ @@ -546,7 +549,7 @@ g_signal_connect(GTK_COLOR_SELECTION_DIALOG(app->open_colorsel)->ok_button, "clicked", G_CALLBACK(on_color_ok_button_clicked), NULL); g_signal_connect(app->open_colorsel, "delete_event", - G_CALLBACK(gtk_widget_hide), NULL); + G_CALLBACK(gtk_widget_hide_on_delete), NULL); } // if colour is non-NULL set it in the dialog as preselected colour if (colour != NULL && (colour[0] == '0' || colour[0] == '#'))
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2007-01-19 18:19:58 UTC (rev 1208) +++ trunk/src/prefs.c 2007-01-19 23:17:40 UTC (rev 1209) @@ -684,14 +684,6 @@ }
-gboolean on_prefs_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) -{ - gtk_widget_hide(widget); - - return TRUE; -} - - void on_prefs_color_choosed(GtkColorButton *widget, gpointer user_data) { GdkColor color; @@ -987,8 +979,10 @@ vte_append_preferences_tab(); #endif
- g_signal_connect((gpointer) app->prefs_dialog, "response", G_CALLBACK(on_prefs_button_clicked), NULL); - g_signal_connect((gpointer) app->prefs_dialog, "delete_event", G_CALLBACK(on_prefs_delete_event), NULL); + g_signal_connect((gpointer) app->prefs_dialog, "response", + G_CALLBACK(on_prefs_button_clicked), NULL); + g_signal_connect((gpointer) app->prefs_dialog, "delete_event", + G_CALLBACK(gtk_widget_hide_on_delete), NULL); g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "tagbar_font"), "font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(1)); g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "msgwin_font"),
Modified: trunk/src/prefs.h =================================================================== --- trunk/src/prefs.h 2007-01-19 18:19:58 UTC (rev 1208) +++ trunk/src/prefs.h 2007-01-19 23:17:40 UTC (rev 1209) @@ -28,8 +28,6 @@
void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_data);
-gboolean on_prefs_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); - void on_prefs_font_choosed(GtkFontButton *widget, gpointer user_data);
void on_prefs_color_choosed(GtkColorButton *widget, gpointer user_data);
Modified: trunk/src/search.c =================================================================== --- trunk/src/search.c 2007-01-19 18:19:58 UTC (rev 1208) +++ trunk/src/search.c 2007-01-19 23:17:40 UTC (rev 1209) @@ -286,7 +286,7 @@ g_signal_connect((gpointer) widgets.find_dialog, "response", G_CALLBACK(on_find_dialog_response), entry); g_signal_connect((gpointer) widgets.find_dialog, "delete_event", - G_CALLBACK(gtk_widget_hide), NULL); + G_CALLBACK(gtk_widget_hide_on_delete), NULL);
sbox = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(sbox), label, FALSE, FALSE, 0); @@ -416,7 +416,7 @@ g_signal_connect((gpointer) widgets.replace_dialog, "response", G_CALLBACK(on_replace_dialog_response), entry_replace); g_signal_connect((gpointer) widgets.replace_dialog, "delete_event", - G_CALLBACK(gtk_widget_hide), NULL); + G_CALLBACK(gtk_widget_hide_on_delete), NULL);
fbox = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(fbox), label_find, FALSE, FALSE, 0); @@ -620,7 +620,7 @@ g_signal_connect((gpointer) widgets.find_in_files_dialog, "response", G_CALLBACK(on_find_in_files_dialog_response), combo); g_signal_connect((gpointer) widgets.find_in_files_dialog, "delete_event", - G_CALLBACK(gtk_widget_hide), NULL); + G_CALLBACK(gtk_widget_hide_on_delete), NULL);
gtk_widget_show_all(widgets.find_in_files_dialog); sel = get_default_text(idx);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.