aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-03-10 22:10:47 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-03-17 20:49:12 +0800
commitc8bbe0df730a8252f062b0aaf98adac9aabd7542 (patch)
tree29c3a294a04869631a8e31f22069ec8ccad9ff56 /modules
parent3b205698762afcd86ac79595960253d84aff5487 (diff)
downloadgsoc2013-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.
Diffstat (limited to 'modules')
-rw-r--r--modules/settings/e-settings-deprecated.c35
1 files changed, 35 insertions, 0 deletions
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