[QGIS Commit] r14183 - in trunk/qgis/src: app gui
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Thu Sep 2 12:15:25 EDT 2010
Author: jef
Date: 2010-09-02 16:15:25 +0000 (Thu, 02 Sep 2010)
New Revision: 14183
Modified:
trunk/qgis/src/app/qgsattributedialog.cpp
trunk/qgis/src/gui/qgsattributeeditor.cpp
Log:
fix #2978
Modified: trunk/qgis/src/app/qgsattributedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributedialog.cpp 2010-09-02 16:00:11 UTC (rev 14182)
+++ trunk/qgis/src/app/qgsattributedialog.cpp 2010-09-02 16:15:25 UTC (rev 14183)
@@ -156,7 +156,10 @@
mypLabel->setText( myFieldName + tr( " (txt)" ) );
}
- myWidget->setEnabled( vl->isEditable() );
+ if ( vl->editType( it.key() ) != QgsVectorLayer::Immutable )
+ {
+ myWidget->setEnabled( vl->isEditable() );
+ }
mypInnerLayout->addWidget( myWidget, index, 1 );
mpIndizes << it.key();
@@ -181,7 +184,10 @@
QgsAttributeEditor::createAttributeEditor( mDialog, myWidget, vl, it.key(), it.value() );
- myWidget->setEnabled( vl->isEditable() );
+ if ( vl->editType( it.key() ) != QgsVectorLayer::Immutable )
+ {
+ myWidget->setEnabled( vl->isEditable() );
+ }
mpIndizes << it.key();
mpWidgets << myWidget;
Modified: trunk/qgis/src/gui/qgsattributeeditor.cpp
===================================================================
--- trunk/qgis/src/gui/qgsattributeeditor.cpp 2010-09-02 16:00:11 UTC (rev 14182)
+++ trunk/qgis/src/gui/qgsattributeeditor.cpp 2010-09-02 16:15:25 UTC (rev 14183)
@@ -318,6 +318,7 @@
case QgsVectorLayer::LineEdit:
case QgsVectorLayer::TextEdit:
case QgsVectorLayer::UniqueValuesEditable:
+ case QgsVectorLayer::Immutable:
{
QLineEdit *le = NULL;
QTextEdit *te = NULL;
@@ -381,6 +382,11 @@
{
myWidget = pte;
}
+
+ if ( myWidget )
+ {
+ myWidget->setDisabled( editType == QgsVectorLayer::Immutable );
+ }
}
break;
@@ -428,9 +434,6 @@
}
}
break;
-
- case QgsVectorLayer::Immutable:
- return NULL;
}
setValue( myWidget, vl, idx, value );
More information about the QGIS-commit
mailing list