From 400e4b174bc6310f6d61b404403b0eb01ef557a7 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 23 Feb 2009 12:41:51 +0000 Subject: [PATCH] Hide local folders on browsing a remote folder in move to dialog pmo-trunk-r7637 --- src/hildon2/modest-platform.c | 6 ++++++ src/widgets/modest-folder-view.c | 5 +++++ src/widgets/modest-folder-view.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 51c3276..ce6fd08 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -2451,6 +2451,7 @@ move_to_dialog_show_accounts (GtkWidget *dialog) modest_folder_view_show_non_move_folders (MODEST_FOLDER_VIEW (folder_view), TRUE); modest_folder_view_set_style (MODEST_FOLDER_VIEW (folder_view), MODEST_FOLDER_VIEW_STYLE_SHOW_ALL); modest_folder_view_set_filter (MODEST_FOLDER_VIEW (folder_view), MODEST_FOLDER_VIEW_FILTER_HIDE_FOLDERS); + modest_folder_view_unset_filter (MODEST_FOLDER_VIEW (folder_view), MODEST_FOLDER_VIEW_FILTER_HIDE_LOCAL_FOLDERS); hildon_pannable_area_jump_to (HILDON_PANNABLE_AREA (pannable), 0, 0); g_object_set_data (G_OBJECT (dialog), MOVE_TO_DIALOG_SHOWING_FOLDERS, GINT_TO_POINTER (FALSE)); @@ -2478,10 +2479,15 @@ move_to_dialog_show_folders (GtkWidget *dialog, TnyFolderStore *folder_store) if (modest_tny_account_is_virtual_local_folders (account)) { account_id = ""; selection_label_text = g_strconcat (_("TODO: local folders"), "/", NULL); + } else if (modest_tny_account_is_memory_card_account (account)) { + account_id = ""; + selection_label_text = g_strconcat (_("TODO: MMC ACCOUNT"), "/", NULL); } else { account_id = tny_account_get_id (account); selection_label_text = g_strconcat (tny_account_get_name (account), "/", NULL); + modest_folder_view_set_filter (MODEST_FOLDER_VIEW (folder_view), + MODEST_FOLDER_VIEW_FILTER_HIDE_LOCAL_FOLDERS); } gtk_label_set_text (GTK_LABEL (selection_label), selection_label_text); g_free (selection_label_text); diff --git a/src/widgets/modest-folder-view.c b/src/widgets/modest-folder-view.c index 1cb1465..d4fadda 100644 --- a/src/widgets/modest-folder-view.c +++ b/src/widgets/modest-folder-view.c @@ -1960,6 +1960,11 @@ filter_row (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) return FALSE; } + if (retval && (priv->filter & MODEST_FOLDER_VIEW_FILTER_HIDE_LOCAL_FOLDERS)) { + if (TNY_IS_FOLDER (instance) && !modest_tny_folder_store_is_remote (TNY_FOLDER_STORE (instance))) + return FALSE; + } + if (retval && (priv->filter & MODEST_FOLDER_VIEW_FILTER_CAN_HAVE_FOLDERS)) { if (TNY_IS_FOLDER (instance)) { /* Check folder rules */ diff --git a/src/widgets/modest-folder-view.h b/src/widgets/modest-folder-view.h index 36ecc51..80d2c02 100644 --- a/src/widgets/modest-folder-view.h +++ b/src/widgets/modest-folder-view.h @@ -65,6 +65,7 @@ typedef enum _ModestFolderViewFilter { MODEST_FOLDER_VIEW_FILTER_DELETABLE = 1 << 4, MODEST_FOLDER_VIEW_FILTER_HIDE_ACCOUNTS = 1 << 5, MODEST_FOLDER_VIEW_FILTER_HIDE_FOLDERS = 1 << 6, + MODEST_FOLDER_VIEW_FILTER_HIDE_LOCAL_FOLDERS = 1 << 7, } ModestFolderViewFilter; typedef struct _ModestFolderView ModestFolderView; -- 1.7.9.5