ModestWindow *win;
gchar *account_name;
gboolean poke_status;
+ gboolean interactive;
} SendReceiveInfo;
static void
/* Send & receive. */
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
- modest_mail_operation_update_account (mail_op, info->account_name, info->poke_status,
+ modest_mail_operation_update_account (mail_op, info->account_name, info->poke_status, info->interactive,
(info->win) ? retrieve_all_messages_cb : NULL,
new_messages_arrived, info->win);
g_object_unref (G_OBJECT (mail_op));
modest_ui_actions_do_send_receive (const gchar *account_name,
gboolean force_connection,
gboolean poke_status,
+ gboolean interactive,
ModestWindow *win)
{
gchar *acc_name = NULL;
info->account_name = acc_name;
info->win = (win) ? g_object_ref (win) : NULL;
info->poke_status = poke_status;
+ info->interactive = interactive;
info->account = modest_tny_account_store_get_server_account (acc_store, acc_name,
TNY_ACCOUNT_TYPE_STORE);
void
modest_ui_actions_do_send_receive_all (ModestWindow *win,
gboolean force_connection,
- gboolean poke_status)
+ gboolean poke_status,
+ gboolean interactive)
{
GSList *account_names, *iter;
while (iter) {
modest_ui_actions_do_send_receive ((const char*) iter->data,
force_connection,
- poke_status, win);
+ poke_status, interactive, win);
iter = g_slist_next (iter);
}
/* Refresh the active account. Force the connection if needed
and poke the status of all folders */
- modest_ui_actions_do_send_receive (NULL, TRUE, TRUE, win);
+ modest_ui_actions_do_send_receive (NULL, TRUE, TRUE, TRUE, win);
}
modest_ui_actions_rename_folder_error_handler (ModestMailOperation *mail_op,
gpointer user_data)
{
- ModestMainWindow *window = MODEST_MAIN_WINDOW (user_data);
const GError *error = NULL;
const gchar *message = NULL;
message = _CS("ckdg_ib_folder_already_exists");
break;
default:
- g_warning ("%s: BUG: unexpected error:[%d]: %s", __FUNCTION__,
- error->code, error->message);
- return;
+ message = _("emev_ib_ui_imap_unable_to_rename");
}
- modest_platform_information_banner (GTK_WIDGET (window), NULL, message);
+ /* We don't set a parent for the dialog because the dialog
+ will be destroyed so the banner won't appear */
+ modest_platform_information_banner (NULL, NULL, message);
}
typedef struct {
TnyFolder *new_folder,
gpointer user_data)
{
- /* Select now */
- modest_folder_view_select_folder (MODEST_FOLDER_VIEW (user_data),
- new_folder, FALSE);
+ ModestFolderView *folder_view;
+
+ folder_view = MODEST_FOLDER_VIEW (user_data);
+ /* Note that if the rename fails new_folder will be NULL */
+ if (new_folder) {
+ modest_folder_view_select_folder (folder_view, new_folder, FALSE);
+ } else {
+ modest_folder_view_select_first_inbox_or_local (folder_view);
+ }
}
static void
TnyTransportAccount *server_account;
gchar *message = NULL;
- /* Don't show anything if the user cancelled something */
- if (err->code == TNY_SYSTEM_ERROR_CANCEL)
+ /* Don't show anything if the user cancelled something or the send receive request is not
+ * interactive */
+ if (err->code == TNY_SYSTEM_ERROR_CANCEL ||
+ !modest_tny_send_queue_get_requested_send_receive (MODEST_TNY_SEND_QUEUE (self)))
return;
+
/* Get the server name: */
server_account =
TNY_TRANSPORT_ACCOUNT (tny_camel_send_queue_get_transport_account (TNY_CAMEL_SEND_QUEUE (self)));
- if (server_account) {
- server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));
-
- g_object_unref (server_account);
- server_account = NULL;
- }
-
- g_return_if_fail (server_name);
+ if (server_account)
+ server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));
+ else
+ g_return_if_reached ();
/* Show the appropriate message text for the GError: */
switch (err->code) {
modest_platform_run_information_dialog (NULL, message);
g_free (message);
+ g_object_unref (server_account);
}
void