if (modest_msg_view_window_last_message_selected (win) &&
modest_msg_view_window_first_message_selected (win)) {
modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (win));
- } else if (!modest_msg_view_window_select_next_message (win)) {
+ } else if (!modest_msg_view_window_select_next_message (win) &&
+ !modest_msg_view_window_select_previous_message (win)) {
gboolean ret_value;
g_signal_emit_by_name (G_OBJECT (win), "delete-event", NULL, &ret_value);
}
{
const GError *error;
GObject *win = NULL;
- const gchar *err_msg;
+ const gchar *err_msg = (const gchar *) user_data;
win = modest_mail_operation_get_source (mail_op);
error = modest_mail_operation_get_error (mail_op);
-
- /* Select error message */
- if (error->code == MODEST_MAIL_OPERATION_ERROR_MESSAGE_SIZE_LIMIT)
- err_msg = _("emev_ni_ui_imap_msg_size_exceed_error");
- else
- err_msg = (const gchar *) user_data;
/* Show error */
modest_platform_run_information_dialog ((GtkWindow *) win, err_msg);
send&receive was invoked by the user then do not show any
visual notification, only play a sound and activate the LED
(for the Maemo version) */
- if ((new_headers != NULL) && (tny_list_get_length (new_headers) > 0))
+ if (TNY_IS_LIST(new_headers) && (tny_list_get_length (new_headers)) > 0)
modest_platform_on_new_headers_received (new_headers,
show_visual_notifications);
MODEST_MAIL_OPERATION_ERROR_ITEM_NOT_FOUND,
"modest: could not find send queue for account\n");
} else {
- /* Keeep messages in outbox folder */
- tny_send_queue_cancel (send_queue, FALSE, &error);
- }
+ /* Cancel the current send */
+ tny_account_cancel (TNY_ACCOUNT (transport_account));
+
+ /* Suspend all pending messages */
+ tny_send_queue_cancel (send_queue, TNY_SEND_QUEUE_CANCEL_ACTION_SUSPEND, &error);
+ }
frees:
if (transport_account != NULL)
if ((gpointer) local_account != (gpointer) folder_store &&
(gpointer) mmc_account != (gpointer) folder_store) {
+ const char *proto_name = tny_account_get_proto (TNY_ACCOUNT (folder_store));
+ ModestTransportStoreProtocol proto = MODEST_PROTOCOL_STORE_MAILDIR;
+ if (proto_name != NULL) {
+ proto = modest_protocol_info_get_transport_store_protocol (proto_name);
+ }
is_local_account = FALSE;
/* New button should be dimmed on remote
- account root */
- new_sensitive = FALSE;
+ POP account root */
+ new_sensitive = (proto != MODEST_PROTOCOL_STORE_POP);
}
g_object_unref (local_account);
}
if (MODEST_IS_MSG_VIEW_WINDOW (object)) {
ModestMsgViewWindow *self = MODEST_MSG_VIEW_WINDOW (object);
- if (!modest_msg_view_window_select_next_message (self))
- if (!modest_msg_view_window_select_previous_message (self))
- /* No more messages to view, so close this window */
- modest_ui_actions_on_close_window (NULL, MODEST_WINDOW(self));
+ if (modest_msg_view_window_last_message_selected (self) &&
+ modest_msg_view_window_first_message_selected (self)) {
+ modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (self));
+ } else if (!modest_msg_view_window_select_next_message (self) &&
+ !modest_msg_view_window_select_previous_message (self)) {
+ /* No more messages to view, so close this window */
+ modest_ui_actions_on_close_window (NULL, MODEST_WINDOW(self));
+ }
} else if (MODEST_IS_MAIN_WINDOW (object) && helper->reference != NULL) {
GtkWidget *header_view;
GtkTreePath *path;
gchar *message = NULL;
/* Don't show anything if the user cancelled something */
- if (err->code == TNY_TRANSPORT_ACCOUNT_ERROR_SEND_USER_CANCEL)
+ if (err->code == TNY_SYSTEM_ERROR_CANCEL)
return;
/* Get the server name: */
/* Show the appropriate message text for the GError: */
switch (err->code) {
- case TNY_TRANSPORT_ACCOUNT_ERROR_SEND_HOST_LOOKUP_FAILED:
+ case TNY_SERVICE_ERROR_CONNECT:
message = g_strdup_printf (_("emev_ib_ui_smtp_server_invalid"), server_name);
break;
- case TNY_TRANSPORT_ACCOUNT_ERROR_SEND_SERVICE_UNAVAILABLE:
- message = g_strdup_printf (_("emev_ib_ui_smtp_server_invalid"), server_name);
- break;
- case TNY_TRANSPORT_ACCOUNT_ERROR_SEND_AUTHENTICATION_NOT_SUPPORTED:
+ case TNY_SERVICE_ERROR_AUTHENTICATE:
message = g_strdup_printf (_("emev_ni_ui_smtp_authentication_fail_error"), server_name);
break;
- case TNY_TRANSPORT_ACCOUNT_ERROR_SEND:
+ case TNY_SERVICE_ERROR_SEND:
message = g_strdup (_("emev_ib_ui_smtp_send_error"));
break;
default:
- g_warning ("%s: unexpected TNY_TRANSPORT_ACCOUNT_ERROR %d",
+ g_warning ("%s: unexpected ERROR %d",
__FUNCTION__, err->code);
message = g_strdup (_("emev_ib_ui_smtp_send_error"));
break;
#else
gtk_widget_queue_draw (header_view);
#endif
+
+ /* Rerun dimming rules, because the message could become deletable for example */
+ modest_window_check_dimming_rules_group (MODEST_WINDOW (main_window),
+ MODEST_DIMMING_RULES_TOOLBAR);
/* Free */
frees: