Hide local folders on browsing a remote folder in move to dialog
authorJose Dapena Paz <jdapena@igalia.com>
Mon, 23 Feb 2009 12:41:51 +0000 (12:41 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Mon, 23 Feb 2009 12:41:51 +0000 (12:41 +0000)
pmo-trunk-r7637

src/hildon2/modest-platform.c
src/widgets/modest-folder-view.c
src/widgets/modest-folder-view.h

index 51c3276..ce6fd08 100644 (file)
@@ -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);
index 1cb1465..d4fadda 100644 (file)
@@ -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 */
index 36ecc51..80d2c02 100644 (file)
@@ -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;