Skip to content

Commit

Permalink
Rebase and partially revert 9bae832
Browse files Browse the repository at this point in the history
All signals are now in the base class, even if only
a subset of available providers actually emits them.

This way we can handle all source select dialogs
the same way, regardless if they are vector, DB
or raster (or others).
  • Loading branch information
elpaso committed Jul 18, 2017
1 parent e83ef2e commit bd925cd
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 17 deletions.
10 changes: 10 additions & 0 deletions python/gui/qgsabstractdatasourcewidget.sip
Expand Up @@ -67,6 +67,16 @@ Emitted when a raster layer has been selected for addition
void addVectorLayer( const QString &uri, const QString &layerName );
%Docstring
Emitted when a vector layer has been selected for addition
%End

void progress( int, int );
%Docstring
Emitted when a progress dialog is shown by the provider dialog
%End

void progressMessage( QString message );
%Docstring
Emitted when a progress dialog is shown by the provider dialog
%End

protected:
Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgsowssourceselect.sip
Expand Up @@ -112,8 +112,6 @@ Stores the selected datasource whenerver it is changed
Add some default wms servers to the list
%End

void on_mDialogButtonBox_helpRequested();

protected:

virtual QList<QgsOWSSourceSelect::SupportedFormat> providerFormats();
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgsabstractdatasourcewidget.h
Expand Up @@ -76,6 +76,12 @@ class GUI_EXPORT QgsAbstractDataSourceWidget : public QDialog
//! Emitted when a vector layer has been selected for addition
void addVectorLayer( const QString &uri, const QString &layerName );

//! Emitted when a progress dialog is shown by the provider dialog
void progress( int, int );

//! Emitted when a progress dialog is shown by the provider dialog
void progressMessage( QString message );

protected:

//! Constructor
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsdatasourcemanagerdialog.h
Expand Up @@ -104,10 +104,10 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
//! Emitted when a connection has changed inside the provider dialogs
//! This signal is normally forwarded to the application to notify other
//! browsers that they need to refresh their connections list
void connectionsChanged( );
void connectionsChanged();
//! One or more provider connections have changed and the
//! dialogs should be refreshed
void providerDialogsRefreshRequested( );
void providerDialogsRefreshRequested();

private:
// Return the dialog from the provider
Expand Down
2 changes: 0 additions & 2 deletions src/gui/qgsowssourceselect.h
Expand Up @@ -110,8 +110,6 @@ class GUI_EXPORT QgsOWSSourceSelect : public QgsAbstractDataSourceWidget, protec
//! Add some default wms servers to the list
void on_mAddDefaultButton_clicked();

void on_mDialogButtonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

protected:

/**
Expand Down
5 changes: 0 additions & 5 deletions src/providers/arcgisrest/qgsamssourceselect.h
Expand Up @@ -30,11 +30,6 @@ class QgsAmsSourceSelect: public QgsArcGisServiceSourceSelect
public:
QgsAmsSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );

signals:
void addRasterLayer( QString const &rasterLayerPath,
QString const &baseName,
QString const &providerKey );

protected:
bool connectToService( const QgsOwsConnection &connection ) override;
QString getLayerURI( const QgsOwsConnection &connection,
Expand Down
2 changes: 1 addition & 1 deletion src/providers/db2/qgsdb2sourceselect.cpp
Expand Up @@ -458,7 +458,7 @@ void QgsDb2SourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "DB2" ) );
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
Expand Down
2 changes: 0 additions & 2 deletions src/providers/db2/qgsdb2sourceselect.h
Expand Up @@ -110,8 +110,6 @@ class QgsDb2SourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsDb

signals:
void addGeometryColumn( QgsDb2LayerProperty );
void progress( int, int );
void progressMessage( QString );

public slots:
//! Determines the tables the user selected and closes the dialog
Expand Down
2 changes: 1 addition & 1 deletion src/providers/mssql/qgsmssqlsourceselect.cpp
Expand Up @@ -453,7 +453,7 @@ void QgsMssqlSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "mssql" ) );
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
Expand Down
2 changes: 0 additions & 2 deletions src/providers/mssql/qgsmssqlsourceselect.h
Expand Up @@ -80,8 +80,6 @@ class QgsMssqlSourceSelect : public QgsAbstractDataSourceWidget, private Ui::Qgs

signals:
void addGeometryColumn( const QgsMssqlLayerProperty & );
void progress( int, int );
void progressMessage( QString );

public slots:

Expand Down

0 comments on commit bd925cd

Please sign in to comment.