X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=369e4befbc44b76d8eafc94fdda4bbf60de599ea;hp=049da20cd45b5f0b81693eb05a909459cb020c9e;hb=305b5f8ec558ffedb3b531618b7877cf8ee722b6;hpb=b48954c32882b59110f8f1926c04b9a391289c90 diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 049da20..369e4be 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -1863,13 +1863,49 @@ void modest_ui_actions_on_send_receive (GtkAction *action, ModestWindow *win) { /* Check if accounts exist */ - gboolean accounts_exist = + gboolean accounts_exist; + + accounts_exist = modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE); /* If not, allow the user to create an account before trying to send/receive. */ if (!accounts_exist) modest_ui_actions_on_accounts (NULL, win); + /* Refresh the current folder. The if is always TRUE it's just an extra check */ + if (MODEST_IS_MAIN_WINDOW (win)) { + GtkWidget *header_view, *folder_view; + TnyFolderStore *folder_store; + + folder_view = + modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win), + MODEST_MAIN_WINDOW_WIDGET_TYPE_FOLDER_VIEW); + if (!folder_view) + return; + + folder_store = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (folder_view)); + + /* No need to refresh the INBOX the send_receive will do it for us */ + if (folder_store && TNY_IS_FOLDER (folder_store) && + tny_folder_get_folder_type (TNY_FOLDER (folder_store)) != TNY_FOLDER_TYPE_INBOX) { + header_view = + modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win), + MODEST_MAIN_WINDOW_WIDGET_TYPE_HEADER_VIEW); + + /* We do not need to set the contents style + because it hasn't changed. We also do not + need to save the widget status. Just force + a refresh */ + modest_header_view_set_folder (MODEST_HEADER_VIEW(header_view), + TNY_FOLDER (folder_store), + folder_refreshed_cb, + MODEST_MAIN_WINDOW (win)); + } + + if (folder_store) + g_object_unref (folder_store); + } + /* Refresh the active account */ modest_ui_actions_do_send_receive (NULL, win); }