Skip to content
Permalink
Browse files

Merge pull request #5935 from elpaso/bugfix-17728-source-select-buttons

Use standard buttons for unified add layer dialog
  • Loading branch information
elpaso committed Dec 22, 2017
2 parents 02152ac + 8fb147f commit 22098a4905884a8dadd7a25aeaf7dfd18751c883
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/gui/qgsabstractdatasourcewidget.cpp
@@ -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 );

}

0 comments on commit 22098a4

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