From ff9fcffeca2bdc37a91e0c2f0cb51f871a3cd7a1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 24 May 2011 11:02:59 -0400 Subject: EMFolderTree: Add an EAlertSink property. Now EMFolderTree has access to both an EShellBackend and an EAlertSink; everything it needs to build and submit EActivity instances. --- shell/e-shell-sidebar.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index d99e66ac61..b72a210300 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -27,6 +27,7 @@ #include "e-shell-sidebar.h" +#include #include #include #include @@ -50,10 +51,16 @@ enum { PROP_SHELL_VIEW }; +/* Forward Declarations */ +static void e_shell_sidebar_alert_sink_init + (EAlertSinkInterface *interface); + G_DEFINE_TYPE_WITH_CODE ( EShellSidebar, e_shell_sidebar, GTK_TYPE_BIN, + G_IMPLEMENT_INTERFACE ( + E_TYPE_ALERT_SINK, e_shell_sidebar_alert_sink_init) G_IMPLEMENT_INTERFACE ( E_TYPE_EXTENSIBLE, NULL)) @@ -299,6 +306,25 @@ shell_sidebar_forall (GtkContainer *container, container, include_internals, callback, callback_data); } +static void +shell_sidebar_submit_alert (EAlertSink *alert_sink, + EAlert *alert) +{ + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + + /* EShellSidebar is a proxy alert sink. Forward the alert + * to the EShellContent widget for display to the user. */ + + shell_sidebar = E_SHELL_SIDEBAR (alert_sink); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + alert_sink = E_ALERT_SINK (shell_content); + e_alert_sink_submit_alert (alert_sink, alert); +} + static void e_shell_sidebar_class_init (EShellSidebarClass *class) { @@ -386,6 +412,12 @@ e_shell_sidebar_class_init (EShellSidebarClass *class) G_PARAM_CONSTRUCT_ONLY)); } +static void +e_shell_sidebar_alert_sink_init (EAlertSinkInterface *interface) +{ + interface->submit_alert = shell_sidebar_submit_alert; +} + static void e_shell_sidebar_init (EShellSidebar *shell_sidebar) { -- cgit v1.2.3