From 8b6cfb36cc347bdf88249e87082775dc910cb87d Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Wed, 11 Nov 2009 19:12:33 +0100 Subject: [PATCH] If no header available and we have to show error fetching message, show a different string, not requiring subject. --- src/modest-protocol-registry.c | 2 ++ src/modest-protocol-registry.h | 1 + src/modest-ui-actions.c | 11 ++++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modest-protocol-registry.c b/src/modest-protocol-registry.c index 9e89763..c71b1f0 100644 --- a/src/modest-protocol-registry.c +++ b/src/modest-protocol-registry.c @@ -457,6 +457,7 @@ modest_protocol_registry_set_to_default (ModestProtocolRegistry *self) modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_AUTH_ERROR, translation_is_userdata, "emev_ni_ui_pop3_msg_connect_error", NULL); modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_ACCOUNT_CONNECTION_ERROR, translation_is_userdata, "emev_ni_ui_pop3_msg_connect_error", NULL); modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE, translation_is_userdata_no_param, "emev_ni_ui_pop3_msg_recv_error", NULL); + modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE_LOST_HEADER, translation_is_userdata, "emev_ni_ui_pop3_msg_recv_error", NULL); modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_SSL_PROTO_NAME, translation_is_userdata_no_param, "mcen_fi_advsetup_other_security_securepop3s", NULL); modest_protocol_registry_add (self, protocol, 3, MODEST_PROTOCOL_REGISTRY_TRANSPORT_STORE_PROTOCOLS, @@ -476,6 +477,7 @@ modest_protocol_registry_set_to_default (ModestProtocolRegistry *self) modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_AUTH_ERROR, translation_is_userdata, "emev_ni_ui_imap_connect_server_error", NULL); modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_ACCOUNT_CONNECTION_ERROR, translation_is_userdata, "emev_ni_ui_imap_connect_server_error", NULL); modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE, translation_is_userdata, "emev_ni_ui_imap_message_not_available_in_server", NULL); + modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE_LOST_HEADER, translation_is_userdata, "emev_ni_ui_pop3_msg_recv_error", NULL); modest_protocol_set_translation (protocol, MODEST_PROTOCOL_TRANSLATION_SSL_PROTO_NAME, translation_is_userdata_no_param, "mcen_fi_advsetup_other_security_secureimap4s", NULL); account_options = tny_simple_list_new (); pair = tny_pair_new (MODEST_ACCOUNT_OPTION_USE_LSUB, ""); diff --git a/src/modest-protocol-registry.h b/src/modest-protocol-registry.h index 3bf3aa9..1a5129e 100644 --- a/src/modest-protocol-registry.h +++ b/src/modest-protocol-registry.h @@ -98,6 +98,7 @@ G_BEGIN_DECLS #define MODEST_PROTOCOL_TRANSLATION_AUTH_ERROR "translation-auth-error" /* server name */ #define MODEST_PROTOCOL_TRANSLATION_ACCOUNT_CONNECTION_ERROR "translation-account-connection-error" /* hostname */ #define MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE "translation-msg-not-available" /* subject */ +#define MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE_LOST_HEADER "translation-msg-not-available-lost-header" /* subject */ #define MODEST_PROTOCOL_TRANSLATION_SSL_PROTO_NAME "translation-ssl-proto-name" diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index a471477..814348c 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -1010,9 +1010,14 @@ modest_ui_actions_msg_retrieval_check (ModestMailOperation *mail_op, if (protocol) { if (tny_account_get_connection_status (account) == TNY_CONNECTION_STATUS_CONNECTED) { - format = modest_protocol_get_translation (protocol, - MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE, - subject); + if (header) { + format = modest_protocol_get_translation (protocol, + MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE, + subject); + } else { + format = modest_protocol_get_translation (protocol, + MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE_LOST_HEADER); + } } else { format = g_strdup_printf (_("mail_ib_backend_server_invalid"), tny_account_get_hostname (account)); -- 1.7.9.5