2007-07-27 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Fri, 27 Jul 2007 10:03:32 +0000 (10:03 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Fri, 27 Jul 2007 10:03:32 +0000 (10:03 +0000)
* src/maemo/modest-maemo-utils.c:
(modest_maemo_utils_get_supported_secure_authentication_methods):
Make sure that we have a connection, asking the user for one
if necessary.
* src/maemo/modest-main-window.c: (modest_main_window_on_show):
Check for a connection before showing the wizard, because
the wizard needs a connection to check for server capabilities.

pmo-trunk-r2818

ChangeLog2
src/maemo/modest-maemo-utils.c
src/maemo/modest-main-window.c

index 2f8bb8f..64bd9fa 100644 (file)
@@ -1,5 +1,15 @@
 2007-07-27  Murray Cumming  <murrayc@murrayc.com>
 
+       * src/maemo/modest-maemo-utils.c:
+       (modest_maemo_utils_get_supported_secure_authentication_methods):
+       Make sure that we have a connection, asking the user for one 
+       if necessary.
+       * src/maemo/modest-main-window.c: (modest_main_window_on_show): 
+       Check for a connection before showing the wizard, because 
+       the wizard needs a connection to check for server capabilities.
+
+2007-07-27  Murray Cumming  <murrayc@murrayc.com>
+
        * src/maemo/modest-account-view-window.c:
        (on_new_button_clicked): Remember the wizard dialog instance, 
        so we can just present it again if necessary. This prevents 
index 522392b..5ac6bb5 100644 (file)
@@ -45,6 +45,7 @@
 #include "modest-hildon-includes.h"
 
 #include "modest-maemo-utils.h"
+#include "modest-platform.h"
 
 /*
  * For getting and tracking the Bluetooth name
@@ -380,6 +381,10 @@ GList* modest_maemo_utils_get_supported_secure_authentication_methods (ModestTra
 {
        g_return_val_if_fail (proto != MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN, NULL);
        
+       /* We need a connection to get the capabilities; */
+       if (!modest_platform_connect_and_wait (GTK_WINDOW (parent_window), NULL))
+               return NULL;
+        
        /*
        result = g_list_append (result, GINT_TO_POINTER (MODEST_PROTOCOL_AUTH_CRAMMD5));
        */
@@ -402,7 +407,6 @@ GList* modest_maemo_utils_get_supported_secure_authentication_methods (ModestTra
                tny_account = NULL;
        }
 
-       /* TODO: Handle connection requests. */
        
        if (!tny_account) {
                g_printerr ("%s could not create tny account.", __FUNCTION__);
index d61565f..0ab62cf 100644 (file)
@@ -779,6 +779,12 @@ modest_main_window_on_show (GtkWidget *self, gpointer user_data)
        
        restore_settings (MODEST_MAIN_WINDOW(self), TRUE);
 
+       /* The UI spec wants us to show a connection dialog when the application is 
+        * started by the user, if there is no connection.
+        * Do this before showing the account wizard, 
+        * because wizard needs a connection to discover capabilities. */
+        modest_platform_connect_and_wait (GTK_WINDOW (self), NULL);
+        
        /* Check if accounts exist and show the account wizard if not */
        gboolean accounts_exist = 
                modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE);
@@ -798,10 +804,6 @@ modest_main_window_on_show (GtkWidget *self, gpointer user_data)
                gtk_action_set_visible (send_receive_all, g_slist_length (accounts));
                modest_account_mgr_free_account_names (accounts);
        }
-
-       /* The UI spec wants us to show a connection dialog when the application is 
-        * started by the user, if there is no connection: */
-        modest_platform_connect_and_wait (GTK_WINDOW (self), NULL);
 }
 
 ModestWindow *