- /* Check pop and MMC accounts */
- if (!result) {
- result = _selected_folder_is_MMC_or_POP_root (win);
- }
-
- return result;
-}
-
-static gboolean
-_selected_folder_is_MMC_or_POP_root (ModestMainWindow *win)
-{
- GtkWidget *folder_view = NULL;
- TnyFolderStore *parent_folder = NULL;
- gboolean result = FALSE;
-
- folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(win),
- MODEST_MAIN_WINDOW_WIDGET_TYPE_FOLDER_VIEW);
- if (!folder_view)
- return FALSE;
-
- /* Get selected folder as parent of new folder to create */
- parent_folder = modest_folder_view_get_selected (MODEST_FOLDER_VIEW(folder_view));
- if (!parent_folder)
- return TRUE;
-
- if (TNY_IS_ACCOUNT (parent_folder)) {
- /* If it's the local account then do not dim */
- if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (parent_folder))) {
- result = FALSE;
- } else {
- /* If it's the MMC root folder then dim it */
- if (!strcmp (tny_account_get_id (TNY_ACCOUNT (parent_folder)), MODEST_MMC_ACCOUNT_ID)) {
- result = TRUE;
- } else {
- const gchar *proto_str = tny_account_get_proto (TNY_ACCOUNT (parent_folder));
- /* If it's POP then dim */
- result = (modest_protocol_info_get_transport_store_protocol (proto_str) ==
- MODEST_PROTOCOL_STORE_POP) ? TRUE : FALSE;
- }
- }
- }
- g_object_unref (parent_folder);
-