+#ifdef MODEST_TOOLKIT_HILDON2
+/*
+ * UI handler for the "Move to" action when invoked from the
+ * ModestFolderWindow
+ */
+static void
+modest_ui_actions_on_folder_window_move_to (GtkWidget *folder_view,
+ TnyFolderStore *dst_folder,
+ TnyList *selection,
+ GtkWindow *win)
+{
+ TnyFolderStore *src_folder = NULL;
+ TnyIterator *iterator;
+
+ if (tny_list_get_length (selection) != 1)
+ return;
+
+ iterator = tny_list_create_iterator (selection);
+ src_folder = TNY_FOLDER_STORE (tny_iterator_get_current (iterator));
+ g_object_unref (iterator);
+
+
+ gboolean do_xfer = TRUE;
+
+ /* Allow only to transfer folders to the local root folder */
+ if (TNY_IS_ACCOUNT (dst_folder) &&
+ !MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (dst_folder) &&
+ !modest_tny_account_is_memory_card_account (TNY_ACCOUNT (dst_folder))) {
+ do_xfer = FALSE;
+ /* Show an error */
+ modest_platform_run_information_dialog (win,
+ _("mail_in_ui_folder_move_target_error"),
+ FALSE);
+ } else if (!TNY_IS_FOLDER (src_folder)) {
+ g_warning ("%s: src_folder is not a TnyFolder.\n", __FUNCTION__);
+ do_xfer = FALSE;
+ }
+
+ if (do_xfer) {
+ MoveFolderInfo *info = g_new0 (MoveFolderInfo, 1);
+ DoubleConnectionInfo *connect_info = g_slice_new (DoubleConnectionInfo);
+
+ info->src_folder = g_object_ref (src_folder);
+ info->dst_folder = g_object_ref (dst_folder);
+ info->delete_original = TRUE;
+ info->folder_view = folder_view;
+
+ connect_info->callback = on_move_folder_cb;
+ connect_info->dst_account = get_account_from_folder_store (TNY_FOLDER_STORE (dst_folder));
+ connect_info->data = info;
+
+ modest_platform_double_connect_and_perform(GTK_WINDOW (win), TRUE,
+ TNY_FOLDER_STORE (src_folder),
+ connect_info);
+ }
+
+ /* Frees */
+ g_object_unref (src_folder);
+}
+#endif
+