Skip to content
Permalink
Browse files

Relation managment: enable the remove button when selection

If nothing is selected, this button is doing nothing.
  • Loading branch information
pvalsecc authored and m-kuhn committed Nov 8, 2016
1 parent aaa3117 commit 4234ad5c352373f7743a426846ffd736c7e2fc52
Showing with 9 additions and 1 deletion.
  1. +7 −0 src/app/qgsrelationmanagerdialog.cpp
  2. +2 −1 src/app/qgsrelationmanagerdialog.h
@@ -25,6 +25,9 @@ QgsRelationManagerDialog::QgsRelationManagerDialog( QgsRelationManager* relation
, mRelationManager( relationMgr )
{
setupUi( this );

mBtnRemoveRelation->setEnabled( false );
connect( mRelationsTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsRelationManagerDialog::onSelectionChanged );
}

QgsRelationManagerDialog::~QgsRelationManagerDialog()
@@ -158,3 +161,7 @@ QList< QgsRelation > QgsRelationManagerDialog::relations()
return relations;
}

void QgsRelationManagerDialog::onSelectionChanged()
{
mBtnRemoveRelation->setEnabled( mRelationsTable->selectionModel()->hasSelection() );
}
@@ -37,10 +37,11 @@ class APP_EXPORT QgsRelationManagerDialog : public QWidget, private Ui::QgsRelat
void addRelation( const QgsRelation& rel );
QList< QgsRelation > relations();

public slots:
private slots:
void on_mBtnAddRelation_clicked();
void on_mBtnDiscoverRelations_clicked();
void on_mBtnRemoveRelation_clicked();
void onSelectionChanged();

private:
QgsRelationManager* mRelationManager;

0 comments on commit 4234ad5

Please sign in to comment.
You can’t perform that action at this time.