From 0ae8e9e7b7c224915f474a4e635a8ccecd476c40 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 8 Aug 2012 10:04:20 -0400 Subject: 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. --- modules/mail/em-mailer-prefs.c | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'modules/mail') 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", -- cgit v1.2.3