* Reverted previous fix
[modest] / src / modest-ui-actions.c
index 4667e39..614ba87 100644 (file)
@@ -217,10 +217,17 @@ modest_ui_actions_run_account_setup_wizard (ModestWindow *win)
                win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(),
                                                         TRUE);  /* create if not existent */
        
-       /* make sure the mainwindow is visible */
        gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win));
-       gtk_widget_show_all (GTK_WIDGET(win));
-       gtk_window_present (GTK_WINDOW(win));
+
+       /* make sure the mainwindow is visible. We need to present the
+          wizard again to give it the focus back. show_all are needed
+          in order to get the widgets properly drawn (MainWindow main
+          paned won't be in its right position and the dialog will be
+          missplaced */
+       gtk_widget_show_all (GTK_WIDGET (win));
+       gtk_widget_show_all (GTK_WIDGET (wizard));
+       gtk_window_present (GTK_WINDOW (win));
+       gtk_window_present (GTK_WINDOW (wizard));
        
        dialog_response = gtk_dialog_run (GTK_DIALOG (wizard));
        gtk_widget_destroy (GTK_WIDGET (wizard));
@@ -514,7 +521,6 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win)
 
                        /* Select next or previous row */
                        if (gtk_tree_row_reference_valid (next_row_reference)) {
-/*                             next_path = gtk_tree_row_reference_get_path (row_reference); */
                                gtk_tree_selection_select_path (sel, next_path);
                        }
                        else if (gtk_tree_row_reference_valid (prev_row_reference)) {                           
@@ -533,8 +539,10 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win)
                }
                
                /* Update toolbar dimming state */
-               if (main_window)
+               if (main_window) {
+                       modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (main_window));
                        modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (main_window));
+               }
 
                /* Free */
                g_list_foreach (sel_list, (GFunc) gtk_tree_path_free, NULL);
@@ -1074,7 +1082,8 @@ modest_ui_actions_disk_operations_error_handler (ModestMailOperation *mail_op,
                } else if (error->code == TNY_SYSTEM_ERROR_MEMORY) {
                        modest_platform_information_banner ((GtkWidget *) win,
                                                            NULL, _("emev_ui_imap_inbox_select_error"));
-               } else if (error->code == MODEST_MAIL_OPERATION_ERROR_FILE_IO) {
+               } else if (error->domain == MODEST_MAIL_OPERATION_ERROR &&
+                          error->code == MODEST_MAIL_OPERATION_ERROR_FILE_IO) {
                        modest_platform_information_banner ((GtkWidget *) win,
                                                            NULL, dgettext ("hildon-common-strings", "sfil_ni_unable_to_open_file_not_found"));
                } else if (user_data) {
@@ -2873,7 +2882,8 @@ modest_ui_actions_on_send (GtkWidget *widget, ModestMsgEditWindow *edit_window)
 
        if (modest_mail_operation_get_error (mail_operation) != NULL) {
                const GError *error = modest_mail_operation_get_error (mail_operation);
-               if (error->code == MODEST_MAIL_OPERATION_ERROR_INSTANCE_CREATION_FAILED) {
+               if (error->domain == MODEST_MAIL_OPERATION_ERROR &&
+                   error->code == MODEST_MAIL_OPERATION_ERROR_INSTANCE_CREATION_FAILED) {
                        g_warning ("%s failed: %s\n", __FUNCTION__, (modest_mail_operation_get_error (mail_operation))->message);
                        modest_platform_information_banner (NULL, NULL, _CS("sfil_ni_not_enough_memory"));
                        had_error = TRUE;
@@ -3196,16 +3206,15 @@ modest_ui_actions_rename_folder_error_handler (ModestMailOperation *mail_op,
        if (!error)
                g_return_if_reached ();
 
-       switch (error->code) {
-       case MODEST_MAIL_OPERATION_ERROR_FOLDER_EXISTS:
+       if (error->domain == MODEST_MAIL_OPERATION_ERROR &&
+           error->code == MODEST_MAIL_OPERATION_ERROR_FOLDER_EXISTS) {
                message = _CS("ckdg_ib_folder_already_exists");
-               break;
-       case TNY_SERVICE_ERROR_STATE:
+       } else if (error->domain == TNY_ERROR_DOMAIN &&
+                  error->code == 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:
+       } else {
                message = _("emev_ib_ui_imap_unable_to_rename");
        }
 
@@ -4067,9 +4076,9 @@ modest_ui_actions_on_select_all (GtkAction *action,
                /* Set focuse on header view */
                gtk_widget_grab_focus (header_view);
 
-
                /* Enable window dimming management */
                modest_window_enable_dimming (MODEST_WINDOW(window));
+               modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (window));
                modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (window));
        }