Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 4234ad5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/app/qgsrelationmanagerdialog.cpp
Expand Up @@ -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()
Expand Down Expand Up @@ -158,3 +161,7 @@ QList< QgsRelation > QgsRelationManagerDialog::relations()
return relations;
}

void QgsRelationManagerDialog::onSelectionChanged()
{
mBtnRemoveRelation->setEnabled( mRelationsTable->selectionModel()->hasSelection() );
}
3 changes: 2 additions & 1 deletion src/app/qgsrelationmanagerdialog.h
Expand Up @@ -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;
Expand Down

0 comments on commit 4234ad5

Please sign in to comment.