2007-05-08 Murray Cumming <murrayc@murrayc.com>
+ * src/modest-tny-account-store.c:
+ (modest_tny_account_store_alert): Adapt to the changed tinymail API,
+ using a GError instead of a string message, so we can translate it in
+ Modest.
+
+
+2007-05-08 Murray Cumming <murrayc@murrayc.com>
+
* src/maemo/modest-address-book.c:
(modest_address_book_check_names):
* src/maemo/modest-msg-view-window.c:
#include <tny-account.h>
#include <tny-account-store.h>
#include <tny-store-account.h>
+#include <tny-error.h>
#include <tny-transport-account.h>
#include <tny-simple-list.h>
#include <tny-account-store.h>
static gchar*
get_password (TnyAccount *account, const gchar *prompt, gboolean *cancel)
{
+ /* printf("DEBUG: %s\n", __FUNCTION__); */
+
const gchar *key;
const TnyAccountStore *account_store;
ModestTnyAccountStore *self;
} else
*cancel = FALSE;
+ /* printf(" DEBUG: %s: returning %s\n", __FUNCTION__, pwd); */
+
return pwd;
}
static gboolean
modest_tny_account_store_alert (TnyAccountStore *self, TnyAlertType type,
- const gchar *prompt)
+ const GError *error)
{
+ g_return_val_if_fail (error, FALSE);
+
+ printf("DEBUG: %s: error->message=%s\n", __FUNCTION__, error->message);
+
GtkMessageType gtktype;
gboolean retval = FALSE;
GtkWidget *dialog;
gtktype = GTK_MESSAGE_ERROR;
break;
}
+
+ const gchar *prompt = NULL;
+ switch (error->code)
+ {
+ case TNY_ACCOUNT_ERROR_TRY_CONNECT:
+ /* Use a Logical ID: */
+ prompt = _("Modest account not yet fully configured");
+ break;
+ default:
+ g_warning ("%s: Unhandled GError code.", __FUNCTION__);
+ prompt = NULL;
+ break;
+ }
+
+ if (!prompt)
+ return FALSE;
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
gtktype, GTK_BUTTONS_YES_NO, prompt);