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

[tor-commits] [vidalia/master] Remove Find bridges button and the rest of the functionality



commit caeea278a13c8c64d86d181b38a4f6a60f9e40e6
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date:   Mon May 14 11:33:28 2012 -0300

    Remove Find bridges button and the rest of the functionality
---
 CHANGELOG                                          |    6 +-
 src/vidalia/CMakeLists.txt                         |    5 -
 src/vidalia/config/BridgeDownloader.cpp            |  149 --------------------
 src/vidalia/config/BridgeDownloader.h              |  122 ----------------
 .../config/BridgeDownloaderProgressDialog.cpp      |   90 ------------
 .../config/BridgeDownloaderProgressDialog.h        |   83 -----------
 .../config/BridgeDownloaderProgressDialog.ui       |   73 ----------
 src/vidalia/config/NetworkPage.cpp                 |   91 ------------
 src/vidalia/config/NetworkPage.h                   |   15 --
 src/vidalia/config/NetworkPage.ui                  |   79 +----------
 10 files changed, 9 insertions(+), 704 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 8429b72..8dc6178 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-0.2.18  13-May-2012
+0.2.18  14-May-2012
   o Use consensus bandwidth for routers when microdescriptors is
     enabled. Fixes bug 3287.
   o Notify users that a warning status event has appeared by flashing
@@ -12,8 +12,6 @@
     that string if needed.) Fixes bug 5109.
   o Displays Korean, Catalan and Greek in their native scripts. Fix
     bug 5110.
-  o Fix the bridge line parsing for requests to bridges.torproject.org
-    when the user clicks 'find bridges now'. Fixes bug 5730.
   o Support adding comments in the same line as a config option inside
     the torrc dialog. Fixes bug 5475.
   o Remove Polipo and Torbutton from Vidalia's build scripts. Resolves
@@ -24,6 +22,8 @@
     the Vidalia binary location as the starting point for relative
     paths.
   o Enable Burmese, Croatian, Basque and Serbian translation.
+  o Remove the "Find bridges" button in order to avoid compromising
+    users that need to hide behind tor at all times. Fixes bug 5371.
 
 0.2.17  11-Feb-2012
   o Improve the translation policy: do not remove translations that
diff --git a/src/vidalia/CMakeLists.txt b/src/vidalia/CMakeLists.txt
index 52ba510..7cc1d20 100644
--- a/src/vidalia/CMakeLists.txt
+++ b/src/vidalia/CMakeLists.txt
@@ -86,8 +86,6 @@ set(vidalia_SRCS ${vidalia_SRCS}
   config/AbstractTorSettings.cpp
   config/AdvancedPage.cpp
   config/AppearancePage.cpp
-  config/BridgeDownloader.cpp
-  config/BridgeDownloaderProgressDialog.cpp
   config/BridgeUsageDialog.cpp
   config/ConfigDialog.cpp
   config/ConfigPageStack.cpp
@@ -116,8 +114,6 @@ qt4_wrap_cpp(vidalia_SRCS
   config/AbstractTorSettings.h
   config/AdvancedPage.h
   config/AppearancePage.h
-  config/BridgeDownloader.h
-  config/BridgeDownloaderProgressDialog.h
   config/BridgeUsageDialog.h
   config/ConfigDialog.h
   config/ConfigPage.h
@@ -271,7 +267,6 @@ qt4_wrap_ui(vidalia_SRCS
   bwgraph/BandwidthGraph.ui
   config/AdvancedPage.ui
   config/AppearancePage.ui
-  config/BridgeDownloaderProgressDialog.ui
   config/BridgeUsageDialog.ui
   config/ConfigDialog.ui
   config/GeneralPage.ui
diff --git a/src/vidalia/config/BridgeDownloader.cpp b/src/vidalia/config/BridgeDownloader.cpp
deleted file mode 100644
index 1cf47ea..0000000
--- a/src/vidalia/config/BridgeDownloader.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
-**  including this file, may be copied, modified, propagated, or distributed
-**  except according to the terms described in the LICENSE file.
-*/
-
-/*
-** \file BridgeDownloader.cpp
-** \brief Downloads a list of new bridge addresses via HTTPS
-*/
-
-#include "BridgeDownloader.h"
-#include "Vidalia.h"
-
-#define BRIDGEDB_HOST  "bridges.torproject.org"
-#define BRIDGEDB_PORT  443
-
-BridgeDownloader::BridgeDownloader(QObject *parent)
-  : QObject(parent)
-{
-  _https = new QNetworkAccessManager();
-
-  connect(_https, SIGNAL(finished(QNetworkReply *)),
-          this, SLOT(httpsRequestFinished(QNetworkReply *)));
-  connect(_https, SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)),
-          this, SLOT(sslErrors(QNetworkReply *, QList<QSslError>)));
-}
-
-void
-BridgeDownloader::setProxy(const QString &host, int port,
-                           const QString &username, const QString &password)
-{
-  _https->setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, host, port, username, password));
-}
-
-bool
-BridgeDownloader::downloadBridges(BridgeDownloadMethod method)
-{
-  if (! isMethodSupported(method))
-    return false;
-
-  switch (method) {
-    case DownloadMethodHttps:
-      startHttpsDownload();
-      break;
-
-    default:
-      break;
-  }
-  return true;
-}
-
-bool
-BridgeDownloader::isMethodSupported(BridgeDownloadMethod method)
-{
-  switch (method) {
-    case DownloadMethodHttps:
-      return QSslSocket::supportsSsl();
-
-    default:
-      break;
-  }
-  return false;
-}
-
-void
-BridgeDownloader::startHttpsDownload()
-{
-  emit statusChanged(tr("Starting HTTPS bridge request..."));
-  emit downloadProgress(0, 0);
-
-  _reply = _https->get(QNetworkRequest(QUrl("https://bridges.torproject.org/?format=plain";)));
-  connect(_reply, SIGNAL(downloadProgress(qint64, qint64)),
-          this, SIGNAL(downloadProgress(qint64, qint64)));
-  vInfo("Sending an HTTPS bridge request to %1:%2.").arg(BRIDGEDB_HOST)
-                                                    .arg(BRIDGEDB_PORT);
-}
-
-void
-BridgeDownloader::cancelBridgeRequest()
-{
-  _reply->close();
-  disconnect(_reply, 0, 0, 0);
-}
-
-void
-BridgeDownloader::httpsStateChanged(int state)
-{
-  switch (state) {
-    case QHttp::Connecting:
-      emit statusChanged(tr("Connecting to %1:%2...").arg(BRIDGEDB_HOST)
-                                                     .arg(BRIDGEDB_PORT));
-      break;
-
-    case QHttp::Sending:
-      emit statusChanged(tr("Sending an HTTPS request for bridges..."));
-      break;
-
-    case QHttp::Reading:
-      emit statusChanged(tr("Downloading a list of bridges..."));
-      break;
-
-    default:
-      break;
-  }
-}
-
-void
-BridgeDownloader::httpsRequestFinished(QNetworkReply *reply)
-{
-  if (reply->error() != QNetworkReply::NoError) {
-    QString errorString = reply->errorString();
-    vWarn("Bridge request failed: %2").arg(errorString);
-
-    emit bridgeRequestFailed(errorString);
-  } else {
-    QByteArray response = reply->readAll();
-    vInfo("Bridge request complete: received %2 bytes.").arg(response.size());
-
-    QStringList bridges, lines = QString(response).split("\n");
-    foreach (QString line, lines) {
-      line = line.trimmed();
-      if (line.startsWith("bridge ", Qt::CaseInsensitive))
-        bridges << line;
-    }
-    emit bridgeRequestFinished(bridges);
-  }
-  _reply->close();
-  disconnect(_reply,0,0,0);
-}
-
-void
-BridgeDownloader::sslErrors(QNetworkReply *reply, const QList<QSslError> &sslErrors)
-{
-  QString errorString;
-  QStringList errorStrings;
-
-  vWarn("%1 SSL error(s) when requesting bridge information:")
-                                                      .arg(sslErrors.size());
-  foreach (QSslError sslError, sslErrors) {
-    errorString = sslError.errorString();
-    errorStrings << errorString;
-    vWarn("  SSL Error: %1").arg(errorString);
-  }
-}
diff --git a/src/vidalia/config/BridgeDownloader.h b/src/vidalia/config/BridgeDownloader.h
deleted file mode 100644
index 7bef313..0000000
--- a/src/vidalia/config/BridgeDownloader.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
-**  including this file, may be copied, modified, propagated, or distributed
-**  except according to the terms described in the LICENSE file.
-*/
-
-/*
-** \file BridgeDownloader.h
-** \brief Downloads a list of new bridge addresses via HTTPS
-*/
-
-#ifndef _BRIDGEDOWNLOADER_H
-#define _BRIDGEDOWNLOADER_H
-
-#include <QtNetwork>
-
-class BridgeDownloader : public QObject
-{
-  Q_OBJECT
-
-public:
-  /** Available bridge download methods. */
-  enum BridgeDownloadMethod {
-    DownloadMethodHttps, /** Download via an HTTPS connection. */
-  };
-
-  /** Default constructor.
-   */
-  BridgeDownloader(QObject *parent = 0);
-
-  /** Initiates a request for a set of bridges using the specified
-   * download <b>method</b>. Returns true if the request was initiated
-   * successfully, or false on error.
-   */
-  bool downloadBridges(BridgeDownloadMethod method);
-
-  /** Enables HTTPS proxy support, using the proxy server <b>host</b> on
-   * port <b>port</b>. A <b>username</b> and <b>password</b> can also
-   * optionally be supplied, if required by the proxy.
-   */
-  void setProxy(const QString &host, int port,
-                const QString &username = QString(),
-                const QString &password = QString());
-
-  /** Returns true if <b>method</b> is supported by the currently
-   * available Qt libraries.
-   */
-  static bool isMethodSupported(BridgeDownloadMethod method);
-
-public slots:
-  /** Cancels any pending bridge download requests.
-   */
-  void cancelBridgeRequest();
-
-signals:
-  /** Emitted when the underlying QHttp object reads data from an HTTPS
-   * response. <b>done</b> indicates how many bytes out of <b>total</b>
-   * have been read so far. Note that <b>total</b> may be 0 if the expected
-   * total size of the response is not known.
-   */
-  void downloadProgress(qint64 done, qint64 total);
-
-  /** Emitted when the status of the bridge request changes. <b>status</b>
-   * describes the new current state of the request.
-   */
-  void statusChanged(const QString &status);
-
-  /** Emitted when the previous request for bridge addresses completes
-   * successfully. The QStringList <b>bridges</b> contains a (possibly empty)
-   * list of bridge addresses parsed from the received response.
-   */
-  void bridgeRequestFinished(const QStringList &bridges);
-
-  /** Emitted when the previous request for bridge addresses fails. The
-   * QString <b>error</b> is a human-readable string describing the error
-   * encountered.
-   */
-  void bridgeRequestFailed(const QString &error);
-
-private slots:
-  /** Called when the state of the underlying QHttp object changes. A
-   * statusChanged() signal is emitted with the appropriate text
-   * describing the new state of the request.
-   */
-  void httpsStateChanged(int state);
-
-  /** Called when the underlying QHttp object used to make the bridge
-   * request completes. <b>error</b> is set to false if the request was
-   * successful, or true if the request failed. If <b>id</b> does not
-   * match the request ID previously returned by QHttp::get(), then the
-   * signal is ignored since it is the result of a close() or abort()
-   * request.
-   */
-  void httpsRequestFinished(QNetworkReply *reply);
-
-  /** Called when the HTTPS connection encounters one or more
-   * <b>sslErrors</b>. Currently the errors are just logged and
-   * bridgeRequestFailed() is <i>not</i> emitted, since QHttp will also
-   * emit
-   */
-  void sslErrors(QNetworkReply *, const QList<QSslError> &sslErrors);
-
-private:
-  /** Initiates an HTTPS connection to bridges.torproject.org to start
-   * downloading a set of bridges.
-   */
-  void startHttpsDownload();
-
-  /** Used to connect to the bridge database, send an HTTPS request for
-   * new bridge addresses and then read the response. */
-  QNetworkAccessManager* _https;
-
-  /** Identifier of the current bridge request */
-  QNetworkReply *_reply;
-};
-
-#endif
-
diff --git a/src/vidalia/config/BridgeDownloaderProgressDialog.cpp b/src/vidalia/config/BridgeDownloaderProgressDialog.cpp
deleted file mode 100644
index 9150988..0000000
--- a/src/vidalia/config/BridgeDownloaderProgressDialog.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
-**  including this file, may be copied, modified, propagated, or distributed
-**  except according to the terms described in the LICENSE file.
-*/
-
-/*
-** \file BridgeDownloaderProgressDialog.cpp
-** \brief Displays the progress of a request for bridge addresses
-*/
-
-#include "BridgeDownloaderProgressDialog.h"
-
-#include <QTimer>
-
-
-BridgeDownloaderProgressDialog::BridgeDownloaderProgressDialog(QWidget *parent)
-  : QDialog(parent)
-{
-  ui.setupUi(this);
-
-  connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)),
-          this, SLOT(buttonClicked(QAbstractButton *)));
-
-  setModal(true);
-}
-
-void
-BridgeDownloaderProgressDialog::setVisible(bool visible)
-{
-  if (visible) {
-    ui.progressBar->setRange(0, 0);
-    ui.buttonBox->setStandardButtons(QDialogButtonBox::Cancel);
-  }
-  QDialog::setVisible(visible);
-}
-
-void
-BridgeDownloaderProgressDialog::setStatus(const QString &status)
-{
-  ui.lblStatus->setText(status);
-}
-
-void
-BridgeDownloaderProgressDialog::setDownloadProgress(qint64 done, qint64 total)
-{
-  ui.progressBar->setRange(0, total);
-  ui.progressBar->setValue(done);
-}
-
-void
-BridgeDownloaderProgressDialog::bridgeRequestFinished(const QStringList &bridges)
-{
-  Q_UNUSED(bridges);
-
-  accept();
-}
-
-void
-BridgeDownloaderProgressDialog::bridgeRequestFailed(const QString &error)
-{
-  ui.lblStatus->setText(tr("Unable to download bridges: %1").arg(error));
-
-  ui.progressBar->setRange(0, 1);
-  ui.progressBar->setValue(1);
-
-  ui.buttonBox->setStandardButtons(QDialogButtonBox::Cancel
-                                     | QDialogButtonBox::Retry
-                                     | QDialogButtonBox::Help);
-}
-
-void
-BridgeDownloaderProgressDialog::buttonClicked(QAbstractButton *button)
-{
-  int standardButton = ui.buttonBox->standardButton(button);
-  if (standardButton == QDialogButtonBox::Retry) {
-    setStatus(tr("Retrying bridge request..."));
-    setDownloadProgress(0, 0);
-    ui.buttonBox->setStandardButtons(QDialogButtonBox::Cancel);
-
-    QTimer::singleShot(1000, this, SIGNAL(retry()));
-  } else {
-    done(standardButton);
-  }
-}
-
diff --git a/src/vidalia/config/BridgeDownloaderProgressDialog.h b/src/vidalia/config/BridgeDownloaderProgressDialog.h
deleted file mode 100644
index 34f15c2..0000000
--- a/src/vidalia/config/BridgeDownloaderProgressDialog.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
-**  including this file, may be copied, modified, propagated, or distributed
-**  except according to the terms described in the LICENSE file.
-*/
-
-/*
-** \file BridgeDownloaderProgressDialog.h
-** \brief Displays the progress of a request for bridge addresses
-*/
-
-#ifndef _BRIDGEDOWNLOADERPROGRESSDIALOG_H
-#define _BRIDGEDOWNLOADERPROGRESSDIALOG_H
-
-#include "ui_BridgeDownloaderProgressDialog.h"
-
-#include <QDialog>
-
-
-class BridgeDownloaderProgressDialog : public QDialog
-{
-  Q_OBJECT
-
-public:
-  /** Default constructor.
-   */
-  BridgeDownloaderProgressDialog(QWidget *parent = 0);
-
-public slots:
-  /** Sets the status message text in the dialog to <b>status</b>.
-   */
-  void setStatus(const QString &status);
-
-  /** Updates the bridge download progress bar to <b>value</b> out of
-   * <b>maximum</b> steps. If <b>value</b> and <b>maximum</b> are both 0,
-   * then a "busy" progress bar is displayed.
-   */
-  void setDownloadProgress(qint64 value, qint64 maximum);
-
-  /** Called when the bridge download completes successfully and discards
-   * the progress dialog with an Accept result code. <b>bridges</b>
-   * contains the list of bridges downloaded, but is currently ignored.
-   */
-  void bridgeRequestFinished(const QStringList &bridges);
-
-  /** Called when the bridge download fails. The string <b>error</b>
-   * provides a human-readable description of the reason the download
-   * failed, which is displayed for the user.
-   */
-  void bridgeRequestFailed(const QString &error);
-
-signals:
-  /** Emitted when the user clicks the "Retry" button after a previous
-   * bridge request has failed.
-   */
-  void retry();
-
-protected:
-  /** Overloaded method called when the progress dialog is first shown in
-   * order to initialize the progress bar, status text and dialog button
-   * box.
-   */
-  virtual void setVisible(bool visible);
-
-private slots:
-  /** Called when <b>button</b> is clicked in the progress dialog's
-   * QDialogButtonBox. Dismisses the dialog and sets the result code to
-   * the QDialogButtonBox::StandardButton enum value indicated by
-   * <b>button</b>.
-   */
-  void buttonClicked(QAbstractButton *button);
-
-private:
-  /**< Qt Designer generated object. */
-  Ui::BridgeDownloaderProgressDialog ui;
-};
-
-#endif
-
diff --git a/src/vidalia/config/BridgeDownloaderProgressDialog.ui b/src/vidalia/config/BridgeDownloaderProgressDialog.ui
deleted file mode 100644
index 84210a6..0000000
--- a/src/vidalia/config/BridgeDownloaderProgressDialog.ui
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>BridgeDownloaderProgressDialog</class>
- <widget class="QDialog" name="BridgeDownloaderProgressDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>366</width>
-    <height>105</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Downloading Bridges</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../res/vidalia.qrc">
-    <normaloff>:/images/32x32/network-workgroup.png</normaloff>:/images/32x32/network-workgroup.png</iconset>
-  </property>
-  <property name="modal">
-   <bool>true</bool>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" rowspan="2">
-    <widget class="QLabel" name="lblPixmap">
-     <property name="text">
-      <string/>
-     </property>
-     <property name="pixmap">
-      <pixmap resource="../res/vidalia.qrc">:/images/48x48/network-workgroup.png</pixmap>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="QLabel" name="lblStatus">
-     <property name="text">
-      <string/>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="QProgressBar" name="progressBar">
-     <property name="value">
-      <number>0</number>
-     </property>
-     <property name="textVisible">
-      <bool>false</bool>
-     </property>
-     <property name="format">
-      <string/>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../res/vidalia.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/src/vidalia/config/NetworkPage.cpp b/src/vidalia/config/NetworkPage.cpp
index e0651dd..7d16fbd 100644
--- a/src/vidalia/config/NetworkPage.cpp
+++ b/src/vidalia/config/NetworkPage.cpp
@@ -17,7 +17,6 @@
 #include "NetworkSettings.h"
 #include "VMessageBox.h"
 #include "Vidalia.h"
-#include "BridgeDownloaderProgressDialog.h"
 #include "DomainValidator.h"
 
 #include "stringutil.h"
@@ -50,7 +49,6 @@ NetworkPage::NetworkPage(QWidget *parent)
   connect(ui.lineBridge, SIGNAL(returnPressed()), this, SLOT(addBridge()));
   connect(ui.lblHelpFindBridges, SIGNAL(linkActivated(QString)),
           this, SLOT(onLinkActivated(QString)));
-  connect(ui.btnFindBridges, SIGNAL(clicked()), this, SLOT(findBridges()));
   connect(ui.cmboProxyType, SIGNAL(currentIndexChanged(int)),
           this, SLOT(proxyTypeChanged(int)));
 
@@ -61,17 +59,6 @@ NetworkPage::NetworkPage(QWidget *parent)
                        ui.listBridges, this,
                        SLOT(copySelectedBridgesToClipboard()));
 
-  if (! BridgeDownloader::isMethodSupported(BridgeDownloader::DownloadMethodHttps)) {
-    ui.btnFindBridges->setVisible(false);
-    ui.lblHelpFindBridges->setText(
-      tr("<a href=\"bridges.finding\">How can I find bridges?</a>"));
-    _bridgeDownloader = 0;
-  } else {
-    _bridgeDownloader = new BridgeDownloader(this);
-    connect(_bridgeDownloader, SIGNAL(bridgeRequestFinished(QStringList)),
-            this, SLOT(bridgeRequestFinished(QStringList)));
-  }
-
 #if defined(Q_WS_MAC)
   /* On OS X, the network page looks better without frame titles. Everywhere
    * else needs titles or else there's a break in the frame border. */
@@ -329,84 +316,6 @@ NetworkPage::load()
   ui.listBridges->addItems(settings.getBridgeList());
 }
 
-/** Called when the user clicks the "Find Bridges Now" button.
- * Attempts to establish an HTTPS connection to bridges.torproject.org
- * and download one or more bridge addresses. */
-void
-NetworkPage::findBridges()
-{
-  BridgeDownloaderProgressDialog *dlg = new BridgeDownloaderProgressDialog(this);
-
-  connect(_bridgeDownloader, SIGNAL(statusChanged(QString)),
-          dlg, SLOT(setStatus(QString)));
-  connect(_bridgeDownloader, SIGNAL(downloadProgress(qint64, qint64)),
-          dlg, SLOT(setDownloadProgress(qint64, qint64)));
-  connect(_bridgeDownloader, SIGNAL(bridgeRequestFailed(QString)),
-          dlg, SLOT(bridgeRequestFailed(QString)));
-  connect(_bridgeDownloader, SIGNAL(bridgeRequestFinished(QStringList)),
-          dlg, SLOT(bridgeRequestFinished(QStringList)));
-  connect(dlg, SIGNAL(retry()), this, SLOT(startBridgeRequest()));
-
-  startBridgeRequest();
-  switch (dlg->exec()) {
-    case QDialogButtonBox::Cancel:
-      _bridgeDownloader->cancelBridgeRequest();
-      break;
-
-    case QDialogButtonBox::Help:
-      emit helpRequested("bridges.finding");
-      break;
-  }
-
-  delete dlg;
-}
-
-/** Starts a new request for additional bridge addresses. */
-void
-NetworkPage::startBridgeRequest()
-{
-  if (ui.chkUseProxy->isChecked() &&
-     ui.cmboProxyType->currentIndex() == NetworkSettings::HttpHttpsProxy) {
-    _bridgeDownloader->setProxy(ui.lineProxyAddress->text(),
-                                ui.lineProxyPort->text().toUInt(),
-                                ui.lineProxyUsername->text(),
-                                ui.lineProxyPassword->text());
-  }
-
-  _bridgeDownloader->downloadBridges(BridgeDownloader::DownloadMethodHttps);
-}
-
-/** Called when a previous bridge request initiated by the findBridges()
- * method has completed. <b>bridges</b> contains a list of all bridges
- * received. */
-void
-NetworkPage::bridgeRequestFinished(const QStringList &bridges)
-{
-  bool foundNewBridges = false;
-
-  foreach (QString bridge, bridges) {
-    QString address = bridge.trimmed().split(" ").at(1);
-    if (ui.listBridges->findItems(address, Qt::MatchContains).isEmpty()) {
-      ui.listBridges->addItem(address);
-      foundNewBridges = true;
-    }
-  }
-
-  if (! foundNewBridges) {
-    QMessageBox dlg(this);
-    dlg.setIcon(QMessageBox::Information);
-    dlg.setText(tr("No new bridges are currently available. You can either "
-                   "wait a while and try again, or try another method of "
-                   "finding new bridges."));
-    dlg.setInformativeText(tr("Click Help to see other methods of finding "
-                              "new bridges."));
-    dlg.setStandardButtons(QMessageBox::Ok | QMessageBox::Help);
-
-    if (dlg.exec() == QMessageBox::Help)
-      emit helpRequested("bridges.finding");
-  }
-}
-
 /** Disable proxy username and password fields when the user wants to use
  * a SOCKS 4 proxy. */
 void
diff --git a/src/vidalia/config/NetworkPage.h b/src/vidalia/config/NetworkPage.h
index 073e006..0b94ef2 100644
--- a/src/vidalia/config/NetworkPage.h
+++ b/src/vidalia/config/NetworkPage.h
@@ -19,7 +19,6 @@
 #include "ui_NetworkPage.h"
 #include "ConfigPage.h"
 #include "Vidalia.h"
-#include "BridgeDownloader.h"
 
 #include <QPoint>
 
@@ -65,26 +64,12 @@ private slots:
   /** 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. Calls
-   * startBridgeRequest() to start a new request for additional bridge
-   * addresses, and displays a progress dialog for the user. */
-  void findBridges();
-  /** Starts a new request for additional bridge addresses. */
-  void startBridgeRequest();
-  /** Called when a previous bridge request initiated by the findBridges()
-   * method has completed. <b>bridges</b> contains a list of all bridges
-   * received. */
-  void bridgeRequestFinished(const QStringList &bridges);
 
   /** Disable proxy username and password fields when the user wants to use
    * a SOCKS 4 proxy. */
   void proxyTypeChanged(int selection);
 
 private:
-  /** Helper class used to facilitate downloading one or more bridge
-   * addresses. */
-  BridgeDownloader* _bridgeDownloader;
-
   /** Qt Designer generated object */
   Ui::NetworkPage ui;
 };
diff --git a/src/vidalia/config/NetworkPage.ui b/src/vidalia/config/NetworkPage.ui
index 4704604..3fc301b 100644
--- a/src/vidalia/config/NetworkPage.ui
+++ b/src/vidalia/config/NetworkPage.ui
@@ -14,12 +14,6 @@
    <enum>Qt::NoContextMenu</enum>
   </property>
   <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="margin">
-    <number>9</number>
-   </property>
    <item>
     <widget class="QCheckBox" name="chkUseProxy">
      <property name="toolTip">
@@ -57,12 +51,6 @@
       <string>Proxy Settings</string>
      </property>
      <layout class="QGridLayout">
-      <property name="margin">
-       <number>9</number>
-      </property>
-      <property name="spacing">
-       <number>6</number>
-      </property>
       <item row="0" column="0">
        <widget class="QLabel" name="lblProxyAddress">
         <property name="text">
@@ -75,12 +63,6 @@
       </item>
       <item row="0" column="1" colspan="2">
        <layout class="QHBoxLayout">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <property name="margin">
-         <number>0</number>
-        </property>
         <item>
          <widget class="QLineEdit" name="lineProxyAddress"/>
         </item>
@@ -118,12 +100,6 @@
       </item>
       <item row="1" column="1" colspan="2">
        <layout class="QHBoxLayout">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <property name="margin">
-         <number>0</number>
-        </property>
         <item>
          <widget class="QLineEdit" name="lineProxyUsername"/>
         </item>
@@ -148,7 +124,7 @@
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
-        <property name="sizeHint" >
+        <property name="sizeHint" stdset="0">
          <size>
           <width>40</width>
           <height>20</height>
@@ -206,12 +182,6 @@
       <string>Firewall Settings</string>
      </property>
      <layout class="QHBoxLayout">
-      <property name="spacing">
-       <number>6</number>
-      </property>
-      <property name="margin">
-       <number>9</number>
-      </property>
       <item>
        <widget class="QLabel" name="lblReachablePorts">
         <property name="text">
@@ -263,20 +233,8 @@
       <string>Bridge Settings</string>
      </property>
      <layout class="QVBoxLayout">
-      <property name="spacing">
-       <number>6</number>
-      </property>
-      <property name="margin">
-       <number>9</number>
-      </property>
       <item>
        <layout class="QHBoxLayout">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <property name="margin">
-         <number>0</number>
-        </property>
         <item>
          <widget class="QLabel" name="lblAddBridge">
           <property name="text">
@@ -289,7 +247,7 @@
           <property name="orientation">
            <enum>Qt::Horizontal</enum>
           </property>
-          <property name="sizeHint" >
+          <property name="sizeHint" stdset="0">
            <size>
             <width>40</width>
             <height>20</height>
@@ -301,20 +259,8 @@
       </item>
       <item>
        <layout class="QHBoxLayout">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <property name="margin">
-         <number>0</number>
-        </property>
         <item>
          <layout class="QVBoxLayout">
-          <property name="spacing">
-           <number>6</number>
-          </property>
-          <property name="margin">
-           <number>0</number>
-          </property>
           <item>
            <widget class="QLineEdit" name="lineBridge">
             <property name="maxLength">
@@ -336,12 +282,6 @@
         </item>
         <item>
          <layout class="QVBoxLayout">
-          <property name="spacing">
-           <number>6</number>
-          </property>
-          <property name="margin">
-           <number>0</number>
-          </property>
           <item>
            <widget class="QToolButton" name="btnAddBridge">
             <property name="text">
@@ -392,7 +332,7 @@
             <property name="orientation">
              <enum>Qt::Vertical</enum>
             </property>
-            <property name="sizeHint" >
+            <property name="sizeHint" stdset="0">
              <size>
               <width>20</width>
               <height>40</height>
@@ -407,19 +347,12 @@
       <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=&quot;bridges.finding&quot;&gt;How else can I find bridges?&lt;/a&gt;</string>
+           <string>&lt;a href=&quot;bridges.finding&quot;&gt;How can I find bridges?&lt;/a&gt;</string>
           </property>
          </widget>
         </item>
@@ -428,7 +361,7 @@
           <property name="orientation">
            <enum>Qt::Horizontal</enum>
           </property>
-          <property name="sizeHint" >
+          <property name="sizeHint" stdset="0">
            <size>
             <width>40</width>
             <height>20</height>
@@ -446,7 +379,7 @@
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
-     <property name="sizeHint" >
+     <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits