aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-11-28 05:32:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-11-28 05:32:04 +0800
commit8b80096cad750de0a00b252730aa019a69314813 (patch)
treef16db931321510ec819c21aef48cd4695876d7ea
parent95e93d3433ca1481fc01c1ca177f69628e725432 (diff)
downloadgsoc2013-evolution-8b80096cad750de0a00b252730aa019a69314813.tar.gz
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
-rw-r--r--filter/ChangeLog20
-rw-r--r--filter/filter-folder.c25
-rw-r--r--filter/libfilter-i18n.h36
-rw-r--r--filter/rule-editor.c14
-rw-r--r--filter/vfolder-rule.c8
5 files changed, 76 insertions, 27 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index d8a32ea80b..6951581f89 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,23 @@
+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.
+
2001-11-12 Jeffrey Stedfast <fejj@ximian.com>
* filter-rule.c (validate): Force the user to name the filter.
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;
diff --git a/filter/libfilter-i18n.h b/filter/libfilter-i18n.h
index d3cc5cbb36..175eac2dc6 100644
--- a/filter/libfilter-i18n.h
+++ b/filter/libfilter-i18n.h
@@ -1,39 +1,23 @@
/* Automatically generated. Do not edit. */
-char *s = N_("after");
char *s = N_("Assign Color");
char *s = N_("Assign Score");
char *s = N_("Attachments");
-char *s = N_("before");
-char *s = N_("contains");
char *s = N_("Copy to Folder");
char *s = N_("Date received");
char *s = N_("Date sent");
char *s = N_("Delete");
char *s = N_("Deleted");
-char *s = N_("does not contain");
-char *s = N_("does not end with");
-char *s = N_("does not exist");
-char *s = N_("does not sound like");
-char *s = N_("does not start with");
char *s = N_("Do Not Exist");
char *s = N_("Draft");
-char *s = N_("ends with");
char *s = N_("Exist");
-char *s = N_("exists");
char *s = N_("Expression");
char *s = N_("Important");
-char *s = N_("is");
-char *s = N_("is greater than");
-char *s = N_("is less than");
-char *s = N_("is not");
char *s = N_("Mailing list");
char *s = N_("Message Body");
char *s = N_("Message Header");
char *s = N_("Message was received");
char *s = N_("Message was sent");
char *s = N_("Move to Folder");
-char *s = N_("on or after");
-char *s = N_("on or before");
char *s = N_("Read");
char *s = N_("Recipients");
char *s = N_("Regex Match");
@@ -42,12 +26,28 @@ char *s = N_("Score");
char *s = N_("Sender");
char *s = N_("Set Status");
char *s = N_("Size (kB)");
-char *s = N_("sounds like");
char *s = N_("Source Account");
char *s = N_("Specific header");
-char *s = N_("starts with");
char *s = N_("Status");
char *s = N_("Stop Processing");
char *s = N_("Subject");
+char *s = N_("after");
+char *s = N_("before");
+char *s = N_("contains");
+char *s = N_("does not contain");
+char *s = N_("does not end with");
+char *s = N_("does not exist");
+char *s = N_("does not sound like");
+char *s = N_("does not start with");
+char *s = N_("ends with");
+char *s = N_("exists");
+char *s = N_("is greater than");
+char *s = N_("is less than");
+char *s = N_("is not");
+char *s = N_("is");
+char *s = N_("on or after");
+char *s = N_("on or before");
+char *s = N_("sounds like");
+char *s = N_("starts with");
char *s = N_("was after");
char *s = N_("was before");
diff --git a/filter/rule-editor.c b/filter/rule-editor.c
index 9bb90c2b89..2529790283 100644
--- a/filter/rule-editor.c
+++ b/filter/rule-editor.c
@@ -264,6 +264,12 @@ add_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re)
}
static void
+add_editor_destroyed(GtkWidget *w, RuleEditor *re)
+{
+ add_editor_clicked(w, -1, re);
+}
+
+static void
rule_add (GtkWidget *widget, RuleEditor *re)
{
GtkWidget *rules;
@@ -285,6 +291,7 @@ rule_add (GtkWidget *widget, RuleEditor *re)
gtk_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (re->dialog), "clicked", add_editor_clicked, re);
+ gtk_signal_connect (GTK_OBJECT (re->dialog), "destroy", add_editor_destroyed, re);
gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE);
gtk_widget_show (re->dialog);
@@ -331,6 +338,12 @@ edit_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re)
}
static void
+edit_editor_destroyed(GtkWidget *w, RuleEditor *re)
+{
+ edit_editor_clicked(w, -1, re);
+}
+
+static void
rule_edit (GtkWidget *widget, RuleEditor *re)
{
GtkWidget *rules;
@@ -351,6 +364,7 @@ rule_edit (GtkWidget *widget, RuleEditor *re)
gtk_widget_set_parent (re->dialog, GTK_WIDGET (re));
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (re->dialog), "clicked", edit_editor_clicked, re);
+ gtk_signal_connect (GTK_OBJECT (re->dialog), "destroy", edit_editor_destroyed, re);
gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE);
diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c
index f940747c71..818b303366 100644
--- a/filter/vfolder-rule.c
+++ b/filter/vfolder-rule.c
@@ -358,12 +358,20 @@ source_add(GtkWidget *widget, struct _source_data *data)
GList *l;
gchar *s;
+ gtk_widget_set_sensitive(widget, FALSE);
def = "";
evolution_shell_client_user_select_folder (global_shell_client,
GTK_WINDOW (gtk_widget_get_toplevel (widget)),
_("Select Folder"),
def, allowed_types, NULL, &uri);
+ if (GTK_OBJECT_DESTROYED(widget)) {
+ g_free(uri);
+ return;
+ }
+
+ gtk_widget_set_sensitive(widget, TRUE);
+
if (uri != NULL && uri[0] != '\0') {
data->vr->sources = g_list_append(data->vr->sources, uri);