Show the protocol logical id when a message retrieving fails
[modest] / src / modest-ui-actions.c
index ffc10d4..b998952 100644 (file)
@@ -905,14 +905,30 @@ modest_ui_actions_msg_retrieval_check (ModestMailOperation *mail_op,
 
                if (error && ((error->code == TNY_SERVICE_ERROR_NO_SUCH_MESSAGE) ||
                              error->code == TNY_SERVICE_ERROR_MESSAGE_NOT_AVAILABLE)) {
-                       gchar *subject, *msg;
+                       gchar *subject, *msg, *format = NULL;
+                       TnyAccount *account;
                        subject = tny_header_dup_subject (header);
                        if (!subject)
-                               subject = g_strdup (_("mail_va_no_subject"));;
-                       msg = g_strdup_printf (_("emev_ni_ui_imap_message_not_available_in_server"),
-                                              subject);
+                               subject = g_strdup (_("mail_va_no_subject"));
+
+                       account = modest_mail_operation_get_account (mail_op);
+                       if (account) {
+                               ModestProtocol *protocol;
+                               ModestProtocolType proto;
+                               proto = modest_tny_account_get_protocol_type (account);
+                               protocol = modest_protocol_registry_get_protocol_by_type (modest_runtime_get_protocol_registry (), proto);
+                               if (protocol)
+                                       format = modest_protocol_get_translation (protocol, MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE);
+                               g_object_unref (account);
+                       }
+
+                       if (!format)
+                               format = g_strdup (_("emev_ni_ui_imap_message_not_available_in_server"));
+
+                       msg = g_strdup_printf (format, subject);
                        modest_platform_run_information_dialog (NULL, msg, FALSE);
                        g_free (msg);
+                       g_free (format);
                        g_free (subject);
                }
 
@@ -1019,7 +1035,6 @@ get_info_from_header (TnyHeader *header, gboolean *is_draft, gboolean *can_open)
                                           outbox which is not in
                                           failed state */
                                        *can_open = FALSE;
-                                       g_object_unref(traccount);
                                 }
 #endif
                        }
@@ -3443,7 +3458,7 @@ modest_ui_actions_rename_folder_error_handler (ModestMailOperation *mail_op,
                   message is opened for example */
                message = _("emev_ni_internal_error");
        } else {
-               message = _("emev_ib_ui_imap_unable_to_rename");
+               message = _CS("ckdg_ib_unable_to_remove");
        }
 
        /* We don't set a parent for the dialog because the dialog
@@ -5668,6 +5683,10 @@ modest_ui_actions_on_folder_window_move_to (GtkWidget *folder_view,
            !MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (dst_folder) &&
            !modest_tny_account_is_memory_card_account (TNY_ACCOUNT (dst_folder))) {
                do_xfer = FALSE;
+               /* Show an error */
+               modest_platform_run_information_dialog (win,
+                                                       _("mail_in_ui_folder_move_target_error"),
+                                                       FALSE);
        } else if (!TNY_IS_FOLDER (src_folder)) {
                g_warning ("%s: src_folder is not a TnyFolder.\n", __FUNCTION__);
                do_xfer = FALSE;
@@ -5676,7 +5695,7 @@ modest_ui_actions_on_folder_window_move_to (GtkWidget *folder_view,
        if (do_xfer) {
                MoveFolderInfo *info = g_new0 (MoveFolderInfo, 1);
                DoubleConnectionInfo *connect_info = g_slice_new (DoubleConnectionInfo);
-               
+
                info->src_folder = g_object_ref (src_folder);
                info->dst_folder = g_object_ref (dst_folder);
                info->delete_original = TRUE;
@@ -5690,6 +5709,7 @@ modest_ui_actions_on_folder_window_move_to (GtkWidget *folder_view,
                                                           TNY_FOLDER_STORE (src_folder), 
                                                           connect_info);
        }
+
        /* Frees */
        g_object_unref (src_folder);
 }