Skip to content
Permalink
Browse files

[auth] Proxy settings use the new auth settings dialog

  • Loading branch information
elpaso committed Oct 3, 2017
1 parent c856ba3 commit 191942abf0a30a1f3985f8c15d69bf94a8623675
Showing with 41 additions and 83 deletions.
  1. +9 −12 src/app/qgsoptions.cpp
  2. +0 −1 src/app/qgsoptions.h
  3. +32 −70 src/ui/qgsoptionsbase.ui
@@ -309,21 +309,18 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mDefaultTileMaxRetrySpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/defaultTileMaxRetry" ), "3" ).toInt() );

// Proxy stored authentication configurations
mProxyAuthConfigSelect = new QgsAuthConfigSelect( this, QStringLiteral( "proxy" ) );
tabAuth->insertTab( 1, mProxyAuthConfigSelect, tr( "Configurations" ) );
mAuthSettings->setDataprovider( QStringLiteral( "proxy" ) );
QString authcfg = mSettings->value( QStringLiteral( "proxy/authcfg" ) ).toString();
mProxyAuthConfigSelect->setConfigId( authcfg );
if ( !authcfg.isEmpty() )
{
tabAuth->setCurrentIndex( tabAuth->indexOf( mProxyAuthConfigSelect ) );
}
mAuthSettings->setConfigId( authcfg );
mAuthSettings->setWarningText( tr( "<b style=\"color:red\">Warning: credentials are stored unencrypted (in clear text) in the system settings!</b>" ) );

//Web proxy settings
grpProxy->setChecked( mSettings->value( QStringLiteral( "proxy/proxyEnabled" ), "0" ).toBool() );
leProxyHost->setText( mSettings->value( QStringLiteral( "proxy/proxyHost" ), "" ).toString() );
leProxyPort->setText( mSettings->value( QStringLiteral( "proxy/proxyPort" ), "" ).toString() );
leProxyUser->setText( mSettings->value( QStringLiteral( "proxy/proxyUser" ), "" ).toString() );
leProxyPassword->setText( mSettings->value( QStringLiteral( "proxy/proxyPassword" ), "" ).toString() );

mAuthSettings->setPassword( mSettings->value( QStringLiteral( "proxy/proxyUser" ), "" ).toString() );
mAuthSettings->setUsername( mSettings->value( QStringLiteral( "proxy/proxyPassword" ), "" ).toString() );

//available proxy types
mProxyTypeComboBox->insertItem( 0, QStringLiteral( "DefaultProxy" ) );
@@ -1174,14 +1171,14 @@ void QgsOptions::saveOptions()
mSettings->setValue( QStringLiteral( "/qgis/defaultTileMaxRetry" ), mDefaultTileMaxRetrySpinBox->value() );

// Proxy stored authentication configurations
mSettings->setValue( QStringLiteral( "proxy/authcfg" ), mProxyAuthConfigSelect->configId( ) );
mSettings->setValue( QStringLiteral( "proxy/authcfg" ), mAuthSettings->configId( ) );

//Web proxy settings
mSettings->setValue( QStringLiteral( "proxy/proxyEnabled" ), grpProxy->isChecked() );
mSettings->setValue( QStringLiteral( "proxy/proxyHost" ), leProxyHost->text() );
mSettings->setValue( QStringLiteral( "proxy/proxyPort" ), leProxyPort->text() );
mSettings->setValue( QStringLiteral( "proxy/proxyUser" ), leProxyUser->text() );
mSettings->setValue( QStringLiteral( "proxy/proxyPassword" ), leProxyPassword->text() );
mSettings->setValue( QStringLiteral( "proxy/proxyUser" ), mAuthSettings->username() );
mSettings->setValue( QStringLiteral( "proxy/proxyPassword" ), mAuthSettings->password() );
mSettings->setValue( QStringLiteral( "proxy/proxyType" ), mProxyTypeComboBox->currentText() );

if ( !mCacheDirectory->text().isEmpty() )
@@ -256,7 +256,6 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption

QList< QgsOptionsPageWidget * > mAdditionalOptionWidgets;
QgsLocatorOptionsWidget *mLocatorOptionsWidget = nullptr;
QgsAuthConfigSelect *mProxyAuthConfigSelect = nullptr;

};

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1029</width>
<height>726</height>
<height>878</height>
</rect>
</property>
<property name="minimumSize">
@@ -349,7 +349,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>846</width>
<width>580</width>
<height>672</height>
</rect>
</property>
@@ -4892,9 +4892,9 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<property name="geometry">
<rect>
<x>0</x>
<y>-44</y>
<width>846</width>
<height>830</height>
<y>0</y>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
@@ -5119,33 +5119,27 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_18">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item row="0" column="2">
<widget class="QLineEdit" name="leProxyHost"/>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="leProxyPort"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="lblProxyPort">
<widget class="QLabel" name="lblProxyHost">
<property name="text">
<string>Port</string>
<string>Host</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lblProxyHost">
<item row="1" column="3">
<widget class="QLineEdit" name="leProxyHost"/>
</item>
<item row="2" column="2">
<widget class="QLabel" name="lblProxyPort">
<property name="text">
<string>Host</string>
<string>Port</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="3">
<widget class="QLineEdit" name="leProxyPort"/>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer_27">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -5161,49 +5155,16 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
</property>
</spacer>
</item>
<item row="4" column="1" colspan="2">
<widget class="QTabWidget" name="tabAuth">
<property name="currentIndex">
<number>0</number>
<item row="3" column="2" colspan="2">
<widget class="QGroupBox" name="mAuthGroupBox">
<property name="title">
<string>Authentication</string>
</property>
<widget class="QWidget" name="authLegacy">
<attribute name="title">
<string>Authentication</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_25">
<item row="0" column="0">
<widget class="QLabel" name="lblUser">
<property name="text">
<string>User name</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblPassword">
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="leProxyUser">
<property name="toolTip">
<string>Leave this blank if no proxy username / password are required</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QgsPasswordLineEdit" name="leProxyPassword">
<property name="toolTip">
<string>Leave this blank if no proxy username / password are required</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
</layout>
</widget>
<layout class="QVBoxLayout" name="verticalLayout_23">
<item>
<widget class="QgsAuthSettingsWidget" name="mAuthSettings" native="true"/>
</item>
</layout>
</widget>
</item>
</layout>
@@ -5477,11 +5438,6 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<extends>QSpinBox</extends>
<header>qgsspinbox.h</header>
</customwidget>
<customwidget>
<class>QgsPasswordLineEdit</class>
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
<customwidget>
<class>QgsColorSchemeList</class>
<extends>QWidget</extends>
@@ -5500,6 +5456,12 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<header>qgsautheditorwidgets.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsAuthSettingsWidget</class>
<extends>QWidget</extends>
<header>auth/qgsauthsettingswidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mOptionsListWidget</tabstop>

0 comments on commit 191942a

Please sign in to comment.
You can’t perform that action at this time.