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

[vidalia-svn] r2027: If the user is running a Tor that does not support bridges, (in trunk: . src/gui/config)



Author: edmanm
Date: 2007-10-13 20:27:10 -0400 (Sat, 13 Oct 2007)
New Revision: 2027

Modified:
   trunk/
   trunk/src/gui/config/networkpage.cpp
   trunk/src/gui/config/networkpage.h
   trunk/src/gui/config/networkpage.ui
Log:
 r2114@lysithea:  edmanm | 2007-10-13 20:26:38 -0400
 If the user is running a Tor that does not support bridges, disable the bridge
 UI and show a label indicating that even though their Tor doesn't support
 bridges, the little checkbox is still doing something.



Property changes on: trunk
___________________________________________________________________
 svk:merge ticket from /local/vidalia/trunk [r2114] on dc66be73-d13e-47ba-a267-8dc7cda68c65

Modified: trunk/src/gui/config/networkpage.cpp
===================================================================
--- trunk/src/gui/config/networkpage.cpp	2007-10-14 00:26:59 UTC (rev 2026)
+++ trunk/src/gui/config/networkpage.cpp	2007-10-14 00:27:10 UTC (rev 2027)
@@ -56,7 +56,12 @@
   connect(ui.listBridges, SIGNAL(itemSelectionChanged()),
           this, SLOT(bridgeSelectionChanged()));
   connect(ui.lineBridge, SIGNAL(returnPressed()), this, SLOT(addBridge()));
-
+  connect(Vidalia::torControl(), SIGNAL(authenticated()),
+          this, SLOT(onAuthenticated()));
+  connect(Vidalia::torControl(), SIGNAL(disconnected()),
+          this, SLOT(onDisconnected()));
+  
+  ui.lblNoBridgeSupport->setVisible(false);
   ui.lineHttpProxyAddress->setValidator(new DomainValidator(this));
   ui.lineHttpProxyPort->setValidator(new QIntValidator(1, 65535, this));
 
@@ -90,6 +95,29 @@
   NetworkSettings(Vidalia::torControl()).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);
+}
+
 /** Verifies that <b>bridge</b> is a valid bridge identifier and places a 
  * normalized identifier in <b>out</b>. The normalized identifier will have
  * all spaces removed from the fingerprint portion (if any) and all

Modified: trunk/src/gui/config/networkpage.h
===================================================================
--- trunk/src/gui/config/networkpage.h	2007-10-14 00:26:59 UTC (rev 2026)
+++ trunk/src/gui/config/networkpage.h	2007-10-14 00:27:10 UTC (rev 2027)
@@ -71,6 +71,14 @@
   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();
 
 private:
   /** Verifies that <b>bridge</b> is a valid bridge identifier and places a 

Modified: trunk/src/gui/config/networkpage.ui
===================================================================
--- trunk/src/gui/config/networkpage.ui	2007-10-14 00:26:59 UTC (rev 2026)
+++ trunk/src/gui/config/networkpage.ui	2007-10-14 00:27:10 UTC (rev 2027)
@@ -274,6 +274,19 @@
        <number>6</number>
       </property>
       <item>
+       <widget class="QLabel" name="lblNoBridgeSupport" >
+        <property name="text" >
+         <string>The Tor version you are currently running does not support bridges. &lt;br>Tor will still try to encrypt its directory connections.</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignCenter</set>
+        </property>
+        <property name="wordWrap" >
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item>
        <widget class="QLabel" name="lblAddBridge" >
         <property name="sizePolicy" >
          <sizepolicy>