Skip to content

Commit

Permalink
Revert "Fix #10337 - Allow attribute form on all features (new QgsFea…
Browse files Browse the repository at this point in the history
…tures are invalid)"

This reverts commit 9bdc932.
  • Loading branch information
m-kuhn committed May 25, 2014
1 parent 29187e4 commit 3871ce7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgsattributedialog.cpp
Expand Up @@ -150,5 +150,5 @@ void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, QgsAt
mDialog->layout()->addWidget( mAttributeForm );
QDialogButtonBox* buttonBox = mAttributeForm->findChild<QDialogButtonBox*>();
connect( buttonBox, SIGNAL( rejected() ), mDialog, SLOT( close() ) );
connect( buttonBox, SIGNAL( accepted() ), mDialog, SLOT( accept() ) );
connect( buttonBox, SIGNAL( accepted() ), mDialog, SLOT( close() ) );
}
12 changes: 9 additions & 3 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -227,15 +227,21 @@ void QgsAttributeForm::onAttributeDeleted( int idx )

void QgsAttributeForm::synchronizeEnabledState()
{
bool enabled = mLayer->isEditable();
Q_FOREACH( QgsWidgetWrapper* ww, mWidgets )
{
ww->setEnabled( enabled );
if ( mFeature.isValid() && mLayer->isEditable() )
{
ww->setEnabled( true );
}
else
{
ww->setEnabled( false );
}
}

QPushButton* okButton = mButtonBox->button( QDialogButtonBox::Ok );
if ( okButton )
okButton->setEnabled( enabled );
okButton->setEnabled( mFeature.isValid() && mLayer->isEditable() );
}

void QgsAttributeForm::init()
Expand Down

0 comments on commit 3871ce7

Please sign in to comment.