@@ -164,21 +164,6 @@ void QgsWMSSourceSelect::populateConnectionList()
164164 cmbConnections->addItems ( QgsWMSConnection::connectionList () );
165165
166166 setConnectionListPosition ();
167-
168- if ( cmbConnections->count () == 0 )
169- {
170- // No connections - disable various buttons
171- btnConnect->setEnabled ( false );
172- btnEdit->setEnabled ( false );
173- btnDelete->setEnabled ( false );
174- }
175- else
176- {
177- // Connections - enable various buttons
178- btnConnect->setEnabled ( true );
179- btnEdit->setEnabled ( true );
180- btnDelete->setEnabled ( true );
181- }
182167}
183168void QgsWMSSourceSelect::on_btnNew_clicked ()
184169{
@@ -214,7 +199,7 @@ void QgsWMSSourceSelect::on_btnDelete_clicked()
214199 if ( result == QMessageBox::Ok )
215200 {
216201 QgsWMSConnection::deleteConnection ( cmbConnections->currentText () );
217- cmbConnections->removeItem ( cmbConnections->currentIndex () ); // populateConnectionList();
202+ cmbConnections->removeItem ( cmbConnections->currentIndex () );
218203 setConnectionListPosition ();
219204 emit connectionsChanged ();
220205 }
@@ -1024,6 +1009,21 @@ void QgsWMSSourceSelect::setConnectionListPosition()
10241009 else
10251010 cmbConnections->setCurrentIndex ( cmbConnections->count () - 1 );
10261011 }
1012+
1013+ if ( cmbConnections->count () == 0 )
1014+ {
1015+ // No connections - disable various buttons
1016+ btnConnect->setEnabled ( false );
1017+ btnEdit->setEnabled ( false );
1018+ btnDelete->setEnabled ( false );
1019+ }
1020+ else
1021+ {
1022+ // Connections - enable various buttons
1023+ btnConnect->setEnabled ( true );
1024+ btnEdit->setEnabled ( true );
1025+ btnDelete->setEnabled ( true );
1026+ }
10271027}
10281028
10291029void QgsWMSSourceSelect::showStatusMessage ( QString const &theMessage )
0 commit comments