Skip to content

Commit cd39999

Browse files
authoredJul 20, 2017
Merge pull request #4889 from gacarrillor/one_button_ESC_key_handling
Handle Esc key in Data Source Manager
2 parents 6e49403 + 63a2b74 commit cd39999

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎src/gui/qgsdatasourcemanagerdialog.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QWidget *parent, QgsMapC
6060
ogrItem->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddOgrLayer.svg" ) ) );
6161
ogrItem->setToolTip( tr( "Add Vector layer" ) );
6262
connect( ovl, &QgsOpenVectorLayerDialog::addVectorLayers, this, &QgsDataSourceManagerDialog::vectorLayersAdded );
63+
connect( ovl, &QgsOpenVectorLayerDialog::rejected, this, &QgsDataSourceManagerDialog::reject );
6364
mPageNames.append( QStringLiteral( "ogr" ) );
6465

6566
// RASTER (forward to app)
@@ -187,6 +188,7 @@ QgsAbstractDataSourceWidget *QgsDataSourceManagerDialog::providerDialog( const Q
187188
{
188189
dlg->setMapCanvas( mMapCanvas );
189190
}
191+
connect( dlg, &QgsAbstractDataSourceWidget::rejected, this, &QgsDataSourceManagerDialog::reject );
190192
return dlg;
191193
}
192194
}
@@ -229,3 +231,9 @@ void QgsDataSourceManagerDialog::addVectorProviderDialog( const QString provider
229231
connect( this, SIGNAL( providerDialogsRefreshRequested() ), dlg, SLOT( refresh() ) );
230232
}
231233
}
234+
235+
void QgsDataSourceManagerDialog::showEvent( QShowEvent *e )
236+
{
237+
ui->mOptionsStackedWidget->currentWidget()->show();
238+
QDialog::showEvent( e );
239+
}

‎src/gui/qgsdatasourcemanagerdialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
7878
//! Refresh the browser view
7979
void refresh();
8080

81+
protected:
82+
virtual void showEvent( QShowEvent *event ) override;
83+
8184
signals:
8285
//! Emitted when a raster layer was selected for addition: for signal forwarding to QgisApp
8386
void addRasterLayer( const QString &uri, const QString &baseName, const QString &providerKey );

0 commit comments

Comments
 (0)
Please sign in to comment.