Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed problem with saving first entry
  • Loading branch information
signedav committed Nov 6, 2017
1 parent 2c0d518 commit 52240ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/app/qgsattributesformproperties.cpp
Expand Up @@ -46,7 +46,7 @@ QgsAttributesFormProperties::QgsAttributesFormProperties( QgsVectorLayer *layer,
mFormLayoutTree->setType( DnDTree::Type::Drop );

// AttributeTypeDialog
mAttributeTypeDialog = new QgsAttributeTypeDialog( mLayer, 0, mAttributeTypeFrame );
mAttributeTypeDialog = new QgsAttributeTypeDialog( mLayer, -1, mAttributeTypeFrame );
mAttributeTypeDialog->layout()->setMargin( 0 );
mAttributeTypeFrame->layout()->setMargin( 0 );
mAttributeTypeFrame->layout()->addWidget( mAttributeTypeDialog );
Expand Down Expand Up @@ -79,8 +79,8 @@ void QgsAttributesFormProperties::init()
initLayoutConfig();
initInitPython();

//mAttributeTypeDialog->setEnabled( false );
//mAttributeRelationEdit->setEnabled( false );
mAttributeTypeDialog->setEnabled( false );
mAttributeRelationEdit->setEnabled( false );
}

void QgsAttributesFormProperties::initAvailableWidgetsTree()
Expand Down Expand Up @@ -264,6 +264,9 @@ void QgsAttributesFormProperties::loadAttributeTypeDialog()

void QgsAttributesFormProperties::storeAttributeTypeDialog()
{
if ( mAttributeTypeDialog->fieldIdx() < 0 )
return;

FieldConfig cfg;

cfg.mEditable = mAttributeTypeDialog->fieldEditable();
Expand Down
10 changes: 3 additions & 7 deletions src/app/qgsattributetypedialog.cpp
Expand Up @@ -45,8 +45,9 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
, mFieldIdx( fieldIdx )
{
setupUi( this );
//removed selectionListWidget: connect( selectionListWidget, &QListWidget::currentRowChanged, this, &QgsAttributeTypeDialog::selectionListWidget_currentRowChanged );
setWindowTitle( tr( "Edit Widget Properties - %1 (%2)" ).arg( vl->fields().at( fieldIdx ).name(), vl->name() ) );

if ( fieldIdx < 0 )
return;

QMapIterator<QString, QgsEditorWidgetFactory *> it( QgsGui::editorWidgetRegistry()->factories() );
QStandardItemModel *widgetTypeModel = qobject_cast<QStandardItemModel *>( mWidgetTypeComboBox->model() );
Expand Down Expand Up @@ -89,11 +90,6 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
restoreGeometry( settings.value( QStringLiteral( "Windows/QgsAttributeTypeDialog/geometry" ) ).toByteArray() );

constraintExpressionWidget->setLayer( vl );

// TODO, what should this help be connected to?
#if 0
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAttributeTypeDialog::showHelp );
#endif
}

QgsAttributeTypeDialog::~QgsAttributeTypeDialog()
Expand Down

0 comments on commit 52240ad

Please sign in to comment.