Skip to content

Commit 1131288

Browse files
author
timlinux
committedJun 15, 2008
Added global proxy configuration to options dialog. Use the follow qsettings 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@8648 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3c57584 commit 1131288

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
 

‎src/app/qgsoptions.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ QgsOptions::QgsOptions(QWidget *parent, Qt::WFlags fl) :
6161
#endif
6262
spinBoxIdentifyValue->setValue(identifyValue);
6363

64+
//Web proxy settings
65+
grpProxy->setChecked(settings.value("proxy/proxyEnabled", "0").toBool());
66+
leProxyHost->setText(settings.value("proxy/proxyHost", "").toString());
67+
leProxyPort->setText(settings.value("proxy/proxyPort", "").toString());
68+
leProxyUser->setText(settings.value("proxy/proxyUser", "").toString());
69+
leProxyPassword->setText(settings.value("proxy/proxyPassword", "").toString());
6470
// set the current theme
6571
cmbTheme->setItemText(cmbTheme->currentIndex(), settings.value("/Themes").toString());
6672
// set the display update threshold
@@ -246,6 +252,13 @@ QString QgsOptions::theme()
246252
void QgsOptions::saveOptions()
247253
{
248254
QSettings settings;
255+
//Web proxy settings
256+
settings.setValue("proxy/proxyEnabled", grpProxy->isChecked());
257+
settings.setValue("proxy/proxyHost", leProxyHost->text());
258+
settings.setValue("proxy/proxyPort", leProxyPort->text());
259+
settings.setValue("proxy/proxyUser", leProxyUser->text());
260+
settings.setValue("proxy/proxyPassword", leProxyPassword->text());
261+
//general settings
249262
settings.setValue("/Map/identifyRadius", spinBoxIdentifyValue->value());
250263
settings.setValue("/qgis/showLegendClassifiers",cbxLegendClassifiers->isChecked());
251264
settings.setValue("/qgis/hideSplash",cbxHideSplash->isChecked());

‎src/ui/qgsoptionsbase.ui

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,104 @@
938938
</item>
939939
</layout>
940940
</widget>
941+
<widget class="QWidget" name="tab" >
942+
<attribute name="title" >
943+
<string>Proxy</string>
944+
</attribute>
945+
<layout class="QGridLayout" >
946+
<item row="0" column="0" >
947+
<widget class="QGroupBox" name="grpProxy" >
948+
<property name="title" >
949+
<string>Use proxy for web access</string>
950+
</property>
951+
<property name="flat" >
952+
<bool>false</bool>
953+
</property>
954+
<property name="checkable" >
955+
<bool>true</bool>
956+
</property>
957+
<layout class="QGridLayout" >
958+
<item row="0" column="0" >
959+
<widget class="QLabel" name="lblProxyHost" >
960+
<property name="text" >
961+
<string>Host</string>
962+
</property>
963+
<property name="buddy" >
964+
<cstring>cboModellerPluginName</cstring>
965+
</property>
966+
</widget>
967+
</item>
968+
<item row="0" column="1" >
969+
<widget class="QLineEdit" name="leProxyHost" />
970+
</item>
971+
<item row="1" column="0" >
972+
<widget class="QLabel" name="lblProxyPort" >
973+
<property name="text" >
974+
<string>Port</string>
975+
</property>
976+
<property name="buddy" >
977+
<cstring>cboModellerPluginName</cstring>
978+
</property>
979+
</widget>
980+
</item>
981+
<item row="1" column="1" >
982+
<widget class="QLineEdit" name="leProxyPort" />
983+
</item>
984+
<item row="2" column="0" >
985+
<widget class="QLabel" name="lblUser" >
986+
<property name="text" >
987+
<string>User</string>
988+
</property>
989+
<property name="buddy" >
990+
<cstring>cboModellerPluginName</cstring>
991+
</property>
992+
</widget>
993+
</item>
994+
<item row="2" column="1" >
995+
<widget class="QLineEdit" name="leProxyUser" >
996+
<property name="toolTip" >
997+
<string>Leave this blank if no proxy username / password are required</string>
998+
</property>
999+
</widget>
1000+
</item>
1001+
<item row="3" column="0" >
1002+
<widget class="QLabel" name="lblPassword" >
1003+
<property name="text" >
1004+
<string>Password</string>
1005+
</property>
1006+
<property name="buddy" >
1007+
<cstring>cboModellerPluginName</cstring>
1008+
</property>
1009+
</widget>
1010+
</item>
1011+
<item row="3" column="1" >
1012+
<widget class="QLineEdit" name="leProxyPassword" >
1013+
<property name="toolTip" >
1014+
<string>Leave this blank if no proxy username / password are required</string>
1015+
</property>
1016+
<property name="echoMode" >
1017+
<enum>QLineEdit::Password</enum>
1018+
</property>
1019+
</widget>
1020+
</item>
1021+
</layout>
1022+
</widget>
1023+
</item>
1024+
<item row="1" column="0" >
1025+
<spacer>
1026+
<property name="orientation" >
1027+
<enum>Qt::Vertical</enum>
1028+
</property>
1029+
<property name="sizeHint" >
1030+
<size>
1031+
<width>20</width>
1032+
<height>40</height>
1033+
</size>
1034+
</property>
1035+
</spacer>
1036+
</item>
1037+
</layout>
1038+
</widget>
9411039
</widget>
9421040
</item>
9431041
<item row="1" column="0" >

0 commit comments

Comments
 (0)
Please sign in to comment.