aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-shell-sidebar.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/calendar/e-memo-shell-sidebar.c')
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 31304948f9..b7e52a9095 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -101,24 +101,12 @@ memo_shell_sidebar_emit_status_message (EMemoShellSidebar *memo_shell_sidebar,
g_signal_emit (memo_shell_sidebar, signal_id, 0, status_message, -1.0);
}
-static EAlertSink *
-get_alert_sink (EShellView *shell_view)
-{
- EShellWindow *shell_window;
-
- shell_window = e_shell_view_get_shell_window (shell_view);
-
- if (g_strcmp0 (e_shell_window_get_active_view (shell_window), "calendar") == 0)
- shell_view = e_shell_window_peek_shell_view (shell_window, "calendar");
-
- return E_ALERT_SINK (e_shell_view_get_shell_content (shell_view));
-}
-
static void
memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
GHashTable *client_table;
ESource *source;
@@ -128,6 +116,7 @@ memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar,
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
uid = e_source_peek_uid (source);
@@ -137,7 +126,8 @@ memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar,
g_hash_table_remove (client_table, uid);
memo_shell_sidebar_emit_status_message (memo_shell_sidebar, NULL);
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:memos-crashed", NULL);
g_object_unref (source);
@@ -149,18 +139,23 @@ memo_shell_sidebar_backend_error_cb (EMemoShellSidebar *memo_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
ESourceGroup *source_group;
ESource *source;
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
source_group = e_source_peek_group (source);
- e_alert_submit (get_alert_sink (shell_view),
- "calendar:backend-error", e_source_group_peek_name (source_group), e_source_peek_name (source), message, NULL);
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
+ "calendar:backend-error",
+ e_source_group_peek_name (source_group),
+ e_source_peek_name (source), message, NULL);
}
static void
@@ -169,11 +164,13 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
const gchar *message;
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
if (g_error_matches (error, E_CALENDAR_ERROR,
E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
@@ -194,14 +191,16 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
return;
case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-memos",
NULL);
/* fall through */
default:
if (error->code != E_CALENDAR_STATUS_REPOSITORY_OFFLINE) {
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
error->message, NULL);
}
@@ -230,6 +229,7 @@ memo_shell_sidebar_default_loaded_cb (ESource *source,
EShellSidebar *shell_sidebar)
{
EMemoShellSidebarPrivate *priv;
+ EShellContent *shell_content;
EShellView *shell_view;
ECal *client;
GError *error = NULL;
@@ -237,6 +237,7 @@ memo_shell_sidebar_default_loaded_cb (ESource *source,
priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
client = e_load_cal_source_finish (source, result, &error);
@@ -245,7 +246,8 @@ memo_shell_sidebar_default_loaded_cb (ESource *source,
goto exit;
} else if (error != NULL) {
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
error->message, NULL);
g_error_free (error);