aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail/em-mailer-prefs.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-08-08 22:04:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-08 22:12:15 +0800
commit0ae8e9e7b7c224915f474a4e635a8ccecd476c40 (patch)
tree22c78c968cd628b928db2e4f2182001fb27a54a0 /modules/mail/em-mailer-prefs.c
parenta661dfebc6e3c5daeb7cf9bf3492eae989c4f590 (diff)
downloadgsoc2013-evolution-0ae8e9e7b7c224915f474a4e635a8ccecd476c40.tar
gsoc2013-evolution-0ae8e9e7b7c224915f474a4e635a8ccecd476c40.tar.gz
gsoc2013-evolution-0ae8e9e7b7c224915f474a4e635a8ccecd476c40.tar.bz2
gsoc2013-evolution-0ae8e9e7b7c224915f474a4e635a8ccecd476c40.tar.lz
gsoc2013-evolution-0ae8e9e7b7c224915f474a4e635a8ccecd476c40.tar.xz
gsoc2013-evolution-0ae8e9e7b7c224915f474a4e635a8ccecd476c40.tar.zst
gsoc2013-evolution-0ae8e9e7b7c224915f474a4e635a8ccecd476c40.zip
Return of the "mark messages as read" preference.
This reverses the removal of the "Mark messages as read" preference in commit e7247d6d60336861ed5c0ba05dd64e29f728349c. I apparently misjudged the popularity of this preference, as there's been a surprising amout of backlash and confusion as to its removal on the mailing list, IRC channel, and various distro-support forums. So, "mea culpa" for removing that one. Haven't heard a peep about the other removed preferences, however, so they will stay gone.
Diffstat (limited to 'modules/mail/em-mailer-prefs.c')
-rw-r--r--modules/mail/em-mailer-prefs.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c
index b2381b2cf2..1877e28624 100644
--- a/modules/mail/em-mailer-prefs.c
+++ b/modules/mail/em-mailer-prefs.c
@@ -121,6 +121,38 @@ em_mailer_prefs_init (EMMailerPrefs *preferences)
preferences->settings = g_settings_new ("org.gnome.evolution.mail");
}
+static gboolean
+mark_seen_milliseconds_to_seconds (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
+{
+ gint milliseconds;
+ gdouble seconds;
+
+ milliseconds = g_value_get_int (source_value);
+ seconds = milliseconds / 1000.0;
+ g_value_set_double (target_value, seconds);
+
+ return TRUE;
+}
+
+static gboolean
+mark_seen_seconds_to_milliseconds (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
+{
+ gint milliseconds;
+ gdouble seconds;
+
+ seconds = g_value_get_double (source_value);
+ milliseconds = seconds * 1000;
+ g_value_set_int (target_value, milliseconds);
+
+ return TRUE;
+}
+
enum {
JH_LIST_COLUMN_NAME,
JH_LIST_COLUMN_VALUE
@@ -768,6 +800,30 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs,
/* Message Display */
+ widget = e_builder_get_widget (prefs->builder, "chkMarkTimeout");
+ g_object_bind_property (
+ shell_settings, "mail-mark-seen",
+ widget, "active",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE);
+
+ /* The "mark seen" timeout requires special transform functions
+ * because we display the timeout value to the user in seconds
+ * but store the settings value in milliseconds. */
+ widget = e_builder_get_widget (prefs->builder, "spinMarkTimeout");
+ g_object_bind_property (
+ shell_settings, "mail-mark-seen",
+ widget, "sensitive",
+ G_BINDING_SYNC_CREATE);
+ g_object_bind_property_full (
+ shell_settings, "mail-mark-seen-timeout",
+ widget, "value",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE,
+ mark_seen_milliseconds_to_seconds,
+ mark_seen_seconds_to_milliseconds,
+ NULL, (GDestroyNotify) NULL);
+
widget = e_builder_get_widget (prefs->builder, "view-check");
g_object_bind_property (
shell_settings, "mail-global-view-setting",