aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-15 03:05:43 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-15 11:21:40 +0800
commitb688b36e2d6883f475f653a4f56a160f7b9b2578 (patch)
tree2ebce143bb1e3d3df3778d383720874b42ac7daa
parent9c4500a9b5b030e6fb2b8c02e518254d94c10add (diff)
downloadgsoc2013-evolution-b688b36e2d6883f475f653a4f56a160f7b9b2578.tar.gz
gsoc2013-evolution-b688b36e2d6883f475f653a4f56a160f7b9b2578.tar.zst
gsoc2013-evolution-b688b36e2d6883f475f653a4f56a160f7b9b2578.zip
MessageList: Add a "show-deleted" property.
Bind this to the "show-deleted" GSettings key. New functions: message_list_get_show_deleted() message_list_set_show_deleted()
-rw-r--r--mail/message-list.c53
-rw-r--r--mail/message-list.h3
-rw-r--r--modules/settings/e-settings-message-list.c5
3 files changed, 61 insertions, 0 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index f7c58d22d4..77b82efcb8 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -102,6 +102,7 @@ struct _MessageListPrivate {
struct _MLSelection clipboard;
gboolean destroyed;
+ gboolean show_deleted;
gboolean thread_latest;
gboolean thread_subject;
gboolean any_row_changed; /* save state before regen list when this is set to true */
@@ -156,6 +157,7 @@ enum {
PROP_FOLDER,
PROP_PASTE_TARGET_LIST,
PROP_SESSION,
+ PROP_SHOW_DELETED,
PROP_THREAD_LATEST,
PROP_THREAD_SUBJECT
};
@@ -2691,6 +2693,12 @@ message_list_set_property (GObject *object,
g_value_get_object (value));
return;
+ case PROP_SHOW_DELETED:
+ message_list_set_show_deleted (
+ MESSAGE_LIST (object),
+ g_value_get_boolean (value));
+ return;
+
case PROP_THREAD_LATEST:
message_list_set_thread_latest (
MESSAGE_LIST (object),
@@ -2742,6 +2750,13 @@ message_list_get_property (GObject *object,
MESSAGE_LIST (object)));
return;
+ case PROP_SHOW_DELETED:
+ g_value_set_boolean (
+ value,
+ message_list_get_show_deleted (
+ MESSAGE_LIST (object)));
+ return;
+
case PROP_THREAD_LATEST:
g_value_set_boolean (
value,
@@ -2944,6 +2959,18 @@ message_list_class_init (MessageListClass *class)
g_object_class_install_property (
object_class,
+ PROP_SHOW_DELETED,
+ g_param_spec_boolean (
+ "show-deleted",
+ "Show Deleted",
+ "Show messages marked for deletion",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (
+ object_class,
PROP_THREAD_LATEST,
g_param_spec_boolean (
"thread-latest",
@@ -4018,6 +4045,32 @@ message_list_get_paste_target_list (MessageList *message_list)
}
gboolean
+message_list_get_show_deleted (MessageList *message_list)
+{
+ g_return_val_if_fail (IS_MESSAGE_LIST (message_list), FALSE);
+
+ return message_list->priv->show_deleted;
+}
+
+void
+message_list_set_show_deleted (MessageList *message_list,
+ gboolean show_deleted)
+{
+ g_return_if_fail (IS_MESSAGE_LIST (message_list));
+
+ if (show_deleted == message_list->priv->show_deleted)
+ return;
+
+ message_list->priv->show_deleted = show_deleted;
+
+ g_object_notify (G_OBJECT (message_list), "show-deleted");
+
+ /* Changing this property triggers a message list regen. */
+ if (message_list->frozen == 0)
+ mail_regen_list (message_list, message_list->search, FALSE);
+}
+
+gboolean
message_list_get_thread_latest (MessageList *message_list)
{
g_return_val_if_fail (IS_MESSAGE_LIST (message_list), FALSE);
diff --git a/mail/message-list.h b/mail/message-list.h
index ec76cc600c..1b05639406 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -171,6 +171,9 @@ GtkTargetList * message_list_get_copy_target_list
(MessageList *message_list);
GtkTargetList * message_list_get_paste_target_list
(MessageList *message_list);
+gboolean message_list_get_show_deleted (MessageList *message_list);
+void message_list_set_show_deleted (MessageList *message_list,
+ gboolean show_deleted);
gboolean message_list_get_thread_latest (MessageList *message_list);
void message_list_set_thread_latest (MessageList *message_list,
gboolean thread_latest);
diff --git a/modules/settings/e-settings-message-list.c b/modules/settings/e-settings-message-list.c
index 35c1274a9f..513069d1cb 100644
--- a/modules/settings/e-settings-message-list.c
+++ b/modules/settings/e-settings-message-list.c
@@ -48,6 +48,11 @@ settings_message_list_constructed (GObject *object)
settings = g_settings_new ("org.gnome.evolution.mail");
g_settings_bind (
+ settings, "show-deleted",
+ message_list, "show-deleted",
+ G_SETTINGS_BIND_GET);
+
+ g_settings_bind (
settings, "thread-latest",
message_list, "thread-latest",
G_SETTINGS_BIND_GET);