Skip to content

Commit

Permalink
Added global proxy configuration to options dialog. Use the follow qs…
Browse files Browse the repository at this point in the history
…ettings keys to obtain proxy configs: proxy/proxyEnabled, proxy/proxyHost, proxy/proxyPort, proxy/proxyUser and proxy/proxyPassword. Note that the proxy password is not encrypted in any way when stored in Qt config file / win registry.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8648 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jun 15, 2008
1 parent 2ee3409 commit c5cd0a2
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ QgsOptions::QgsOptions(QWidget *parent, Qt::WFlags fl) :
#endif
spinBoxIdentifyValue->setValue(identifyValue);

//Web proxy settings
grpProxy->setChecked(settings.value("proxy/proxyEnabled", "0").toBool());
leProxyHost->setText(settings.value("proxy/proxyHost", "").toString());
leProxyPort->setText(settings.value("proxy/proxyPort", "").toString());
leProxyUser->setText(settings.value("proxy/proxyUser", "").toString());
leProxyPassword->setText(settings.value("proxy/proxyPassword", "").toString());
// set the current theme
cmbTheme->setItemText(cmbTheme->currentIndex(), settings.value("/Themes").toString());
// set the display update threshold
Expand Down Expand Up @@ -246,6 +252,13 @@ QString QgsOptions::theme()
void QgsOptions::saveOptions()
{
QSettings settings;
//Web proxy settings
settings.setValue("proxy/proxyEnabled", grpProxy->isChecked());
settings.setValue("proxy/proxyHost", leProxyHost->text());
settings.setValue("proxy/proxyPort", leProxyPort->text());
settings.setValue("proxy/proxyUser", leProxyUser->text());
settings.setValue("proxy/proxyPassword", leProxyPassword->text());
//general settings
settings.setValue("/Map/identifyRadius", spinBoxIdentifyValue->value());
settings.setValue("/qgis/showLegendClassifiers",cbxLegendClassifiers->isChecked());
settings.setValue("/qgis/hideSplash",cbxHideSplash->isChecked());
Expand Down
98 changes: 98 additions & 0 deletions src/ui/qgsoptionsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,104 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>Proxy</string>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QGroupBox" name="grpProxy" >
<property name="title" >
<string>Use proxy for web access</string>
</property>
<property name="flat" >
<bool>false</bool>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="lblProxyHost" >
<property name="text" >
<string>Host</string>
</property>
<property name="buddy" >
<cstring>cboModellerPluginName</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="leProxyHost" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="lblProxyPort" >
<property name="text" >
<string>Port</string>
</property>
<property name="buddy" >
<cstring>cboModellerPluginName</cstring>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="leProxyPort" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="lblUser" >
<property name="text" >
<string>User</string>
</property>
<property name="buddy" >
<cstring>cboModellerPluginName</cstring>
</property>
</widget>
</item>
<item row="2" 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="3" column="0" >
<widget class="QLabel" name="lblPassword" >
<property name="text" >
<string>Password</string>
</property>
<property name="buddy" >
<cstring>cboModellerPluginName</cstring>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLineEdit" 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>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0" >
Expand Down

0 comments on commit c5cd0a2

Please sign in to comment.