[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r3724: Add the .ui stuff for the "Find Bridges Now" button (hidden (vidalia/trunk/src/vidalia/config)



Author: edmanm
Date: 2009-04-18 21:57:56 -0400 (Sat, 18 Apr 2009)
New Revision: 3724

Modified:
   vidalia/trunk/src/vidalia/config/networkpage.cpp
   vidalia/trunk/src/vidalia/config/networkpage.h
   vidalia/trunk/src/vidalia/config/networkpage.ui
Log:

Add the .ui stuff for the "Find Bridges Now" button (hidden for now since
it doesn't do anything yet) and stub in a slot for it. Also remove some
cruft from back when we supported Tors that didn't support bridges.


Modified: vidalia/trunk/src/vidalia/config/networkpage.cpp
===================================================================
--- vidalia/trunk/src/vidalia/config/networkpage.cpp	2009-04-18 08:38:43 UTC (rev 3723)
+++ vidalia/trunk/src/vidalia/config/networkpage.cpp	2009-04-19 01:57:56 UTC (rev 3724)
@@ -52,8 +52,8 @@
           this, SLOT(onDisconnected()));
   connect(ui.lblHelpFindBridges, SIGNAL(linkActivated(QString)),
           this, SLOT(onLinkActivated(QString)));
-          
-  ui.lblNoBridgeSupport->setVisible(false);
+  connect(ui.btnFindBridges, SIGNAL(clicked()), this, SLOT(findBridges()));
+
   ui.lineHttpProxyAddress->setValidator(new DomainValidator(this));
   ui.lineHttpProxyPort->setValidator(new QIntValidator(1, 65535, this));
 
@@ -68,6 +68,9 @@
   ui.grpFirewallSettings->setTitle("");
   ui.grpBridgeSettings->setTitle("");
 #endif
+//#if !defined(USE_QSSLSOCKET)
+  ui.btnFindBridges->setVisible(false);
+//#endif
 }
 
 /** Called when the user changes the UI translation. */
@@ -103,29 +106,6 @@
   settings.revert();
 }
 
-/** Called when Vidalia has connected and authenticated to Tor. This will
- * check Tor's version number and, if it's too old, will disable the bridge
- * settings UI and show a message indicating the user's Tor is too old. */
-void
-NetworkPage::onAuthenticated()
-{
-  quint32 torVersion = Vidalia::torControl()->getTorVersion();
-  if (torVersion < 0x020003) {
-    ui.grpBridgeSettings->setEnabled(false);
-    ui.lblNoBridgeSupport->setVisible(true);
-  }
-}
-
-/** Called when Vidalia disconnects from Tor. This will reenable the bridge
- * settings (if they were previously disabled) and hide the warning message
- * indicating the user's Tor does not support bridges. */
-void
-NetworkPage::onDisconnected()
-{
-  ui.grpBridgeSettings->setEnabled(true);
-  ui.lblNoBridgeSupport->setVisible(false);
-}
-
 /** Called when a link in a label is clicked. <b>url</b> is the target of
  * the clicked link. */
 void
@@ -368,3 +348,12 @@
   ui.listBridges->addItems(settings.getBridgeList());
 }
 
+/** Called when the user clicks the "Find Bridges Now" button.
+ * Attempts to establish an HTTP connection to bridges.torproject.org
+ * and download one or more bridge addresses. */
+void
+NetworkPage::findBridges()
+{
+
+}
+

Modified: vidalia/trunk/src/vidalia/config/networkpage.h
===================================================================
--- vidalia/trunk/src/vidalia/config/networkpage.h	2009-04-18 08:38:43 UTC (rev 3723)
+++ vidalia/trunk/src/vidalia/config/networkpage.h	2009-04-19 01:57:56 UTC (rev 3724)
@@ -62,17 +62,13 @@
   void bridgeContextMenuRequested(const QPoint &pos);
   /** Called when the user changes which bridges they have selected. */
   void bridgeSelectionChanged();
-  /** Called when Vidalia has connected and authenticated to Tor. This will
-   * check Tor's version number and, if it's too old, will disable the bridge
-   * settings UI and show a message indicating the user's Tor is too old. */
-  void onAuthenticated();
-  /** Called when Vidalia disconnects from Tor. This will reenable the bridge
-   * settings (if they were previously disabled) and hide the warning message
-   * indicating the user's Tor does not support bridges. */
-  void onDisconnected();
   /** Called when a link in a label is clicked. <b>url</b> is the target of
    * the clicked link.*/
   void onLinkActivated(const QString &url);
+  /** Called when the user clicks the "Find Bridges Now" button.
+   * Attempts to establish an HTTP connection to bridges.torproject.org
+   * and download one or more bridge addresses. */
+  void findBridges();
 
 private:
   /** Verifies that <b>bridge</b> is a valid bridge identifier and places a 

Modified: vidalia/trunk/src/vidalia/config/networkpage.ui
===================================================================
--- vidalia/trunk/src/vidalia/config/networkpage.ui	2009-04-18 08:38:43 UTC (rev 3723)
+++ vidalia/trunk/src/vidalia/config/networkpage.ui	2009-04-19 01:57:56 UTC (rev 3724)
@@ -5,20 +5,20 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>568</width>
-    <height>539</height>
+    <width>616</width>
+    <height>659</height>
    </rect>
   </property>
   <property name="contextMenuPolicy" >
    <enum>Qt::NoContextMenu</enum>
   </property>
   <layout class="QVBoxLayout" >
+   <property name="spacing" >
+    <number>6</number>
+   </property>
    <property name="margin" >
     <number>9</number>
    </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
    <item>
     <widget class="QCheckBox" name="chkUseProxy" >
      <property name="toolTip" >
@@ -35,9 +35,7 @@
    <item>
     <widget class="QGroupBox" name="grpProxySettings" >
      <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>5</hsizetype>
-       <vsizetype>1</vsizetype>
+      <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -93,12 +91,12 @@
       </item>
       <item row="1" column="1" colspan="4" >
        <layout class="QHBoxLayout" >
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <property name="margin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
-         <number>6</number>
-        </property>
         <item>
          <widget class="QLineEdit" name="lineHttpProxyUsername" />
         </item>
@@ -120,12 +118,12 @@
       </item>
       <item row="0" column="1" colspan="4" >
        <layout class="QHBoxLayout" >
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <property name="margin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
-         <number>6</number>
-        </property>
         <item>
          <widget class="QLineEdit" name="lineHttpProxyAddress" />
         </item>
@@ -186,9 +184,7 @@
    <item>
     <widget class="QGroupBox" name="grpFirewallSettings" >
      <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>5</hsizetype>
-       <vsizetype>1</vsizetype>
+      <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -203,12 +199,12 @@
       <string>Firewall Settings</string>
      </property>
      <layout class="QHBoxLayout" >
+      <property name="spacing" >
+       <number>6</number>
+      </property>
       <property name="margin" >
        <number>9</number>
       </property>
-      <property name="spacing" >
-       <number>6</number>
-      </property>
       <item>
        <widget class="QLabel" name="lblReachablePorts" >
         <property name="text" >
@@ -245,9 +241,7 @@
    <item>
     <widget class="QGroupBox" name="grpBridgeSettings" >
      <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>5</hsizetype>
-       <vsizetype>5</vsizetype>
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -262,33 +256,20 @@
       <string>Bridge Settings</string>
      </property>
      <layout class="QVBoxLayout" >
+      <property name="spacing" >
+       <number>6</number>
+      </property>
       <property name="margin" >
        <number>9</number>
       </property>
-      <property name="spacing" >
-       <number>6</number>
-      </property>
       <item>
-       <widget class="QLabel" name="lblNoBridgeSupport" >
-        <property name="text" >
-         <string>The Tor software you are currently running does not support bridges. &lt;br>Directory connections will still be encrypted.</string>
+       <layout class="QHBoxLayout" >
+        <property name="spacing" >
+         <number>6</number>
         </property>
-        <property name="alignment" >
-         <set>Qt::AlignCenter</set>
-        </property>
-        <property name="wordWrap" >
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" >
         <property name="margin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
-         <number>6</number>
-        </property>
         <item>
          <widget class="QLabel" name="lblAddBridge" >
           <property name="text" >
@@ -309,34 +290,24 @@
           </property>
          </spacer>
         </item>
-        <item>
-         <widget class="QLabel" name="lblHelpFindBridges" >
-          <property name="cursor" >
-           <cursor>13</cursor>
-          </property>
-          <property name="text" >
-           <string>&lt;a href="bridges.finding">How do I find a bridge?&lt;/a></string>
-          </property>
-         </widget>
-        </item>
        </layout>
       </item>
       <item>
        <layout class="QHBoxLayout" >
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <property name="margin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
-         <number>6</number>
-        </property>
         <item>
          <layout class="QVBoxLayout" >
+          <property name="spacing" >
+           <number>6</number>
+          </property>
           <property name="margin" >
            <number>0</number>
           </property>
-          <property name="spacing" >
-           <number>6</number>
-          </property>
           <item>
            <widget class="QLineEdit" name="lineBridge" >
             <property name="maxLength" >
@@ -358,19 +329,20 @@
         </item>
         <item>
          <layout class="QVBoxLayout" >
+          <property name="spacing" >
+           <number>6</number>
+          </property>
           <property name="margin" >
            <number>0</number>
           </property>
-          <property name="spacing" >
-           <number>6</number>
-          </property>
           <item>
            <widget class="QToolButton" name="btnAddBridge" >
             <property name="text" >
              <string/>
             </property>
             <property name="icon" >
-             <iconset resource="../res/vidalia.qrc" >:/images/22x22/list-add.png</iconset>
+             <iconset resource="../res/vidalia.qrc" >
+              <normaloff>:/images/22x22/list-add.png</normaloff>:/images/22x22/list-add.png</iconset>
             </property>
            </widget>
           </item>
@@ -386,7 +358,8 @@
              <string/>
             </property>
             <property name="icon" >
-             <iconset resource="../res/vidalia.qrc" >:/images/22x22/list-remove.png</iconset>
+             <iconset resource="../res/vidalia.qrc" >
+              <normaloff>:/images/22x22/list-remove.png</normaloff>:/images/22x22/list-remove.png</iconset>
             </property>
            </widget>
           </item>
@@ -402,7 +375,8 @@
              <string/>
             </property>
             <property name="icon" >
-             <iconset resource="../res/vidalia.qrc" >:/images/22x22/edit-copy.png</iconset>
+             <iconset resource="../res/vidalia.qrc" >
+              <normaloff>:/images/22x22/edit-copy.png</normaloff>:/images/22x22/edit-copy.png</iconset>
             </property>
            </widget>
           </item>
@@ -423,6 +397,40 @@
         </item>
        </layout>
       </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3" >
+        <item>
+         <widget class="QPushButton" name="btnFindBridges" >
+          <property name="text" >
+           <string>Find Bridges Now</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="lblHelpFindBridges" >
+          <property name="cursor" >
+           <cursorShape>PointingHandCursor</cursorShape>
+          </property>
+          <property name="text" >
+           <string>&lt;a href="bridges.finding">How else can I find bridges?&lt;/a></string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer" >
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" >
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
      </layout>
     </widget>
    </item>