@@ -50,6 +50,12 @@ QgsNewHttpConnection::QgsNewHttpConnection(
50
50
cmbDpiMode->addItem ( tr ( " UMN" ) );
51
51
cmbDpiMode->addItem ( tr ( " GeoServer" ) );
52
52
53
+ cmbVersion->clear ();
54
+ cmbVersion->addItem ( tr ( " Auto-detect" ) );
55
+ cmbVersion->addItem ( tr ( " 1.0" ) );
56
+ cmbVersion->addItem ( tr ( " 1.1" ) );
57
+ cmbVersion->addItem ( tr ( " 2.0" ) );
58
+
53
59
mAuthConfigSelect = new QgsAuthConfigSelect ( this );
54
60
tabAuth->insertTab ( 1 , mAuthConfigSelect , tr ( " Configurations" ) );
55
61
@@ -92,7 +98,18 @@ QgsNewHttpConnection::QgsNewHttpConnection(
92
98
}
93
99
cmbDpiMode->setCurrentIndex ( dpiIdx );
94
100
101
+ QString version = settings.value ( key + " /version" ).toString ();
102
+ int versionIdx = 0 ; // AUTO
103
+ if ( version == " 1.0.0" )
104
+ versionIdx = 1 ;
105
+ else if ( version == " 1.1.0" )
106
+ versionIdx = 2 ;
107
+ else if ( version == " 2.0.0" )
108
+ versionIdx = 3 ;
109
+ cmbVersion->setCurrentIndex ( versionIdx );
110
+
95
111
txtReferer->setText ( settings.value ( key + " /referer" ).toString () );
112
+ txtMaxNumFeatures->setText ( settings.value ( key + " /maxnumfeatures" ).toString () );
96
113
97
114
txtUserName->setText ( settings.value ( credentialsKey + " /username" ).toString () );
98
115
txtPassword->setText ( settings.value ( credentialsKey + " /password" ).toString () );
@@ -107,6 +124,20 @@ QgsNewHttpConnection::QgsNewHttpConnection(
107
124
108
125
if ( mBaseKey != " /Qgis/connections-wms/" )
109
126
{
127
+ if ( mBaseKey != " /Qgis/connections-wcs/" &&
128
+ mBaseKey != " /Qgis/connections-wfs/" )
129
+ {
130
+ cbxIgnoreAxisOrientation->setVisible ( false );
131
+ cbxInvertAxisOrientation->setVisible ( false );
132
+ mGroupBox ->layout ()->removeWidget ( cbxIgnoreAxisOrientation );
133
+ mGroupBox ->layout ()->removeWidget ( cbxInvertAxisOrientation );
134
+ }
135
+
136
+ if ( mBaseKey == " /Qgis/connections-wfs/" )
137
+ {
138
+ cbxIgnoreAxisOrientation->setText ( tr ( " Ignore axis orientation (WFS 1.1/WFS 2.0)" ) );
139
+ }
140
+
110
141
if ( mBaseKey == " /Qgis/connections-wcs/" )
111
142
{
112
143
cbxIgnoreGetMapURI->setText ( tr ( " Ignore GetCoverage URI reported in capabilities" ) );
@@ -115,12 +146,8 @@ QgsNewHttpConnection::QgsNewHttpConnection(
115
146
else
116
147
{
117
148
cbxIgnoreGetMapURI->setVisible ( false );
118
- cbxIgnoreAxisOrientation->setVisible ( false );
119
- cbxInvertAxisOrientation->setVisible ( false );
120
149
cbxSmoothPixmapTransform->setVisible ( false );
121
150
mGroupBox ->layout ()->removeWidget ( cbxIgnoreGetMapURI );
122
- mGroupBox ->layout ()->removeWidget ( cbxIgnoreAxisOrientation );
123
- mGroupBox ->layout ()->removeWidget ( cbxInvertAxisOrientation );
124
151
mGroupBox ->layout ()->removeWidget ( cbxSmoothPixmapTransform );
125
152
}
126
153
@@ -136,13 +163,23 @@ QgsNewHttpConnection::QgsNewHttpConnection(
136
163
mGroupBox ->layout ()->removeWidget ( txtReferer );
137
164
lblReferer->setVisible ( false );
138
165
mGroupBox ->layout ()->removeWidget ( lblReferer );
166
+ }
139
167
140
- // Adjust height
141
- int w = width ();
142
- adjustSize ();
143
- resize ( w, height () );
168
+ if ( mBaseKey != " /Qgis/connections-wfs/" )
169
+ {
170
+ cmbVersion->setVisible ( false );
171
+ mGroupBox ->layout ()->removeWidget ( cmbVersion );
172
+ lblMaxNumFeatures->setVisible ( false );
173
+ mGroupBox ->layout ()->removeWidget ( lblMaxNumFeatures );
174
+ txtMaxNumFeatures->setVisible ( false );
175
+ mGroupBox ->layout ()->removeWidget ( txtMaxNumFeatures );
144
176
}
145
177
178
+ // Adjust height
179
+ int w = width ();
180
+ adjustSize ();
181
+ resize ( w, height () );
182
+
146
183
on_txtName_textChanged ( connName );
147
184
}
148
185
@@ -219,11 +256,18 @@ void QgsNewHttpConnection::accept()
219
256
}
220
257
221
258
settings.setValue ( key + " /url" , url.toString () );
222
- if ( mBaseKey == " /Qgis/connections-wms/" || mBaseKey == " /Qgis/connections-wcs/" )
259
+
260
+ if ( mBaseKey == " /Qgis/connections-wms/" ||
261
+ mBaseKey == " /Qgis/connections-wcs/" ||
262
+ mBaseKey == " /Qgis/connections-wfs/" )
223
263
{
224
- settings.setValue ( key + " /ignoreGetMapURI" , cbxIgnoreGetMapURI->isChecked () );
225
264
settings.setValue ( key + " /ignoreAxisOrientation" , cbxIgnoreAxisOrientation->isChecked () );
226
265
settings.setValue ( key + " /invertAxisOrientation" , cbxInvertAxisOrientation->isChecked () );
266
+ }
267
+
268
+ if ( mBaseKey == " /Qgis/connections-wms/" || mBaseKey == " /Qgis/connections-wcs/" )
269
+ {
270
+ settings.setValue ( key + " /ignoreGetMapURI" , cbxIgnoreGetMapURI->isChecked () );
227
271
settings.setValue ( key + " /smoothPixmapTransform" , cbxSmoothPixmapTransform->isChecked () );
228
272
229
273
int dpiMode = 0 ;
@@ -252,6 +296,28 @@ void QgsNewHttpConnection::accept()
252
296
{
253
297
settings.setValue ( key + " /ignoreGetFeatureInfoURI" , cbxIgnoreGetFeatureInfoURI->isChecked () );
254
298
}
299
+ if ( mBaseKey == " /Qgis/connections-wfs/" )
300
+ {
301
+ QString version = " auto" ;
302
+ switch ( cmbVersion->currentIndex () )
303
+ {
304
+ case 0 :
305
+ version = " auto" ;
306
+ break ;
307
+ case 1 :
308
+ version = " 1.0.0" ;
309
+ break ;
310
+ case 2 :
311
+ version = " 1.1.0" ;
312
+ break ;
313
+ case 3 :
314
+ version = " 2.0.0" ;
315
+ break ;
316
+ }
317
+ settings.setValue ( key + " /version" , version );
318
+
319
+ settings.setValue ( key + " /maxnumfeatures" , txtMaxNumFeatures->text () );
320
+ }
255
321
256
322
settings.setValue ( key + " /referer" , txtReferer->text () );
257
323
0 commit comments