38  : QDialog( parent, fl )
 
   40  , mServiceName( serviceName )
 
   41  , mOriginalConnName( connectionName )
 
   46  if ( mServiceName.startsWith( QLatin1String( 
"qgis/" ) ) )
 
   53    mServiceName = mServiceName.split( 
'-' ).last().toUpper();
 
   61  connect( buttonBox, &QDialogButtonBox::helpRequested, 
this, &QgsNewHttpConnection::showHelp );
 
   63  QString connectionType = mServiceName;
 
   64  if ( mServiceName == QLatin1String( 
"WMS" ) )
 
   66    connectionType = QStringLiteral( 
"WMS/WMTS" );
 
   68  setWindowTitle( tr( 
"Create a New %1 Connection" ).arg( connectionType ) );
 
   70  txtName->setValidator( 
new QRegularExpressionValidator( QRegularExpression( 
"[^\\/]+" ), txtName ) );
 
   79  cmbTilePixelRatio->clear();
 
   85  cmbVersion->addItem( tr( 
"Maximum" ) );
 
   86  cmbVersion->addItem( tr( 
"1.0" ) );
 
   87  cmbVersion->addItem( tr( 
"1.1" ) );
 
   88  cmbVersion->addItem( tr( 
"2.0" ) );
 
   89  cmbVersion->addItem( tr( 
"OGC API - Features" ) );
 
   90  connect( cmbVersion, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsNewHttpConnection::wfsVersionCurrentIndexChanged );
 
   92  mComboWfsFeatureMode->clear();
 
   93  mComboWfsFeatureMode->addItem( tr( 
"Default" ), QStringLiteral( 
"default" ) );
 
   94  mComboWfsFeatureMode->addItem( tr( 
"Simple Features" ), QStringLiteral( 
"simpleFeatures" ) );
 
   95  mComboWfsFeatureMode->addItem( tr( 
"Complex Features" ), QStringLiteral( 
"complexFeatures" ) );
 
   99  mComboHttpMethod->setCurrentIndex( mComboHttpMethod->findData( QVariant::fromValue( 
Qgis::HttpMethod::Get ) ) );
 
  101  cmbFeaturePaging->clear();
 
  102  cmbFeaturePaging->addItem( tr( 
"Default (trust server capabilities)" ) );
 
  103  cmbFeaturePaging->addItem( tr( 
"Enabled" ) );
 
  104  cmbFeaturePaging->addItem( tr( 
"Disabled" ) );
 
  105  connect( cmbFeaturePaging, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged );
 
  109  if ( !connectionName.isEmpty() )
 
  114    txtName->setText( connectionName );
 
  115    const QStringList detailParameters { mServiceName.toLower(), connectionName };
 
  126  mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
 
  130    mWmsOptionsGroupBox->setVisible( 
false );
 
  131    mGroupBox->layout()->removeWidget( mWmsOptionsGroupBox );
 
  135    mWfsOptionsGroupBox->setVisible( 
false );
 
  136    mGroupBox->layout()->removeWidget( mWfsOptionsGroupBox );
 
  140    txtUrl->setToolTip( tr( 
"HTTP address of the WFS service, or landing page of a OGC API service<br>(an ending slash might be needed for some OGC API servers)" ) );
 
  145    cbxIgnoreGetMapURI->setText( tr( 
"Ignore GetCoverage URI reported in capabilities" ) );
 
  146    cbxWmsIgnoreAxisOrientation->setText( tr( 
"Ignore axis orientation" ) );
 
  149      mWmsOptionsGroupBox->setTitle( tr( 
"WCS Options" ) );
 
  151      cbxIgnoreGetFeatureInfoURI->setVisible( 
false );
 
  152      mWmsOptionsGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );
 
  154      sbFeatureCount->setVisible( 
false );
 
  155      mWmsOptionsGroupBox->layout()->removeWidget( sbFeatureCount );
 
  156      lblFeatureCount->setVisible( 
false );
 
  157      mWmsOptionsGroupBox->layout()->removeWidget( lblFeatureCount );
 
  159      cmbDpiMode->setVisible( 
false );
 
  160      mWmsOptionsGroupBox->layout()->removeWidget( cmbDpiMode );
 
  161      lblDpiMode->setVisible( 
false );
 
  162      mWmsOptionsGroupBox->layout()->removeWidget( lblDpiMode );
 
  163      cmbTilePixelRatio->setVisible( 
false );
 
  164      mWmsOptionsGroupBox->layout()->removeWidget( cmbTilePixelRatio );
 
  165      lblTilePixelRatio->setVisible( 
false );
 
  166      mWmsOptionsGroupBox->layout()->removeWidget( lblTilePixelRatio );
 
  172    mTestConnectionButton->hide();
 
  173    mGroupBox->layout()->removeWidget( mTestConnectionButton );
 
  178    mAuthGroupBox->hide();
 
  179    mGroupBox->layout()->removeWidget( mAuthGroupBox );
 
  182  connect( txtName, &QLineEdit::textChanged, 
this, &QgsNewHttpConnection::nameChanged );
 
  183  connect( txtUrl, &QLineEdit::textChanged, 
this, &QgsNewHttpConnection::urlChanged );
 
  185  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( 
true );
 
  186  connect( txtName, &QLineEdit::textChanged, 
this, &QgsNewHttpConnection::updateOkButtonState );
 
  187  connect( txtUrl, &QLineEdit::textChanged, 
this, &QgsNewHttpConnection::updateOkButtonState );
 
  189  nameChanged( connectionName );
 
 
  312  QStringList detailsParameters = { mServiceName.toLower(), mOriginalConnName };
 
  327  cmbDpiMode->setCurrentIndex( cmbDpiMode->findData( 
static_cast<int>( dpiMode ) ) );
 
  329  cmbTilePixelRatio->setCurrentIndex( cmbTilePixelRatio->findData( 
static_cast<int>( tilePixelRatio ) ) );
 
  335  if ( version == QLatin1String( 
"1.0.0" ) )
 
  337  else if ( version == QLatin1String( 
"1.1.0" ) )
 
  339  else if ( version == QLatin1String( 
"2.0.0" ) )
 
  341  else if ( version == QLatin1String( 
"OGC_API_FEATURES" ) )
 
  343  cmbVersion->setCurrentIndex( versionIdx );
 
  346  wfsVersionCurrentIndexChanged( versionIdx );
 
  354  if ( pagingEnabled == QLatin1String( 
"enabled" ) )
 
  356  else if ( pagingEnabled == QLatin1String( 
"disabled" ) )
 
  362  mComboWfsFeatureMode->setCurrentIndex( std::max( mComboWfsFeatureMode->findData( wfsFeatureMode ), 0 ) );
 
 
  402  const QString newConnectionName = txtName->text();
 
  410  if ( !mOriginalConnName.isNull() && mOriginalConnName != newConnectionName )
 
  416  QStringList detailsParameters = { mServiceName.toLower(), newConnectionName };
 
  451    QString version = QStringLiteral( 
"auto" );
 
  452    switch ( cmbVersion->currentIndex() )
 
  455        version = QStringLiteral( 
"auto" );
 
  458        version = QStringLiteral( 
"1.0.0" );
 
  461        version = QStringLiteral( 
"1.1.0" );
 
  464        version = QStringLiteral( 
"2.0.0" );
 
  467        version = QStringLiteral( 
"OGC_API_FEATURES" );
 
  475    QString pagingEnabled = QStringLiteral( 
"default" );
 
  476    switch ( cmbFeaturePaging->currentIndex() )
 
  479        pagingEnabled = QStringLiteral( 
"default" );
 
  482        pagingEnabled = QStringLiteral( 
"enabled" );
 
  485        pagingEnabled = QStringLiteral( 
"disabled" );
 
  490    const QString featureMode = mComboWfsFeatureMode->currentData().toString();
 
  494  QStringList credentialsParameters = { mServiceName.toLower(), newConnectionName };
 
  499  if ( mHttpHeaders->isVisible() )
 
 
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
 
bool setValue(const T &value, const QString &dynamicKeyPart=QString()) const
Set settings value.
 
bool exists(const QString &dynamicKeyPart=QString()) const
Returns true if the settings is contained in the underlying QSettings.