From 71905fa5bf116e62156995c97e00f4b4db656a69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sergio=20Villar=20Sen=C3=ADn?= Date: Fri, 8 May 2009 10:00:52 +0200 Subject: [PATCH] Fixes NB#114489, show the account settings dialog on connection errors --- src/modest-tny-account-store.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 28d6680..788ea2d 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -1107,33 +1107,36 @@ modest_tny_account_store_alert (TnyAccountStore *self, /* Can't allocate memory for this operation */ case TNY_SERVICE_ERROR_UNKNOWN: - return FALSE; + return FALSE; default: g_debug ("Unexpected error %d", error->code); g_return_val_if_reached (FALSE); } - + if (error->code == TNY_SERVICE_ERROR_CERTIFICATE) retval = modest_platform_run_certificate_confirmation_dialog (server_name, error->message); else if (error->code == TNY_SERVICE_ERROR_AUTHENTICATE || error->code == TNY_SERVICE_ERROR_CONNECT) { + TnyDevice *device = modest_runtime_get_device (); modest_platform_run_information_dialog (NULL, prompt, TRUE); - /* Show the account dialog if it was wrong */ - if (error->code == TNY_SERVICE_ERROR_AUTHENTICATE) + /* Show the account dialog. Checking the online status + allows us to minimize the number of times that we + incorrectly show the dialog */ + if (tny_device_is_online (device)) show_wrong_password_dialog (account); retval = TRUE; } g_debug ("%s: error code %d (%s", __FUNCTION__, error->code, error->message); - + if (prompt) g_free (prompt); - + return retval; } -- 1.7.9.5