diff options
author | Not Zed <NotZed@Ximian.com> | 2001-11-28 05:32:04 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-11-28 05:32:04 +0800 |
commit | 8b80096cad750de0a00b252730aa019a69314813 (patch) | |
tree | f16db931321510ec819c21aef48cd4695876d7ea /filter/filter-folder.c | |
parent | 95e93d3433ca1481fc01c1ca177f69628e725432 (diff) | |
download | gsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.tar gsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.tar.gz gsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.tar.bz2 gsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.tar.lz gsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.tar.xz gsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.tar.zst gsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.zip |
Hook onto destroy event. (edit_editor_destroyed): IF we get destroyed,
2001-11-21 Not Zed <NotZed@Ximian.com>
* rule-editor.c (rule_edit): Hook onto destroy event.
(edit_editor_destroyed): IF we get destroyed, fake a -1 click
event to clean up.
(rule_add): hook onto destroy of dialogue.
(add_editor_destroyed): Simulate -1 click event to clean up. Fix
for #15745.
2001-11-20 Not Zed <NotZed@Ximian.com>
* vfolder-rule.c (source_add): Desensitise button while we're
running, and if we are destroyed, exit and do nothing when we're
done. Fixes crash in #15498.
* filter-folder.c (button_clicked): Ref 'ff' around dialogue
showing incase we go away before it returns. Also desensitise
button that invoked us while its being processed & remove
'is_active' hack. Fixes similar problems to those in #15498.
svn path=/trunk/; revision=14794
Diffstat (limited to 'filter/filter-folder.c')
-rw-r--r-- | filter/filter-folder.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/filter/filter-folder.c b/filter/filter-folder.c index 177e0996e4..5b862a986a 100644 --- a/filter/filter-folder.c +++ b/filter/filter-folder.c @@ -227,22 +227,28 @@ button_clicked (GtkButton *button, FilterFolder *ff) #ifdef SHELL const char *allowed_types[] = { "mail", NULL }; char *def, *physical_uri, *evolution_uri; - static gboolean is_active = FALSE; gchar *s; - if (is_active) - return; - - is_active = TRUE; - def = ff->uri ? ff->uri : ""; - + + gtk_widget_set_sensitive((GtkWidget *)button, FALSE); + gtk_object_ref((GtkObject *)ff); + evolution_shell_client_user_select_folder (global_shell_client, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))), _("Select Folder"), def, allowed_types, &evolution_uri, &physical_uri); + + if (GTK_OBJECT_DESTROYED(button)) { + g_free(physical_uri); + g_free(evolution_uri); + gtk_object_unref((GtkObject *)ff); + return; + } + + gtk_widget_set_sensitive((GtkWidget *)button, TRUE); if (physical_uri != NULL && physical_uri[0] != '\0') { g_free (ff->uri); @@ -257,8 +263,9 @@ button_clicked (GtkButton *button, FilterFolder *ff) g_free (physical_uri); } g_free (evolution_uri); - - is_active = FALSE; + + gtk_object_unref((GtkObject *)ff); + #else GnomeDialog *gd; GtkEntry *entry; |