aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-13 12:18:42 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-13 12:18:42 +0800
commita08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff (patch)
tree1389fd5b324ef8bf8397e95218a6f18e7e82c3f2 /filter
parent7d53a155c8dcf9e232edcb3c70df6584713e1076 (diff)
downloadgsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.tar.gz
gsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.tar.zst
gsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.zip
comment out gtk_destroyed check.
2002-11-13 Not Zed <NotZed@Ximian.com> * vfolder-rule.c (source_add): comment out gtk_destroyed check. * filter-label.c: Added back some of the guts. Might not work but some of the code uses it :-/. Gives u a fixed set of non-editable labels. svn path=/trunk/; revision=18729
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog8
-rw-r--r--filter/filter-label.c49
-rw-r--r--filter/filter-label.h5
-rw-r--r--filter/libfilter-i18n.h44
-rw-r--r--filter/vfolder-rule.c5
5 files changed, 86 insertions, 25 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 9571bfb928..12abd29ea0 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,11 @@
+2002-11-13 Not Zed <NotZed@Ximian.com>
+
+ * vfolder-rule.c (source_add): comment out gtk_destroyed check.
+
+ * filter-label.c: Added back some of the guts. Might not work but
+ some of the code uses it :-/. Gives u a fixed set of non-editable
+ labels.
+
2002-11-08 Jeffrey Stedfast <fejj@ximian.com>
* rule-editor.c (rule_edit): Use weak_ref instead of connecting to
diff --git a/filter/filter-label.c b/filter/filter-label.c
index a249a8adf3..d6521a94d8 100644
--- a/filter/filter-label.c
+++ b/filter/filter-label.c
@@ -113,12 +113,59 @@ filter_label_new (void)
return (FilterLabel *) g_object_new (FILTER_TYPE_LABEL, NULL, NULL);
}
+
+static struct {
+ char *path;
+ char *title;
+ char *value;
+} labels[] = {
+ { "/Mail/Labels/label_0", N_("Important"), "important" },
+ { "/Mail/Labels/label_1", N_("Work"), "work" },
+ { "/Mail/Labels/label_2", N_("Personal"), "personal" },
+ { "/Mail/Labels/label_3", N_("To Do"), "todo" },
+ { "/Mail/Labels/label_4", N_("Later"), "later" },
+};
+
+int filter_label_count(void)
+{
+ return sizeof(labels)/sizeof(labels[0]);
+}
+
+const char *filter_label_label(int i)
+{
+ if (i<0 || i >= sizeof(labels)/sizeof(labels[0]))
+ return NULL;
+ else
+ return labels[i].value;
+}
+
+int filter_label_index(const char *label)
+{
+ int i;
+
+ for (i=0;i<sizeof(labels)/sizeof(labels[0]);i++) {
+ if (strcmp(labels[i].value, label) == 0)
+ return i;
+ }
+
+ return -1;
+}
+
static void
xml_create (FilterElement *fe, xmlNodePtr node)
{
FilterOption *fo = (FilterOption *) fe;
-
+ int i;
+
FILTER_ELEMENT_CLASS (parent_class)->xml_create (fe, node);
/* FIXME: probably use gconf_client_get_list() here? */
+
+ /* just hardcode some stuff for now */
+ for (i=0;i<sizeof(labels)/sizeof(labels[0]);i++) {
+ const char *title;
+
+ title = _(labels[i].title);
+ filter_option_add(fo, labels[i].value, title, NULL);
+ }
}
diff --git a/filter/filter-label.h b/filter/filter-label.h
index bde83811ce..395ce07d48 100644
--- a/filter/filter-label.h
+++ b/filter/filter-label.h
@@ -58,6 +58,11 @@ GType filter_label_get_type (void);
FilterLabel *filter_label_new (void);
+/* Sigh, this is a mess, but its cleaner than the original mess */
+int filter_label_count(void);
+const char *filter_label_label(int i);
+int filter_label_index(const char *label);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/filter/libfilter-i18n.h b/filter/libfilter-i18n.h
index d965e03184..ea7ff03b0e 100644
--- a/filter/libfilter-i18n.h
+++ b/filter/libfilter-i18n.h
@@ -4,34 +4,17 @@ char *s = N_("Assign Color");
char *s = N_("Assign Score");
char *s = N_("Attachments");
char *s = N_("Beep");
-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 return");
-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_("Follow Up");
char *s = N_("Important");
-char *s = N_("is");
-char *s = N_("is after");
-char *s = N_("is before");
-char *s = N_("is Flagged");
-char *s = N_("is greater than");
-char *s = N_("is less than");
-char *s = N_("is not");
-char *s = N_("is not Flagged");
char *s = N_("Label");
char *s = N_("Mailing list");
char *s = N_("Message Body");
@@ -43,19 +26,36 @@ char *s = N_("Read");
char *s = N_("Recipients");
char *s = N_("Regex Match");
char *s = N_("Replied to");
-char *s = N_("returns");
-char *s = N_("returns greater than");
-char *s = N_("returns less than");
char *s = N_("Score");
char *s = N_("Sender");
char *s = N_("Set Status");
char *s = N_("Shell Command");
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_("Unset Status");
+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 return");
+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 Flagged");
+char *s = N_("is after");
+char *s = N_("is before");
+char *s = N_("is greater than");
+char *s = N_("is less than");
+char *s = N_("is not Flagged");
+char *s = N_("is not");
+char *s = N_("is");
+char *s = N_("returns greater than");
+char *s = N_("returns less than");
+char *s = N_("returns");
+char *s = N_("sounds like");
+char *s = N_("starts with");
diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c
index 19de3074f7..d634c0c6f8 100644
--- a/filter/vfolder-rule.c
+++ b/filter/vfolder-rule.c
@@ -394,13 +394,14 @@ source_add (GtkWidget *widget, struct _source_data *data)
GTK_WINDOW (gtk_widget_get_toplevel (widget)),
_("Select Folder"),
def, allowed_types, &folder);
-
+#warning "gtk_object_destroyed?"
+#if 0
if (GTK_OBJECT_DESTROYED (widget)) {
if (folder)
CORBA_free (folder);
return;
}
-
+#endif
gtk_widget_set_sensitive (widget, TRUE);
if (folder) {