2007-05-09 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Wed, 9 May 2007 16:28:18 +0000 (16:28 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Wed, 9 May 2007 16:28:18 +0000 (16:28 +0000)
* src/modest-tny-account-store.c: (modest_tny_account_store_alert):
        Show a HildonNote instead of a GtkDialog for Maemo.

pmo-trunk-r1808

ChangeLog2
src/modest-tny-account-store.c

index c4ad253..9ea665f 100644 (file)
@@ -1,5 +1,10 @@
 2007-05-09  Murray Cumming  <murrayc@murrayc.com>
 
+       * src/modest-tny-account-store.c: (modest_tny_account_store_alert):
+       Show a HildonNote instead of a GtkDialog for Maemo.
+
+2007-05-09  Murray Cumming  <murrayc@murrayc.com>
+
        * src/widgets/modest-account-view.h:
        * src/widgets/modest-account-view.c: (on_account_changed),
        (on_account_removed). Added a boolean flag, set/unset by 
index 45f9598..0e786e2 100644 (file)
@@ -56,6 +56,7 @@
 
 #ifdef MODEST_PLATFORM_MAEMO
 #include <tny-maemo-conic-device.h>
+#include <hildon-widgets/hildon-note.h>
 #endif
 
 /* 'private'/'protected' functions */
@@ -634,23 +635,7 @@ modest_tny_account_store_alert (TnyAccountStore *self, TnyAlertType type,
        
        /* printf("DEBUG: %s: error->message=%s\n", __FUNCTION__, error->message); */
        
-       GtkMessageType gtktype;
-       gboolean retval = FALSE;
-       GtkWidget *dialog;
 
-       switch (type)
-       {
-               case TNY_ALERT_TYPE_INFO:
-               gtktype = GTK_MESSAGE_INFO;
-               break;
-               case TNY_ALERT_TYPE_WARNING:
-               gtktype = GTK_MESSAGE_WARNING;
-               break;
-               case TNY_ALERT_TYPE_ERROR:
-               default:
-               gtktype = GTK_MESSAGE_ERROR;
-               break;
-       }
        
        const gchar *prompt = NULL;
        switch (error->code)
@@ -673,8 +658,31 @@ modest_tny_account_store_alert (TnyAccountStore *self, TnyAlertType type,
        if (!prompt)
                return FALSE;
 
-       dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
+       gboolean retval = FALSE;
+#ifdef MODEST_PLATFORM_MAEMO
+       /* The Tinymail documentation says that we should show Yes and No buttons, 
+        * but these never seem to be questions: */
+        GtkWidget *dialog = GTK_WIDGET (hildon_note_new_information (NULL, prompt));
+#else
+
+       GtkMessageType gtktype = GTK_MESSAGE_ERROR;
+       switch (type)
+       {
+               case TNY_ALERT_TYPE_INFO:
+               gtktype = GTK_MESSAGE_INFO;
+               break;
+               case TNY_ALERT_TYPE_WARNING:
+               gtktype = GTK_MESSAGE_WARNING;
+               break;
+               case TNY_ALERT_TYPE_ERROR:
+               default:
+               gtktype = GTK_MESSAGE_ERROR;
+               break;
+       }
+       
+       GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
                gtktype, GTK_BUTTONS_YES_NO, prompt);
+#endif /* #ifdef MODEST_PLATFORM_MAEMO */
 
        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES)
                retval = TRUE;