X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=a377d6109af7497c997db8d01ef37291f9eafbbd;hp=6a5a9b693df49495e6c2a5d72f14ce9f9859d2d4;hb=4e84a952255aca3593918eedddae60340471063a;hpb=a83b1e1a520ddd3b9941faed9e6169910967161b diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 6a5a9b6..a377d61 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -760,7 +760,10 @@ modest_ui_actions_compose_msg(ModestWindow *win, allowed_size = MODEST_MAX_ATTACHMENT_SIZE; msg_win = modest_msg_edit_window_new (msg, account_name, FALSE); - modest_window_mgr_register_window (modest_runtime_get_window_mgr(), msg_win, NULL); + if (!modest_window_mgr_register_window (modest_runtime_get_window_mgr(), msg_win, NULL)) { + gtk_widget_destroy (GTK_WIDGET (msg_win)); + goto cleanup; + } modest_msg_edit_window_set_modified (MODEST_MSG_EDIT_WINDOW (msg_win), set_as_modified); gtk_widget_show_all (GTK_WIDGET (msg_win)); @@ -827,6 +830,17 @@ modest_ui_actions_msg_retrieval_check (ModestMailOperation *mail_op, g_object_unref (source); } + if (error && ((error->code == TNY_SERVICE_ERROR_NO_SUCH_MESSAGE) || + error->code == TNY_SERVICE_ERROR_MESSAGE_NOT_AVAILABLE)) { + gchar *subject, *msg; + subject = tny_header_dup_subject (header); + msg = g_strdup_printf (_("emev_ni_ui_imap_message_not_available_in_server"), + subject); + modest_platform_run_information_dialog (NULL, msg, FALSE); + g_free (msg); + g_free (subject); + } + /* Remove the header from the preregistered uids */ modest_window_mgr_unregister_header (modest_runtime_get_window_mgr (), header); @@ -981,7 +995,10 @@ open_msg_cb (ModestMailOperation *mail_op, /* Register and show new window */ if (win != NULL) { mgr = modest_runtime_get_window_mgr (); - modest_window_mgr_register_window (mgr, win, NULL); + if (!modest_window_mgr_register_window (mgr, win, NULL)) { + gtk_widget_destroy (GTK_WIDGET (win)); + goto cleanup; + } gtk_widget_show_all (GTK_WIDGET(win)); } @@ -1556,6 +1573,8 @@ reply_forward_cb (ModestMailOperation *mail_op, edit_type = MODEST_EDIT_TYPE_FORWARD; break; default: + modest_window_mgr_unregister_header (modest_runtime_get_window_mgr (), + header); g_return_if_reached (); return; } @@ -1592,6 +1611,11 @@ reply_forward_cb (ModestMailOperation *mail_op, gtk_widget_show_all (GTK_WIDGET (msg_win)); cleanup: + /* We always unregister the header because the message is + forwarded or replied so the original one is no longer + opened */ + modest_window_mgr_unregister_header (modest_runtime_get_window_mgr (), + header); if (new_msg) g_object_unref (G_OBJECT (new_msg)); if (account) @@ -1670,6 +1694,7 @@ reply_forward_performer (gboolean canceled, } /* Retrieve the message */ + modest_window_mgr_register_header (modest_runtime_get_window_mgr (), rf_helper->header, NULL); mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT (parent_window), modest_ui_actions_disk_operations_error_handler, NULL, NULL); @@ -2656,7 +2681,7 @@ modest_ui_actions_on_save_to_drafts (GtkWidget *widget, ModestMsgEditWindow *edi gchar *account_name, *from; ModestAccountMgr *account_mgr; gboolean had_error = FALSE; - ModestMainWindow *win; + ModestMainWindow *win = NULL; g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW(edit_window), FALSE); @@ -2718,6 +2743,14 @@ modest_ui_actions_on_save_to_drafts (GtkWidget *widget, ModestMsgEditWindow *edi on_save_to_drafts_cb, g_object_ref(edit_window)); +#ifdef MODEST_TOOLKIT_HILDON2 + /* In hildon2 we always show the information banner on saving to drafts. + * It will be a system information banner in this case. + */ + gchar *text = g_strdup_printf (_("mail_va_saved_to_drafts"), _("mcen_me_folder_drafts")); + modest_platform_information_banner (NULL, NULL, text); + g_free (text); +#else /* Use the main window as the parent of the banner, if the main window does not exist it won't be shown, if the parent window exists then it's properly shown. We don't use the @@ -2730,6 +2763,7 @@ modest_ui_actions_on_save_to_drafts (GtkWidget *widget, ModestMsgEditWindow *edi modest_platform_information_banner (GTK_WIDGET (win), NULL, text); g_free (text); } +#endif modest_msg_edit_window_set_modified (edit_window, FALSE); /* Frees */ @@ -4502,7 +4536,10 @@ on_move_to_dialog_folder_selection_changed (ModestFolderView* self, MODEST_PROTOCOL_REGISTRY_STORE_HAS_FOLDERS)); } g_object_unref (local_account); - g_object_unref (mmc_account); + + /* It could not exist */ + if (mmc_account) + g_object_unref (mmc_account); } /* Check the target folder rules */ @@ -6035,7 +6072,8 @@ modest_ui_actions_on_send_queue_status_changed (ModestTnySendQueue *send_queue, tree_column = gtk_tree_view_get_column (GTK_TREE_VIEW (header_view), TNY_GTK_HEADER_LIST_MODEL_FROM_COLUMN); - gtk_tree_view_column_queue_resize (tree_column); + if (tree_column) + gtk_tree_view_column_queue_resize (tree_column); } #else gtk_widget_queue_draw (header_view);