[QGIS Commit] r8648 - in trunk/qgis/src: app ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Jun 15 14:37:58 EDT 2008


Author: timlinux
Date: 2008-06-15 14:37:57 -0400 (Sun, 15 Jun 2008)
New Revision: 8648

Modified:
   trunk/qgis/src/app/qgsoptions.cpp
   trunk/qgis/src/ui/qgsoptionsbase.ui
Log:
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.

Modified: trunk/qgis/src/app/qgsoptions.cpp
===================================================================
--- trunk/qgis/src/app/qgsoptions.cpp	2008-06-11 15:08:07 UTC (rev 8647)
+++ trunk/qgis/src/app/qgsoptions.cpp	2008-06-15 18:37:57 UTC (rev 8648)
@@ -61,6 +61,12 @@
 #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
@@ -246,6 +252,13 @@
 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());

Modified: trunk/qgis/src/ui/qgsoptionsbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsoptionsbase.ui	2008-06-11 15:08:07 UTC (rev 8647)
+++ trunk/qgis/src/ui/qgsoptionsbase.ui	2008-06-15 18:37:57 UTC (rev 8648)
@@ -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" >



More information about the QGIS-commit mailing list