Skip to content

Commit

Permalink
Fix #10337 - Allow attribute form on all features (new QgsFeatures ar…
Browse files Browse the repository at this point in the history
…e invalid)
  • Loading branch information
NathanW2 committed May 25, 2014
1 parent 41e37e1 commit 9bdc932
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgsattributedialog.cpp
Original file line number Diff line number Diff line change
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( close() ) );
connect( buttonBox, SIGNAL( accepted() ), mDialog, SLOT( accept() ) );
}
12 changes: 3 additions & 9 deletions src/gui/qgsattributeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,15 @@ void QgsAttributeForm::onAttributeDeleted( int idx )

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

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

void QgsAttributeForm::init()
Expand Down

0 comments on commit 9bdc932

Please sign in to comment.