Skip to content

Commit

Permalink
fix #2978
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14183 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 2, 2010
1 parent af0b606 commit f1ea45c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/app/qgsattributedialog.cpp
Expand Up @@ -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();
Expand All @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions src/gui/qgsattributeeditor.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -381,6 +382,11 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
{
myWidget = pte;
}

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

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

case QgsVectorLayer::Immutable:
return NULL;
}

setValue( myWidget, vl, idx, value );
Expand Down

0 comments on commit f1ea45c

Please sign in to comment.