diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-06-19 23:39:49 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-06-19 23:39:49 +0800 |
commit | 0439c01a9ab20875796c8ecae855627424742bf4 (patch) | |
tree | ae34c7e94f9da39c354f9532c94360b8b4f6746a /mail/e-mail-reader.c | |
parent | 493cc5200496a857a31636c3b0de4617245ec3cd (diff) | |
download | gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar.gz gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar.zst gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.zip |
Bug 616724 - Initialize message window with threaded state of main window
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r-- | mail/e-mail-reader.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 502ee0d2d7..abfbf3b0ab 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -76,6 +76,8 @@ struct _EMailReaderPrivate { * happen when the -user- selects a message. */ guint folder_was_just_selected : 1; guint restoring_message_selection : 1; + + guint group_by_threads : 1; }; enum { @@ -2487,6 +2489,15 @@ mail_reader_class_init (EMailReaderIface *iface) iface->set_message = mail_reader_set_message; iface->update_actions = mail_reader_update_actions; + g_object_interface_install_property ( + iface, + g_param_spec_boolean ( + "group-by-threads", + "Group by Threads", + "Whether to group messages by threads", + FALSE, + G_PARAM_READWRITE)); + signals[CHANGED] = g_signal_new ( "changed", G_OBJECT_CLASS_TYPE (iface), @@ -3100,6 +3111,42 @@ e_mail_reader_set_message (EMailReader *reader, iface->set_message (reader, uid); } +gboolean +e_mail_reader_get_group_by_threads (EMailReader *reader) +{ + EMailReaderPrivate *priv; + + g_return_val_if_fail (E_IS_MAIL_READER (reader), FALSE); + + priv = E_MAIL_READER_GET_PRIVATE (reader); + + return priv->group_by_threads; +} + +void +e_mail_reader_set_group_by_threads (EMailReader *reader, + gboolean group_by_threads) +{ + EMailReaderPrivate *priv; + GtkWidget *message_list; + + g_return_if_fail (E_IS_MAIL_READER (reader)); + + priv = E_MAIL_READER_GET_PRIVATE (reader); + + if (group_by_threads == priv->group_by_threads) + return; + + priv->group_by_threads = group_by_threads; + + /* XXX MessageList should define a property for this. */ + message_list = e_mail_reader_get_message_list (reader); + message_list_set_threaded ( + MESSAGE_LIST (message_list), group_by_threads); + + g_object_notify (G_OBJECT (reader), "group-by-threads"); +} + void e_mail_reader_create_charset_menu (EMailReader *reader, GtkUIManager *ui_manager, |