Kaydet (Commit) 278458e4 authored tarafından Enrico Tröger's avatar Enrico Tröger

Fixed crashes when using some dialogs after they were closed before.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1209 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 44f105e7
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
available on all systems. available on all systems.
* geany.desktop.in: Added more mimetypes supplied by Nick Schermer. * geany.desktop.in: Added more mimetypes supplied by Nick Schermer.
* doc/geany.docbook: Documented GEANY_PROJECT_EXT. * 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> 2007-01-18 Enrico Tröger <enrico.troeger@uvena.de>
......
...@@ -127,7 +127,7 @@ void dialogs_show_open_file () ...@@ -127,7 +127,7 @@ void dialogs_show_open_file ()
g_signal_connect((gpointer) app->open_filesel, "selection-changed", g_signal_connect((gpointer) app->open_filesel, "selection-changed",
G_CALLBACK(on_file_open_selection_changed), NULL); G_CALLBACK(on_file_open_selection_changed), NULL);
g_signal_connect ((gpointer) app->open_filesel, "delete_event", 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_signal_connect((gpointer) app->open_filesel, "response",
G_CALLBACK(on_file_open_dialog_response), NULL); G_CALLBACK(on_file_open_dialog_response), NULL);
} }
...@@ -267,8 +267,10 @@ gboolean dialogs_show_save_as() ...@@ -267,8 +267,10 @@ gboolean dialogs_show_save_as()
gtk_window_set_type_hint(GTK_WINDOW(app->save_filesel), GDK_WINDOW_TYPE_HINT_DIALOG); 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); 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, "delete_event",
g_signal_connect((gpointer) app->save_filesel, "response", G_CALLBACK(on_file_save_dialog_response), NULL); 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)); gtk_window_set_transient_for(GTK_WINDOW(app->save_filesel), GTK_WINDOW(app->window));
} }
...@@ -415,7 +417,7 @@ void dialogs_show_open_font() ...@@ -415,7 +417,7 @@ void dialogs_show_open_font()
gtk_widget_show(GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->apply_button); gtk_widget_show(GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->apply_button);
g_signal_connect((gpointer) app->open_fontsel, 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, g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->ok_button,
"clicked", G_CALLBACK(on_font_ok_button_clicked), NULL); "clicked", G_CALLBACK(on_font_ok_button_clicked), NULL);
g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->cancel_button, g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->cancel_button,
...@@ -423,7 +425,8 @@ void dialogs_show_open_font() ...@@ -423,7 +425,8 @@ void dialogs_show_open_font()
g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->apply_button, g_signal_connect((gpointer) GTK_FONT_SELECTION_DIALOG(app->open_fontsel)->apply_button,
"clicked", G_CALLBACK(on_font_apply_button_clicked), NULL); "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)); gtk_window_set_transient_for(GTK_WINDOW(app->open_fontsel), GTK_WINDOW(app->window));
} }
/* We make sure the dialog is visible. */ /* We make sure the dialog is visible. */
...@@ -546,7 +549,7 @@ void dialogs_show_color(gchar *colour) ...@@ -546,7 +549,7 @@ void dialogs_show_color(gchar *colour)
g_signal_connect(GTK_COLOR_SELECTION_DIALOG(app->open_colorsel)->ok_button, "clicked", g_signal_connect(GTK_COLOR_SELECTION_DIALOG(app->open_colorsel)->ok_button, "clicked",
G_CALLBACK(on_color_ok_button_clicked), NULL); G_CALLBACK(on_color_ok_button_clicked), NULL);
g_signal_connect(app->open_colorsel, "delete_event", 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 is non-NULL set it in the dialog as preselected colour
if (colour != NULL && (colour[0] == '0' || colour[0] == '#')) if (colour != NULL && (colour[0] == '0' || colour[0] == '#'))
......
...@@ -684,14 +684,6 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat ...@@ -684,14 +684,6 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
} }
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) void on_prefs_color_choosed(GtkColorButton *widget, gpointer user_data)
{ {
GdkColor color; GdkColor color;
...@@ -987,8 +979,10 @@ void dialogs_show_prefs_dialog(void) ...@@ -987,8 +979,10 @@ void dialogs_show_prefs_dialog(void)
vte_append_preferences_tab(); vte_append_preferences_tab();
#endif #endif
g_signal_connect((gpointer) app->prefs_dialog, "response", G_CALLBACK(on_prefs_button_clicked), NULL); g_signal_connect((gpointer) app->prefs_dialog, "response",
g_signal_connect((gpointer) app->prefs_dialog, "delete_event", G_CALLBACK(on_prefs_delete_event), NULL); 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"), g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "tagbar_font"),
"font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(1)); "font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(1));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "msgwin_font"), g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "msgwin_font"),
......
...@@ -28,8 +28,6 @@ void prefs_init_dialog(void); ...@@ -28,8 +28,6 @@ void prefs_init_dialog(void);
void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_data); 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_font_choosed(GtkFontButton *widget, gpointer user_data);
void on_prefs_color_choosed(GtkColorButton *widget, gpointer user_data); void on_prefs_color_choosed(GtkColorButton *widget, gpointer user_data);
......
...@@ -286,7 +286,7 @@ void search_show_find_dialog() ...@@ -286,7 +286,7 @@ void search_show_find_dialog()
g_signal_connect((gpointer) widgets.find_dialog, "response", g_signal_connect((gpointer) widgets.find_dialog, "response",
G_CALLBACK(on_find_dialog_response), entry); G_CALLBACK(on_find_dialog_response), entry);
g_signal_connect((gpointer) widgets.find_dialog, "delete_event", 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); sbox = gtk_hbox_new(FALSE, 6);
gtk_box_pack_start(GTK_BOX(sbox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(sbox), label, FALSE, FALSE, 0);
...@@ -416,7 +416,7 @@ void search_show_replace_dialog() ...@@ -416,7 +416,7 @@ void search_show_replace_dialog()
g_signal_connect((gpointer) widgets.replace_dialog, "response", g_signal_connect((gpointer) widgets.replace_dialog, "response",
G_CALLBACK(on_replace_dialog_response), entry_replace); G_CALLBACK(on_replace_dialog_response), entry_replace);
g_signal_connect((gpointer) widgets.replace_dialog, "delete_event", 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); fbox = gtk_hbox_new(FALSE, 6);
gtk_box_pack_start(GTK_BOX(fbox), label_find, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(fbox), label_find, FALSE, FALSE, 0);
...@@ -620,7 +620,7 @@ void search_show_find_in_files_dialog() ...@@ -620,7 +620,7 @@ void search_show_find_in_files_dialog()
g_signal_connect((gpointer) widgets.find_in_files_dialog, "response", g_signal_connect((gpointer) widgets.find_in_files_dialog, "response",
G_CALLBACK(on_find_in_files_dialog_response), combo); G_CALLBACK(on_find_in_files_dialog_response), combo);
g_signal_connect((gpointer) widgets.find_in_files_dialog, "delete_event", 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); gtk_widget_show_all(widgets.find_in_files_dialog);
sel = get_default_text(idx); sel = get_default_text(idx);
......
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