From 1a1c3aed373e99b50e8d95d48bae66cdf6d76be5 Mon Sep 17 00:00:00 2001 From: brushtyler Date: Sun, 14 Nov 2010 21:44:41 +0000 Subject: [PATCH] disable the attribute table's "toggle editing" button when the layer is read-only git-svn-id: http://svn.osgeo.org/qgis/trunk@14661 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/app/attributetable/qgsattributetabledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/attributetable/qgsattributetabledialog.cpp b/src/app/attributetable/qgsattributetabledialog.cpp index b2f6d261a841..e241f956a1d8 100644 --- a/src/app/attributetable/qgsattributetabledialog.cpp +++ b/src/app/attributetable/qgsattributetabledialog.cpp @@ -101,7 +101,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid bool canDeleteAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::DeleteAttributes; mToggleEditingButton->setCheckable( true ); mToggleEditingButton->setChecked( mLayer->isEditable() ); - mToggleEditingButton->setEnabled( canChangeAttributes ); + mToggleEditingButton->setEnabled( canChangeAttributes && !mLayer->isReadOnly() ); mOpenFieldCalculator->setEnabled( canChangeAttributes && mLayer->isEditable() ); mDeleteSelectedButton->setEnabled( canDeleteFeatures && mLayer->isEditable() ); mAddAttribute->setEnabled( canAddAttributes && mLayer->isEditable() );