* Fix build typos
[modest] / src / modest-ui-actions.c
index 7712173..b36b855 100644 (file)
@@ -1854,7 +1854,7 @@ modest_ui_actions_on_sort (GtkAction *action,
                }
 
                /* Show sorting dialog */
-               modest_platform_run_sort_dialog (GTK_WINDOW (window), MODEST_SORT_HEADERS);     
+               modest_utils_run_sort_dialog (GTK_WINDOW (window), MODEST_SORT_HEADERS);        
        }
 }
 
@@ -2367,11 +2367,16 @@ modest_ui_actions_on_folder_selection_changed (ModestFolderView *folder_view,
                }
        } else {
                if (TNY_IS_FOLDER (folder_store) && selected) {
-                       
+                       TnyAccount *account;
+                       const gchar *account_name = NULL;
+                       gboolean refresh;
+
                        /* Update the active account */
-                       TnyAccount *account = modest_tny_folder_get_account (TNY_FOLDER (folder_store));
+                       account = modest_tny_folder_get_account (TNY_FOLDER (folder_store));
                        if (account) {
                                set_active_account_from_tny_account (account, MODEST_WINDOW (main_window));
+                               account_name = 
+                                       modest_tny_account_get_parent_modest_account_name_for_server_account (account);
                                g_object_unref (account);
                                account = NULL;
                        }
@@ -2382,6 +2387,8 @@ modest_ui_actions_on_folder_selection_changed (ModestFolderView *folder_view,
                        modest_main_window_set_contents_style (main_window, 
                                                               MODEST_MAIN_WINDOW_CONTENTS_STYLE_HEADERS);
 
+                       refresh = !modest_account_mgr_account_is_busy (modest_runtime_get_account_mgr (), account_name);
+
                        /* Set folder on header view. This function
                           will call tny_folder_refresh_async so we
                           pass a callback that will be called when
@@ -2389,6 +2396,7 @@ modest_ui_actions_on_folder_selection_changed (ModestFolderView *folder_view,
                           empty view if there are no messages */
                        modest_header_view_set_folder (MODEST_HEADER_VIEW(header_view),
                                                       TNY_FOLDER (folder_store),
+                                                      refresh,
                                                       folder_refreshed_cb,
                                                       main_window);
                        
@@ -4393,8 +4401,13 @@ on_move_to_dialog_folder_selection_changed (ModestFolderView* self,
                return;
 
        children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area));
+#ifdef MODEST_PLATFORM_MAEMO
        ok_button = GTK_WIDGET (children->next->next->data);
        new_button = GTK_WIDGET (children->next->data);
+#else
+       ok_button = GTK_WIDGET (children->data);
+       new_button = GTK_WIDGET (children->next->next->data);
+#endif
        g_list_free (children);
 
        /* check if folder_store is an remote account */
@@ -4525,18 +4538,33 @@ create_move_to_dialog (GtkWindow *win,
 {
        GtkWidget *dialog, *scroll;
        GtkWidget *new_button;
+#ifndef MODEST_PLATFORM_MAEMO
+       GtkWidget *folder_view_label;
+#endif
 
        dialog = gtk_dialog_new_with_buttons (_("mcen_ti_moveto_folders_title"),
                                              GTK_WINDOW (win),
                                              GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT,
                                              NULL);
 
+#ifdef MODEST_PLATFORM_MAEMO
        gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_ok"), GTK_RESPONSE_ACCEPT);
        /* We do this manually so GTK+ does not associate a response ID for
         * the button. */
        new_button = gtk_button_new_from_stock (_("mcen_bd_new"));
        gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->action_area), new_button, FALSE, FALSE, 0);
        gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_cancel"), GTK_RESPONSE_REJECT);
+#else
+       /* We do this manually so GTK+ does not associate a response ID for
+        * the button. */
+       new_button = gtk_button_new_with_label (_("mcen_ti_new_folder"));
+       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), new_button, FALSE, FALSE, 0);
+       gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (GTK_DIALOG (dialog)->action_area), new_button, TRUE);
+       gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
+       gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_ACCEPT);
+       gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
+       gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 24);
+#endif
 
        /* Create scrolled window */
        scroll = gtk_scrolled_window_new (NULL, NULL);
@@ -4544,6 +4572,10 @@ create_move_to_dialog (GtkWindow *win,
                                         GTK_POLICY_AUTOMATIC,
                                         GTK_POLICY_AUTOMATIC);
 
+#ifndef MODEST_PLATFORM_MAEMO
+       gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
+#endif
+
        /* Create folder view */
        *tree_view = modest_platform_create_folder_view (NULL);
 
@@ -4623,7 +4655,11 @@ create_move_to_dialog (GtkWindow *win,
                            scroll, TRUE, TRUE, 0);
 
        gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox));
+#ifdef MODEST_PLATFORM_MAEMO
        gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 300);
+#else
+       gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 400);
+#endif
 
        return dialog;
 }
@@ -4856,7 +4892,9 @@ open_msg_for_purge_cb (ModestMailOperation *mail_op,
                response = modest_platform_run_confirmation_dialog (GTK_WINDOW (win),_("mcen_nc_purge_file_text_inbox"));
 
                if (response == GTK_RESPONSE_OK) {
-                       modest_platform_information_banner (NULL, NULL, _("mcen_ib_removing_attachment"));
+                       GtkWidget *info;
+                       info =
+                               modest_platform_animation_banner (GTK_WIDGET (win), NULL, _("mcen_ib_removing_attachment"));
                        iter = tny_list_create_iterator (parts);
                        while (!tny_iterator_is_done (iter)) {
                                TnyMimePart *part;
@@ -4873,10 +4911,9 @@ open_msg_for_purge_cb (ModestMailOperation *mail_op,
                        g_object_unref (iter);
                        
                        tny_msg_rewrite_cache (msg);
+
+                       gtk_widget_destroy (info);
                }
-     /* } else { */
-               /* This string no longer exists, refer to NB#75415 for more info */
-               /* modest_platform_information_banner (NULL, NULL, _("mail_ib_attachment_already_purged")); */
        }
 
        modest_window_mgr_unregister_header (mgr, header);
@@ -5859,9 +5896,12 @@ modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
        TnyTransportAccount *server_account;
        gchar *message = NULL;
 
-       /* Don't show anything if the user cancelled something or the send receive request is not
-        * interactive */
+       /* Don't show anything if the user cancelled something or the
+        * send receive request is not interactive. Authentication
+        * errors are managed by the account store so no need to show
+        * a dialog here again */
        if (err->code == TNY_SYSTEM_ERROR_CANCEL ||
+           err->code == TNY_SERVICE_ERROR_AUTHENTICATE ||
            !modest_tny_send_queue_get_requested_send_receive (MODEST_TNY_SEND_QUEUE (self)))
                return;
 
@@ -5879,9 +5919,6 @@ modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
        case TNY_SERVICE_ERROR_CONNECT:
                message = g_strdup_printf (_("emev_ib_ui_smtp_server_invalid"), server_name);
                break;
-       case TNY_SERVICE_ERROR_AUTHENTICATE:
-               message = g_strdup_printf (_("emev_ni_ui_smtp_authentication_fail_error"), server_name);
-               break;
        case TNY_SERVICE_ERROR_SEND:
                message = g_strdup (dgettext("hildon-common-strings", "sfil_ib_unable_to_send"));
                break;
@@ -5894,10 +5931,6 @@ modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
                message = g_strdup (dgettext("hildon-common-strings", "sfil_ib_unable_to_send"));
                break;  
        }
-       
-       /* TODO if the username or the password where not defined we
-          should show the Accounts Settings dialog or the Connection
-          specific SMTP server window */
 
        modest_platform_run_information_dialog (NULL, message, FALSE);
        g_free (message);