X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=f43ffbf6588b83b5037a5cecc21382d1dbb3ee27;hp=0cf7d02225277bdec8eb68e345c58d2dbad2d192;hb=4306fe319d2e238ee2f99bc1420623b25b1dfdd6;hpb=ff2951c65742d01f80db5db689197ec61a2dc782 diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 0cf7d02..f43ffbf 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -700,12 +700,8 @@ modest_ui_actions_on_add_to_contacts (GtkAction *action, ModestWindow *win) clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY); selection = gtk_clipboard_wait_for_text (clipboard); - /* Question: why is the clipboard being used here? - * It doesn't really make a lot of sense. */ - - if (selection) - { - modest_address_book_add_address (selection); + if (selection) { + modest_address_book_add_address (selection, (GtkWindow *) win); g_free (selection); } } @@ -1932,7 +1928,7 @@ reply_forward (ReplyForwardAction action, ModestWindow *win) ReplyForwardHelper *rf_helper = NULL; guint reply_forward_type; - g_return_if_fail (MODEST_IS_WINDOW(win)); + g_return_if_fail (win && MODEST_IS_WINDOW(win)); /* we check for low-mem; in that case, show a warning, and don't allow * reply/forward (because it could potentially require a lot of memory */ @@ -2052,7 +2048,7 @@ reply_forward (ReplyForwardAction action, ModestWindow *win) if (folder) g_object_unref (folder); } else { - reply_forward_cb (NULL, header, FALSE, NULL, NULL, rf_helper); + reply_forward_cb (NULL, header, FALSE, NULL, NULL, NULL); } /* Frees */ g_object_unref (header_list); @@ -2216,29 +2212,6 @@ new_messages_arrived (ModestMailOperation *self, } -gboolean -retrieve_all_messages_cb (GObject *source, - guint num_msgs, - guint retrieve_limit) -{ - GtkWindow *window; - gchar *msg; - gint response; - - window = GTK_WINDOW (source); - msg = g_strdup_printf (_("mail_nc_msg_count_limit_exceeded"), - num_msgs, retrieve_limit); - - /* Ask the user if they want to retrieve all the messages */ - response = - modest_platform_run_confirmation_dialog_with_buttons (window, msg, - _("mcen_bd_get_all"), - _("mcen_bd_newest_only")); - /* Free and return */ - g_free (msg); - return (response == GTK_RESPONSE_ACCEPT) ? TRUE : FALSE; -} - typedef struct { TnyAccount *account; ModestWindow *win; @@ -2284,7 +2257,6 @@ do_send_receive_performer (gboolean canceled, /* Send & receive. */ modest_mail_operation_update_account (info->mail_op, info->account_name, info->poke_status, info->interactive, - (info->win) ? retrieve_all_messages_cb : NULL, new_messages_arrived, info->win); clean: @@ -5687,20 +5659,20 @@ xfer_messages_error_handler (ModestMailOperation *mail_op, win = modest_mail_operation_get_source (mail_op); error = modest_mail_operation_get_error (mail_op); - account = modest_mail_operation_get_account (mail_op); - if (error && modest_tny_account_store_is_disk_full_error (modest_runtime_get_account_store(), - (GError *) error, account)) { - gchar *msg = g_strdup_printf (_KR("cerm_device_memory_full"), ""); - modest_platform_information_banner ((GtkWidget *) win, NULL, msg); - g_free (msg); - } else { + /* We cannot get the account from the mail op as that is the + source account and for checking memory full conditions we + need the destination one */ + account = TNY_ACCOUNT (user_data); + + if (error && + !modest_tny_account_store_check_disk_full_error (modest_runtime_get_account_store(), + (GtkWidget *) win, (GError*) error, + account, _KR("cerm_memory_card_full"))) { modest_platform_run_information_dialog ((GtkWindow *) win, _("mail_in_ui_folder_move_target_error"), FALSE); } - if (account) - g_object_unref (account); if (win) g_object_unref (win); } @@ -5745,8 +5717,7 @@ xfer_messages_performer (gboolean canceled, /* tinymail will return NULL for local folders it seems */ dst_forbids_message_add = modest_protocol_registry_protocol_type_has_tag (modest_runtime_get_protocol_registry (), modest_tny_account_get_protocol_type (dst_account), - MODEST_PROTOCOL_REGISTRY_STORE_FORBID_MESSAGE_ADD); - g_object_unref (dst_account); + MODEST_PROTOCOL_REGISTRY_STORE_FORBID_INCOMING_XFERS); if (dst_forbids_message_add) { modest_platform_information_banner (GTK_WIDGET (win), @@ -5778,7 +5749,8 @@ xfer_messages_performer (gboolean canceled, /* Perform the mail operation */ mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT(win), xfer_messages_error_handler, - movehelper, NULL); + g_object_ref (dst_account), + g_object_unref); modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op); @@ -5791,6 +5763,8 @@ xfer_messages_performer (gboolean canceled, g_object_unref (G_OBJECT (mail_op)); end: + if (dst_account) + g_object_unref (dst_account); g_object_unref (helper->dst_folder); g_object_unref (helper->headers); g_slice_free (XferMsgsHelper, helper);