diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-10 22:10:47 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-17 20:49:12 +0800 |
commit | c8bbe0df730a8252f062b0aaf98adac9aabd7542 (patch) | |
tree | 29c3a294a04869631a8e31f22069ec8ccad9ff56 | |
parent | 3b205698762afcd86ac79595960253d84aff5487 (diff) | |
download | gsoc2013-evolution-c8bbe0df730a8252f062b0aaf98adac9aabd7542.tar gsoc2013-evolution-c8bbe0df730a8252f062b0aaf98adac9aabd7542.tar.gz gsoc2013-evolution-c8bbe0df730a8252f062b0aaf98adac9aabd7542.tar.bz2 gsoc2013-evolution-c8bbe0df730a8252f062b0aaf98adac9aabd7542.tar.lz gsoc2013-evolution-c8bbe0df730a8252f062b0aaf98adac9aabd7542.tar.xz gsoc2013-evolution-c8bbe0df730a8252f062b0aaf98adac9aabd7542.tar.zst gsoc2013-evolution-c8bbe0df730a8252f062b0aaf98adac9aabd7542.zip |
Add "forward-style-name" setting.
Replaces the "forward-style" setting, which is now deprecated.
The new setting uses an enum type compatible with EMailForwardStyle.
-rw-r--r-- | data/org.gnome.evolution.mail.gschema.xml.in | 23 | ||||
-rw-r--r-- | modules/settings/e-settings-deprecated.c | 35 |
2 files changed, 55 insertions, 3 deletions
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in index 7ac3df8fd7..69c5799872 100644 --- a/data/org.gnome.evolution.mail.gschema.xml.in +++ b/data/org.gnome.evolution.mail.gschema.xml.in @@ -1,4 +1,12 @@ <schemalist> + + <!-- Keep this synchronized with EMailForwardStyle. --> + <enum id="org.gnome.evolution.mail.ForwardStyle"> + <value nick='attached' value='0'/> + <value nick='inline' value='1'/> + <value nick='quoted' value='2'/> + </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> @@ -335,10 +343,9 @@ <_summary>Flush Outbox after filtering</_summary> <_description>Whether to flush Outbox after filtering is done. Outbox flush will happen only when there was used any 'Forward to' filter action and approximately one minute after the last action invocation.</_description> </key> - <key name="forward-style" type="i"> - <default>0</default> + <key name="forward-style-name" enum="org.gnome.evolution.mail.ForwardStyle"> + <default>'attached'</default> <_summary>Default forward style</_summary> - <_description></_description> </key> <key name="reply-style" type="i"> <default>0</default> @@ -536,5 +543,15 @@ <child name="send-recv-window" schema="org.gnome.evolution.window"/> <child name="subscription-window" schema="org.gnome.evolution.window"/> <child name="vfolder-window" schema="org.gnome.evolution.window"/> + + <!-- The following keys are deprecated. --> + + <key name="forward-style" type="i"> + <default>0</default> + <_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> + </schema> + </schemalist> diff --git a/modules/settings/e-settings-deprecated.c b/modules/settings/e-settings-deprecated.c index abcf152800..2bed41abf3 100644 --- a/modules/settings/e-settings-deprecated.c +++ b/modules/settings/e-settings-deprecated.c @@ -24,6 +24,7 @@ #include "e-settings-deprecated.h" #include <shell/e-shell.h> +#include <libemail-engine/e-mail-enums.h> #define E_SETTINGS_DEPRECATED_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -39,6 +40,9 @@ struct _ESettingsDeprecatedPrivate { gulong work_day_friday_handler_id; gulong work_day_saturday_handler_id; gulong work_day_sunday_handler_id; + + GSettings *mail_settings; + gulong forward_style_name_handler_id; }; /* Flag values used in the "working-days" key. */ @@ -168,6 +172,16 @@ settings_deprecated_work_day_sunday_cb (GSettings *settings, } static void +settings_deprecated_forward_style_name_cb (GSettings *settings, + const gchar *key) +{ + EMailForwardStyle style; + + style = g_settings_get_enum (settings, "forward-style-name"); + g_settings_set_int (settings, "forward-style", style); +} + +static void settings_deprecated_dispose (GObject *object) { ESettingsDeprecatedPrivate *priv; @@ -230,7 +244,15 @@ settings_deprecated_dispose (GObject *object) priv->work_day_sunday_handler_id = 0; } + if (priv->forward_style_name_handler_id > 0) { + g_signal_handler_disconnect ( + priv->mail_settings, + priv->forward_style_name_handler_id); + priv->forward_style_name_handler_id = 0; + } + g_clear_object (&priv->calendar_settings); + g_clear_object (&priv->mail_settings); /* Chain up to parent's dispose() method. */ G_OBJECT_CLASS (e_settings_deprecated_parent_class)->dispose (object); @@ -281,6 +303,11 @@ settings_deprecated_constructed (GObject *object) priv->calendar_settings, "work-day-sunday", (int_value & DEPRECATED_WORKING_DAYS_SUNDAY) != 0); + int_value = g_settings_get_int ( + priv->mail_settings, "forward-style"); + g_settings_set_enum ( + priv->mail_settings, "forward-style-name", int_value); + /* Write changes back to the deprecated keys. */ handler_id = g_signal_connect ( @@ -322,6 +349,11 @@ settings_deprecated_constructed (GObject *object) priv->calendar_settings, "changed::work-day-sunday", G_CALLBACK (settings_deprecated_work_day_sunday_cb), NULL); priv->work_day_sunday_handler_id = handler_id; + + handler_id = g_signal_connect ( + priv->mail_settings, "changed::forward-style-name", + G_CALLBACK (settings_deprecated_forward_style_name_cb), NULL); + priv->forward_style_name_handler_id = handler_id; } static void @@ -354,6 +386,9 @@ e_settings_deprecated_init (ESettingsDeprecated *extension) settings = g_settings_new ("org.gnome.evolution.calendar"); extension->priv->calendar_settings = settings; + + settings = g_settings_new ("org.gnome.evolution.mail"); + extension->priv->mail_settings = settings; } void |