From 1fc74b1bc1eeb2a64a26747e815c12f4bcf4598e Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 12 Jul 2007 15:00:58 +0000 Subject: [PATCH] 2007-07-12 Murray Cumming * src/modest-ui-dimming-rules.c: (_selected_folder_is_root): Add a short-cut, by checking if the folder store is an account. This ensures that the Sort menu item and toolbar is dimmed for the local-folders account root item, fixing projects.maemo.org bug NB#62545. pmo-trunk-r2730 --- ChangeLog2 | 8 ++++++++ src/modest-ui-dimming-rules.c | 19 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index 11cbbce..77c7839 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,13 @@ 2007-07-12 Murray Cumming + * src/modest-ui-dimming-rules.c: (_selected_folder_is_root): + Add a short-cut, by checking if the folder store is an account. + This ensures that the Sort menu item and toolbar is dimmed for + the local-folders account root item, fixing + projects.maemo.org bug NB#62545. + +2007-07-12 Murray Cumming + * src/modest-tny-account-store.c: (get_password): Show the password dialog (via the signal) only in the mainloop, via an idle handler that we wait for. This could theoretically prevent diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index fac5d9d..66ee5db 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -1164,6 +1164,21 @@ _selected_folder_is_root (ModestMainWindow *win) g_return_val_if_fail (MODEST_IS_MAIN_WINDOW(win), FALSE); + /* All accounts are root items: */ + GtkWidget *folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(win), + MODEST_WIDGET_TYPE_FOLDER_VIEW); + if (folder_view) { + TnyFolderStore *folder_store = + modest_folder_view_get_selected (MODEST_FOLDER_VIEW(folder_view)); + const gboolean is_account = TNY_IS_ACCOUNT (folder_store); + g_object_unref (folder_store); + folder_store = NULL; + + if (is_account) + return TRUE; + } + + /* Try something more precise: */ types[0] = TNY_FOLDER_TYPE_ROOT; /* Check folder type */ @@ -1298,7 +1313,7 @@ _selected_folder_is_any_of_type (ModestWindow *win, guint i=0; gboolean result = FALSE; - /*Get curent folder */ + /*Get current folder */ if (MODEST_IS_MAIN_WINDOW(win)) { /* Get folder view */ @@ -1347,7 +1362,7 @@ _folder_is_any_of_type (TnyFolder *folder, /* Get folder type */ folder_type = modest_tny_folder_guess_folder_type (folder); - + /* Check foler type */ for (i=0; i < ntypes; i++) { result = result || folder_type == types[i]; -- 1.7.9.5