aboutsummaryrefslogtreecommitdiffstats
path: root/modules/settings
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-03-10 22:45:23 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-03-17 20:49:12 +0800
commit54bb7dd76c8c698eb69bd7460cf74551c182b439 (patch)
tree304e54b6b47aacfb0874d2db4f3a71710afef063 /modules/settings
parentc8bbe0df730a8252f062b0aaf98adac9aabd7542 (diff)
downloadgsoc2013-evolution-54bb7dd76c8c698eb69bd7460cf74551c182b439.tar
gsoc2013-evolution-54bb7dd76c8c698eb69bd7460cf74551c182b439.tar.gz
gsoc2013-evolution-54bb7dd76c8c698eb69bd7460cf74551c182b439.tar.bz2
gsoc2013-evolution-54bb7dd76c8c698eb69bd7460cf74551c182b439.tar.lz
gsoc2013-evolution-54bb7dd76c8c698eb69bd7460cf74551c182b439.tar.xz
gsoc2013-evolution-54bb7dd76c8c698eb69bd7460cf74551c182b439.tar.zst
gsoc2013-evolution-54bb7dd76c8c698eb69bd7460cf74551c182b439.zip
Add "reply-style-name" setting.
Replaces the "reply-style" setting, which is now deprecated. The new setting uses an enum type compatible with EMailReplyStyle.
Diffstat (limited to 'modules/settings')
-rw-r--r--modules/settings/e-settings-deprecated.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/modules/settings/e-settings-deprecated.c b/modules/settings/e-settings-deprecated.c
index 2bed41abf3..f7b21ae573 100644
--- a/modules/settings/e-settings-deprecated.c
+++ b/modules/settings/e-settings-deprecated.c
@@ -43,6 +43,7 @@ struct _ESettingsDeprecatedPrivate {
GSettings *mail_settings;
gulong forward_style_name_handler_id;
+ gulong reply_style_name_handler_id;
};
/* Flag values used in the "working-days" key. */
@@ -182,6 +183,30 @@ settings_deprecated_forward_style_name_cb (GSettings *settings,
}
static void
+settings_deprecated_reply_style_name_cb (GSettings *settings,
+ const gchar *key)
+{
+ /* XXX The "reply-style" key uses a completely different
+ * numbering than the EMailReplyStyle enum. *sigh* */
+ switch (g_settings_get_enum (settings, "reply-style-name")) {
+ case E_MAIL_REPLY_STYLE_QUOTED:
+ g_settings_set_int (settings, "reply-style", 2);
+ break;
+ case E_MAIL_REPLY_STYLE_DO_NOT_QUOTE:
+ g_settings_set_int (settings, "reply-style", 3);
+ break;
+ case E_MAIL_REPLY_STYLE_ATTACH:
+ g_settings_set_int (settings, "reply-style", 0);
+ break;
+ case E_MAIL_REPLY_STYLE_OUTLOOK:
+ g_settings_set_int (settings, "reply-style", 1);
+ break;
+ default:
+ g_warn_if_reached ();
+ }
+}
+
+static void
settings_deprecated_dispose (GObject *object)
{
ESettingsDeprecatedPrivate *priv;
@@ -251,6 +276,13 @@ settings_deprecated_dispose (GObject *object)
priv->forward_style_name_handler_id = 0;
}
+ if (priv->reply_style_name_handler_id > 0) {
+ g_signal_handler_disconnect (
+ priv->mail_settings,
+ priv->reply_style_name_handler_id);
+ priv->reply_style_name_handler_id = 0;
+ }
+
g_clear_object (&priv->calendar_settings);
g_clear_object (&priv->mail_settings);
@@ -308,6 +340,38 @@ settings_deprecated_constructed (GObject *object)
g_settings_set_enum (
priv->mail_settings, "forward-style-name", int_value);
+ /* XXX The "reply-style" key uses a completely different
+ * numbering than the EMailReplyStyle enum. *sigh* */
+ switch (g_settings_get_int (priv->mail_settings, "reply-style")) {
+ case 0:
+ g_settings_set_enum (
+ priv->mail_settings,
+ "reply-style-name",
+ E_MAIL_REPLY_STYLE_ATTACH);
+ break;
+ case 1:
+ g_settings_set_enum (
+ priv->mail_settings,
+ "reply-style-name",
+ E_MAIL_REPLY_STYLE_OUTLOOK);
+ break;
+ case 2:
+ g_settings_set_enum (
+ priv->mail_settings,
+ "reply-style-name",
+ E_MAIL_REPLY_STYLE_QUOTED);
+ break;
+ case 3:
+ g_settings_set_enum (
+ priv->mail_settings,
+ "reply-style-name",
+ E_MAIL_REPLY_STYLE_DO_NOT_QUOTE);
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
+
/* Write changes back to the deprecated keys. */
handler_id = g_signal_connect (
@@ -354,6 +418,11 @@ settings_deprecated_constructed (GObject *object)
priv->mail_settings, "changed::forward-style-name",
G_CALLBACK (settings_deprecated_forward_style_name_cb), NULL);
priv->forward_style_name_handler_id = handler_id;
+
+ handler_id = g_signal_connect (
+ priv->mail_settings, "changed::reply-style-name",
+ G_CALLBACK (settings_deprecated_reply_style_name_cb), NULL);
+ priv->reply_style_name_handler_id = handler_id;
}
static void