#include <glib/gprintf.h>
#include <string.h>
#include <modest-runtime.h>
+#include <modest-defs.h>
#include <modest-tny-folder.h>
#include <modest-tny-msg.h>
#include <modest-tny-account.h>
if (!header_view) {
modest_platform_information_banner (NULL, NULL, _CS("ckdg_ib_nothing_to_sort"));
-
+
return;
}
/* Show sorting dialog */
- modest_utils_run_sort_dialog (GTK_WINDOW (window), MODEST_SORT_HEADERS);
+ modest_utils_run_sort_dialog (GTK_WINDOW (window), MODEST_SORT_HEADERS);
}
static void
&parent_folder);
if (result == GTK_RESPONSE_ACCEPT && parent_folder) {
- CreateFolderConnect *helper = (CreateFolderConnect *) g_slice_new0 (CreateFolderHelper);
+ CreateFolderConnect *helper = (CreateFolderConnect *) g_slice_new0 (CreateFolderConnect);
helper->folder_name = g_strdup (folder_name);
helper->parent = g_object_ref (parent_folder);
parent_folder = modest_folder_view_get_selected (MODEST_FOLDER_VIEW(folder_view));
#endif
- if (parent_folder)
+ if (parent_folder) {
do_create_folder (GTK_WINDOW (parent_window), parent_folder, NULL);
+ g_object_unref (parent_folder);
+ }
}
void
gint response,
gpointer user_data)
{
- GtkWidget *parent_win, *folder_view;
+ GtkWidget *parent_win;
MoveToInfo *helper = NULL;
+ ModestFolderView *folder_view;
helper = (MoveToInfo *) user_data;
parent_win = (GtkWidget *) helper->win;
- folder_view = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog),
- MODEST_MOVE_TO_DIALOG_FOLDER_VIEW));
+ folder_view = MODEST_FOLDER_VIEW (g_object_get_data (G_OBJECT (dialog),
+ MODEST_MOVE_TO_DIALOG_FOLDER_VIEW));
switch (response) {
TnyFolderStore *dst_folder;
case MODEST_GTK_RESPONSE_NEW_FOLDER:
- modest_ui_actions_create_folder (GTK_WIDGET (dialog), folder_view);
+ modest_ui_actions_create_folder (GTK_WIDGET (dialog), GTK_WIDGET (folder_view));
return;
case GTK_RESPONSE_NONE:
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
break;
case GTK_RESPONSE_OK:
- dst_folder = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (folder_view));
- /* Do window specific stuff */
+ dst_folder = modest_folder_view_get_selected (folder_view);
+
if (MODEST_IS_MAIN_WINDOW (parent_win)) {
+ /* Clean list to move used for filtering */
+ modest_folder_view_set_list_to_move (folder_view, NULL);
+
modest_ui_actions_on_main_window_move_to (NULL,
- folder_view,
+ GTK_WIDGET (folder_view),
dst_folder,
MODEST_MAIN_WINDOW (parent_win));
#ifdef MODEST_TOOLKIT_HILDON2
} else if (MODEST_IS_FOLDER_WINDOW (parent_win)) {
- modest_ui_actions_on_folder_window_move_to (folder_view,
+ /* Clean list to move used for filtering */
+ modest_folder_view_set_list_to_move (folder_view, NULL);
+
+ modest_ui_actions_on_folder_window_move_to (GTK_WIDGET (folder_view),
dst_folder,
helper->list,
GTK_WINDOW (parent_win));
return;
}
+ /* Clean list to move used for filtering */
+ modest_folder_view_set_list_to_move (folder_view, NULL);
+
/* Moving from headers window in edit mode */
modest_ui_actions_on_window_move_to (NULL, helper->list,
dst_folder,
static GtkWidget*
create_move_to_dialog (GtkWindow *win,
- GtkWidget *folder_view)
+ GtkWidget *folder_view,
+ TnyList *list_to_move)
{
GtkWidget *dialog, *tree_view = NULL;
/* Hide special folders */
modest_folder_view_show_non_move_folders (MODEST_FOLDER_VIEW (tree_view), FALSE);
+ if (list_to_move)
+ modest_folder_view_set_list_to_move (MODEST_FOLDER_VIEW (tree_view), list_to_move);
#ifndef MODEST_TOOLKIT_HILDON2
modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (tree_view));
#endif
}
/* Create and run the dialog */
- dialog = create_move_to_dialog (GTK_WINDOW (win), NULL);
+ dialog = create_move_to_dialog (GTK_WINDOW (win), NULL, list_to_move);
modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
GTK_WINDOW (dialog),
(GtkWindow *) win);