From 478474a3ac38e088f438c26bd80f83b22321c127 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 25 May 2007 09:08:15 +0000 Subject: [PATCH] 2007-05-25 Murray Cumming * 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 | 10 ++++++++++ src/modest-tny-account.c | 6 ++++-- src/modest-ui-actions.c | 13 ++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index 4b161cc..9c5607d 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,3 +1,13 @@ +2007-05-25 Murray Cumming + + * 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 * Makefile.am: diff --git a/src/modest-tny-account.c b/src/modest-tny-account.c index c6617fb..baebf31 100644 --- a/src/modest-tny-account.c +++ b/src/modest-tny-account.c @@ -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)); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 348b2b8..3638194 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -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)); -- 1.7.9.5