Added bug 90185 to changelog
[modest] / src / modest-ui-actions.c
index 6e4e532..b0a7961 100644 (file)
@@ -529,11 +529,11 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win)
                        }
 
                        /* Free */
-                       if (next_row_reference != NULL) 
+                       if (gtk_tree_row_reference_valid (next_row_reference)) 
                                gtk_tree_row_reference_free (next_row_reference);
                        if (next_path != NULL) 
                                gtk_tree_path_free (next_path);                         
-                       if (prev_row_reference != NULL) 
+                       if (gtk_tree_row_reference_valid (prev_row_reference)) 
                                gtk_tree_row_reference_free (prev_row_reference);
                        if (prev_path != NULL) 
                                gtk_tree_path_free (prev_path);
@@ -821,6 +821,19 @@ 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);
+                       if (!subject)
+                               subject = g_strdup (_("mail_va_no_subject"));
+                       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);
@@ -2502,7 +2515,7 @@ modest_ui_actions_on_msg_link_hover (ModestMsgView *msgview, const gchar* link,
                                     ModestWindow *win)
 {
        /* g_message ("%s %s", __FUNCTION__, link); */
-}      
+}
 
 
 void
@@ -2522,7 +2535,7 @@ modest_ui_actions_on_msg_link_contextual (ModestMsgView *msgview, const gchar* l
 void
 modest_ui_actions_on_msg_attachment_clicked (ModestMsgView *msgview, TnyMimePart *mime_part,
                                             ModestWindow *win)
-{              
+{
        /* we check for low-mem; in that case, show a warning, and don't allow
         * viewing attachments
         */
@@ -3209,6 +3222,11 @@ modest_ui_actions_rename_folder_error_handler (ModestMailOperation *mail_op,
        case MODEST_MAIL_OPERATION_ERROR_FOLDER_EXISTS:
                message = _CS("ckdg_ib_folder_already_exists");
                break;
+       case TNY_SERVICE_ERROR_STATE:
+               /* This means that the folder is already in use (a
+                  message is opened for example */
+               message = _("emev_ni_internal_error");
+               break;
        default:
                message = _("emev_ib_ui_imap_unable_to_rename");
        }
@@ -4752,7 +4770,8 @@ move_to_cb (ModestMailOperation *mail_op,
                                /* 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) {
+               } else if (MODEST_IS_MAIN_WINDOW (object) && 
+                          gtk_tree_row_reference_valid (helper->reference)) {
                        GtkWidget *header_view;
                        GtkTreePath *path;
                        GtkTreeSelection *sel;
@@ -4774,7 +4793,7 @@ move_to_cb (ModestMailOperation *mail_op,
        /* Close the "Pasting" information banner */
        gtk_widget_destroy (GTK_WIDGET(helper->banner));
        g_object_unref (helper->banner);
-       if (helper->reference != NULL)
+       if (gtk_tree_row_reference_valid (helper->reference))
                gtk_tree_row_reference_free (helper->reference);
        g_free (helper);
 }
@@ -4970,7 +4989,7 @@ modest_ui_actions_on_main_window_remove_attachments (GtkAction *action,
                                                                         NULL, NULL);
                modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
                modest_mail_operation_get_msg (mail_op, header, FALSE, open_msg_for_purge_cb, win);
-               
+
                g_object_unref (mail_op);
        }
        if (header)
@@ -5425,7 +5444,7 @@ modest_ui_actions_on_move_to (GtkAction *action,
        /* Create and run the dialog */
        dialog = create_move_to_dialog (GTK_WINDOW (win), folder_view, &tree_view);
        modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (tree_view));
-       gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (dialog));
        result = gtk_dialog_run (GTK_DIALOG(dialog));
        g_object_ref (tree_view);
        gtk_widget_destroy (dialog);
@@ -5975,6 +5994,8 @@ modest_ui_actions_on_send_queue_status_changed (ModestTnySendQueue *send_queue,
        /* 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);
+       modest_window_check_dimming_rules_group (MODEST_WINDOW (main_window), 
+                                                MODEST_DIMMING_RULES_MENU);
        
        /* Free */
  frees: