Skip to content

Commit

Permalink
[needs-docs] remove "Add default servers" button from the WMS
Browse files Browse the repository at this point in the history
conenctions dialog (fix #29873)
  • Loading branch information
alexbruy committed Apr 23, 2020
1 parent f1c0b8a commit 7fcdbca
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 56 deletions.
35 changes: 0 additions & 35 deletions src/providers/wms/qgswmssourceselect.cpp
Expand Up @@ -70,7 +70,6 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs
connect( btnChangeSpatialRefSys, &QPushButton::clicked, this, &QgsWMSSourceSelect::btnChangeSpatialRefSys_clicked );
connect( lstLayers, &QTreeWidget::itemSelectionChanged, this, &QgsWMSSourceSelect::lstLayers_itemSelectionChanged );
connect( cmbConnections, static_cast<void ( QComboBox::* )( int )>( &QComboBox::activated ), this, &QgsWMSSourceSelect::cmbConnections_activated );
connect( btnAddDefault, &QPushButton::clicked, this, &QgsWMSSourceSelect::btnAddDefault_clicked );
connect( btnSearch, &QPushButton::clicked, this, &QgsWMSSourceSelect::btnSearch_clicked );
connect( btnAddWMS, &QPushButton::clicked, this, &QgsWMSSourceSelect::btnAddWMS_clicked );
connect( tableWidgetWMSList, &QTableWidget::itemSelectionChanged, this, &QgsWMSSourceSelect::tableWidgetWMSList_itemSelectionChanged );
Expand Down Expand Up @@ -1123,11 +1122,6 @@ void QgsWMSSourceSelect::cmbConnections_activated( int )
QgsWMSConnection::setSelectedConnection( cmbConnections->currentText() );
}

void QgsWMSSourceSelect::btnAddDefault_clicked()
{
addDefaultServers();
}

QString QgsWMSSourceSelect::descriptionForAuthId( const QString &authId )
{
if ( mCrsNames.contains( authId ) )
Expand All @@ -1138,35 +1132,6 @@ QString QgsWMSSourceSelect::descriptionForAuthId( const QString &authId )
return qgisSrs.userFriendlyIdentifier();
}

void QgsWMSSourceSelect::addDefaultServers()
{
QMap<QString, QString> exampleServers;
exampleServers[QStringLiteral( "QGIS Server Demo - Alaska" )] = QStringLiteral( "http://demo.qgis.org/cgi-bin/qgis_mapserv.fcgi?map=/web/demos/alaska/alaska_map.qgs" );
exampleServers[QStringLiteral( "Geoserver Demo" )] = QStringLiteral( "https://demo.geo-solutions.it/geoserver/wms/" );
exampleServers[QStringLiteral( "Mapserver Demo" )] = QStringLiteral( "http://demo.mapserver.org/cgi-bin/wms" );

QgsSettings settings;
settings.beginGroup( QStringLiteral( "qgis/connections-wms" ) );
QMap<QString, QString>::const_iterator i = exampleServers.constBegin();
for ( ; i != exampleServers.constEnd(); ++i )
{
// Only do a server if it's name doesn't already exist.
QStringList keys = settings.childGroups();
if ( !keys.contains( i.key() ) )
{
QString path = i.key();
settings.setValue( path + "/url", i.value() );
}
}
settings.endGroup();
populateConnectionList();

QMessageBox::information( this, tr( "WMS proxies" ), "<p>" + tr( "Several WMS servers have "
"been added to the server list. Note that if "
"you access the internet via a web proxy, you will "
"need to set the proxy settings in the QGIS options dialog." ) + "</p>" );
}

void QgsWMSSourceSelect::addWMSListRow( const QDomElement &item, int row )
{
QDomElement title = item.firstChildElement( QStringLiteral( "title" ) );
Expand Down
6 changes: 0 additions & 6 deletions src/providers/wms/qgswmssourceselect.h
Expand Up @@ -95,9 +95,6 @@ class QgsWMSSourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsWM
//! Stores the selected datasource whenerver it is changed
void cmbConnections_activated( int );

//! Add some default wms servers to the list
void btnAddDefault_clicked();

private:
//! Populate the connection list combo box
void populateConnectionList();
Expand All @@ -108,9 +105,6 @@ class QgsWMSSourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsWM
//! Sets the server connection combo box to that stored in the config file.
void setConnectionListPosition();

//! Add a few example servers to the list.
void addDefaultServers();

//! Selected CRS
QString mCRS;

Expand Down
16 changes: 1 addition & 15 deletions src/ui/qgswmssourceselectbase.ui
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>773</width>
<width>744</width>
<height>544</height>
</rect>
</property>
Expand Down Expand Up @@ -125,19 +125,6 @@
</property>
</spacer>
</item>
<item row="1" column="11">
<widget class="QPushButton" name="btnAddDefault">
<property name="statusTip">
<string>Adds a few example WMS servers</string>
</property>
<property name="whatsThis">
<string comment="Adds several example WMS servers to the list"/>
</property>
<property name="text">
<string>Add Default Servers</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="12">
<widget class="QTreeWidget" name="lstLayers">
<property name="sizePolicy">
Expand Down Expand Up @@ -507,7 +494,6 @@
<tabstop>btnDelete</tabstop>
<tabstop>btnLoad</tabstop>
<tabstop>btnSave</tabstop>
<tabstop>btnAddDefault</tabstop>
<tabstop>lstLayers</tabstop>
<tabstop>mTileWidth</tabstop>
<tabstop>mTileHeight</tabstop>
Expand Down

0 comments on commit 7fcdbca

Please sign in to comment.