Skip to content

Commit

Permalink
Merge pull request #7061 from rouault/wms_wmts
Browse files Browse the repository at this point in the history
WMS provider: use 'WMS/WMTS' instead of 'WMS' in various UI labels (fixes #18883)
  • Loading branch information
m-kuhn authored May 25, 2018
2 parents 99b6194 + 83b0bd7 commit 9aa5ac0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/gui/qgsnewhttpconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ

QRegExp rx( "/connections-([^/]+)/" );
if ( rx.indexIn( baseKey ) != -1 )
setWindowTitle( tr( "Create a New %1 Connection" ).arg( rx.cap( 1 ).toUpper() ) );
{
QString connectionType( rx.cap( 1 ).toUpper() );
if ( connectionType == QLatin1String( "WMS" ) )
{
connectionType = QStringLiteral( "WMS/WMTS" );
}
setWindowTitle( tr( "Create a New %1 Connection" ).arg( connectionType ) );
}

// It would be obviously much better to use mBaseKey also for credentials,
// but for some strange reason a different hardcoded key was used instead.
Expand Down
4 changes: 2 additions & 2 deletions src/providers/wms/qgswmsdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ QgsDataItem *QgsWmsDataItemProvider::createDataItem( const QString &path, QgsDat
QgsDebugMsg( "path = " + path );
if ( path.isEmpty() )
{
return new QgsWMSRootItem( parentItem, QStringLiteral( "WMS" ), QStringLiteral( "wms:" ) );
return new QgsWMSRootItem( parentItem, QStringLiteral( "WMS/WMTS" ), QStringLiteral( "wms:" ) );
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4241,7 +4241,7 @@ class QgsWmsSourceSelectProvider : public QgsSourceSelectProvider
public:

QString providerKey() const override { return QStringLiteral( "wms" ); }
QString text() const override { return QObject::tr( "WMS" ); }
QString text() const override { return QStringLiteral( "WMS/WMTS" ); } // untranslatable string as acronym for this particular case. Use QObject::tr() otherwise
int ordering() const override { return QgsSourceSelectProvider::OrderRemoteProvider + 10; }
QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddWmsLayer.svg" ) ); }
QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const override
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsnewhttpconnectionbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="mWmsOptionsGroupBox">
<property name="title">
<string>WMS Options</string>
<string>WMS/WMTS Options</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="5" column="0" colspan="2">
Expand Down

0 comments on commit 9aa5ac0

Please sign in to comment.