Skip to content

Commit

Permalink
Merge pull request #5935 from elpaso/bugfix-17728-source-select-buttons
Browse files Browse the repository at this point in the history
Use standard buttons for unified add layer dialog
  • Loading branch information
elpaso authored Dec 22, 2017
2 parents 02152ac + 8fb147f commit 22098a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/qgsabstractdatasourcewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ const QgsMapCanvas *QgsAbstractDataSourceWidget::mapCanvas() const
void QgsAbstractDataSourceWidget::setupButtons( QDialogButtonBox *buttonBox )
{

mAddButton = new QPushButton( tr( "&Add" ) );
buttonBox->setStandardButtons( QDialogButtonBox::Apply | QDialogButtonBox::Close | QDialogButtonBox::Help );
mAddButton = buttonBox->button( QDialogButtonBox::Apply );
mAddButton->setText( tr( "&Add" ) );
mAddButton->setToolTip( tr( "Add selected layers to map" ) );
mAddButton->setEnabled( false );
buttonBox->addButton( mAddButton, QDialogButtonBox::ApplyRole );
connect( mAddButton, &QPushButton::clicked, this, &QgsAbstractDataSourceWidget::addButtonClicked );
connect( this, &QgsAbstractDataSourceWidget::enableButtons, mAddButton, &QPushButton::setEnabled );

QPushButton *closeButton = new QPushButton( tr( "&Close" ) );
QPushButton *closeButton = buttonBox->button( QDialogButtonBox::Close );
closeButton->setToolTip( tr( "Close this dialog without adding any layer" ) );
buttonBox->addButton( closeButton, QDialogButtonBox::RejectRole );
connect( closeButton, &QPushButton::clicked, this, &QgsAbstractDataSourceWidget::reject );

}
Expand Down

0 comments on commit 22098a4

Please sign in to comment.