[evolution/gnome-2-30] Bug #488979 - Disable Edit for card views in contacts



commit cc7240b28e554ec88bbba7f67c52699b7588c59b
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 1 14:14:56 2010 +0200

    Bug #488979 - Disable Edit for card views in contacts

 widgets/menus/gal-define-views-dialog.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index 34c20be..3a32dc6 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);
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]