* Renamed a function
[modest] / src / modest-ui-actions.c
index 672ba2c..7dba805 100644 (file)
@@ -143,11 +143,11 @@ static gboolean
 download_uncached_messages (TnyList *header_list, GtkWindow *win);
 
 
-static gint
+/*static gint
 msgs_move_to_confirmation (GtkWindow *win,
                           TnyFolder *dest_folder,
                           gboolean delete,
-                          TnyList *headers);
+                          TnyList *headers);*/
 
 
 /* Show the account creation wizard dialog.
@@ -164,9 +164,17 @@ modest_run_account_setup_wizard (ModestWindow *win)
                
        g_return_val_if_fail (MODEST_IS_WINDOW(win), FALSE);
        
-       wizard = modest_easysetup_wizard_dialog_new ();
+       wizard = modest_easysetup_wizard_dialog_new_or_present ();
+
+       /* if wizard == NULL it means there is already a easy setup thingy running;
+        * in that case, don't do anything here; the call above will present it instead */
+       if (!wizard) {
+               g_message ("%s: easysetup wizard already running", __FUNCTION__);
+               return FALSE;
+       }
+
        gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win));
-       
+
        /* Don't make this a modal window, because secondary windows will then 
         * be unusable, freezing the UI: */
        /* gtk_window_set_modal (GTK_WINDOW (wizard), TRUE); */
@@ -395,7 +403,6 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win)
                                           tny_list_get_length(header_list)), desc);
 
        /* Confirmation dialog */
-       printf("DEBUG: %s\n", __FUNCTION__);    
        response = modest_platform_run_confirmation_dialog (GTK_WINDOW (win),
                                                            message);
        
@@ -1774,8 +1781,8 @@ folder_refreshed_cb (ModestMailOperation *mail_op,
        ModestMainWindow *win = NULL;
        GtkWidget *header_view;
        TnyFolder *current_folder;
-       gboolean folder_empty = TRUE;
-       gboolean all_marked_as_deleted = TRUE;
+       gboolean folder_empty = FALSE;
+       gboolean all_marked_as_deleted = FALSE;
 
        g_return_if_fail (TNY_IS_FOLDER (folder));
 
@@ -2081,7 +2088,7 @@ modest_ui_actions_on_send (GtkWidget *widget, ModestMsgEditWindow *edit_window)
        
        gchar *from = modest_account_mgr_get_from_string (account_mgr, account_name);
 
-       modest_platform_information_banner (NULL, NULL, _("mcen_ib_outbox_waiting_to_be_sent"));
+/*     modest_platform_information_banner (NULL, NULL, _("mcen_ib_outbox_waiting_to_be_sent")); */
 
        /* Create the mail operation */
        ModestMailOperation *mail_operation = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_SEND, G_OBJECT(edit_window));
@@ -2415,10 +2422,14 @@ modest_ui_actions_on_rename_folder (GtkAction *action,
                gchar *folder_name;
                gint response;
                const gchar *current_name;
+               TnyFolderStore *parent;
 
                current_name = tny_folder_get_name (TNY_FOLDER (folder));
-               response = modest_platform_run_rename_folder_dialog (GTK_WINDOW (main_window), NULL,
-                                                                    current_name, &folder_name);
+               parent = tny_folder_get_folder_store (TNY_FOLDER (folder));
+               response = modest_platform_run_rename_folder_dialog (GTK_WINDOW (main_window), 
+                                                                    parent, current_name, 
+                                                                    &folder_name);
+               g_object_unref (parent);
 
                if (response == GTK_RESPONSE_ACCEPT && strlen (folder_name) > 0) {
                        ModestMailOperation *mail_op;
@@ -3408,6 +3419,7 @@ create_move_to_dialog (GtkWindow *win,
 
        /* Create folder view */
        *tree_view = modest_platform_create_folder_view (NULL);
+/*     *tree_view = modest_folder_view_new (NULL); */
 
        g_signal_connect (G_OBJECT (new_button), "clicked", G_CALLBACK(create_move_to_dialog_on_new_folder), *tree_view);
 
@@ -3415,13 +3427,14 @@ create_move_to_dialog (GtkWindow *win,
           window (msg window for example) after the main window was
           closed, so we can not just get the model of the folder
           view */
-       if (MODEST_IS_FOLDER_VIEW (folder_view))
-               gtk_tree_view_set_model (GTK_TREE_VIEW (*tree_view),
-                                        gtk_tree_view_get_model (GTK_TREE_VIEW (folder_view)));
-       else
+       if (MODEST_IS_FOLDER_VIEW (folder_view)) {
+               modest_folder_view_copy_model (MODEST_FOLDER_VIEW(folder_view), 
+                                              MODEST_FOLDER_VIEW(*tree_view));
+       } else
                modest_folder_view_update_model (MODEST_FOLDER_VIEW (*tree_view), 
                                                 TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
 
+       /* Hide special folders */
        modest_folder_view_show_non_move_folders (MODEST_FOLDER_VIEW (*tree_view), FALSE);
        
        gtk_container_add (GTK_CONTAINER (scroll), *tree_view);
@@ -3478,7 +3491,7 @@ has_retrieved_msgs (TnyList *list)
  * response. If it's other kind of movement the it always returns
  * GTK_RESPONSE_OK
  */
-static gint
+gint
 msgs_move_to_confirmation (GtkWindow *win,
                           TnyFolder *dest_folder,
                           gboolean delete,
@@ -3816,7 +3829,6 @@ modest_ui_actions_xfer_messages_from_move_to (TnyFolderStore *dst_folder,
        g_object_unref (headers);
 }
 
-
 /*
  * UI handler for the "Move to" action when invoked from the
  * ModestMainWindow