* 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
2007-07-12 Murray Cumming <murrayc@murrayc.com>
2007-07-12 Murray Cumming <murrayc@murrayc.com>
+ * 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 <murrayc@murrayc.com>
+
* 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
* 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
g_return_val_if_fail (MODEST_IS_MAIN_WINDOW(win), FALSE);
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 */
types[0] = TNY_FOLDER_TYPE_ROOT;
/* Check folder type */
guint i=0;
gboolean result = FALSE;
guint i=0;
gboolean result = FALSE;
+ /*Get current folder */
if (MODEST_IS_MAIN_WINDOW(win)) {
/* Get folder view */
if (MODEST_IS_MAIN_WINDOW(win)) {
/* Get folder view */
/* Get folder type */
folder_type = modest_tny_folder_guess_folder_type (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];
/* Check foler type */
for (i=0; i < ntypes; i++) {
result = result || folder_type == types[i];