{
TnyAccountStoreViewIface *klass = (TnyAccountStoreViewIface *)g;
- klass->set_account_store_func = modest_folder_view_set_account_store;
-
- return;
+ klass->set_account_store = modest_folder_view_set_account_store;
}
static void
}
if (priv->cur_folder_store) {
- if (TNY_IS_FOLDER(priv->cur_folder_store))
- tny_folder_sync (TNY_FOLDER(priv->cur_folder_store), FALSE, NULL);
+ if (TNY_IS_FOLDER(priv->cur_folder_store)) {
+ ModestMailOperation *mail_op;
+
+ mail_op = modest_mail_operation_new (NULL);
+ modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
+ mail_op);
+ modest_mail_operation_sync_folder (mail_op, TNY_FOLDER (priv->cur_folder_store), FALSE);
+ }
g_object_unref (priv->cur_folder_store);
priv->cur_folder_store = NULL;
my_window = gtk_widget_get_ancestor (GTK_WIDGET (user_data), MODEST_TYPE_WINDOW);
acc_name = modest_tny_account_get_parent_modest_account_name_for_server_account (self);
- modest_ui_actions_do_send_receive (acc_name, MODEST_WINDOW (my_window));
+ modest_ui_actions_do_send_receive (acc_name, FALSE, MODEST_WINDOW (my_window));
}
}
/* FIXME: the local accounts are not shown when the query
selects only the subscribed folders */
- model = tny_gtk_folder_store_tree_model_new (NULL);
+ model = tny_gtk_folder_store_tree_model_new (NULL);
/* Get the accounts: */
tny_account_store_get_accounts (TNY_ACCOUNT_STORE(account_store),
selected = gtk_tree_selection_get_selected (sel, &model, &iter);
- /* Notify the display name observers */
- /* TODO: this is redundant, and it's only required because we sometimes lose the focus of the folder
- view */
- g_signal_emit (G_OBJECT(user_data),
- signals[FOLDER_DISPLAY_NAME_CHANGED_SIGNAL], 0,
- NULL);
-
tree_view = MODEST_FOLDER_VIEW (user_data);
if (selected) {
TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN, &parent_folder,
-1);
if ((parent_type == TNY_FOLDER_TYPE_ROOT) &&
- TNY_IS_ACCOUNT (parent_folder) &&
- modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (parent_folder))) {
- cmp1 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_or_mmc_folder_type
- (TNY_FOLDER (folder1)));
- cmp2 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_or_mmc_folder_type
- (TNY_FOLDER (folder2)));
+ TNY_IS_ACCOUNT (parent_folder)) {
+ if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (parent_folder))) {
+ cmp1 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_or_mmc_folder_type
+ (TNY_FOLDER (folder1)));
+ cmp2 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_or_mmc_folder_type
+ (TNY_FOLDER (folder2)));
+ } else if (modest_tny_account_is_memory_card_account (TNY_ACCOUNT (parent_folder))) {
+ if (modest_local_folder_info_get_type (tny_folder_get_name (TNY_FOLDER (folder1))) == TNY_FOLDER_TYPE_ARCHIVE) {
+ cmp1 = 0;
+ cmp2 = 1;
+ } else if (modest_local_folder_info_get_type (tny_folder_get_name (TNY_FOLDER (folder2))) == TNY_FOLDER_TYPE_ARCHIVE) {
+ cmp1 = 1;
+ cmp2 = 0;
+ }
+ }
}
g_object_unref (parent_folder);
}
g_slice_free (DndHelper, helper);
}
-/*
- * This function is the callback of the
- * modest_mail_operation_xfer_msgs () and
- * modest_mail_operation_xfer_folder() calls. We check here if the
- * message/folder was correctly asynchronously transferred. The reason
- * to use the same callback is that the code is the same, it only has
- * to check that the operation went fine and then finalize the drag
- * and drop action
- */
static void
xfer_cb (ModestMailOperation *mail_op,
gpointer user_data)
dnd_helper_destroyer (helper);
}
+static void
+xfer_msgs_cb (ModestMailOperation *mail_op,
+ gpointer user_data)
+{
+ /* Common part */
+ xfer_cb (mail_op, user_data);
+}
+
+static void
+xfer_folder_cb (ModestMailOperation *mail_op,
+ TnyFolder *new_folder,
+ gpointer user_data)
+{
+ DndHelper *helper;
+ GtkWidget *folder_view;
+
+ helper = (DndHelper *) user_data;
+ folder_view = g_object_ref (helper->folder_view);
+
+ /* Common part */
+ xfer_cb (mail_op, user_data);
+
+ /* Select the folder */
+ if (new_folder)
+ modest_folder_view_select_folder (MODEST_FOLDER_VIEW (folder_view),
+ new_folder, FALSE);
+ g_object_unref (folder_view);
+}
+
+
/* get the folder for the row the treepath refers to. */
/* folder must be unref'd */
static TnyFolderStore *
headers,
folder,
helper->delete_source,
- xfer_cb, helper);
+ xfer_msgs_cb, helper);
/* Frees */
cleanup:
TNY_FOLDER (info->src_folder),
info->dst_folder,
info->helper->delete_source,
- xfer_cb,
+ xfer_folder_cb,
info->helper);
- modest_folder_view_select_folder (MODEST_FOLDER_VIEW(info->folder_view),
- TNY_FOLDER (info->dst_folder), TRUE);
+/* modest_folder_view_select_folder (MODEST_FOLDER_VIEW(info->folder_view), */
+/* TNY_FOLDER (info->dst_folder), TRUE); */
g_object_unref (G_OBJECT (mail_op));
}
}
/* Connect to source folder and perform the copy/move */
- modest_platform_connect_if_remote_and_perform (NULL,
+ modest_platform_connect_if_remote_and_perform (NULL, TRUE,
info->src_folder,
drag_and_drop_from_folder_view_src_folder_performer,
info);
info->helper = helper;
/* Connect to the destination folder and perform the copy/move */
- modest_platform_connect_if_remote_and_perform (GTK_WINDOW (win),
+ modest_platform_connect_if_remote_and_perform (GTK_WINDOW (win), TRUE,
dest_folder,
drag_and_drop_from_folder_view_dst_folder_performer,
info);
static void
-on_row_inserted_maybe_select_folder (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter,
+on_row_inserted_maybe_select_folder (GtkTreeModel *tree_model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
ModestFolderView *self)
{
ModestFolderViewPrivate *priv = NULL;
/* Disable next */
modest_folder_view_disable_next_folder_selection (self);
-/* g_object_unref (priv->folder_to_select); */
-/* priv->folder_to_select = NULL; */
/* Refilter the model */
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (tree_model));