Skip to content
Permalink
Browse files
fix #2978
git-svn-id: http://svn.osgeo.org/qgis/trunk@14183 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 2, 2010
1 parent c593fac commit fe9b70966889b50a03797c8708decb2a273652e4
Showing with 14 additions and 5 deletions.
  1. +8 −2 src/app/qgsattributedialog.cpp
  2. +6 −3 src/gui/qgsattributeeditor.cpp
@@ -156,7 +156,10 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
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 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat

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;
@@ -318,6 +318,7 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
case QgsVectorLayer::LineEdit:
case QgsVectorLayer::TextEdit:
case QgsVectorLayer::UniqueValuesEditable:
case QgsVectorLayer::Immutable:
{
QLineEdit *le = NULL;
QTextEdit *te = NULL;
@@ -381,6 +382,11 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
{
myWidget = pte;
}

if ( myWidget )
{
myWidget->setDisabled( editType == QgsVectorLayer::Immutable );
}
}
break;

@@ -428,9 +434,6 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
}
}
break;

case QgsVectorLayer::Immutable:
return NULL;
}

setValue( myWidget, vl, idx, value );

0 comments on commit fe9b709

Please sign in to comment.