* src/modest-text-utils.[ch]:
[modest] / src / modest-ui-actions.c
index eaa9bc5..a175fb0 100644 (file)
@@ -1000,14 +1000,21 @@ modest_ui_actions_get_msgs_full_error_handler (ModestMailOperation *mail_op,
 {
        const GError *error;
        GObject *win = NULL;
-       const gchar *err_msg = (const gchar *) user_data;
 
        win = modest_mail_operation_get_source (mail_op);
        error = modest_mail_operation_get_error (mail_op);
 
        /* Show error */
-       if (err_msg)
-               modest_platform_run_information_dialog ((GtkWindow *) win, err_msg);
+       if (error->code == TNY_SYSTEM_ERROR_MEMORY ||
+           error->code == TNY_IO_ERROR_WRITE ||
+           error->code == TNY_IO_ERROR_READ) {
+               modest_platform_information_banner ((GtkWidget *) win, 
+                                                   NULL, dgettext("ke-recv", 
+                                                                  "cerm_device_memory_full"));
+       } else if (user_data) {
+               modest_platform_information_banner ((GtkWidget *) win, 
+                                                   NULL, user_data);
+       }
 
        if (win)
                g_object_unref (win);
@@ -3309,7 +3316,10 @@ modest_ui_actions_on_copy (GtkAction *action,
        focused_widget = gtk_window_get_focus (GTK_WINDOW (window));
 
        if (GTK_IS_LABEL (focused_widget)) {
-               gtk_clipboard_set_text (clipboard, gtk_label_get_text (GTK_LABEL (focused_widget)), -1);
+               gchar *selection;
+               selection = modest_text_utils_label_get_selection (GTK_LABEL (focused_widget));
+               gtk_clipboard_set_text (clipboard, selection, -1);
+               g_free (selection);
                gtk_clipboard_set_can_store (clipboard, NULL, 0);
                gtk_clipboard_store (clipboard);
        } else if (GTK_IS_EDITABLE (focused_widget)) {
@@ -4335,7 +4345,17 @@ folder_move_to_cb (ModestMailOperation *mail_op,
                   TnyFolder *new_folder,
                   gpointer user_data)
 {
+       GtkWidget *folder_view;
+       GObject *object;
+
+       object = modest_mail_operation_get_source (mail_op);
+       folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(object),
+                                                          MODEST_MAIN_WINDOW_WIDGET_TYPE_FOLDER_VIEW);
+       g_object_ref (folder_view);
+       g_object_unref (object);
        move_to_cb (mail_op, user_data);
+       modest_folder_view_select_folder (MODEST_FOLDER_VIEW (folder_view), new_folder, FALSE);
+       g_object_unref (folder_view);
 }
 
 static void
@@ -4463,6 +4483,7 @@ open_msg_for_purge_cb (ModestMailOperation *mail_op,
 
                                tny_iterator_next (iter);
                        }
+                       g_object_unref (iter);
                        
                        tny_msg_rewrite_cache (msg);
                }
@@ -4470,7 +4491,6 @@ open_msg_for_purge_cb (ModestMailOperation *mail_op,
                /* This string no longer exists, refer to NB#75415 for more info */
                /* modest_platform_information_banner (NULL, NULL, _("mail_ib_attachment_already_purged")); */
        }
-       g_object_unref (iter);
 
        modest_window_mgr_unregister_header (mgr, header);
 
@@ -4483,7 +4503,6 @@ modest_ui_actions_on_main_window_remove_attachments (GtkAction *action,
 {
        GtkWidget *header_view;
        TnyList *header_list;
-       TnyIterator *iter;
        TnyHeader *header;
        TnyHeaderFlags flags;
        ModestWindow *msg_view_window =  NULL;
@@ -4501,7 +4520,7 @@ modest_ui_actions_on_main_window_remove_attachments (GtkAction *action,
        }
        
        if (tny_list_get_length (header_list) == 1) {
-               iter = tny_list_create_iterator (header_list);
+               TnyIterator *iter = tny_list_create_iterator (header_list);
                header = TNY_HEADER (tny_iterator_get_current (iter));
                g_object_unref (iter);
        } else