aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-07-16 10:38:41 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-07-16 10:38:41 +0800
commit7f0ab8334b1dcdf8beb19ea28005ba6055c7bfc0 (patch)
tree319340d3b5cb0a0d45e872b869875e7c2c100bb8 /mail
parent09a5b6b00a5ace026bf019e3a6eba905e4312d2d (diff)
downloadgsoc2013-evolution-7f0ab8334b1dcdf8beb19ea28005ba6055c7bfc0.tar.gz
gsoc2013-evolution-7f0ab8334b1dcdf8beb19ea28005ba6055c7bfc0.tar.zst
gsoc2013-evolution-7f0ab8334b1dcdf8beb19ea28005ba6055c7bfc0.zip
Lookup the label colour based on the label token, not an integer.
2002-07-15 Not Zed <NotZed@Ximian.com> * message-list.c (ml_tree_value_at): Lookup the label colour based on the label token, not an integer. * folder-browser.c (on_right_click): Lookup the label name from the filter type. Sigh, a bunch of other code should do similar but i'm going to leave it as integers. (set_msg_label): Set the label directly. svn path=/trunk/; revision=17473
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/folder-browser.c24
-rw-r--r--mail/message-list.c4
3 files changed, 19 insertions, 17 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e0b40785f3..97a2dc0f27 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -33,6 +33,14 @@
2002-07-15 Not Zed <NotZed@Ximian.com>
+ * message-list.c (ml_tree_value_at): Lookup the label colour based
+ on the label token, not an integer.
+
+ * folder-browser.c (on_right_click): Lookup the label name from
+ the filter type. Sigh, a bunch of other code should do similar
+ but i'm going to leave it as integers.
+ (set_msg_label): Set the label directly.
+
* mail-vfolder.c (vfolder_editor_clicked): Set the vfolder_editor
variable to null before we close the dialogue, otherwise the close
destroys it and reverts the file.
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index efae51d74a..605b33d751 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -49,6 +49,7 @@
#include "filter/vfolder-context.h"
#include "filter/filter-option.h"
#include "filter/filter-input.h"
+#include "filter/filter-label.h"
#include "mail-search-dialogue.h"
#include "e-util/e-sexp.h"
@@ -1606,7 +1607,7 @@ colour_closures_free (GPtrArray *closures)
struct _label_data {
FolderBrowser *fb;
- int label;
+ const char *label;
};
static void
@@ -1614,22 +1615,13 @@ set_msg_label (GtkWidget *widget, gpointer user_data)
{
struct _label_data *data = user_data;
GPtrArray *uids;
- char *label;
int i;
-
- if (data->label != -1)
- label = g_strdup_printf ("%d", data->label);
- else
- label = NULL;
-
+
uids = g_ptr_array_new ();
message_list_foreach (data->fb->message_list, enumerate_msg, uids);
- for (i = 0; i < uids->len; i++) {
- camel_folder_set_message_user_tag (data->fb->folder, uids->pdata[i], "label", label);
- }
+ for (i = 0; i < uids->len; i++)
+ camel_folder_set_message_user_tag (data->fb->folder, uids->pdata[i], "label", data->label);
g_ptr_array_free (uids, TRUE);
-
- g_free (label);
}
static void
@@ -2024,9 +2016,9 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
g_ptr_array_add (closures, label_menu[0].closure);
gtk_object_ref (GTK_OBJECT (fb));
((struct _label_data *) label_menu[0].closure)->fb = fb;
- ((struct _label_data *) label_menu[0].closure)->label = -1;
+ ((struct _label_data *) label_menu[0].closure)->label = NULL;
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < filter_label_count(); i++) {
struct _label_data *closure;
GdkPixmap *pixmap;
GdkColormap *map;
@@ -2052,7 +2044,7 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
closure = g_new (struct _label_data, 1);
gtk_object_ref (GTK_OBJECT (fb));
closure->fb = fb;
- closure->label = i;
+ closure->label = filter_label_label(i);
g_ptr_array_add (closures, closure);
diff --git a/mail/message-list.c b/mail/message-list.c
index a96b2ed473..3175c4e5b1 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -37,6 +37,8 @@
#include <e-util/ename/e-name-western.h>
#include <e-util/e-memory.h>
+#include "filter/filter-label.h"
+
#include "mail-config.h"
#include "message-list.h"
#include "mail-mt.h"
@@ -987,7 +989,7 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data)
label = camel_tag_get ((CamelTag **) &msg_info->user_tags, "label");
if (colour == NULL) {
if (label != NULL) {
- colour = mail_config_get_label_color_string (atoi (label));
+ colour = mail_config_get_label_color_string (filter_label_index(label));
} else if (msg_info->flags & CAMEL_MESSAGE_FLAGGED) {
/* FIXME: extract from the xpm somehow. */
colour = "#A7453E";
mmit/devel/libgsf?h=gstreamer0.10-removal&id=f51aa1f6f500b63a914ff9989687b4741efe3be4'>- Make gconf dependency optional by knob.stas2009-02-132-3/+10 * Presenting GNOME 2.24 for FreeBSD.marcus2009-01-104-28/+30 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-1/+1 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-201-3/+2 * Update to 1.14.8.marcus2008-03-073-7/+4 * Update to 1.14.7.mezz2007-09-082-4/+4 * Forgot to do the 'cvs rm' on this file.mezz2007-09-061-17626/+0 * Update to 1.14.6.mezz2007-09-055-82/+30 * One more PORTREVISION bump to ensure everyone gets the GConf schemas installed.marcus2007-07-131-1/+1 * Fix path to the patch file. Funny enough, make patch worked without this.marcus2007-07-131-2/+2 * Remove a REINPLACE hunk that snuck in.marcus2007-07-131-13/+0 * Correct distfile generation, and re-enable GConf schema installation.marcus2007-07-133-2/+17707 * Disable the GCONF_SCHEMAS for now, the gconf stuff is broke. I have reportedmezz2007-07-131-1/+1 * -Update to 1.14.5.mezz2007-07-123-43/+7 * Correct the plist.marcus2007-06-222-2/+1 * Update to 1.14.4.marcus2007-06-195-14/+47 * - Welcome X.org 7.2 \o/.flz2007-05-201-1/+1 * Update to 1.14.3ahze2006-11-072-4/+4 * Presenting GNOME 2.16.1 for FreeBSD. This release represents a massivemarcus2006-10-144-9/+51 * Update to 0.14.1.marcus2006-05-134-18/+6 * Presenting GNOME 2.14.1 for FreeBSD! Checkoutmarcus2006-04-303-8/+11 * Conversion to a single libtool environment.ade2006-02-232-1/+2 * Be sure to use the standard GConf source.marcus2006-01-241-1/+2 * - Add SHA256 checksumspav2005-11-241-0/+1 * - Update to 1.13.3ahze2005-11-074-11/+15 * Presenting GNOME 2.12 for FreeBSD. The release is chock full of bug fixesmarcus2005-11-05