Skip to content

Commit b31f05c

Browse files
committedJun 2, 2017
[addlayerbutton] New signals for new interfaces
1 parent dcab8ca commit b31f05c

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed
 

‎src/app/qgsdatasourcemanagerdialog.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,12 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
4646
// Bind list index to the stacked dialogs
4747
connect( ui->mList, SIGNAL( currentRowChanged( int ) ), this, SLOT( setCurrentPage( int ) ) );
4848

49-
/////////////////////////////////////////////////////////////////////////////
5049
// BROWSER Add the browser widget to the first stacked widget page
51-
5250
mBrowserWidget = new QgsBrowserDockWidget( QStringLiteral( "Browser" ), this );
5351
mBrowserWidget->setFeatures( QDockWidget::NoDockWidgetFeatures );
5452
ui->mStackedWidget->addWidget( mBrowserWidget );
5553

56-
/////////////////////////////////////////////////////////////////////////////
5754
// VECTOR Layers (completely different interface: it's not a provider)
58-
5955
QgsOpenVectorLayerDialog *ovl = new QgsOpenVectorLayerDialog( this, Qt::Widget, true );
6056
ui->mStackedWidget->addWidget( ovl );
6157
QListWidgetItem *ogrItem = new QListWidgetItem( tr( "Vector files" ), ui->mList );
@@ -65,7 +61,6 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
6561
// Add data provider dialogs
6662
QDialog *dlg;
6763

68-
6964
#ifdef HAVE_POSTGRESQL
7065
addDbProviderDialog( QStringLiteral( "postgres" ), tr( "PostgreSQL" ), QStringLiteral( "/mActionAddPostgisLayer.svg" ) );
7166
#endif
@@ -83,13 +78,15 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
8378
addRasterProviderDialog( QStringLiteral( "wcs" ), tr( "WCS" ), QStringLiteral( "/mActionAddWcsLayer.svg" ) );
8479

8580
dlg = providerDialog( QStringLiteral( "WFS" ), tr( "WFS" ), QStringLiteral( "/mActionAddWfsLayer.svg" ) );
81+
8682
if ( dlg )
8783
{
8884
// Forward (if only a common interface for the signals had been used in the providers ...)
89-
connect( dlg, SIGNAL( addFsLayer( QString, QString ) ), this, SIGNAL( addFsLayer( QString, QString ) ) );
90-
connect( this, &QgsDataSourceManagerDialog::addFsLayer,
91-
this, [ = ]( const QString & vectorLayerPath, const QString & baseName )
92-
{ this->vectorLayerAdded( vectorLayerPath, baseName, QStringLiteral( "WFS" ) ); } );
85+
connect( dlg, SIGNAL( addWfsLayer( QString, QString ) ), this, SIGNAL( addWfsLayer( QString, QString ) ) );
86+
connect( this, &QgsDataSourceManagerDialog::addWfsLayer, this, [ = ]( const QString & vectorLayerPath, const QString & baseName )
87+
{
88+
this->vectorLayerAdded( vectorLayerPath, baseName, QStringLiteral( "WFS" ) );
89+
} );
9390
}
9491

9592
QgsSourceSelectDialog *afss = dynamic_cast<QgsSourceSelectDialog *>( providerDialog( QStringLiteral( "arcgisfeatureserver" ),
@@ -99,8 +96,8 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
9996
{
10097
afss->setCurrentExtentAndCrs( mMapCanvas->extent(), mMapCanvas->mapSettings().destinationCrs() );
10198
// Forward (if only a common interface for the signals had been used in the providers ...)
102-
connect( afss, SIGNAL( addLayer( QString, QString ) ), this, SIGNAL( addFsLayer( QString, QString ) ) );
103-
connect( this, &QgsDataSourceManagerDialog::addFsLayer,
99+
connect( afss, SIGNAL( addLayer( QString, QString ) ), this, SIGNAL( addAfsLayer( QString, QString ) ) );
100+
connect( this, &QgsDataSourceManagerDialog::addAfsLayer,
104101
this, [ = ]( const QString & vectorLayerPath, const QString & baseName )
105102
{ this->vectorLayerAdded( vectorLayerPath, baseName, QStringLiteral( "arcgisfeatureserver" ) ); } );
106103
}

‎src/app/qgsdatasourcemanagerdialog.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class QgsDataSourceManagerDialog : public QDialog
5050
//! For signal forwarding to QgisApp
5151
void addRasterLayer( QString const &uri, QString const &baseName, QString const &providerKey );
5252
void addVectorLayer( const QString &vectorLayerPath, const QString &baseName, const QString &providerKey );
53-
void addFsLayer( const QString &uri, const QString &typeName );
53+
void addWfsLayer( const QString &uri, const QString &typeName );
54+
void addAfsLayer( const QString &uri, const QString &typeName );
5455
void addVectorLayers( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
5556
void showProgress( int progress, int totalSteps );
5657
void showStatusMessage( const QString &message );

0 commit comments

Comments
 (0)
Please sign in to comment.