Skip to content
Permalink
Browse files

Renamed base class to QgsAbstractDataSourceWidget

  • Loading branch information
elpaso committed Jul 17, 2017
1 parent aba9da5 commit c4e26d72c0c0f60ad2278492d499b4da5835f75a
Showing with 80 additions and 80 deletions.
  1. +1 −1 python/gui/gui_auto.sip
  2. +6 −6 python/gui/{qgssourceselect.sip → qgsabstractdatasourcewidget.sip}
  3. +1 −1 python/gui/qgsarcgisservicesourceselect.sip
  4. +1 −1 python/gui/qgsowssourceselect.sip
  5. +3 −3 src/gui/CMakeLists.txt
  6. +4 −4 src/gui/{qgssourceselect.cpp → qgsabstractdatasourcewidget.cpp}
  7. +7 −7 src/gui/{qgssourceselect.h → qgsabstractdatasourcewidget.h}
  8. +5 −5 src/gui/qgsarcgisservicesourceselect.cpp
  9. +2 −2 src/gui/qgsarcgisservicesourceselect.h
  10. +3 −3 src/gui/qgsowssourceselect.cpp
  11. +2 −2 src/gui/qgsowssourceselect.h
  12. +3 −3 src/providers/db2/qgsdb2sourceselect.cpp
  13. +2 −2 src/providers/db2/qgsdb2sourceselect.h
  14. +3 −3 src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
  15. +2 −2 src/providers/delimitedtext/qgsdelimitedtextsourceselect.h
  16. +3 −3 src/providers/mssql/qgsmssqlsourceselect.cpp
  17. +2 −2 src/providers/mssql/qgsmssqlsourceselect.h
  18. +2 −2 src/providers/oracle/qgsoraclesourceselect.cpp
  19. +2 −2 src/providers/oracle/qgsoraclesourceselect.h
  20. +4 −4 src/providers/postgres/qgspgsourceselect.cpp
  21. +2 −2 src/providers/postgres/qgspgsourceselect.h
  22. +3 −3 src/providers/spatialite/qgsspatialitesourceselect.cpp
  23. +2 −2 src/providers/spatialite/qgsspatialitesourceselect.h
  24. +3 −3 src/providers/virtual/qgsvirtuallayersourceselect.cpp
  25. +2 −2 src/providers/virtual/qgsvirtuallayersourceselect.h
  26. +3 −3 src/providers/wfs/qgswfssourceselect.cpp
  27. +2 −2 src/providers/wfs/qgswfssourceselect.h
  28. +3 −3 src/providers/wms/qgswmssourceselect.cpp
  29. +2 −2 src/providers/wms/qgswmssourceselect.h
@@ -21,7 +21,7 @@
%Include qgsbrowserdockwidget.sip
%Include qgsvertexmarker.sip
%Include qgsfiledownloader.sip
%Include qgssourceselect.sip
%Include qgsabstractdatasourcewidget.sip
%Include attributetable/qgsfeaturemodel.sip
%Include auth/qgsauthauthoritieseditor.sip
%Include auth/qgsauthcertificateinfo.sip
@@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssourceselect.h *
* src/gui/qgsabstractdatasourcewidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -10,7 +10,7 @@



class QgsSourceSelect : QDialog
class QgsAbstractDataSourceWidget : QDialog
{
%Docstring
Abstract base Data Source Widget to create connections and add layers
@@ -21,16 +21,16 @@ class QgsSourceSelect : QDialog
%End

%TypeHeaderCode
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"
%End
public:

QgsSourceSelect( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
QgsAbstractDataSourceWidget( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
%Docstring
Constructor
%End

virtual ~QgsSourceSelect( ) = 0;
virtual ~QgsAbstractDataSourceWidget( ) = 0;
%Docstring
Pure Virtual Destructor
%End
@@ -60,7 +60,7 @@ Emitted when the provider's connections have changed
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssourceselect.h *
* src/gui/qgsabstractdatasourcewidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -11,7 +11,7 @@



class QgsArcGisServiceSourceSelect : QgsSourceSelect, protected Ui::QgsArcGisServiceSourceSelectBase
class QgsArcGisServiceSourceSelect : QgsAbstractDataSourceWidget, protected Ui::QgsArcGisServiceSourceSelectBase
{
%Docstring
Base class for listing ArcGis layers available from a remote service.
@@ -11,7 +11,7 @@



class QgsOWSSourceSelect : QgsSourceSelect, protected Ui::QgsOWSSourceSelectBase
class QgsOWSSourceSelect : QgsAbstractDataSourceWidget, protected Ui::QgsOWSSourceSelectBase
{
%Docstring
Dialog to create connections and add layers WCS etc.
@@ -346,7 +346,7 @@ SET(QGIS_GUI_SRCS
qgsvertexmarker.cpp
qgsfiledownloader.cpp
qgsdatasourcemanagerdialog.cpp
qgssourceselect.cpp
qgsabstractdatasourcewidget.cpp
)

SET(QGIS_GUI_MOC_HDRS
@@ -499,7 +499,7 @@ SET(QGIS_GUI_MOC_HDRS
qgsvariableeditorwidget.h
qgsfiledownloader.h
qgsdatasourcemanagerdialog.h
qgssourceselect.h
qgsabstractdatasourcewidget.h

ogr/qgsopenvectorlayerdialog.h
ogr/qgsnewogrconnection.h
@@ -706,7 +706,7 @@ SET(QGIS_GUI_HDRS
qgsvertexmarker.h
qgsfiledownloader.h
qgsdatasourcemanagerdialog.h
qgssourceselect.h
qgsabstractdatasourcewidget.h

ogr/qgsopenvectorlayerdialog.h
ogr/qgsogrhelperfunctions.h
@@ -1,5 +1,5 @@
/***************************************************************************
qgssourceselect.cpp - base class for source selector widgets
qgsabstractdatasourcewidget.cpp - base class for source selector widgets
-------------------
begin : 10 July 2017
original : (C) 2017 by Alessandro Pasotti email : apasotti at boundlessgeo dot com
@@ -15,16 +15,16 @@
* *
***************************************************************************/

#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"

QgsSourceSelect::QgsSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ):
QgsAbstractDataSourceWidget::QgsAbstractDataSourceWidget( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ):
QDialog( parent, fl ),
mWidgetMode( widgetMode )
{

}

QgsSourceSelect::~QgsSourceSelect()
QgsAbstractDataSourceWidget::~QgsAbstractDataSourceWidget()
{

}
@@ -1,5 +1,5 @@
/***************************************************************************
qgssourceselect.h - base class for source selector widgets
qgsabstractdatasourcewidget.h - base class for source selector widgets
-------------------
begin : 10 July 2017
original : (C) 2017 by Alessandro Pasotti email : apasotti at boundlessgeo dot com
@@ -15,8 +15,8 @@
* *
***************************************************************************/

#ifndef QGSSOURCESELECT_H
#define QGSSOURCESELECT_H
#ifndef QGSABSTRACTDATASOURCEWIDGET_H
#define QGSABSTRACTDATASOURCEWIDGET_H
#include "qgis_sip.h"
#include "qgis.h"
#include "qgis_gui.h"
@@ -33,17 +33,17 @@
* and add layers.
* \since QGIS 3.0
*/
class GUI_EXPORT QgsSourceSelect : public QDialog
class GUI_EXPORT QgsAbstractDataSourceWidget : public QDialog
{
Q_OBJECT

public:

//! Constructor
QgsSourceSelect( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
QgsAbstractDataSourceWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );

//! Pure Virtual Destructor
virtual ~QgsSourceSelect( ) = 0;
virtual ~QgsAbstractDataSourceWidget( ) = 0;

//! Return the widget mode
QgsProviderRegistry::WidgetMode widgetMode( ) { return mWidgetMode; }
@@ -64,4 +64,4 @@ class GUI_EXPORT QgsSourceSelect : public QDialog
QgsProviderRegistry::WidgetMode mWidgetMode;
};

#endif // QGSSOURCESELECT_H
#endif // QGSABSTRACTDATASOURCEWIDGET_H
@@ -40,17 +40,17 @@
/**
* Item delegate with tweaked sizeHint.
*/
class QgsSourceSelectItemDelegate : public QItemDelegate
class QgsAbstractDataSourceWidgetItemDelegate : public QItemDelegate
{
public:
//! Constructor
QgsSourceSelectItemDelegate( QObject *parent = 0 ) : QItemDelegate( parent ) { }
QgsAbstractDataSourceWidgetItemDelegate( QObject *parent = 0 ) : QItemDelegate( parent ) { }
QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
};


QgsArcGisServiceSourceSelect::QgsArcGisServiceSourceSelect( const QString &serviceName, ServiceType serviceType, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ):
QgsSourceSelect( parent, fl, widgetMode ),
QgsAbstractDataSourceWidget( parent, fl, widgetMode ),
mServiceName( serviceName ),
mServiceType( serviceType ),
mBuildQueryButton( 0 ),
@@ -81,7 +81,7 @@ QgsArcGisServiceSourceSelect::QgsArcGisServiceSourceSelect( const QString &servi
mProjectionSelector = new QgsProjectionSelectionDialog( this );
mProjectionSelector->setMessage( QString() );

treeView->setItemDelegate( new QgsSourceSelectItemDelegate( treeView ) );
treeView->setItemDelegate( new QgsAbstractDataSourceWidgetItemDelegate( treeView ) );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/SourceSelectDialog/geometry" ) ).toByteArray() );
@@ -458,7 +458,7 @@ void QgsArcGisServiceSourceSelect::filterChanged( const QString &text )
mModelProxy->sort( mModelProxy->sortColumn(), mModelProxy->sortOrder() );
}

QSize QgsSourceSelectItemDelegate::sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const
QSize QgsAbstractDataSourceWidgetItemDelegate::sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
QVariant indexData = index.data( Qt::DisplayRole );
if ( indexData.isNull() )
@@ -30,7 +30,7 @@
#include "ui_qgsarcgisservicesourceselectbase.h"
#include "qgsrectangle.h"
#include "qgscoordinatereferencesystem.h"
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"
#include "qgis_gui.h"

class QStandardItemModel;
@@ -41,7 +41,7 @@ class QgsOwsConnection;
/**
* Base class for listing ArcGis layers available from a remote service.
*/
class GUI_EXPORT QgsArcGisServiceSourceSelect : public QgsSourceSelect, protected Ui::QgsArcGisServiceSourceSelectBase
class GUI_EXPORT QgsArcGisServiceSourceSelect : public QgsAbstractDataSourceWidget, protected Ui::QgsArcGisServiceSourceSelectBase
{
Q_OBJECT

@@ -55,13 +55,13 @@
#include <QNetworkReply>

QgsOWSSourceSelect::QgsOWSSourceSelect( const QString &service, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsSourceSelect( parent, fl, widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
, mService( service )
, mCurrentTileset( nullptr )
{
setupUi( this );

if ( QgsSourceSelect::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
}
@@ -88,7 +88,7 @@ QgsOWSSourceSelect::QgsOWSSourceSelect( const QString &service, QWidget *parent,
// 'Prefer network' is the default noted in the combobox's tool tip
mCacheComboBox->setCurrentIndex( mCacheComboBox->findData( QNetworkRequest::PreferNetwork ) );

if ( QgsSourceSelect::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
{
connect( mAddButton, &QAbstractButton::clicked, this, &QgsOWSSourceSelect::addClicked );
//set the current project CRS if available
@@ -26,7 +26,7 @@
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgsproviderregistry.h"
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"

#include <QStringList>
#include <QPushButton>
@@ -49,7 +49,7 @@ class QDomElement;
* The user can then connect and add
* layers from the WCS server to the map canvas.
*/
class GUI_EXPORT QgsOWSSourceSelect : public QgsSourceSelect, protected Ui::QgsOWSSourceSelectBase
class GUI_EXPORT QgsOWSSourceSelect : public QgsAbstractDataSourceWidget, protected Ui::QgsOWSSourceSelectBase
{
Q_OBJECT

@@ -117,15 +117,15 @@ void QgsDb2SourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemMod
}

QgsDb2SourceSelect::QgsDb2SourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsSourceSelect( parent, fl, widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
, mColumnTypeThread( NULL )
, mUseEstimatedMetadata( false )
{
setupUi( this );

setWindowTitle( tr( "Add Db2 Table(s)" ) );

if ( QgsSourceSelect::widgetMode() != QgsProviderRegistry::WidgetMode::None )
if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
@@ -138,7 +138,7 @@ QgsDb2SourceSelect::QgsDb2SourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

if ( QgsSourceSelect::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsDb2SourceSelect::addTables );
@@ -25,7 +25,7 @@
#include "qgsdb2tablemodel.h"
#include "qgshelp.h"
#include "qgsproviderregistry.h"
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"

#include <QMap>
#include <QPair>
@@ -88,7 +88,7 @@ class QgsDb2GeomColumnTypeThread : public QThread
* for Db2 databases. The user can then connect and add
* tables from the database to the map canvas.
*/
class QgsDb2SourceSelect : public QgsSourceSelect, private Ui::QgsDbSourceSelectBase
class QgsDb2SourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsDbSourceSelectBase
{
Q_OBJECT

@@ -35,7 +35,7 @@
const int MAX_SAMPLE_LENGTH = 200;

QgsDelimitedTextSourceSelect::QgsDelimitedTextSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsSourceSelect( parent, fl, widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
, mFile( new QgsDelimitedTextFile() )
, mExampleRowCount( 20 )
, mBadRowCount( 0 )
@@ -48,7 +48,7 @@ QgsDelimitedTextSourceSelect::QgsDelimitedTextSourceSelect( QWidget *parent, Qt:
QgsSettings settings;
restoreGeometry( settings.value( mPluginKey + "/geometry" ).toByteArray() );

if ( QgsSourceSelect::widgetMode() != QgsProviderRegistry::WidgetMode::None )
if ( QgsAbstractDataSourceWidget::widgetMode() != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Cancel ) );
buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Add" ) );
@@ -199,7 +199,7 @@ void QgsDelimitedTextSourceSelect::on_buttonBox_accepted()

// add the layer to the map
emit addVectorLayer( QString::fromAscii( url.toEncoded() ), txtLayerName->text(), QStringLiteral( "delimitedtext" ) );
if ( QgsSourceSelect::widgetMode() == QgsProviderRegistry::WidgetMode::None )
if ( QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -19,7 +19,7 @@
#include "qgshelp.h"
#include "qgsguiutils.h"
#include "qgsproviderregistry.h"
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"

class QButtonGroup;
class QgisInterface;
@@ -28,7 +28,7 @@ class QgsDelimitedTextFile;
/**
* \class QgsDelimitedTextSourceSelect
*/
class QgsDelimitedTextSourceSelect : public QgsSourceSelect, private Ui::QgsDelimitedTextSourceSelectBase
class QgsDelimitedTextSourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsDelimitedTextSourceSelectBase
{
Q_OBJECT

@@ -119,15 +119,15 @@ void QgsMssqlSourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemM
}

QgsMssqlSourceSelect::QgsMssqlSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsSourceSelect( parent, fl, widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode )
, mColumnTypeThread( nullptr )
, mUseEstimatedMetadata( false )
{
setupUi( this );

setWindowTitle( tr( "Add MSSQL Table(s)" ) );

if ( QgsSourceSelect::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
@@ -140,7 +140,7 @@ QgsMssqlSourceSelect::QgsMssqlSourceSelect( QWidget *parent, Qt::WindowFlags fl,
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

if ( QgsSourceSelect::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
if ( QgsAbstractDataSourceWidget::widgetMode( ) != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsMssqlSourceSelect::addTables );

0 comments on commit c4e26d7

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