diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-11-22 01:42:34 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-11-22 13:12:36 +0800 |
commit | 5fabd29bd2580bbe479034634b405abfa36bb500 (patch) | |
tree | 1ed5bb5fed2f74e3fd2d831ac84b929d55ab5ca9 /modules | |
parent | f9ffebc2f7a6fb285e686133dcccf17766c2ba79 (diff) | |
download | gsoc2013-evolution-5fabd29bd2580bbe479034634b405abfa36bb500.tar gsoc2013-evolution-5fabd29bd2580bbe479034634b405abfa36bb500.tar.gz gsoc2013-evolution-5fabd29bd2580bbe479034634b405abfa36bb500.tar.bz2 gsoc2013-evolution-5fabd29bd2580bbe479034634b405abfa36bb500.tar.lz gsoc2013-evolution-5fabd29bd2580bbe479034634b405abfa36bb500.tar.xz gsoc2013-evolution-5fabd29bd2580bbe479034634b405abfa36bb500.tar.zst gsoc2013-evolution-5fabd29bd2580bbe479034634b405abfa36bb500.zip |
Add EMailReader.get_preview_pane() method.
Also give EMailReader::show-search-bar signal a default implementation,
since it can now dig up the search bar widget itself.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 105 |
1 files changed, 54 insertions, 51 deletions
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 7918930736..ed94b45af3 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -46,6 +46,10 @@ #include "e-mail-shell-backend.h" #include "e-mail-shell-view-actions.h" +#define E_MAIL_SHELL_CONTENT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_MAIL_SHELL_CONTENT, EMailShellContentPrivate)) + struct _EMailShellContentPrivate { EMailView *mail_view; }; @@ -153,7 +157,7 @@ mail_shell_content_dispose (GObject *object) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT (object)->priv; + priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (object); if (priv->mail_view != NULL) { g_object_unref (priv->mail_view); @@ -173,7 +177,7 @@ mail_shell_content_constructed (GObject *object) GtkWidget *container; GtkWidget *widget; - priv = E_MAIL_SHELL_CONTENT (object)->priv; + priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (object); /* Chain up to parent's constructed () method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -209,14 +213,14 @@ mail_shell_content_constructed (GObject *object) static guint32 mail_shell_content_check_state (EShellContent *shell_content) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; EMailReader *reader; - priv = E_MAIL_SHELL_CONTENT (shell_content)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (shell_content); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_check_state (reader); } @@ -224,13 +228,13 @@ mail_shell_content_check_state (EShellContent *shell_content) static void mail_shell_content_focus_search_results (EShellContent *shell_content) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; GtkWidget *message_list; EMailReader *reader; - priv = E_MAIL_SHELL_CONTENT (shell_content)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (shell_content); - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); message_list = e_mail_reader_get_message_list (reader); gtk_widget_grab_focus (message_list); @@ -239,13 +243,13 @@ mail_shell_content_focus_search_results (EShellContent *shell_content) static guint mail_shell_content_open_selected_mail (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_open_selected_mail (reader); } @@ -280,13 +284,13 @@ mail_shell_content_get_action_group (EMailReader *reader, static EAlertSink * mail_shell_content_get_alert_sink (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_get_alert_sink (reader); } @@ -294,13 +298,13 @@ mail_shell_content_get_alert_sink (EMailReader *reader) static EMailBackend * mail_shell_content_get_backend (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_get_backend (reader); } @@ -308,13 +312,13 @@ mail_shell_content_get_backend (EMailReader *reader) static EMFormatHTML * mail_shell_content_get_formatter (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_get_formatter (reader); } @@ -322,13 +326,13 @@ mail_shell_content_get_formatter (EMailReader *reader) static gboolean mail_shell_content_get_hide_deleted (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_get_hide_deleted (reader); } @@ -336,13 +340,13 @@ mail_shell_content_get_hide_deleted (EMailReader *reader) static GtkWidget * mail_shell_content_get_message_list (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_get_message_list (reader); } @@ -350,58 +354,58 @@ mail_shell_content_get_message_list (EMailReader *reader) static GtkMenu * mail_shell_content_get_popup_menu (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); return e_mail_reader_get_popup_menu (reader); } -static GtkWindow * -mail_shell_content_get_window (EMailReader *reader) +static EPreviewPane * +mail_shell_content_get_preview_pane (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); - return e_mail_reader_get_window (reader); + return e_mail_reader_get_preview_pane (reader); } -static void -mail_shell_content_set_folder (EMailReader *reader, - CamelFolder *folder) +static GtkWindow * +mail_shell_content_get_window (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); - return e_mail_reader_set_folder (reader, folder); + return e_mail_reader_get_window (reader); } static void -mail_shell_content_show_search_bar (EMailReader *reader) +mail_shell_content_set_folder (EMailReader *reader, + CamelFolder *folder) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT (reader)->priv; + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ - reader = E_MAIL_READER (priv->mail_view); + reader = E_MAIL_READER (mail_shell_content->priv->mail_view); - e_mail_reader_show_search_bar (reader); + return e_mail_reader_set_folder (reader, folder); } static void @@ -456,9 +460,8 @@ mail_shell_content_class_init (EMailShellContentClass *class) static void mail_shell_content_init (EMailShellContent *mail_shell_content) { - mail_shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - mail_shell_content, E_TYPE_MAIL_SHELL_CONTENT, - EMailShellContentPrivate); + mail_shell_content->priv = + E_MAIL_SHELL_CONTENT_GET_PRIVATE (mail_shell_content); /* Postpone widget construction until we have a shell view. */ } @@ -479,9 +482,9 @@ mail_shell_content_reader_init (EMailReaderInterface *interface) interface->get_hide_deleted = mail_shell_content_get_hide_deleted; interface->get_message_list = mail_shell_content_get_message_list; interface->get_popup_menu = mail_shell_content_get_popup_menu; + interface->get_preview_pane = mail_shell_content_get_preview_pane; interface->get_window = mail_shell_content_get_window; interface->set_folder = mail_shell_content_set_folder; - interface->show_search_bar = mail_shell_content_show_search_bar; interface->open_selected_mail = mail_shell_content_open_selected_mail; } |