aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-05-17 04:56:36 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-05-17 04:56:36 +0800
commit3cedfae4c21b3e2cdd53a74208f38c0e9885055f (patch)
tree33a553001856816f86305966900de187721ddcb6 /mail/mail-config.c
parent03c399c656ca3cc0d206d15e2f0d217f045d3ee2 (diff)
downloadgsoc2013-evolution-3cedfae4c21b3e2cdd53a74208f38c0e9885055f.tar.gz
gsoc2013-evolution-3cedfae4c21b3e2cdd53a74208f38c0e9885055f.tar.zst
gsoc2013-evolution-3cedfae4c21b3e2cdd53a74208f38c0e9885055f.zip
Check for a label tag when doing a lookup on the COLOR column.
2002-05-16 Jeffrey Stedfast <fejj@ximian.com> * message-list.c (ml_tree_value_at): Check for a label tag when doing a lookup on the COLOR column. * mail-config.c (mail_config_get_label_color_string): Return the colour in string format. * folder-browser.c (set_msg_label): Replaces colourise_msg and sets the "label" tag rather than the "colour" tag. * mail-preferences.c (mail_preferences_apply): Call mail_config_write() so that the settings get synced to disk. svn path=/trunk/; revision=16938
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index ecd0b8487a..316f945d59 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -71,11 +71,11 @@
MailConfigLabel label_defaults[5] = {
- { N_("Important"), 0x00ff0000 }, /* red */
- { N_("Work"), 0x00ff8c00 }, /* orange */
- { N_("Personal"), 0x00008b00 }, /* forest green */
- { N_("To Do"), 0x000000ff }, /* blue */
- { N_("Later"), 0x008b008b } /* magenta */
+ { N_("Important"), 0x00ff0000, NULL }, /* red */
+ { N_("Work"), 0x00ff8c00, NULL }, /* orange */
+ { N_("Personal"), 0x00008b00, NULL }, /* forest green */
+ { N_("To Do"), 0x000000ff, NULL }, /* blue */
+ { N_("Later"), 0x008b008b, NULL } /* magenta */
};
typedef struct {
@@ -375,6 +375,8 @@ mail_config_clear (void)
for (i = 0; i < 5; i++) {
g_free (config->labels[i].name);
config->labels[i].name = NULL;
+ g_free (config->labels[i].string);
+ config->labels[i].string = NULL;
}
}
@@ -2205,9 +2207,31 @@ mail_config_set_label_color (int label, guint32 color)
{
g_return_if_fail (label >= 0 && label < 5);
+ g_free (config->labels[label].string);
+ config->labels[label].string = NULL;
+
config->labels[label].color = color;
}
+const char *
+mail_config_get_label_color_string (int label)
+{
+ g_return_val_if_fail (label >= 0 && label < 5, NULL);
+
+ if (!config->labels[label].string) {
+ guint32 rgb = config->labels[label].color;
+ char *colour;
+
+ colour = g_strdup_printf ("#%.2x%.2x%.2x",
+ (rgb & 0xff0000) >> 16,
+ (rgb & 0xff00) >> 8,
+ rgb & 0xff);
+
+ config->labels[label].string = colour;
+ }
+
+ return config->labels[label].string;
+}
gboolean
mail_config_find_account (const MailConfigAccount *account)