diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-02-23 22:24:24 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-02-23 22:35:21 +0800 |
commit | 14b4e5fab8c7656a2b837fde02d6228c279953a2 (patch) | |
tree | 09206b2a0f03efbb9cf8ae54256c46c0cf2b4345 | |
parent | 820f8dfae64bc73e8bc48b52b3dad225defcc4fa (diff) | |
download | gsoc2013-evolution-14b4e5fab8c7656a2b837fde02d6228c279953a2.tar.gz gsoc2013-evolution-14b4e5fab8c7656a2b837fde02d6228c279953a2.tar.zst gsoc2013-evolution-14b4e5fab8c7656a2b837fde02d6228c279953a2.zip |
ETaskShellSidebar: Use e_source_registry_dup_unique_display_name().
Use a standard format for naming an ESource in user-visible messages.
-rw-r--r-- | calendar/calendar.error.xml | 12 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-sidebar.c | 36 |
2 files changed, 17 insertions, 31 deletions
diff --git a/calendar/calendar.error.xml b/calendar/calendar.error.xml index 166ae5fc66..3ca75905b5 100644 --- a/calendar/calendar.error.xml +++ b/calendar/calendar.error.xml @@ -259,9 +259,8 @@ </error> <error id="prompt-no-contents-offline-tasks" type="error" default="GTK_RESPONSE_YES"> - <!-- Translators: {0} is replaced with a group name, like CalDAV, Google, or such; - {1} is replaced with a calendar/task/memo list name, where the error happened --> - <_primary>Error loading task list '{0}: {1}'</_primary> + <!-- Translators: {0} is the name of the task list. --> + <_primary>Error loading task list '{0}'</_primary> <_secondary>The task list is not marked for offline usage.</_secondary> </error> @@ -278,10 +277,9 @@ </error> <error id="failed-open-tasks" type="error" default="GTK_RESPONSE_YES"> - <!-- Translators: {0} is replaced with a group name, like CalDAV, Google, or such; - {1} is replaced with a calendar/task/memo list name, where the error happened --> - <_primary>Error loading task list '{0}: {1}'</_primary> - <secondary>{2}</secondary> + <!-- Translators: {0} is the name of the task list. --> + <_primary>Error loading task list '{0}'</_primary> + <secondary>{1}</secondary> </error> <error id="failed-open-memos" type="error" default="GTK_RESPONSE_YES"> diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index 5f37302c71..43f12267e7 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -65,8 +65,7 @@ struct _ConnectClosure { ETaskShellSidebar *task_shell_sidebar; /* For error messages. */ - gchar *source_display_name; - gchar *parent_display_name; + gchar *unique_display_name; }; enum { @@ -96,20 +95,15 @@ connect_closure_new (ETaskShellSidebar *task_shell_sidebar, ConnectClosure *closure; ESourceRegistry *registry; ESourceSelector *selector; - ESource *parent; - const gchar *parent_uid; selector = e_task_shell_sidebar_get_selector (task_shell_sidebar); registry = e_source_selector_get_registry (selector); - parent_uid = e_source_get_parent (source); - parent = e_source_registry_ref_source (registry, parent_uid); closure = g_slice_new0 (ConnectClosure); closure->task_shell_sidebar = g_object_ref (task_shell_sidebar); - closure->source_display_name = e_source_dup_display_name (source); - closure->parent_display_name = e_source_dup_display_name (parent); - - g_object_unref (parent); + closure->unique_display_name = + e_source_registry_dup_unique_display_name ( + registry, source, E_SOURCE_EXTENSION_TASK_LIST); return closure; } @@ -119,8 +113,7 @@ connect_closure_free (ConnectClosure *closure) { g_object_unref (closure->task_shell_sidebar); - g_free (closure->source_display_name); - g_free (closure->parent_display_name); + g_free (closure->unique_display_name); g_slice_free (ConnectClosure, closure); } @@ -154,8 +147,7 @@ task_shell_sidebar_emit_status_message (ETaskShellSidebar *task_shell_sidebar, static void task_shell_sidebar_handle_connect_error (ETaskShellSidebar *task_shell_sidebar, - const gchar *parent_display_name, - const gchar *source_display_name, + const gchar *unique_display_name, const GError *error) { EShellView *shell_view; @@ -181,16 +173,14 @@ task_shell_sidebar_handle_connect_error (ETaskShellSidebar *task_shell_sidebar, } else if (offline_error) { e_alert_submit ( E_ALERT_SINK (shell_content), - "calendar:prompt-no-contents-offline-calendar", - parent_display_name, - source_display_name, + "calendar:prompt-no-contents-offline-tasks", + unique_display_name, NULL); } else { e_alert_submit ( E_ALERT_SINK (shell_content), - "calendar:failed-open-calendar", - parent_display_name, - source_display_name, + "calendar:failed-open-tasks", + unique_display_name, error->message, NULL); } @@ -216,8 +206,7 @@ task_shell_sidebar_client_connect_cb (GObject *source_object, if (error != NULL) { task_shell_sidebar_handle_connect_error ( closure->task_shell_sidebar, - closure->parent_display_name, - closure->source_display_name, + closure->unique_display_name, error); g_error_free (error); goto exit; @@ -260,8 +249,7 @@ task_shell_sidebar_default_connect_cb (GObject *source_object, if (error != NULL) { task_shell_sidebar_handle_connect_error ( closure->task_shell_sidebar, - closure->parent_display_name, - closure->source_display_name, + closure->unique_display_name, error); g_error_free (error); goto exit; |