aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/mail-composer-prefs.c1
-rw-r--r--mail/mail-config.glade290
-rw-r--r--mail/mail-preferences.c55
-rw-r--r--mail/mail-preferences.h7
4 files changed, 350 insertions, 3 deletions
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index 9b20e2fe77..6b1c703038 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -203,6 +203,7 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs)
option_menu_connect (prefs->charset, prefs);
/* Spell Checking */
+ /* FIXME: do stuff with these */
prefs->spell_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEnableSpellChecking"));
prefs->colour = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerSpellCheckColor"));
prefs->language = GTK_COMBO (glade_xml_get_widget (gui, "cmboSpellCheckLanguage"));
diff --git a/mail/mail-config.glade b/mail/mail-config.glade
index 2994e69a90..c93f43605e 100644
--- a/mail/mail-config.glade
+++ b/mail/mail-config.glade
@@ -5078,6 +5078,296 @@ Baltic (ISO-8859-4)
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frameColours</name>
+ <border_width>4</border_width>
+ <label>Labels and Colors</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>tableColours</name>
+ <border_width>4</border_width>
+ <rows>6</rows>
+ <columns>3</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
+
+ <widget>
+ <class>GnomeColorPicker</class>
+ <name>colorLabel0</name>
+ <can_focus>True</can_focus>
+ <dither>True</dither>
+ <use_alpha>False</use_alpha>
+ <title>Pick a color</title>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeColorPicker</class>
+ <name>colorLabel1</name>
+ <can_focus>True</can_focus>
+ <dither>True</dither>
+ <use_alpha>False</use_alpha>
+ <title>Pick a color</title>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeColorPicker</class>
+ <name>colorLabel2</name>
+ <can_focus>True</can_focus>
+ <dither>True</dither>
+ <use_alpha>False</use_alpha>
+ <title>Pick a color</title>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeColorPicker</class>
+ <name>colorLabel3</name>
+ <can_focus>True</can_focus>
+ <dither>True</dither>
+ <use_alpha>False</use_alpha>
+ <title>Pick a color</title>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeColorPicker</class>
+ <name>colorLabel4</name>
+ <can_focus>True</can_focus>
+ <dither>True</dither>
+ <use_alpha>False</use_alpha>
+ <title>Pick a color</title>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>4</top_attach>
+ <bottom_attach>5</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>txtLabel0</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text>Important</text>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>txtLabel1</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text>Work</text>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>txtLabel3</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text>Personal</text>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>txtLabel4</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text>To Do</text>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>txtLabel4</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text>Later</text>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>4</top_attach>
+ <bottom_attach>5</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>cmdRestoreLabels</name>
+ <can_focus>True</can_focus>
+ <label>Restore defaults</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>5</top_attach>
+ <bottom_attach>6</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>lblColours</name>
+ <label>Colors</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
</widget>
</widget>
diff --git a/mail/mail-preferences.c b/mail/mail-preferences.c
index 6a964c57ef..ac1e3fc4b4 100644
--- a/mail/mail-preferences.c
+++ b/mail/mail-preferences.c
@@ -27,6 +27,8 @@
#include "mail-preferences.h"
+#include <gal/widgets/e-unicode.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gtkhtml/gtkhtml-properties.h>
#include "widgets/misc/e-charset-picker.h"
@@ -148,6 +150,18 @@ color_set (GtkWidget *widget, guint r, guint g, guint b, guint a, gpointer user_
}
static void
+restore_labels_clicked (GtkWidget *widget, gpointer user_data)
+{
+ MailPreferences *prefs = (MailPreferences *) user_data;
+ int i;
+
+ for (i = 0; i < 5; i++) {
+ e_utf8_gtk_entry_set_text (prefs->labels[i].name, U_(label_defaults[i].name));
+ colorpicker_set_color (prefs->labels[i].color, label_defaults[i].color);
+ }
+}
+
+static void
menu_changed (GtkWidget *widget, gpointer user_data)
{
MailPreferences *prefs = (MailPreferences *) user_data;
@@ -179,6 +193,7 @@ mail_preferences_construct (MailPreferences *prefs)
GtkWidget *toplevel, *menu;
const char *text;
GladeXML *gui;
+ int i;
gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "preferences_tab");
prefs->gui = gui;
@@ -273,7 +288,7 @@ mail_preferences_construct (MailPreferences *prefs)
gtk_signal_connect (GTK_OBJECT (prefs->images_always), "toggled",
toggle_button_toggled, prefs);
- /* ... */
+ /* Some GtkHTML settings */
/* FIXME: use the gtkhtml interfaces for these settings when lewing gets around to adding them */
prefs->show_animated = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkShowAnimatedImages"));
gtk_toggle_button_set_active (prefs->show_animated,
@@ -287,6 +302,7 @@ mail_preferences_construct (MailPreferences *prefs)
gtk_signal_connect (GTK_OBJECT (prefs->autodetect_links), "toggled",
toggle_button_toggled, prefs);
+
prefs->prompt_unwanted_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptWantHTML"));
gtk_toggle_button_set_active (prefs->prompt_unwanted_html, mail_config_get_confirm_unwanted_html ());
gtk_signal_connect (GTK_OBJECT (prefs->prompt_unwanted_html), "toggled",
@@ -302,7 +318,28 @@ mail_preferences_construct (MailPreferences *prefs)
gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (prefs->pgp_path)), "changed",
entry_changed, prefs);
- /* FIXME: what about a label colour tab? */
+ /* Labels and Colours tab */
+ for (i = 0; i < 5; i++) {
+ char *widget_name;
+
+ widget_name = g_strdup_printf ("txtLabel%d", i);
+ prefs->labels[i].name = GTK_ENTRY (glade_xml_get_widget (gui, widget_name));
+ g_free (widget_name);
+ text = mail_config_get_label_name (i);
+ e_utf8_gtk_entry_set_text (prefs->labels[i].name, text ? text : "");
+ gtk_signal_connect (GTK_OBJECT (prefs->labels[i].name), "changed",
+ entry_changed, prefs);
+
+ widget_name = g_strdup_printf ("colorLabel%d", i);
+ prefs->labels[i].color = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, widget_name));
+ g_free (widget_name);
+ colorpicker_set_color (prefs->labels[i].color, mail_config_get_label_color (i));
+ gtk_signal_connect (GTK_OBJECT (prefs->labels[i].color), "color_set",
+ color_set, prefs);
+ }
+ prefs->restore_labels = GTK_BUTTON (glade_xml_get_widget (gui, "cmdRestoreLabels"));
+ gtk_signal_connect (GTK_OBJECT (prefs->restore_labels), "clicked",
+ restore_labels_clicked, prefs);
}
@@ -325,7 +362,7 @@ mail_preferences_apply (MailPreferences *prefs)
CamelPgpType type;
char *string;
guint32 rgb;
- int val;
+ int i, val;
/* General tab */
@@ -387,4 +424,16 @@ mail_preferences_apply (MailPreferences *prefs)
type = string && *string ? mail_config_pgp_type_detect_from_path (string) : CAMEL_PGP_TYPE_NONE;
mail_config_set_pgp_path (string && *string ? string : NULL);
mail_config_set_pgp_type (type);
+
+ /* Labels and Colours */
+ for (i = 0; i < 5; i++) {
+ /* save the label... */
+ string = e_utf8_gtk_entry_get_text (prefs->labels[i].name);
+ mail_config_set_label_name (i, string);
+ g_free (string);
+
+ /* save the colour... */
+ rgb = colorpicker_get_color (prefs->labels[i].color);
+ mail_config_set_label_color (i, rgb);
+ }
}
diff --git a/mail/mail-preferences.h b/mail/mail-preferences.h
index 916fcb4d1f..8403bdb719 100644
--- a/mail/mail-preferences.h
+++ b/mail/mail-preferences.h
@@ -92,6 +92,13 @@ struct _MailPreferences {
/* Security tab */
GnomeFileEntry *pgp_path;
+
+ /* Labels and Colours tab */
+ struct {
+ GtkEntry *name;
+ GnomeColorPicker *color;
+ } labels[5];
+ GtkButton *restore_labels;
};
struct _MailPreferencesClass {