1
1
/* **************************************************************************
2
- qgssourceselectdialog .cpp
2
+ qgsarcgisservicesourceselect .cpp
3
3
-------------------------
4
4
begin : Nov 26, 2015
5
5
copyright : (C) 2015 by Sandro Mani
15
15
* *
16
16
***************************************************************************/
17
17
18
- #include " qgssourceselectdialog .h"
18
+ #include " qgsarcgisservicesourceselect .h"
19
19
#include " qgsowsconnection.h"
20
20
#include " qgsnewhttpconnection.h"
21
21
#include " qgsprojectionselectiondialog.h"
@@ -49,7 +49,7 @@ class QgsSourceSelectItemDelegate : public QItemDelegate
49
49
};
50
50
51
51
52
- QgsSourceSelectDialog::QgsSourceSelectDialog ( const QString &serviceName, ServiceType serviceType, QWidget *parent, Qt::WindowFlags fl )
52
+ QgsArcGisServiceSourceSelect::QgsArcGisServiceSourceSelect ( const QString &serviceName, ServiceType serviceType, QWidget *parent, Qt::WindowFlags fl )
53
53
: QDialog( parent, fl ),
54
54
mServiceName( serviceName ),
55
55
mServiceType( serviceType ),
@@ -61,22 +61,22 @@ QgsSourceSelectDialog::QgsSourceSelectDialog( const QString &serviceName, Servic
61
61
62
62
mAddButton = buttonBox->addButton ( tr ( " &Add" ), QDialogButtonBox::ActionRole );
63
63
mAddButton ->setEnabled ( false );
64
- connect ( mAddButton , &QAbstractButton::clicked, this , &QgsSourceSelectDialog ::addButtonClicked );
64
+ connect ( mAddButton , &QAbstractButton::clicked, this , &QgsArcGisServiceSourceSelect ::addButtonClicked );
65
65
66
66
if ( mServiceType == FeatureService )
67
67
{
68
68
mBuildQueryButton = buttonBox->addButton ( tr ( " &Build query" ), QDialogButtonBox::ActionRole );
69
69
mBuildQueryButton ->setDisabled ( true );
70
- connect ( mBuildQueryButton , &QAbstractButton::clicked, this , &QgsSourceSelectDialog ::buildQueryButtonClicked );
70
+ connect ( mBuildQueryButton , &QAbstractButton::clicked, this , &QgsArcGisServiceSourceSelect ::buildQueryButtonClicked );
71
71
}
72
72
73
73
connect ( buttonBox, &QDialogButtonBox::rejected, this , &QDialog::reject );
74
- connect ( btnNew, &QAbstractButton::clicked, this , &QgsSourceSelectDialog ::addEntryToServerList );
75
- connect ( btnEdit, &QAbstractButton::clicked, this , &QgsSourceSelectDialog ::modifyEntryOfServerList );
76
- connect ( btnDelete, &QAbstractButton::clicked, this , &QgsSourceSelectDialog ::deleteEntryOfServerList );
77
- connect ( btnConnect, &QAbstractButton::clicked, this , &QgsSourceSelectDialog ::connectToServer );
78
- connect ( btnChangeSpatialRefSys, &QAbstractButton::clicked, this , &QgsSourceSelectDialog ::changeCrs );
79
- connect ( lineFilter, &QLineEdit::textChanged, this , &QgsSourceSelectDialog ::filterChanged );
74
+ connect ( btnNew, &QAbstractButton::clicked, this , &QgsArcGisServiceSourceSelect ::addEntryToServerList );
75
+ connect ( btnEdit, &QAbstractButton::clicked, this , &QgsArcGisServiceSourceSelect ::modifyEntryOfServerList );
76
+ connect ( btnDelete, &QAbstractButton::clicked, this , &QgsArcGisServiceSourceSelect ::deleteEntryOfServerList );
77
+ connect ( btnConnect, &QAbstractButton::clicked, this , &QgsArcGisServiceSourceSelect ::connectToServer );
78
+ connect ( btnChangeSpatialRefSys, &QAbstractButton::clicked, this , &QgsArcGisServiceSourceSelect ::changeCrs );
79
+ connect ( lineFilter, &QLineEdit::textChanged, this , &QgsArcGisServiceSourceSelect ::filterChanged );
80
80
populateConnectionList ();
81
81
mProjectionSelector = new QgsProjectionSelectionDialog ( this );
82
82
mProjectionSelector ->setMessage ( QString () );
@@ -108,11 +108,11 @@ QgsSourceSelectDialog::QgsSourceSelectDialog( const QString &serviceName, Servic
108
108
mModelProxy ->setSortCaseSensitivity ( Qt::CaseInsensitive );
109
109
treeView->setModel ( mModelProxy );
110
110
111
- connect ( treeView, &QAbstractItemView::doubleClicked, this , &QgsSourceSelectDialog ::treeWidgetItemDoubleClicked );
112
- connect ( treeView->selectionModel (), &QItemSelectionModel::currentRowChanged, this , &QgsSourceSelectDialog ::treeWidgetCurrentRowChanged );
111
+ connect ( treeView, &QAbstractItemView::doubleClicked, this , &QgsArcGisServiceSourceSelect ::treeWidgetItemDoubleClicked );
112
+ connect ( treeView->selectionModel (), &QItemSelectionModel::currentRowChanged, this , &QgsArcGisServiceSourceSelect ::treeWidgetCurrentRowChanged );
113
113
}
114
114
115
- QgsSourceSelectDialog ::~QgsSourceSelectDialog ()
115
+ QgsArcGisServiceSourceSelect ::~QgsArcGisServiceSourceSelect ()
116
116
{
117
117
QgsSettings settings;
118
118
settings.setValue ( QStringLiteral ( " Windows/SourceSelectDialog/geometry" ), saveGeometry () );
@@ -123,13 +123,13 @@ QgsSourceSelectDialog::~QgsSourceSelectDialog()
123
123
delete mModelProxy ;
124
124
}
125
125
126
- void QgsSourceSelectDialog ::setCurrentExtentAndCrs ( const QgsRectangle &canvasExtent, const QgsCoordinateReferenceSystem &canvasCrs )
126
+ void QgsArcGisServiceSourceSelect ::setCurrentExtentAndCrs ( const QgsRectangle &canvasExtent, const QgsCoordinateReferenceSystem &canvasCrs )
127
127
{
128
128
mCanvasExtent = canvasExtent;
129
129
mCanvasCrs = canvasCrs;
130
130
}
131
131
132
- void QgsSourceSelectDialog ::populateImageEncodings ( const QStringList &availableEncodings )
132
+ void QgsArcGisServiceSourceSelect ::populateImageEncodings ( const QStringList &availableEncodings )
133
133
{
134
134
QLayoutItem *item = nullptr ;
135
135
while ( ( item = gbImageEncoding->layout ()->takeAt ( 0 ) ) != nullptr )
@@ -162,12 +162,12 @@ void QgsSourceSelectDialog::populateImageEncodings( const QStringList &available
162
162
}
163
163
}
164
164
165
- QString QgsSourceSelectDialog ::getSelectedImageEncoding () const
165
+ QString QgsArcGisServiceSourceSelect ::getSelectedImageEncoding () const
166
166
{
167
167
return mImageEncodingGroup ? mImageEncodingGroup ->checkedButton ()->text () : QString ();
168
168
}
169
169
170
- void QgsSourceSelectDialog ::populateConnectionList ()
170
+ void QgsArcGisServiceSourceSelect ::populateConnectionList ()
171
171
{
172
172
QStringList conns = QgsOwsConnection::connectionList ( mServiceName );
173
173
cmbConnections->clear ();
@@ -190,7 +190,7 @@ void QgsSourceSelectDialog::populateConnectionList()
190
190
}
191
191
}
192
192
193
- QString QgsSourceSelectDialog ::getPreferredCrs ( const QSet<QString> &crsSet ) const
193
+ QString QgsArcGisServiceSourceSelect ::getPreferredCrs ( const QSet<QString> &crsSet ) const
194
194
{
195
195
if ( crsSet.size () < 1 )
196
196
{
@@ -221,7 +221,7 @@ QString QgsSourceSelectDialog::getPreferredCrs( const QSet<QString> &crsSet ) co
221
221
return *( crsSet.constBegin () );
222
222
}
223
223
224
- void QgsSourceSelectDialog ::addEntryToServerList ()
224
+ void QgsArcGisServiceSourceSelect ::addEntryToServerList ()
225
225
{
226
226
227
227
QgsNewHttpConnection nc ( 0 , QStringLiteral ( " qgis/connections-%1/" ).arg ( mServiceName .toLower () ) );
@@ -234,7 +234,7 @@ void QgsSourceSelectDialog::addEntryToServerList()
234
234
}
235
235
}
236
236
237
- void QgsSourceSelectDialog ::modifyEntryOfServerList ()
237
+ void QgsArcGisServiceSourceSelect ::modifyEntryOfServerList ()
238
238
{
239
239
QgsNewHttpConnection nc ( 0 , QStringLiteral ( " qgis/connections-%1/" ).arg ( mServiceName .toLower () ), cmbConnections->currentText () );
240
240
nc.setWindowTitle ( tr ( " Modify %1 connection" ).arg ( mServiceName ) );
@@ -246,7 +246,7 @@ void QgsSourceSelectDialog::modifyEntryOfServerList()
246
246
}
247
247
}
248
248
249
- void QgsSourceSelectDialog ::deleteEntryOfServerList ()
249
+ void QgsArcGisServiceSourceSelect ::deleteEntryOfServerList ()
250
250
{
251
251
QString msg = tr ( " Are you sure you want to remove the %1 connection and all associated settings?" )
252
252
.arg ( cmbConnections->currentText () );
@@ -264,7 +264,7 @@ void QgsSourceSelectDialog::deleteEntryOfServerList()
264
264
}
265
265
}
266
266
267
- void QgsSourceSelectDialog ::connectToServer ()
267
+ void QgsArcGisServiceSourceSelect ::connectToServer ()
268
268
{
269
269
bool haveLayers = false ;
270
270
btnConnect->setEnabled ( false );
@@ -308,7 +308,7 @@ void QgsSourceSelectDialog::connectToServer()
308
308
btnChangeSpatialRefSys->setEnabled ( haveLayers );
309
309
}
310
310
311
- void QgsSourceSelectDialog ::addButtonClicked ()
311
+ void QgsArcGisServiceSourceSelect ::addButtonClicked ()
312
312
{
313
313
if ( treeView->selectionModel ()->selectedRows ().isEmpty () )
314
314
{
@@ -368,7 +368,7 @@ void QgsSourceSelectDialog::addButtonClicked()
368
368
accept ();
369
369
}
370
370
371
- void QgsSourceSelectDialog ::changeCrs ()
371
+ void QgsArcGisServiceSourceSelect ::changeCrs ()
372
372
{
373
373
if ( mProjectionSelector ->exec () )
374
374
{
@@ -377,7 +377,7 @@ void QgsSourceSelectDialog::changeCrs()
377
377
}
378
378
}
379
379
380
- void QgsSourceSelectDialog ::changeCrsFilter ()
380
+ void QgsArcGisServiceSourceSelect ::changeCrsFilter ()
381
381
{
382
382
QgsDebugMsg ( " changeCRSFilter called" );
383
383
// evaluate currently selected typename and set the CRS filter in mProjectionSelector
@@ -411,20 +411,20 @@ void QgsSourceSelectDialog::changeCrsFilter()
411
411
}
412
412
}
413
413
414
- void QgsSourceSelectDialog ::on_cmbConnections_activated ( int index )
414
+ void QgsArcGisServiceSourceSelect ::on_cmbConnections_activated ( int index )
415
415
{
416
416
Q_UNUSED ( index );
417
417
QgsOwsConnection::setSelectedConnection ( mServiceName , cmbConnections->currentText () );
418
418
}
419
419
420
- void QgsSourceSelectDialog ::treeWidgetItemDoubleClicked ( const QModelIndex &index )
420
+ void QgsArcGisServiceSourceSelect ::treeWidgetItemDoubleClicked ( const QModelIndex &index )
421
421
{
422
422
QgsDebugMsg ( " double-click called" );
423
423
QgsOwsConnection connection ( mServiceName , cmbConnections->currentText () );
424
424
buildQuery ( connection, index );
425
425
}
426
426
427
- void QgsSourceSelectDialog ::treeWidgetCurrentRowChanged ( const QModelIndex ¤t, const QModelIndex &previous )
427
+ void QgsArcGisServiceSourceSelect ::treeWidgetCurrentRowChanged ( const QModelIndex ¤t, const QModelIndex &previous )
428
428
{
429
429
Q_UNUSED ( previous )
430
430
QgsDebugMsg ( " treeWidget_currentRowChanged called" );
@@ -436,14 +436,14 @@ void QgsSourceSelectDialog::treeWidgetCurrentRowChanged( const QModelIndex &curr
436
436
mAddButton ->setEnabled ( current.isValid () );
437
437
}
438
438
439
- void QgsSourceSelectDialog ::buildQueryButtonClicked ()
439
+ void QgsArcGisServiceSourceSelect ::buildQueryButtonClicked ()
440
440
{
441
441
QgsDebugMsg ( " mBuildQueryButton click called" );
442
442
QgsOwsConnection connection ( mServiceName , cmbConnections->currentText () );
443
443
buildQuery ( connection, treeView->selectionModel ()->currentIndex () );
444
444
}
445
445
446
- void QgsSourceSelectDialog ::filterChanged ( const QString &text )
446
+ void QgsArcGisServiceSourceSelect ::filterChanged ( const QString &text )
447
447
{
448
448
QgsDebugMsg ( " FeatureType filter changed to :" + text );
449
449
QRegExp::PatternSyntax mySyntax = QRegExp::PatternSyntax ( QRegExp::RegExp );
@@ -465,7 +465,7 @@ QSize QgsSourceSelectItemDelegate::sizeHint( const QStyleOptionViewItem &option,
465
465
return size;
466
466
}
467
467
468
- void QgsSourceSelectDialog ::on_buttonBox_helpRequested () const
468
+ void QgsArcGisServiceSourceSelect ::on_buttonBox_helpRequested () const
469
469
{
470
470
QgsContextHelp::run ( metaObject ()->className () );
471
471
}
0 commit comments