* src/modest-ui-actions.c:
authorJose Dapena Paz <jdapena@igalia.com>
Fri, 20 Jul 2007 16:52:01 +0000 (16:52 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Fri, 20 Jul 2007 16:52:01 +0000 (16:52 +0000)
* If there's no header view, then proper information banner
  "nothing to sort" is shown.
* src/modest-ui-dimming-rules.c:
* Dim sort action if folder is empty. IN toolbar we show the
  corresponding information banner (fixes NB#60446).

pmo-trunk-r2762

src/modest-ui-actions.c
src/modest-ui-dimming-rules.c

index e144aa4..937d1b9 100644 (file)
@@ -1344,8 +1344,11 @@ modest_ui_actions_on_sort (GtkAction *action,
                GtkWidget *header_view;
                header_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(window),
                                                                   MODEST_WIDGET_TYPE_HEADER_VIEW);
-               if (!header_view)
+               if (!header_view) {
+                       modest_platform_information_banner (NULL, NULL, _CS("ckdg_ib_nothing_to_sort"));
+
                        return;
+               }
 
                /* Show sorting dialog */
                modest_platform_run_sort_dialog (GTK_WINDOW (window), MODEST_SORT_HEADERS);     
index 6bd8ef4..6b6af4f 100644 (file)
@@ -265,7 +265,12 @@ modest_ui_dimming_rules_on_sort (ModestWindow *win, gpointer user_data)
        /* Check dimmed rule */ 
        if (!dimmed) {
                dimmed = _selected_folder_is_root (MODEST_MAIN_WINDOW(win));
-               modest_dimming_rule_set_notification (rule, NULL);
+               modest_dimming_rule_set_notification (rule, _CS("ckdg_ib_nothing_to_sort"));
+       }
+
+       if (!dimmed) {
+               dimmed = _selected_folder_is_empty (MODEST_MAIN_WINDOW(win));
+               modest_dimming_rule_set_notification (rule, _CS("ckdg_ib_nothing_to_sort"));
        }
 
        return dimmed;