[evolution-data-server] Bug 768672 - Show account name and full folder path in UI messages



commit 516f33f50a4941a688a1aee0c25d75085cb4db12
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 17 12:49:38 2016 +0200

    Bug 768672 - Show account name and full folder path in UI messages

 camel/camel-folder-summary.c               |   11 +++-
 camel/camel-folder.c                       |   82 +++++++++++++++-------------
 camel/camel-offline-folder.c               |   18 ++++---
 camel/camel-vee-folder.c                   |    5 +-
 camel/providers/imapx/camel-imapx-folder.c |    8 ++-
 camel/providers/imapx/camel-imapx-server.c |   10 ++--
 6 files changed, 75 insertions(+), 59 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index d4f0d6e..1f8577a 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -2165,7 +2165,9 @@ cfs_try_release_memory (CamelFolderSummary *summary)
                return FALSE;
        }
 
-       description = g_strdup_printf (_("Release unused memory for folder '%s'"), camel_folder_get_full_name 
(summary->priv->folder));
+       description = g_strdup_printf (_("Release unused memory for folder '%s : %s'"),
+               camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
+               camel_folder_get_full_name (summary->priv->folder));
 
        camel_session_submit_job (
                session, description,
@@ -2379,7 +2381,9 @@ cfs_reload_from_db (CamelFolderSummary *summary,
                if (session) {
                        gchar *description;
 
-                       description = g_strdup_printf (_("Update preview data for folder '%s'"), 
camel_folder_get_full_name (summary->priv->folder));
+                       description = g_strdup_printf (_("Update preview data for folder '%s : %s'"),
+                               camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
+                               camel_folder_get_full_name (summary->priv->folder));
 
                        camel_session_submit_job (
                                session, description,
@@ -2847,7 +2851,8 @@ camel_folder_summary_save_to_db (CamelFolderSummary *summary,
                const gchar *full_name;
 
                full_name = camel_folder_get_full_name (summary->priv->folder);
-               g_warning ("Fixing up a broken summary migration on %s\n", full_name);
+               g_warning ("Fixing up a broken summary migration on '%s : %s'\n",
+                       camel_service_get_display_name (CAMEL_SERVICE (parent_store)), full_name);
 
                /* Begin everything again. */
                camel_db_begin_transaction (cdb, NULL);
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 956ee25..8c33f95 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -283,9 +283,9 @@ folder_filter (CamelSession *session,
        gint i, status = 0;
        CamelJunkFilter *junk_filter;
        gboolean synchronize = FALSE;
-       const gchar *display_name;
+       const gchar *full_name;
 
-       display_name = camel_folder_get_display_name (data->folder);
+       full_name = camel_folder_get_full_name (data->folder);
        parent_store = camel_folder_get_parent_store (data->folder);
        junk_filter = camel_session_get_junk_filter (session);
 
@@ -319,13 +319,15 @@ folder_filter (CamelSession *session,
        if (data->junk) {
                gboolean success = TRUE;
 
-               /* Translators: The %s is replaced with the
-                * folder name where the operation is running. */
+               /* Translators: The first %s is replaced with account name and
+                * the second %s with the folder name where the operation is running. */
                camel_operation_push_message (
                        cancellable, dngettext (GETTEXT_PACKAGE,
-                       "Learning new spam message in '%s'",
-                       "Learning new spam messages in '%s'",
-                       data->junk->len), display_name);
+                       "Learning new spam message in '%s : %s'",
+                       "Learning new spam messages in '%s : %s'",
+                       data->junk->len),
+                       camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
+                       full_name);
 
                for (i = 0; success && i < data->junk->len; i++) {
                        CamelMimeMessage *message;
@@ -359,13 +361,15 @@ folder_filter (CamelSession *session,
        if (data->notjunk) {
                gboolean success = TRUE;
 
-               /* Translators: The %s is replaced with the
-                * folder name where the operation is running. */
+               /* Translators: The first %s is replaced with account name and
+                * the second %s with the folder name where the operation is running. */
                camel_operation_push_message (
                        cancellable, dngettext (GETTEXT_PACKAGE,
-                       "Learning new ham message in '%s'",
-                       "Learning new ham messages in '%s'",
-                       data->notjunk->len), display_name);
+                       "Learning new ham message in '%s : %s'",
+                       "Learning new ham messages in '%s : %s'",
+                       data->notjunk->len),
+                       camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
+                       full_name);
 
                for (i = 0; success && i < data->notjunk->len; i++) {
                        CamelMimeMessage *message;
@@ -407,13 +411,15 @@ folder_filter (CamelSession *session,
                CamelService *service;
                const gchar *store_uid;
 
-               /* Translators: The %s is replaced with the
-                * folder name where the operation is running. */
+               /* Translators: The first %s is replaced with account name and
+                * the second %s with the folder name where the operation is running. */
                camel_operation_push_message (
                        cancellable, dngettext (GETTEXT_PACKAGE,
-                       "Filtering new message in '%s'",
-                       "Filtering new messages in '%s'",
-                       data->recents->len), display_name);
+                       "Filtering new message in '%s : %s'",
+                       "Filtering new messages in '%s : %s'",
+                       data->recents->len),
+                       camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
+                       full_name);
 
                service = CAMEL_SERVICE (parent_store);
                store_uid = camel_service_get_uid (service);
@@ -428,8 +434,8 @@ folder_filter (CamelSession *session,
                                data->folder, uid);
                        if (info == NULL) {
                                g_warning (
-                                       "uid '%s' vanished from folder '%s'",
-                                       uid, display_name);
+                                       "uid '%s' vanished from folder '%s : %s'",
+                                       uid, camel_service_get_display_name (CAMEL_SERVICE (parent_store)), 
full_name);
                                continue;
                        }
 
@@ -1062,8 +1068,9 @@ folder_get_quota_info_sync (CamelFolder *folder,
 {
        g_set_error (
                error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
-               _("Quota information not supported for folder '%s'"),
-               camel_folder_get_display_name (folder));
+               _("Quota information not supported for folder '%s : %s'"),
+               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store (folder))),
+               camel_folder_get_full_name (folder));
 
        return NULL;
 }
@@ -1157,7 +1164,9 @@ folder_changed (CamelFolder *folder,
                        folder->priv->changed_frozen, info);
                g_mutex_unlock (&folder->priv->change_lock);
 
-               description = g_strdup_printf (_("Filtering folder '%s'"), camel_folder_get_full_name 
(folder));
+               description = g_strdup_printf (_("Filtering folder '%s : %s'"),
+                       camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
+                       camel_folder_get_full_name (folder));
 
                camel_session_submit_job (
                        session, description, (CamelSessionCallback) folder_filter,
@@ -2872,8 +2881,6 @@ camel_folder_expunge_sync (CamelFolder *folder,
                            GError **error)
 {
        CamelFolderClass *class;
-       const gchar *display_name;
-       const gchar *message;
        gboolean success;
 
        g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
@@ -2894,9 +2901,9 @@ camel_folder_expunge_sync (CamelFolder *folder,
                return FALSE;
        }
 
-       message = _("Expunging folder '%s'");
-       display_name = camel_folder_get_display_name (folder);
-       camel_operation_push_message (cancellable, message, display_name);
+       camel_operation_push_message (cancellable, _("Expunging folder '%s : %s'"),
+               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store (folder))),
+               camel_folder_get_full_name (folder));
 
        if (!(folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED)) {
                success = class->expunge_sync (folder, cancellable, error);
@@ -3025,8 +3032,9 @@ camel_folder_get_message_sync (CamelFolder *folder,
        g_return_val_if_fail (class->get_message_sync != NULL, NULL);
 
        camel_operation_push_message (
-               cancellable, _("Retrieving message '%s' in %s"),
-               message_uid, camel_folder_get_display_name (folder));
+               cancellable, _("Retrieving message '%s' in '%s : %s'"),
+               message_uid, camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store 
(folder))),
+               camel_folder_get_full_name (folder));
 
        if (class->get_message_cached) {
                /* Return cached message, if available locally; this should
@@ -3208,17 +3216,15 @@ camel_folder_get_quota_info_sync (CamelFolder *folder,
 {
        CamelFolderClass *class;
        CamelFolderQuotaInfo *quota_info;
-       const gchar *display_name;
-       const gchar *message;
 
        g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
 
        class = CAMEL_FOLDER_GET_CLASS (folder);
        g_return_val_if_fail (class->get_quota_info_sync != NULL, NULL);
 
-       message = _("Retrieving quota information for '%s'");
-       display_name = camel_folder_get_display_name (folder);
-       camel_operation_push_message (cancellable, message, display_name);
+       camel_operation_push_message (cancellable, _("Retrieving quota information for '%s : %s'"),
+               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store (folder))),
+               camel_folder_get_full_name (folder));
 
        quota_info = class->get_quota_info_sync (folder, cancellable, error);
        CAMEL_CHECK_GERROR (
@@ -3491,8 +3497,6 @@ camel_folder_refresh_info_sync (CamelFolder *folder,
                                 GError **error)
 {
        CamelFolderClass *class;
-       const gchar *display_name;
-       const gchar *message;
        gboolean success;
 
        g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
@@ -3513,9 +3517,9 @@ camel_folder_refresh_info_sync (CamelFolder *folder,
                return FALSE;
        }
 
-       message = _("Refreshing folder '%s'");
-       display_name = camel_folder_get_display_name (folder);
-       camel_operation_push_message (cancellable, message, display_name);
+       camel_operation_push_message (cancellable, _("Refreshing folder '%s : %s'"),
+               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store (folder))),
+               camel_folder_get_full_name (folder));
 
        success = class->refresh_info_sync (folder, cancellable, error);
        CAMEL_CHECK_GERROR (folder, refresh_info_sync, success, error);
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index 3bc3887..0b5cb94 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -91,7 +91,8 @@ offline_folder_downsync_background (CamelSession *session,
 {
        camel_operation_push_message (
                cancellable,
-               _("Downloading new messages for offline mode in '%s'"),
+               _("Downloading new messages for offline mode in '%s : %s'"),
+               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store (data->folder))),
                camel_folder_get_full_name (data->folder));
 
        if (data->changes) {
@@ -158,7 +159,8 @@ offline_folder_schedule_store_changes_job (gpointer user_data)
                if (session) {
                        gchar *description;
 
-                       description = g_strdup_printf (_("Storing changes in folder '%s'"),
+                       description = g_strdup_printf (_("Storing changes in folder '%s : %s'"),
+                               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store 
(CAMEL_FOLDER (offline_folder)))),
                                camel_folder_get_full_name (CAMEL_FOLDER (offline_folder)));
 
                        camel_session_submit_job (session, description,
@@ -244,7 +246,9 @@ offline_folder_changed (CamelFolder *folder,
                camel_folder_change_info_cat (data->changes, changes);
                data->folder = g_object_ref (folder);
 
-               description = g_strdup_printf (_("Checking download of new messages for offline in '%s'"), 
camel_folder_get_full_name (folder));
+               description = g_strdup_printf (_("Checking download of new messages for offline in '%s : 
%s'"),
+                       camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store 
(folder))),
+                       camel_folder_get_full_name (folder));
 
                camel_session_submit_job (
                        session, description, (CamelSessionCallback)
@@ -353,13 +357,11 @@ offline_folder_downsync_sync (CamelOfflineFolder *offline,
 {
        CamelFolder *folder = (CamelFolder *) offline;
        GPtrArray *uids, *uncached_uids = NULL;
-       const gchar *display_name;
-       const gchar *message;
        gint i;
 
-       message = _("Syncing messages in folder '%s' to disk");
-       display_name = camel_folder_get_display_name (folder);
-       camel_operation_push_message (cancellable, message, display_name);
+       camel_operation_push_message (cancellable, _("Syncing messages in folder '%s : %s' to disk"),
+               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store (folder))),
+               camel_folder_get_full_name (folder));
 
        if (expression)
                uids = camel_folder_search_by_expression (folder, expression, cancellable, NULL);
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index ed5755a..70f3542 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -899,8 +899,9 @@ vee_folder_get_message_sync (CamelFolder *folder,
                g_set_error (
                        error, CAMEL_FOLDER_ERROR,
                        CAMEL_FOLDER_ERROR_INVALID_UID,
-                       _("No such message %s in %s"), uid,
-                       camel_folder_get_display_name (folder));
+                       _("No such message %s in '%s : %s'"), uid,
+                       camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store 
(folder))),
+                       camel_folder_get_full_name (folder));
        }
 
        return msg;
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index 43507dd..30ac2e8 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -699,7 +699,8 @@ imapx_get_quota_info_sync (CamelFolder *folder,
        if (quota_info == NULL)
                g_set_error (
                        error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
-                       _("No quota information available for folder '%s'"),
+                       _("No quota information available for folder '%s : %s'"),
+                       camel_service_get_display_name (CAMEL_SERVICE (store)),
                        camel_folder_get_full_name (folder));
 
 exit:
@@ -1290,8 +1291,9 @@ camel_imapx_folder_list_mailbox (CamelIMAPXFolder *folder,
                g_set_error (
                        error, CAMEL_FOLDER_ERROR,
                        CAMEL_FOLDER_ERROR_INVALID_STATE,
-                       _("No IMAP mailbox available for folder '%s'"),
-                       camel_folder_get_display_name (CAMEL_FOLDER (folder)));
+                       _("No IMAP mailbox available for folder '%s : %s'"),
+                       camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
+                       camel_folder_get_full_name (CAMEL_FOLDER (folder)));
        }
 
 exit:
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 1624d21..bebfa2a 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -4907,8 +4907,9 @@ imapx_server_fetch_changes (CamelIMAPXServer *is,
        is->priv->fetch_changes_last_progress = 0;
 
        camel_operation_push_message (cancellable,
-               _("Scanning for changed messages in '%s'"),
-               camel_folder_get_display_name (folder));
+               _("Scanning for changed messages in '%s : %s'"),
+               camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store (folder))),
+               camel_folder_get_full_name (folder));
 
        success = camel_imapx_server_process_command_sync (is, ic, _("Error scanning changes"), cancellable, 
error);
 
@@ -4928,8 +4929,9 @@ imapx_server_fetch_changes (CamelIMAPXServer *is,
                imapx_uidset_init (&uidset, 0, 100);
 
                camel_operation_push_message (cancellable,
-                       _("Fetching summary information for new messages in '%s'"),
-                       camel_folder_get_display_name (folder));
+                       _("Fetching summary information for new messages in '%s : %s'"),
+                       camel_service_get_display_name (CAMEL_SERVICE (camel_folder_get_parent_store 
(folder))),
+                       camel_folder_get_full_name (folder));
 
                fetch_summary_uids = g_slist_sort (fetch_summary_uids, imapx_uids_desc_cmp);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]