diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-08-26 22:20:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-08-27 01:14:01 +0800 |
commit | 87a3fac95cfdcb3dde4e0b75718239de20d8812f (patch) | |
tree | e69869f6e7c25fa37a44cab806ad4cec66a64354 /mail/e-mail-view.c | |
parent | 5270b3042f2f5b3e122d7c2ac4f365109458dd19 (diff) | |
download | gsoc2013-evolution-87a3fac95cfdcb3dde4e0b75718239de20d8812f.tar.gz gsoc2013-evolution-87a3fac95cfdcb3dde4e0b75718239de20d8812f.tar.zst gsoc2013-evolution-87a3fac95cfdcb3dde4e0b75718239de20d8812f.zip |
Mail module + EMailView cleanups.
Diffstat (limited to 'mail/e-mail-view.c')
-rw-r--r-- | mail/e-mail-view.c | 70 |
1 files changed, 63 insertions, 7 deletions
diff --git a/mail/e-mail-view.c b/mail/e-mail-view.c index 909f38b33d..62e0b0c733 100644 --- a/mail/e-mail-view.c +++ b/mail/e-mail-view.c @@ -35,26 +35,28 @@ struct _EMailViewPrivate { EShellView *shell_view; GtkOrientation orientation; + EMailView *previous_view; guint preview_visible : 1; guint show_deleted : 1; }; enum { - PANE_CLOSE, - VIEW_CHANGED, - OPEN_MAIL, - LAST_SIGNAL -}; - -enum { PROP_0, PROP_ORIENTATION, PROP_PREVIEW_VISIBLE, + PROP_PREVIOUS_VIEW, PROP_SHELL_VIEW, PROP_SHOW_DELETED }; +enum { + PANE_CLOSE, + VIEW_CHANGED, + OPEN_MAIL, + LAST_SIGNAL +}; + static guint signals[LAST_SIGNAL]; G_DEFINE_TYPE (EMailView, e_mail_view, GTK_TYPE_VBOX) @@ -88,6 +90,12 @@ mail_view_set_property (GObject *object, g_value_get_boolean (value)); return; + case PROP_PREVIOUS_VIEW: + e_mail_view_set_previous_view ( + E_MAIL_VIEW (object), + g_value_get_object (value)); + return; + case PROP_SHELL_VIEW: mail_view_set_shell_view ( E_MAIL_VIEW (object), @@ -123,6 +131,12 @@ mail_view_get_property (GObject *object, E_MAIL_VIEW (object))); return; + case PROP_PREVIOUS_VIEW: + g_value_set_object ( + value, e_mail_view_get_previous_view ( + E_MAIL_VIEW (object))); + return; + case PROP_SHELL_VIEW: g_value_set_object ( value, e_mail_view_get_shell_view ( @@ -151,6 +165,11 @@ mail_view_dispose (GObject *object) priv->shell_view = NULL; } + if (priv->previous_view != NULL) { + g_object_unref (priv->previous_view); + priv->previous_view = NULL; + } + /* Chain up to parent's dispose() method. */ G_OBJECT_CLASS (e_mail_view_parent_class)->dispose (object); } @@ -271,6 +290,16 @@ e_mail_view_class_init (EMailViewClass *class) g_object_class_install_property ( object_class, + PROP_PREVIOUS_VIEW, + g_param_spec_object ( + "previous-view", + "Previous View", + NULL, + E_TYPE_MAIL_VIEW, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, PROP_SHELL_VIEW, g_param_spec_object ( "shell-view", @@ -399,6 +428,33 @@ e_mail_view_set_preview_visible (EMailView *view, class->set_preview_visible (view, visible); } +EMailView * +e_mail_view_get_previous_view (EMailView *view) +{ + g_return_val_if_fail (E_IS_MAIL_VIEW (view), NULL); + + return view->priv->previous_view; +} + +void +e_mail_view_set_previous_view (EMailView *view, + EMailView *previous_view) +{ + g_return_if_fail (E_IS_MAIL_VIEW (view)); + + if (previous_view != NULL) { + g_return_if_fail (E_IS_MAIL_VIEW (previous_view)); + g_object_ref (previous_view); + } + + if (view->priv->previous_view != NULL) + g_object_unref (view->priv->previous_view); + + view->priv->previous_view = previous_view; + + g_object_notify (G_OBJECT (view), "previous-view"); +} + gboolean e_mail_view_get_show_deleted (EMailView *view) { |