aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-11-27 20:11:18 +0800
committerMilan Crha <mcrha@redhat.com>2012-11-27 20:11:18 +0800
commit4c699e7e03975639db4a0aa1eddb935e79702248 (patch)
treed433ae6c64223925fd337d9c6fa3e026124f011a /modules
parenta2f69b1d463f87e6de3c30db9043533ef37564d2 (diff)
downloadgsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.gz
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.bz2
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.lz
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.xz
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.zst
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.zip
Identify calendar/memo/task sources in error messages
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c22
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c22
-rw-r--r--modules/calendar/e-task-shell-sidebar.c22
3 files changed, 60 insertions, 6 deletions
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index d734b21d58..809ccb569f 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -242,10 +242,11 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object,
{
ECalClient *client = E_CAL_CLIENT (source_object);
ECalShellSidebar *cal_shell_sidebar = user_data;
- ESource *source;
+ ESource *source, *parent;
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
+ ESourceRegistry *registry;
GError *error = NULL;
source = e_client_get_source (E_CLIENT (client));
@@ -279,6 +280,8 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object,
shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_content = e_shell_view_get_shell_content (shell_view);
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
/* Handle errors. */
switch ((error && error->domain == E_CLIENT_ERROR) ? error->code : -1) {
@@ -291,13 +294,15 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object,
G_STRFUNC, e_source_get_display_name (source),
error->message);
g_clear_error (&error);
+ g_object_unref (parent);
return;
case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-calendar",
- NULL);
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source), NULL);
/* fall through */
default:
@@ -305,6 +310,8 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object,
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-calendar",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
}
@@ -312,10 +319,12 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object,
cal_shell_sidebar,
e_client_get_source (E_CLIENT (client)));
g_clear_error (&error);
+ g_object_unref (parent);
return;
}
g_clear_error (&error);
+ g_object_unref (parent);
/* to have them ready for later use */
e_client_retrieve_capabilities (
@@ -386,12 +395,21 @@ cal_shell_sidebar_default_loaded_cb (GObject *source_object,
goto exit;
} else if (error != NULL) {
+ ESourceRegistry *registry;
+ ESource *parent;
+
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
+
g_warn_if_fail (client == NULL);
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-calendar",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
g_error_free (error);
+ g_object_unref (parent);
goto exit;
}
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index f59e0a8605..7d46384f82 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -237,10 +237,11 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
{
ECalClient *client = E_CAL_CLIENT (source_object);
EMemoShellSidebar *memo_shell_sidebar = user_data;
- ESource *source;
+ ESource *source, *parent;
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
+ ESourceRegistry *registry;
GError *error = NULL;
source = e_client_get_source (E_CLIENT (client));
@@ -274,6 +275,8 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
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);
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
/* Handle errors. */
switch ((error && error->domain == E_CLIENT_ERROR) ? error->code : -1) {
@@ -286,13 +289,15 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
G_STRFUNC, e_source_get_display_name (source),
error->message);
g_clear_error (&error);
+ g_object_unref (parent);
return;
case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-memos",
- NULL);
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source), NULL);
/* fall through */
default:
@@ -300,6 +305,8 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
}
@@ -307,10 +314,12 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
memo_shell_sidebar,
e_client_get_source (E_CLIENT (client)));
g_clear_error (&error);
+ g_object_unref (parent);
return;
}
g_clear_error (&error);
+ g_object_unref (parent);
/* to have them ready for later use */
e_client_retrieve_capabilities (
@@ -381,12 +390,21 @@ memo_shell_sidebar_default_loaded_cb (GObject *source_object,
goto exit;
} else if (error != NULL) {
+ ESourceRegistry *registry;
+ ESource *parent;
+
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
+
g_warn_if_fail (client == NULL);
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
g_error_free (error);
+ g_object_unref (parent);
goto exit;
}
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index 1653fe287b..d88d5e7028 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -237,10 +237,11 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
{
ECalClient *client = E_CAL_CLIENT (source_object);
ETaskShellSidebar *task_shell_sidebar = user_data;
- ESource *source;
+ ESource *source, *parent;
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
+ ESourceRegistry *registry;
GError *error = NULL;
source = e_client_get_source (E_CLIENT (client));
@@ -274,6 +275,8 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_content = e_shell_view_get_shell_content (shell_view);
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
/* Handle errors. */
switch ((error && error->domain == E_CLIENT_ERROR) ? error->code : -1) {
@@ -286,13 +289,15 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
G_STRFUNC, e_source_get_display_name (source),
error->message);
g_clear_error (&error);
+ g_object_unref (parent);
return;
case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-tasks",
- NULL);
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source), NULL);
/* fall through */
default:
@@ -300,6 +305,8 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-tasks",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
}
@@ -307,10 +314,12 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
task_shell_sidebar,
e_client_get_source (E_CLIENT (client)));
g_clear_error (&error);
+ g_object_unref (parent);
return;
}
g_clear_error (&error);
+ g_object_unref (parent);
/* to have them ready for later use */
e_client_retrieve_capabilities (
@@ -381,12 +390,21 @@ task_shell_sidebar_default_loaded_cb (GObject *source_object,
goto exit;
} else if (error != NULL) {
+ ESourceRegistry *registry;
+ ESource *parent;
+
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
+
g_warn_if_fail (client == NULL);
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-tasks",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
g_error_free (error);
+ g_object_unref (parent);
goto exit;
}