+ /* const gchar *prompt = NULL; */
+ gchar *prompt = NULL;
+ switch (error->code) {
+ case TNY_ACCOUNT_STORE_ERROR_CANCEL_ALERT:
+ case TNY_ACCOUNT_ERROR_TRY_CONNECT_USER_CANCEL:
+ /* Don't show waste the user's time by showing him a dialog telling
+ * him that he has just cancelled something: */
+ g_debug ("%s: Handling GError domain=%d, code=%d (cancelled) without showing a dialog, message=%s",
+ __FUNCTION__, error->domain, error->code, error->message);
+ prompt = NULL;
+ break;
+
+ case TNY_ACCOUNT_ERROR_TRY_CONNECT_HOST_LOOKUP_FAILED:
+ case TNY_ACCOUNT_ERROR_TRY_CONNECT_SERVICE_UNAVAILABLE:
+ /* TODO: Show the appropriate message, depending on whether it's POP or IMAP: */
+ g_debug ("%s: Handling GError domain=%d, code=%d (lookup failed), message=%s",
+ __FUNCTION__, error->domain, error->code, error->message);
+
+ switch (proto) {
+ case MODEST_PROTOCOL_STORE_POP:
+ prompt = g_strdup_printf (_("emev_ni_ui_pop3_msg_connect_error"), server_name);
+ break;
+ case MODEST_PROTOCOL_STORE_IMAP:
+ prompt = g_strdup_printf (_("emev_ni_ui_imap_connect_server_error"), server_name);
+ break;
+ case MODEST_PROTOCOL_TRANSPORT_SMTP:
+ default: /* Arbitrary default. */
+ prompt = g_strdup_printf (_("emev_ib_ui_smtp_server_invalid"), server_name);
+ break;
+ }
+
+ /*
+ prompt = g_strdup_printf(
+ _("Incorrect Account Settings:\n Host lookup failed.%s"),
+ error->message);
+ */
+ break;
+
+ case TNY_ACCOUNT_ERROR_TRY_CONNECT_AUTHENTICATION_NOT_SUPPORTED:
+ g_debug ("%s: Handling GError domain=%d, code=%d (authentication not supported), message=%s",
+ __FUNCTION__, error->domain, error->code, error->message);
+ /* TODO: This needs a logical ID for the string: */
+ prompt = g_strdup_printf(
+ _("Incorrect Account Settings:\nThe secure authentication method is not supported.\n%s"),
+ error->message);
+ break;
+
+ case TNY_ACCOUNT_ERROR_TRY_CONNECT_CERTIFICATE:
+ g_debug ("%s: Handling GError domain=%d, code=%d (certificatae), message=%s",
+ __FUNCTION__, error->domain, error->code, error->message);
+ prompt = g_strdup_printf(
+ _("Certificate Problem:\n%s"),
+ error->message);
+ break;
+
+ case TNY_ACCOUNT_ERROR_TRY_CONNECT:
+ /* The tinymail camel implementation just sends us this for almost
+ * everything, so we have to guess at the cause.
+ * It could be a wrong password, or inability to resolve a hostname,
+ * or lack of network, or incorrect authentication method, or something entirely different: */
+ /* TODO: Fix camel to provide specific error codes, and then use the
+ * specific dialog messages from Chapter 12 of the UI spec.
+ */
+ case TNY_ACCOUNT_STORE_ERROR_UNKNOWN_ALERT:
+ /* This debug output is useful. Please keep it uncommented until
+ * we have fixed the problems in this function: */
+ g_debug ("%s: Handling GError domain=%d, code=%d, message=%s",
+ __FUNCTION__, error->domain, error->code, error->message);
+
+ /* TODO: Remove the internal error message for the real release.
+ * This is just so the testers can give us more information: */
+ /* prompt = _("Modest account not yet fully configured."); */
+ prompt = g_strdup_printf(
+ "%s\n (Internal error message, often very misleading):\n%s",
+ _("Incorrect Account Settings"),
+ error->message);
+
+ /* Note: If the password was wrong then get_password() would be called again,
+ * instead of this vfunc being called. */
+
+ break;
+
+ default:
+ g_warning ("%s: Unhandled GError code: %d, message=%s",
+ __FUNCTION__, error->code, error->message);
+ prompt = NULL;
+ break;