Skip to content
Permalink
Browse files

Merge pull request #4889 from gacarrillor/one_button_ESC_key_handling

Handle Esc key in Data Source Manager
  • Loading branch information
elpaso committed Jul 20, 2017
2 parents 6e49403 + 63a2b74 commit cd399990f1823f71bfb983cc2800a838f8dac23a
Showing with 11 additions and 0 deletions.
  1. +8 −0 src/gui/qgsdatasourcemanagerdialog.cpp
  2. +3 −0 src/gui/qgsdatasourcemanagerdialog.h
@@ -60,6 +60,7 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QWidget *parent, QgsMapC
ogrItem->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddOgrLayer.svg" ) ) );
ogrItem->setToolTip( tr( "Add Vector layer" ) );
connect( ovl, &QgsOpenVectorLayerDialog::addVectorLayers, this, &QgsDataSourceManagerDialog::vectorLayersAdded );
connect( ovl, &QgsOpenVectorLayerDialog::rejected, this, &QgsDataSourceManagerDialog::reject );
mPageNames.append( QStringLiteral( "ogr" ) );

// RASTER (forward to app)
@@ -187,6 +188,7 @@ QgsAbstractDataSourceWidget *QgsDataSourceManagerDialog::providerDialog( const Q
{
dlg->setMapCanvas( mMapCanvas );
}
connect( dlg, &QgsAbstractDataSourceWidget::rejected, this, &QgsDataSourceManagerDialog::reject );
return dlg;
}
}
@@ -229,3 +231,9 @@ void QgsDataSourceManagerDialog::addVectorProviderDialog( const QString provider
connect( this, SIGNAL( providerDialogsRefreshRequested() ), dlg, SLOT( refresh() ) );
}
}

void QgsDataSourceManagerDialog::showEvent( QShowEvent *e )
{
ui->mOptionsStackedWidget->currentWidget()->show();
QDialog::showEvent( e );
}
@@ -78,6 +78,9 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
//! Refresh the browser view
void refresh();

protected:
virtual void showEvent( QShowEvent *event ) override;

signals:
//! Emitted when a raster layer was selected for addition: for signal forwarding to QgisApp
void addRasterLayer( const QString &uri, const QString &baseName, const QString &providerKey );

0 comments on commit cd39999

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