aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/mail-accounts.c22
-rw-r--r--mail/mail-accounts.h1
-rw-r--r--mail/mail-config.c33
-rw-r--r--mail/mail-config.glade51
-rw-r--r--mail/mail-config.h3
6 files changed, 118 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 49090864c9..60a41502c2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,16 @@
+2001-05-30 Dan Winship <danw@ximian.com>
+
+ * mail-config.glade: Rename the "PGP" page back to "Other" and add
+ a "default charset" option menu.
+
+ * mail-config.c (config_read, mail_config_write_on_exit,
+ mail_config_get_default_charset, mail_config_set_default_charset):
+ Handle "default charset".
+
+ * mail-accounts.c (construct): Fill in the "default_charset" menu
+ with an e_charset_picker menu.
+ (charset_menu_deactivate): Update the default charset.
+
2001-05-29 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (list_add_addresses): Take another argument to
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index b98a426eb9..78317336cd 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -30,6 +30,7 @@
#include <libgnomeui/gnome-stock.h>
#include <camel/camel-url.h>
#include <camel/camel-pgp-context.h>
+#include <gal/widgets/e-charset-picker.h>
#include "mail-accounts.h"
#include "mail-config.h"
@@ -549,10 +550,22 @@ attach_forward_style_signal (GtkWidget *item, gpointer data)
}
static void
+charset_menu_deactivate (GtkWidget *menu, gpointer data)
+{
+ char *charset;
+
+ charset = e_charset_picker_get_charset (menu);
+ if (charset) {
+ mail_config_set_default_charset (charset);
+ g_free (charset);
+ }
+}
+
+static void
construct (MailAccountsDialog *dialog)
{
GladeXML *gui;
- GtkWidget *notebook;
+ GtkWidget *notebook, *menu;
int num;
gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL);
@@ -654,6 +667,7 @@ construct (MailAccountsDialog *dialog)
gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (dialog->forward_style)),
attach_forward_style_signal, &num);
+ /* Other page */
dialog->pgp_path = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "filePgpPath"));
gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (dialog->pgp_path)),
mail_config_get_pgp_path ());
@@ -661,6 +675,12 @@ construct (MailAccountsDialog *dialog)
gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (dialog->pgp_path)),
"changed", GTK_SIGNAL_FUNC (pgp_path_changed), dialog);
+ dialog->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset"));
+ menu = e_charset_picker_new (mail_config_get_default_charset ());
+ gtk_option_menu_set_menu (dialog->charset, menu);
+ gtk_signal_connect (GTK_OBJECT (menu), "deactivate",
+ GTK_SIGNAL_FUNC (charset_menu_deactivate), NULL);
+
/* now to fill in the clists */
dialog->accounts_row = -1;
dialog->accounts = mail_config_get_accounts ();
diff --git a/mail/mail-accounts.h b/mail/mail-accounts.h
index 91de24e6d1..be7898ad8c 100644
--- a/mail/mail-accounts.h
+++ b/mail/mail-accounts.h
@@ -81,6 +81,7 @@ struct _MailAccountsDialog {
/* Composer page */
GtkToggleButton *send_html;
GtkOptionMenu *forward_style;
+ GtkOptionMenu *charset;
/* PGP page */
GnomeFileEntry *pgp_path;
diff --git a/mail/mail-config.c b/mail/mail-config.c
index aba9a56220..af1667200f 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -68,6 +68,7 @@ typedef struct {
MailConfigHTTPMode http_mode;
MailConfigForwardStyle default_forward_style;
MailConfigDisplayStyle message_display_style;
+ char *default_charset;
} MailConfig;
static const char GCONFPATH[] = "/apps/Evolution/Mail";
@@ -477,6 +478,19 @@ config_read (void)
config->message_display_style = MAIL_CONFIG_DISPLAY_NORMAL;
g_free (str);
+ /* Default charset */
+ str = g_strdup_printf ("=%s/config/Mail=/Format/charset", evolution_dir);
+ config->default_charset = gnome_config_get_string (str);
+ g_free (str);
+ if (!config->default_charset) {
+ config->default_charset = g_get_charset ();
+ if (!config->default_charset ||
+ !g_strcasecmp (config->default_charset, "US-ASCII"))
+ config->default_charset = g_strdup ("ISO-8859-1");
+ else
+ config->default_charset = g_strdup (config->default_charset);
+ }
+
gnome_config_sync ();
}
@@ -671,6 +685,11 @@ mail_config_write_on_exit (void)
gnome_config_set_int (str, config->message_display_style);
g_free (str);
+ /* Default charset */
+ str = g_strdup_printf ("=%s/config/Mail=/Format/default_charset", evolution_dir);
+ gnome_config_set_string (str, config->default_charset);
+ g_free (str);
+
/* Passwords */
gnome_config_private_clean_section ("/Evolution/Passwords");
sources = mail_config_get_sources ();
@@ -927,6 +946,20 @@ mail_config_set_message_display_style (MailConfigDisplayStyle style)
config->message_display_style = style;
}
+const char *
+mail_config_get_default_charset (void)
+{
+ return config->default_charset;
+}
+
+void
+mail_config_set_default_charset (const char *charset)
+{
+ g_free (config->default_charset);
+ config->default_charset = g_strdup (charset);
+}
+
+
const MailConfigAccount *
mail_config_get_default_account (void)
{
diff --git a/mail/mail-config.glade b/mail/mail-config.glade
index f6fcfc9464..f4c5519882 100644
--- a/mail/mail-config.glade
+++ b/mail/mail-config.glade
@@ -2182,7 +2182,7 @@ Quoted
<name>vbox64</name>
<border_width>4</border_width>
<homogeneous>False</homogeneous>
- <spacing>4</spacing>
+ <spacing>8</spacing>
<widget>
<class>GtkHBox</class>
@@ -2203,7 +2203,7 @@ Quoted
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
- <xpad>4</xpad>
+ <xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
@@ -2237,13 +2237,56 @@ Quoted
</widget>
</widget>
</widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox56</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>lblCharset</name>
+ <label>Default character set: </label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>omenuCharset</name>
+ <can_focus>True</can_focus>
+ <items>placeholder
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
- <name>pgp_config_label</name>
- <label>PGP</label>
+ <name>other_config_label</name>
+ <label>Other</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
diff --git a/mail/mail-config.h b/mail/mail-config.h
index d242d032d1..bb4fb8fbce 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -137,6 +137,9 @@ void mail_config_set_default_forward_style (MailConfigForwardS
MailConfigDisplayStyle mail_config_get_message_display_style (void);
void mail_config_set_message_display_style (MailConfigDisplayStyle style);
+const char *mail_config_get_default_charset (void);
+void mail_config_set_default_charset (const char *charset);
+
const MailConfigAccount *mail_config_get_default_account (void);
const MailConfigAccount *mail_config_get_account_by_name (const char *account_name);
const MailConfigAccount *mail_config_get_account_by_source_url (const char *url);