mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Remove OK button and add CLOSE
Yes, it's one more click to quit, but more intuitive UI
This commit is contained in:
parent
1ab20bd7e9
commit
79c8f9686d
@ -53,11 +53,6 @@ Destructor
|
||||
being added.
|
||||
%End
|
||||
|
||||
virtual void okButtonClicked();
|
||||
%Docstring
|
||||
Triggered when the dialog is accepted, call addButtonClicked() and
|
||||
emit the accepted() signal
|
||||
%End
|
||||
|
||||
signals:
|
||||
|
||||
|
@ -52,12 +52,10 @@ void QgsAbstractDataSourceWidget::setupButtons( QDialogButtonBox *buttonBox )
|
||||
connect( mAddButton, &QPushButton::clicked, this, &QgsAbstractDataSourceWidget::addButtonClicked );
|
||||
connect( this, &QgsAbstractDataSourceWidget::enableButtons, mAddButton, &QPushButton::setEnabled );
|
||||
|
||||
QPushButton *okButton = new QPushButton( tr( "&Ok" ) );
|
||||
okButton->setToolTip( tr( "Add selected layers to map and close this dialog" ) );
|
||||
okButton->setEnabled( false );
|
||||
buttonBox->addButton( okButton, QDialogButtonBox::AcceptRole );
|
||||
connect( okButton, &QPushButton::clicked, this, &QgsAbstractDataSourceWidget::okButtonClicked );
|
||||
connect( this, &QgsAbstractDataSourceWidget::enableButtons, okButton, &QPushButton::setEnabled );
|
||||
QPushButton *closeButton = new QPushButton( tr( "&Close" ) );
|
||||
closeButton->setToolTip( tr( "Close this dialog without adding any layer" ) );
|
||||
buttonBox->addButton( closeButton, QDialogButtonBox::RejectRole );
|
||||
connect( closeButton, &QPushButton::clicked, this, &QgsAbstractDataSourceWidget::reject );
|
||||
|
||||
}
|
||||
|
||||
@ -67,8 +65,3 @@ void QgsAbstractDataSourceWidget::setMapCanvas( const QgsMapCanvas *mapCanvas )
|
||||
mMapCanvas = mapCanvas;
|
||||
}
|
||||
|
||||
void QgsAbstractDataSourceWidget::okButtonClicked()
|
||||
{
|
||||
addButtonClicked();
|
||||
emit accepted();
|
||||
}
|
||||
|
@ -69,11 +69,6 @@ class GUI_EXPORT QgsAbstractDataSourceWidget : public QDialog
|
||||
*/
|
||||
virtual void addButtonClicked() { }
|
||||
|
||||
/**
|
||||
* Triggered when the dialog is accepted, call addButtonClicked() and
|
||||
* emit the accepted() signal
|
||||
*/
|
||||
virtual void okButtonClicked();
|
||||
|
||||
signals:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user