diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-12-24 07:44:55 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-12-24 07:44:55 +0000 |
commit | f0ded112875ffa7337d442bd05abdd97170d8dc1 (patch) | |
tree | 259b8bfc77fddba331500754053f09aebcb6b5b7 /src/colorlabel.c | |
parent | 8e167b57790543c62623e5f477d225a52bf9f9c1 (diff) |
made color label text customizable (~/.sylpheed-2.0/colorlabelrc).
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2406 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/colorlabel.c')
-rw-r--r-- | src/colorlabel.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/colorlabel.c b/src/colorlabel.c index 6f742111..d1d0df0a 100644 --- a/src/colorlabel.c +++ b/src/colorlabel.c @@ -41,6 +41,7 @@ #include "colorlabel.h" #include "gtkutils.h" #include "utils.h" +#include "prefs.h" static gchar *labels[] = { N_("Orange"), @@ -356,3 +357,36 @@ void colorlabel_update_menu(void) } } } + +gint colorlabel_read_config(void) +{ + gchar *path; + FILE *fp; + gint i; + gchar buf[PREFSBUFSIZE]; + + path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, "colorlabelrc", + NULL); + if ((fp = g_fopen(path, "rb")) == NULL) { + g_free(path); + return -1; + } + + for (i = 0; i < LABEL_COLORS_ELEMS; i++) { + if (fgets(buf, sizeof(buf), fp) == NULL) + break; + g_strstrip(buf); + if (buf[0] != '\0') { + colorlabel_set_color_text(i, buf); + } + } + + fclose(fp); + g_free(path); + + return 0; +} + +void colorlabel_write_config(void) +{ +} |