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 /modules | |
parent | 493cc5200496a857a31636c3b0de4617245ec3cd (diff) | |
download | gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar.gz gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar.bz2 gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar.lz gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar.xz gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.tar.zst gsoc2013-evolution-0439c01a9ab20875796c8ecae855627424742bf4.zip |
Bug 616724 - Initialize message window with threaded state of main window
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 75 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-content.h | 5 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.c | 2 |
3 files changed, 26 insertions, 56 deletions
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 340e323da1..75787ced9a 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -69,7 +69,6 @@ struct _EMailShellContentPrivate { /* Signal handler IDs */ guint message_list_built_id; - guint group_by_threads : 1; guint preview_visible : 1; guint show_deleted : 1; }; @@ -239,6 +238,18 @@ mail_shell_content_restore_state_cb (EShellWindow *shell_window, gconf_bridge_bind_property (bridge, key, object, "vposition"); } +static void +mail_shell_content_notify_group_by_threads_cb (EMailReader *reader) +{ + gboolean group_by_threads; + + group_by_threads = e_mail_reader_get_group_by_threads (reader); + + mail_shell_content_save_boolean ( + E_MAIL_SHELL_CONTENT (reader), + STATE_KEY_GROUP_BY_THREADS, group_by_threads); +} + static GtkOrientation mail_shell_content_get_orientation (EMailShellContent *mail_shell_content) { @@ -264,8 +275,8 @@ mail_shell_content_set_property (GObject *object, { switch (property_id) { case PROP_GROUP_BY_THREADS: - e_mail_shell_content_set_group_by_threads ( - E_MAIL_SHELL_CONTENT (object), + e_mail_reader_set_group_by_threads ( + E_MAIL_READER (object), g_value_get_boolean (value)); return; @@ -301,8 +312,8 @@ mail_shell_content_get_property (GObject *object, case PROP_GROUP_BY_THREADS: g_value_set_boolean ( value, - e_mail_shell_content_get_group_by_threads ( - E_MAIL_SHELL_CONTENT (object))); + e_mail_reader_get_group_by_threads ( + E_MAIL_READER (object))); return; case PROP_ORIENTATION: @@ -628,8 +639,7 @@ mail_shell_content_set_folder (EMailReader *reader, g_clear_error (&error); } - e_mail_shell_content_set_group_by_threads ( - E_MAIL_SHELL_CONTENT (shell_content), value); + e_mail_reader_set_group_by_threads (reader, value); key = STATE_KEY_PREVIEW_VISIBLE; value = g_key_file_get_boolean (key_file, group_name, key, &error); @@ -686,15 +696,11 @@ mail_shell_content_class_init (EMailShellContentClass *class) shell_content_class = E_SHELL_CONTENT_CLASS (class); shell_content_class->check_state = mail_shell_content_check_state; - g_object_class_install_property ( + /* Inherited from EMailReader */ + g_object_class_override_property ( object_class, PROP_GROUP_BY_THREADS, - g_param_spec_boolean ( - "group-by-threads", - "Group by Threads", - "Whether to group messages by threads", - FALSE, - G_PARAM_READWRITE)); + "group-by-threads"); g_object_class_install_property ( object_class, @@ -742,6 +748,11 @@ mail_shell_content_init (EMailShellContent *mail_shell_content) mail_shell_content->priv->preview_visible = TRUE; + g_signal_connect ( + mail_shell_content, "notify::group-by-threads", + G_CALLBACK (mail_shell_content_notify_group_by_threads_cb), + NULL); + /* Postpone widget construction until we have a shell view. */ } @@ -803,42 +814,6 @@ e_mail_shell_content_new (EShellView *shell_view) } gboolean -e_mail_shell_content_get_group_by_threads (EMailShellContent *mail_shell_content) -{ - g_return_val_if_fail ( - E_IS_MAIL_SHELL_CONTENT (mail_shell_content), FALSE); - - return mail_shell_content->priv->group_by_threads; -} - -void -e_mail_shell_content_set_group_by_threads (EMailShellContent *mail_shell_content, - gboolean group_by_threads) -{ - EMailReader *reader; - GtkWidget *message_list; - - g_return_if_fail (E_IS_MAIL_SHELL_CONTENT (mail_shell_content)); - - if (group_by_threads == mail_shell_content->priv->group_by_threads) - return; - - mail_shell_content->priv->group_by_threads = group_by_threads; - - mail_shell_content_save_boolean ( - mail_shell_content, - STATE_KEY_GROUP_BY_THREADS, group_by_threads); - - /* XXX MessageList should define a property for this. */ - reader = E_MAIL_READER (mail_shell_content); - 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 (mail_shell_content), "group-by-threads"); -} - -gboolean e_mail_shell_content_get_preview_visible (EMailShellContent *mail_shell_content) { g_return_val_if_fail ( diff --git a/modules/mail/e-mail-shell-content.h b/modules/mail/e-mail-shell-content.h index 4be7be206f..a5263bc561 100644 --- a/modules/mail/e-mail-shell-content.h +++ b/modules/mail/e-mail-shell-content.h @@ -66,11 +66,6 @@ GType e_mail_shell_content_get_type (void); void e_mail_shell_content_register_type (GTypeModule *type_module); GtkWidget * e_mail_shell_content_new(EShellView *shell_view); -gboolean e_mail_shell_content_get_group_by_threads - (EMailShellContent *mail_shell_content); -void e_mail_shell_content_set_group_by_threads - (EMailShellContent *mail_shell_content, - gboolean group_by_threads); gboolean e_mail_shell_content_get_preview_visible (EMailShellContent *mail_shell_content); void e_mail_shell_content_set_preview_visible diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 4cef43263d..4aac0075f8 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -575,9 +575,9 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) G_CALLBACK (mail_shell_view_prepare_for_quit_cb), mail_shell_view); + e_mail_reader_init (reader); e_mail_shell_view_actions_init (mail_shell_view); e_mail_shell_view_update_search_filter (mail_shell_view); - e_mail_reader_init (reader); /* Populate built-in rules for search entry popup menu. * Keep the assertions, please. If the conditions aren't |