Skip to content

Commit 9aa5ac0

Browse files
authored
Merge pull request #7061 from rouault/wms_wmts
WMS provider: use 'WMS/WMTS' instead of 'WMS' in various UI labels (fixes #18883)
2 parents 99b6194 + 83b0bd7 commit 9aa5ac0

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/gui/qgsnewhttpconnection.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ
3636

3737
QRegExp rx( "/connections-([^/]+)/" );
3838
if ( rx.indexIn( baseKey ) != -1 )
39-
setWindowTitle( tr( "Create a New %1 Connection" ).arg( rx.cap( 1 ).toUpper() ) );
39+
{
40+
QString connectionType( rx.cap( 1 ).toUpper() );
41+
if ( connectionType == QLatin1String( "WMS" ) )
42+
{
43+
connectionType = QStringLiteral( "WMS/WMTS" );
44+
}
45+
setWindowTitle( tr( "Create a New %1 Connection" ).arg( connectionType ) );
46+
}
4047

4148
// It would be obviously much better to use mBaseKey also for credentials,
4249
// but for some strange reason a different hardcoded key was used instead.

src/providers/wms/qgswmsdataitems.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ QgsDataItem *QgsWmsDataItemProvider::createDataItem( const QString &path, QgsDat
422422
QgsDebugMsg( "path = " + path );
423423
if ( path.isEmpty() )
424424
{
425-
return new QgsWMSRootItem( parentItem, QStringLiteral( "WMS" ), QStringLiteral( "wms:" ) );
425+
return new QgsWMSRootItem( parentItem, QStringLiteral( "WMS/WMTS" ), QStringLiteral( "wms:" ) );
426426
}
427427

428428
// path schema: wms:/connection name (used by OWS)
@@ -432,7 +432,7 @@ QgsDataItem *QgsWmsDataItemProvider::createDataItem( const QString &path, QgsDat
432432
if ( QgsWMSConnection::connectionList().contains( connectionName ) )
433433
{
434434
QgsWMSConnection connection( connectionName );
435-
return new QgsWMSConnectionItem( parentItem, QStringLiteral( "WMS" ), path, connection.uri().encodedUri() );
435+
return new QgsWMSConnectionItem( parentItem, QStringLiteral( "WMS/WMTS" ), path, connection.uri().encodedUri() );
436436
}
437437
}
438438

src/providers/wms/qgswmsprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4241,7 +4241,7 @@ class QgsWmsSourceSelectProvider : public QgsSourceSelectProvider
42414241
public:
42424242

42434243
QString providerKey() const override { return QStringLiteral( "wms" ); }
4244-
QString text() const override { return QObject::tr( "WMS" ); }
4244+
QString text() const override { return QStringLiteral( "WMS/WMTS" ); } // untranslatable string as acronym for this particular case. Use QObject::tr() otherwise
42454245
int ordering() const override { return QgsSourceSelectProvider::OrderRemoteProvider + 10; }
42464246
QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddWmsLayer.svg" ) ); }
42474247
QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const override

src/ui/qgsnewhttpconnectionbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<item row="3" column="0" colspan="2">
119119
<widget class="QGroupBox" name="mWmsOptionsGroupBox">
120120
<property name="title">
121-
<string>WMS Options</string>
121+
<string>WMS/WMTS Options</string>
122122
</property>
123123
<layout class="QGridLayout" name="gridLayout_2">
124124
<item row="5" column="0" colspan="2">

0 commit comments

Comments
 (0)