@@ -56,9 +56,16 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl )
56
56
mWmsProvider( 0 )
57
57
{
58
58
setupUi ( this );
59
+ mAddButton = new QPushButton ( tr ( " &Add" ) );
60
+ buttonBox->addButton ( mAddButton , QDialogButtonBox::ActionRole );
61
+ connect ( mAddButton ,SIGNAL ( clicked () ), this , SLOT ( addClicked () ) );
62
+ connect ( buttonBox,SIGNAL ( helpRequested () ), this , SLOT ( helpClicked () ) );
63
+
59
64
mLayerUpButton ->setIcon ( QgisApp::getThemeIcon ( " /mActionArrowUp.png" ) );
60
65
mLayerDownButton ->setIcon ( QgisApp::getThemeIcon ( " /mActionArrowDown.png" ) );
61
- connect ( btnCancel, SIGNAL ( clicked () ), this , SLOT ( reject () ) );
66
+
67
+ mAddButton ->setEnabled ( false );
68
+ populateConnectionList ();
62
69
63
70
// Qt Designer 4.1 doesn't let us use a QButtonGroup, so it has to
64
71
// be done manually... Unless I'm missing something, it's a whole
@@ -201,7 +208,7 @@ void QgsWMSSourceSelect::on_btnDelete_clicked()
201
208
}
202
209
}
203
210
204
- void QgsWMSSourceSelect::on_btnHelp_clicked ()
211
+ void QgsWMSSourceSelect::helpClicked ()
205
212
{
206
213
207
214
QgsContextHelp::run ( context_id );
@@ -283,7 +290,7 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
283
290
// If we got some layers, let the user add them to the map
284
291
if ( lstLayers->topLevelItemCount () > 0 )
285
292
{
286
- btnAdd ->setEnabled ( TRUE );
293
+ mAddButton ->setEnabled ( TRUE );
287
294
288
295
if ( lstLayers->topLevelItemCount () == 1 )
289
296
{
@@ -292,7 +299,7 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
292
299
}
293
300
else
294
301
{
295
- btnAdd ->setEnabled ( FALSE );
302
+ mAddButton ->setEnabled ( FALSE );
296
303
}
297
304
298
305
return TRUE ;
@@ -427,7 +434,7 @@ void QgsWMSSourceSelect::on_btnConnect_clicked()
427
434
428
435
}
429
436
430
- void QgsWMSSourceSelect::on_btnAdd_clicked ()
437
+ void QgsWMSSourceSelect::addClicked ()
431
438
{
432
439
if ( selectedLayers ().empty () == TRUE )
433
440
{
0 commit comments