Skip to content

Commit

Permalink
Renamed base class to QgsAbstractDataSourceWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jul 18, 2017
1 parent aba9da5 commit c4e26d7
Show file tree
Hide file tree
Showing 29 changed files with 80 additions and 80 deletions.
2 changes: 1 addition & 1 deletion python/gui/gui_auto.sip
Expand Up @@ -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
Expand Down
@@ -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 *
************************************************************************/
Expand All @@ -10,7 +10,7 @@



class QgsSourceSelect : QDialog
class QgsAbstractDataSourceWidget : QDialog
{
%Docstring
Abstract base Data Source Widget to create connections and add layers
Expand All @@ -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
Expand Down Expand Up @@ -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 *
************************************************************************/
2 changes: 1 addition & 1 deletion python/gui/qgsarcgisservicesourceselect.sip
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsowssourceselect.sip
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/gui/CMakeLists.txt
Expand Up @@ -346,7 +346,7 @@ SET(QGIS_GUI_SRCS
qgsvertexmarker.cpp
qgsfiledownloader.cpp
qgsdatasourcemanagerdialog.cpp
qgssourceselect.cpp
qgsabstractdatasourcewidget.cpp
)

SET(QGIS_GUI_MOC_HDRS
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -706,7 +706,7 @@ SET(QGIS_GUI_HDRS
qgsvertexmarker.h
qgsfiledownloader.h
qgsdatasourcemanagerdialog.h
qgssourceselect.h
qgsabstractdatasourcewidget.h

ogr/qgsopenvectorlayerdialog.h
ogr/qgsogrhelperfunctions.h
Expand Down
@@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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; }
Expand All @@ -64,4 +64,4 @@ class GUI_EXPORT QgsSourceSelect : public QDialog
QgsProviderRegistry::WidgetMode mWidgetMode;
};

#endif // QGSSOURCESELECT_H
#endif // QGSABSTRACTDATASOURCEWIDGET_H
10 changes: 5 additions & 5 deletions src/gui/qgsarcgisservicesourceselect.cpp
Expand Up @@ -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 ),
Expand Down Expand Up @@ -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() );
Expand Down Expand Up @@ -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() )
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsarcgisservicesourceselect.h
Expand Up @@ -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;
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsowssourceselect.cpp
Expand Up @@ -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 ) );
}
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsowssourceselect.h
Expand Up @@ -26,7 +26,7 @@
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgsproviderregistry.h"
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"

#include <QStringList>
#include <QPushButton>
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/providers/db2/qgsdb2sourceselect.cpp
Expand Up @@ -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();
Expand All @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/providers/db2/qgsdb2sourceselect.h
Expand Up @@ -25,7 +25,7 @@
#include "qgsdb2tablemodel.h"
#include "qgshelp.h"
#include "qgsproviderregistry.h"
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"

#include <QMap>
#include <QPair>
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
Expand Up @@ -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 )
Expand All @@ -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" ) );
Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/providers/delimitedtext/qgsdelimitedtextsourceselect.h
Expand Up @@ -19,7 +19,7 @@
#include "qgshelp.h"
#include "qgsguiutils.h"
#include "qgsproviderregistry.h"
#include "qgssourceselect.h"
#include "qgsabstractdatasourcewidget.h"

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

Expand Down
6 changes: 3 additions & 3 deletions src/providers/mssql/qgsmssqlsourceselect.cpp
Expand Up @@ -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();
Expand All @@ -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 );
Expand Down

0 comments on commit c4e26d7

Please sign in to comment.