[evolution/wip/webkit2] Bug 747031 - Add hidden option to mark-as-seen always
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] Bug 747031 - Add hidden option to mark-as-seen always
- Date: Wed, 24 Feb 2016 10:31:09 +0000 (UTC)
commit 3e6e805fc78731f6ff7932f5a7da0f72a1b21358
Author: Milan Crha <mcrha redhat com>
Date: Thu Apr 2 19:21:58 2015 +0200
Bug 747031 - Add hidden option to mark-as-seen always
In a meaning: also after selected folder change.
data/org.gnome.evolution.mail.gschema.xml.in | 5 +++
mail/e-mail-browser.c | 20 ++++++++++++
mail/e-mail-paned-view.c | 22 +++++++++++++-
mail/e-mail-reader.c | 42 +++++++++++++++++++++++++-
mail/e-mail-reader.h | 5 +++
modules/mail/e-mail-shell-content.c | 21 ++++++++++++-
modules/settings/e-settings-mail-reader.c | 5 +++
7 files changed, 117 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in
index 9cc4c3a..2e9ad0a 100644
--- a/data/org.gnome.evolution.mail.gschema.xml.in
+++ b/data/org.gnome.evolution.mail.gschema.xml.in
@@ -264,6 +264,11 @@
<_summary>Mark as Seen after specified timeout</_summary>
<_description>Mark as Seen after specified timeout.</_description>
</key>
+ <key name="mark-seen-always" type="b">
+ <default>false</default>
+ <_summary>Mark as Seen always after specified timeout</_summary>
+ <_description>If set to true, the selected message will be set as unread after the timeout also after
the folder change.</_description>
+ </key>
<key name="mark-seen-timeout" type="i">
<default>1500</default>
<_summary>Timeout for marking messages as seen</_summary>
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index e5d4095..4c294a0 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -73,6 +73,7 @@ enum {
PROP_FORWARD_STYLE,
PROP_GROUP_BY_THREADS,
PROP_REPLY_STYLE,
+ PROP_MARK_SEEN_ALWAYS,
PROP_SHOW_DELETED,
PROP_UI_MANAGER
};
@@ -453,6 +454,12 @@ mail_browser_set_property (GObject *object,
E_MAIL_BROWSER (object),
g_value_get_boolean (value));
return;
+
+ case PROP_MARK_SEEN_ALWAYS:
+ e_mail_reader_set_mark_seen_always (
+ E_MAIL_READER (object),
+ g_value_get_boolean (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -527,6 +534,13 @@ mail_browser_get_property (GObject *object,
e_mail_browser_get_ui_manager (
E_MAIL_BROWSER (object)));
return;
+
+ case PROP_MARK_SEEN_ALWAYS:
+ g_value_set_boolean (
+ value,
+ e_mail_reader_get_mark_seen_always (
+ E_MAIL_READER (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -988,6 +1002,12 @@ e_mail_browser_class_init (EMailBrowserClass *class)
PROP_REPLY_STYLE,
"reply-style");
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_MARK_SEEN_ALWAYS,
+ "mark-seen-always");
+
g_object_class_install_property (
object_class,
PROP_SHOW_DELETED,
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 20c3187..3d92ab8 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -62,7 +62,8 @@ enum {
PROP_0,
PROP_FORWARD_STYLE,
PROP_GROUP_BY_THREADS,
- PROP_REPLY_STYLE
+ PROP_REPLY_STYLE,
+ PROP_MARK_SEEN_ALWAYS
};
#define STATE_KEY_GROUP_BY_THREADS "GroupByThreads"
@@ -298,6 +299,12 @@ mail_paned_view_set_property (GObject *object,
E_MAIL_READER (object),
g_value_get_enum (value));
return;
+
+ case PROP_MARK_SEEN_ALWAYS:
+ e_mail_reader_set_mark_seen_always (
+ E_MAIL_READER (object),
+ g_value_get_boolean (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -330,6 +337,13 @@ mail_paned_view_get_property (GObject *object,
e_mail_reader_get_reply_style (
E_MAIL_READER (object)));
return;
+
+ case PROP_MARK_SEEN_ALWAYS:
+ g_value_set_boolean (
+ value,
+ e_mail_reader_get_mark_seen_always (
+ E_MAIL_READER (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -1042,6 +1056,12 @@ e_mail_paned_view_class_init (EMailPanedViewClass *class)
object_class,
PROP_REPLY_STYLE,
"reply-style");
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_MARK_SEEN_ALWAYS,
+ "mark-seen-always");
}
static void
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 06fb7db..624d72b 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -89,6 +89,7 @@ struct _EMailReaderPrivate {
guint did_try_to_open_message : 1;
guint group_by_threads : 1;
+ guint mark_seen_always : 1;
/* to be able to start the mark_seen timeout only after
* the message is loaded into the EMailDisplay */
@@ -3228,7 +3229,7 @@ mail_reader_set_folder (EMailReader *reader,
if (folder != previous_folder) {
e_web_view_clear (E_WEB_VIEW (display));
- priv->folder_was_just_selected = (folder != NULL);
+ priv->folder_was_just_selected = (folder != NULL) && !priv->mark_seen_always;
priv->did_try_to_open_message = FALSE;
/* This is to make sure any post-poned changes in Search
@@ -3911,6 +3912,15 @@ e_mail_reader_default_init (EMailReaderInterface *iface)
E_MAIL_REPLY_STYLE_QUOTED,
G_PARAM_READWRITE));
+ g_object_interface_install_property (
+ iface,
+ g_param_spec_boolean (
+ "mark-seen-always",
+ "Mark Seen Always",
+ "Whether to mark unread message seen even after folder change",
+ FALSE,
+ G_PARAM_READWRITE));
+
signals[CHANGED] = g_signal_new (
"changed",
G_OBJECT_CLASS_TYPE (iface),
@@ -4811,6 +4821,36 @@ e_mail_reader_set_reply_style (EMailReader *reader,
g_object_notify (G_OBJECT (reader), "reply-style");
}
+gboolean
+e_mail_reader_get_mark_seen_always (EMailReader *reader)
+{
+ EMailReaderPrivate *priv;
+
+ g_return_val_if_fail (E_IS_MAIL_READER (reader), FALSE);
+
+ priv = E_MAIL_READER_GET_PRIVATE (reader);
+
+ return priv->mark_seen_always;
+}
+
+void
+e_mail_reader_set_mark_seen_always (EMailReader *reader,
+ gboolean mark_seen_always)
+{
+ EMailReaderPrivate *priv;
+
+ g_return_if_fail (E_IS_MAIL_READER (reader));
+
+ priv = E_MAIL_READER_GET_PRIVATE (reader);
+
+ if (priv->mark_seen_always == mark_seen_always)
+ return;
+
+ priv->mark_seen_always = mark_seen_always;
+
+ g_object_notify (G_OBJECT (reader), "mark-seen-always");
+}
+
void
e_mail_reader_create_charset_menu (EMailReader *reader,
GtkUIManager *ui_manager,
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index 9eef824..7dde175 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -174,6 +174,11 @@ void e_mail_reader_set_group_by_threads
EMailReplyStyle e_mail_reader_get_reply_style (EMailReader *reader);
void e_mail_reader_set_reply_style (EMailReader *reader,
EMailReplyStyle style);
+gboolean e_mail_reader_get_mark_seen_always
+ (EMailReader *reader);
+void e_mail_reader_set_mark_seen_always
+ (EMailReader *reader,
+ gboolean mark_seen_always);
void e_mail_reader_create_charset_menu
(EMailReader *reader,
GtkUIManager *ui_manager,
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 24c4ec6..4673dd6 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -50,7 +50,8 @@ enum {
PROP_FORWARD_STYLE,
PROP_GROUP_BY_THREADS,
PROP_MAIL_VIEW,
- PROP_REPLY_STYLE
+ PROP_REPLY_STYLE,
+ PROP_MARK_SEEN_ALWAYS
};
/* Forward Declarations */
@@ -104,6 +105,12 @@ mail_shell_content_set_property (GObject *object,
E_MAIL_READER (object),
g_value_get_enum (value));
return;
+
+ case PROP_MARK_SEEN_ALWAYS:
+ e_mail_reader_set_mark_seen_always (
+ E_MAIL_READER (object),
+ g_value_get_boolean (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -139,6 +146,12 @@ mail_shell_content_get_property (GObject *object,
value, e_mail_reader_get_reply_style (
E_MAIL_READER (object)));
return;
+
+ case PROP_MARK_SEEN_ALWAYS:
+ g_value_set_boolean (
+ value, e_mail_reader_get_mark_seen_always (
+ E_MAIL_READER (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -427,6 +440,12 @@ e_mail_shell_content_class_init (EMailShellContentClass *class)
object_class,
PROP_REPLY_STYLE,
"reply-style");
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_MARK_SEEN_ALWAYS,
+ "mark-seen-always");
}
static void
diff --git a/modules/settings/e-settings-mail-reader.c b/modules/settings/e-settings-mail-reader.c
index bb31347..7d473ef 100644
--- a/modules/settings/e-settings-mail-reader.c
+++ b/modules/settings/e-settings-mail-reader.c
@@ -61,6 +61,11 @@ settings_mail_reader_idle_cb (EExtension *extension)
extensible, "reply-style",
G_SETTINGS_BIND_GET);
+ g_settings_bind (
+ settings, "mark-seen-always",
+ extensible, "mark-seen-always",
+ G_SETTINGS_BIND_GET);
+
g_object_unref (settings);
action_group = e_mail_reader_get_action_group (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]