From 948e7531afbecb64a29ec366386f254abb31cd78 Mon Sep 17 00:00:00 2001 From: qgis-bot <58983587+qgis-bot@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:27:16 +0100 Subject: [PATCH] [Backport release-3_40] WMS Ignore layer extent settings for default value (#59848) * WMS Ignore layer extent settings for default value * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Damiano Lombardi Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../PyQt6/gui/auto_generated/qgsnewhttpconnection.sip.in | 1 + python/gui/auto_generated/qgsnewhttpconnection.sip.in | 1 + src/gui/qgsnewhttpconnection.cpp | 4 ++++ src/gui/qgsnewhttpconnection.h | 8 ++++++++ 4 files changed, 14 insertions(+) diff --git a/python/PyQt6/gui/auto_generated/qgsnewhttpconnection.sip.in b/python/PyQt6/gui/auto_generated/qgsnewhttpconnection.sip.in index 70539ebd4f54..3b2820211c98 100644 --- a/python/PyQt6/gui/auto_generated/qgsnewhttpconnection.sip.in +++ b/python/PyQt6/gui/auto_generated/qgsnewhttpconnection.sip.in @@ -21,6 +21,7 @@ information for an HTTP Server for WMS, etc. #include "qgsnewhttpconnection.h" %End public: + enum ConnectionType /BaseType=IntEnum/ { ConnectionWfs, diff --git a/python/gui/auto_generated/qgsnewhttpconnection.sip.in b/python/gui/auto_generated/qgsnewhttpconnection.sip.in index 1d6df227db8c..7a1aa97cb883 100644 --- a/python/gui/auto_generated/qgsnewhttpconnection.sip.in +++ b/python/gui/auto_generated/qgsnewhttpconnection.sip.in @@ -21,6 +21,7 @@ information for an HTTP Server for WMS, etc. #include "qgsnewhttpconnection.h" %End public: + enum ConnectionType { ConnectionWfs, diff --git a/src/gui/qgsnewhttpconnection.cpp b/src/gui/qgsnewhttpconnection.cpp index c1b969bbb2e2..a444bc43d930 100644 --- a/src/gui/qgsnewhttpconnection.cpp +++ b/src/gui/qgsnewhttpconnection.cpp @@ -32,6 +32,8 @@ #include #include +const QgsSettingsEntryBool *QgsNewHttpConnection::settingsIgnoreReportedLayerExtentsDefault = new QgsSettingsEntryBool( QStringLiteral( "ignore-reported-layer-extents-default" ), sTreeHttpConnectionDialog, false ); + QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes types, const QString &serviceName, const QString &connectionName, QgsNewHttpConnection::Flags flags, Qt::WindowFlags fl ) : QDialog( parent, fl ) , mTypes( types ) @@ -154,6 +156,8 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ } } + cbxWmsIgnoreReportedLayerExtents->setChecked( settingsIgnoreReportedLayerExtentsDefault->value() ); + if ( !( flags & FlagShowTestConnection ) ) { mTestConnectionButton->hide(); diff --git a/src/gui/qgsnewhttpconnection.h b/src/gui/qgsnewhttpconnection.h index 8be2cf1ba25c..7567c5f332a2 100644 --- a/src/gui/qgsnewhttpconnection.h +++ b/src/gui/qgsnewhttpconnection.h @@ -22,8 +22,10 @@ #include "ui_qgsnewhttpconnectionbase.h" #include "qgsguiutils.h" #include "qgis_gui.h" +#include "qgssettingstree.h" class QgsAuthSettingsWidget; +class QgsSettingsEntryBool; /** * \ingroup gui @@ -35,6 +37,12 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo Q_OBJECT public: +#ifndef SIP_RUN + static inline QgsSettingsTreeNode *sTreeHttpConnectionDialog = QgsSettingsTree::sTreeConnections->createChildNode( QStringLiteral( "http-connection-dialog" ) ); + + static const QgsSettingsEntryBool *settingsIgnoreReportedLayerExtentsDefault; +#endif + /** * Available connection types for configuring in the dialog. */