* Fixes NB#86372, do not dimm the edit and delete buttons when there is only one...
authorSergio Villar Senin <svillar@igalia.com>
Tue, 10 Jun 2008 15:38:13 +0000 (15:38 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 10 Jun 2008 15:38:13 +0000 (15:38 +0000)
pmo-diablo-r4635

src/maemo/modest-account-view-window.c

index 5e065c7..e384cbe 100644 (file)
@@ -431,8 +431,14 @@ button_box_new (ModestAccountViewWindow *self)
        gtk_box_pack_start (GTK_BOX(button_box), priv->delete_button, FALSE, FALSE,2);
        gtk_box_pack_start (GTK_BOX(button_box), priv->close_button, FALSE, FALSE,2);
 
-       gtk_widget_set_sensitive (priv->edit_button, FALSE);
-       gtk_widget_set_sensitive (priv->delete_button, FALSE);  
+       if (priv->account_view) {
+               GtkTreeSelection *sel;
+               sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(priv->account_view));
+               if (gtk_tree_selection_count_selected_rows (sel) == 0) {
+                       gtk_widget_set_sensitive (priv->edit_button, FALSE);
+                       gtk_widget_set_sensitive (priv->delete_button, FALSE);  
+               }
+       }
 
        gtk_widget_show_all (button_box);
        return button_box;