diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-10 22:45:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-17 20:49:12 +0800 |
commit | 54bb7dd76c8c698eb69bd7460cf74551c182b439 (patch) | |
tree | 304e54b6b47aacfb0874d2db4f3a71710afef063 | |
parent | c8bbe0df730a8252f062b0aaf98adac9aabd7542 (diff) | |
download | gsoc2013-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.
-rw-r--r-- | data/org.gnome.evolution.mail.gschema.xml.in | 20 | ||||
-rw-r--r-- | modules/settings/e-settings-deprecated.c | 69 |
2 files changed, 85 insertions, 4 deletions
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in index 69c5799872..c3e26f313c 100644 --- a/data/org.gnome.evolution.mail.gschema.xml.in +++ b/data/org.gnome.evolution.mail.gschema.xml.in @@ -7,6 +7,14 @@ <value nick='quoted' value='2'/> </enum> + <!-- Keep this synchronized with EMailReplyStyle. --> + <enum id="org.gnome.evolution.mail.ReplyStyle"> + <value nick='quoted' value='0'/> + <value nick='do-not-quote' value='1'/> + <value nick='attach' value='2'/> + <value nick='outlook' value='3'/> + </enum> + <schema gettext-domain="evolution" id="org.gnome.evolution.mail" path="/org/gnome/evolution/mail/"> <key name="prompt-check-if-default-mailer" type="b"> <default>true</default> @@ -347,10 +355,9 @@ <default>'attached'</default> <_summary>Default forward style</_summary> </key> - <key name="reply-style" type="i"> - <default>0</default> - <_summary>Default forward style</_summary> - <_description></_description> + <key name="reply-style-name" enum="org.gnome.evolution.mail.ReplyStyle"> + <default>'quoted'</default> + <_summary>Default reply style</_summary> </key> <key name="prompt-on-empty-subject" type="b"> <default>true</default> @@ -551,6 +558,11 @@ <_summary>(Deprecated) Default forward style</_summary> <_description>This key was deprecated in version 3.10 and should no longer be used. Use "forward-style-name" instead.</_description> </key> + <key name="reply-style" type="i"> + <default>0</default> + <_summary>(Deprecated) Default reply style</_summary> + <_description>This key was deprecated in version 3.10 and should no longer be used. Use "reply-style-name" instead.</_description> + </key> </schema> 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 |