From: Sergio Villar Senin Date: Mon, 12 May 2008 10:03:55 +0000 (+0000) Subject: * Set the edit and delete buttons as insensitive only if there is no account selected X-Git-Tag: git_migration_finished~1387 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=6f95048c7a24ff3295e1a30d27d5765cc4ef1d26 * Set the edit and delete buttons as insensitive only if there is no account selected pmo-trunk-r4513 --- diff --git a/src/maemo/modest-account-view-window.c b/src/maemo/modest-account-view-window.c index 100ad77..1ba48c6 100644 --- a/src/maemo/modest-account-view-window.c +++ b/src/maemo/modest-account-view-window.c @@ -432,8 +432,15 @@ 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); + /* Should has been created by window_vbox_new */ + 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; diff --git a/src/widgets/modest-account-view.h b/src/widgets/modest-account-view.h index 2fb5950..aa16dd2 100644 --- a/src/widgets/modest-account-view.h +++ b/src/widgets/modest-account-view.h @@ -87,18 +87,6 @@ ModestAccountView* modest_account_view_new (ModestAccountMgr *account_ **/ gchar* modest_account_view_get_selected_account (ModestAccountView *account_view); -/** - * modest_account_view_set_selected_account: - * @account_view: a #ModestAccountView - * @account_name: The name of the account to select. - * - * Sets the currently selected account. - **/ -/* Not used outside: -void modest_account_view_select_account (ModestAccountView *account_view, - const gchar* account_name); -*/ - G_END_DECLS #endif /* __MODEST_ACCOUNT_VIEW_H__ */