From 09e53887ce88141c014bb99e117fbb28f47febcc Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 1 Apr 2010 14:13:23 +0200 Subject: Bug #488979 - Disable Edit for card views in contacts --- widgets/menus/gal-define-views-dialog.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 34c20be18a..3a32dc64f6 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -188,13 +188,18 @@ gdvd_cursor_changed_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (dialog->treeview), &dialog->model, &iter)) { + GalViewClass *gvclass = NULL; + gtk_tree_model_get (dialog->model, &iter, COL_GALVIEW_DATA, &item, -1); button = e_builder_get_widget (dialog->builder, "button-delete"); gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in); + if (item->view) + gvclass = GAL_VIEW_GET_CLASS (item->view); + button = e_builder_get_widget (dialog->builder, "button-modify"); - gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in); + gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in && gvclass && gvclass->edit != NULL); } } -- cgit