aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-label.c
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/filter-label.c
parent7d53a155c8dcf9e232edcb3c70df6584713e1076 (diff)
downloadgsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.tar
gsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.tar.gz
gsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.tar.bz2
gsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.tar.lz
gsoc2013-evolution-a08bb5c1e3dd09be6a7ef21de2fac295d4bb66ff.tar.xz
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/filter-label.c')
-rw-r--r--filter/filter-label.c49
1 files changed, 48 insertions, 1 deletions
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);
+ }
}