diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 21f19fb84..4c47e6543 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,5 +1,11 @@ 2001-07-20 Pavel Roskin + * gfind.c (setup_gui): Register destroy handler. + (find_destroy): New function. Unregister idle task if needed. + (find_do_chdir): Don't unregister idle task. + (find_do_again): Likewise. + (find_do_panelize): Likewise. + * gfind.c (insert_file) : Join with find_add_match(). (find_do_edit): Put g_status_label into a box to work around what appears to be a bug in gtk-1.2.10. diff --git a/gnome/gfind.c b/gnome/gfind.c index c075ba412..c0fe99503 100644 --- a/gnome/gfind.c +++ b/gnome/gfind.c @@ -510,24 +510,18 @@ select_row(GtkCList *clist, gint row, gint column, GdkEvent *event, GFindDlg *he static void find_do_chdir(GtkWidget *widget, GFindDlg *head) { - gtk_idle_remove(head->idle_tag); - head->idle_tag = 0; head->stop = B_ENTER; gtk_main_quit(); } static void find_do_again(GtkWidget *widget, GFindDlg *head) { - gtk_idle_remove(head->idle_tag); - head->idle_tag = 0; head->stop = B_AGAIN; gtk_main_quit(); } static void find_do_panelize(GtkWidget *widget, GFindDlg *head) { - gtk_idle_remove(head->idle_tag); - head->idle_tag = 0; head->stop = B_PANELIZE; gtk_main_quit(); } @@ -537,8 +531,7 @@ static void find_start_stop(GtkWidget *widget, GFindDlg *head) { if (head->is_start) { - head->idle_tag = gtk_idle_add((GtkFunction) do_search, - head); + head->idle_tag = gtk_idle_add((GtkFunction) do_search, head); } else { gtk_idle_remove(head->idle_tag); head->idle_tag = 0; @@ -569,6 +562,14 @@ static void find_do_edit(GtkWidget *widget, GFindDlg *head) find_do_view_edit(head, 0, 1, dir, file); } +static void find_destroy(GtkWidget *widget, GFindDlg *head) +{ + if (head->idle_tag) { + gtk_idle_remove(head->idle_tag); + head->idle_tag = 0; + } +} + static void setup_gui(GFindDlg *head) { GtkWidget *sw; @@ -613,6 +614,9 @@ static void setup_gui(GFindDlg *head) gtk_signal_connect(GTK_OBJECT(head->g_clist), "select_row", GTK_SIGNAL_FUNC(select_row), head); + gtk_signal_connect (GTK_OBJECT(head->g_find_dlg), "destroy", + GTK_SIGNAL_FUNC(find_destroy), head); + /* * Connect the buttons */