Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove relation editor on double clik in form editor (#36123)
there is now the panel on the right for this
  • Loading branch information
3nids committed May 1, 2020
1 parent dd560f4 commit 347d048
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions src/gui/vector/qgsattributesformproperties.cpp
Expand Up @@ -1182,46 +1182,8 @@ void QgsAttributesDnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int colum
{
case QgsAttributesFormProperties::DnDTreeItemData::Container:
case QgsAttributesFormProperties::DnDTreeItemData::WidgetType:
break;

case QgsAttributesFormProperties::DnDTreeItemData::Relation:
{
QDialog dlg;
dlg.setWindowTitle( tr( "Configure Relation Editor" ) );
QFormLayout *layout = new QFormLayout() ;
dlg.setLayout( layout );
layout->addWidget( baseWidget );

QCheckBox *showLinkButton = new QCheckBox( tr( "Show link button" ) );
showLinkButton->setChecked( itemData.relationEditorConfiguration().showLinkButton );
QCheckBox *showUnlinkButton = new QCheckBox( tr( "Show unlink button" ) );
showUnlinkButton->setChecked( itemData.relationEditorConfiguration().showUnlinkButton );
QCheckBox *showSaveChildEditsButton = new QCheckBox( tr( "Show save child layer edits button" ) );
showSaveChildEditsButton->setChecked( itemData.relationEditorConfiguration().showSaveChildEditsButton );
layout->addRow( showLinkButton );
layout->addRow( showUnlinkButton );
layout->addRow( showSaveChildEditsButton );

QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );

connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );

dlg.layout()->addWidget( buttonBox );

if ( dlg.exec() )
{
QgsAttributesFormProperties::RelationEditorConfiguration relEdCfg;
relEdCfg.showLinkButton = showLinkButton->isChecked();
relEdCfg.showUnlinkButton = showUnlinkButton->isChecked();
relEdCfg.showSaveChildEditsButton = showSaveChildEditsButton->isChecked();
itemData.setShowLabel( showLabelCheckbox->isChecked() );
itemData.setRelationEditorConfiguration( relEdCfg );

item->setData( 0, QgsAttributesFormProperties::DnDTreeRole, itemData );
}
}
break;
break;

case QgsAttributesFormProperties::DnDTreeItemData::QmlWidget:
{
Expand Down

0 comments on commit 347d048

Please sign in to comment.