2007-05-25 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Fri, 25 May 2007 09:08:15 +0000 (09:08 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Fri, 25 May 2007 09:08:15 +0000 (09:08 +0000)
* src/modest-tny-account.c:
        (modest_tny_account_get_special_folder): Add TODO because this fails when
        the network is busy.
        (modest_tny_folder_store_get_local_size):  Fix an incorrect type check.
        * src/modest-ui-actions.c: (modest_ui_actions_on_smtp_servers):
        Do not try to show this window when there is no active account. The UI
        specs does not tell us what to do in this case.

pmo-trunk-r1974

ChangeLog2
src/modest-tny-account.c
src/modest-ui-actions.c

index 4b161cc..9c5607d 100644 (file)
@@ -1,3 +1,13 @@
+2007-05-25  Murray Cumming  <murrayc@murrayc.com>
+
+       * src/modest-tny-account.c:
+       (modest_tny_account_get_special_folder): Add TODO because this fails when 
+       the network is busy.
+       (modest_tny_folder_store_get_local_size):  Fix an incorrect type check.
+       * src/modest-ui-actions.c: (modest_ui_actions_on_smtp_servers): 
+       Do not try to show this window when there is no active account. The UI 
+       specs does not tell us what to do in this case.
+
 2007-05-24  Murray Cumming  <murrayc@murrayc.com>
 
        * Makefile.am:
index c6617fb..baebf31 100644 (file)
@@ -85,7 +85,9 @@ modest_tny_account_get_special_folder (TnyAccount *account,
 
        folders = TNY_LIST (tny_simple_list_new ());
 
-       /* no need to do this _async, as these are local folders */
+       /* There is no need to do this _async, as these are local folders. */
+       /* TODO: However, this seems to fail sometimes when the network is busy, 
+        * returning an empty list. murrayc. */
        tny_folder_store_get_folders (TNY_FOLDER_STORE (local_account),
                                      folders, NULL, NULL);
        iter = tny_list_create_iterator (folders);
@@ -583,7 +585,7 @@ modest_tny_folder_store_get_local_size (TnyFolderStore *self)
        RecurseFoldersHelper *helper;
        gint retval;
 
-       g_return_val_if_fail (TNY_IS_ACCOUNT (self), -1);
+       g_return_val_if_fail (TNY_IS_FOLDER_STORE (self), -1);
 
        /* Create helper */
        helper = g_malloc0 (sizeof (RecurseFoldersHelper));
index 348b2b8..3638194 100644 (file)
@@ -391,11 +391,22 @@ modest_ui_actions_on_smtp_servers (GtkAction *action, ModestWindow *win)
 #ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */
        
        /* Create the window if necessary: */
+       const gchar *active_account_name = modest_window_get_active_account (win);
+       
+       /* TODO: Dim the menu item (not in the UI spec)? or show a warning,
+        * or show the default account?
+        * If we show the default account then the account name should be shown in 
+        * the window when we show it. */
+       if (!active_account_name) {
+               g_warning ("%s: No account is active.", __FUNCTION__);
+               return;
+       }
+               
        GtkWidget *specific_window = GTK_WIDGET (modest_connection_specific_smtp_window_new ());
        modest_connection_specific_smtp_window_fill_with_connections (
                MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (specific_window), 
                modest_runtime_get_account_mgr(), 
-               modest_window_get_active_account (win));
+               active_account_name);
 
        /* Show the window: */  
        gtk_window_set_transient_for (GTK_WINDOW (specific_window), GTK_WINDOW (win));