Vidalia 0.2.15
|
#include <NetworkPage.h>
Public Member Functions | |
NetworkPage (QWidget *parent=0) | |
bool | save (QString &errmsg) |
void | load () |
bool | apply (QString &errmsg) |
void | revert () |
bool | changedSinceLastApply () |
virtual void | retranslateUi () |
Private Slots | |
void | addBridge () |
void | removeBridge () |
void | copySelectedBridgesToClipboard () |
void | bridgeContextMenuRequested (const QPoint &pos) |
void | bridgeSelectionChanged () |
void | onLinkActivated (const QString &url) |
void | findBridges () |
void | startBridgeRequest () |
void | bridgeRequestFinished (const QStringList &bridges) |
void | proxyTypeChanged (int selection) |
Private Member Functions | |
bool | validateBridge (const QString &bridge, QString *out) |
Private Attributes | |
BridgeDownloader * | _bridgeDownloader |
Ui::NetworkPage | ui |
Definition at line 27 of file NetworkPage.h.
NetworkPage::NetworkPage | ( | QWidget * | parent = 0 | ) |
Default Constructor
Constructor
Definition at line 36 of file NetworkPage.cpp.
References _bridgeDownloader, addBridge(), bridgeContextMenuRequested(), bridgeRequestFinished(), bridgeSelectionChanged(), copySelectedBridgesToClipboard(), BridgeDownloader::DownloadMethodHttps, findBridges(), BridgeDownloader::isMethodSupported(), onLinkActivated(), proxyTypeChanged(), removeBridge(), ui, and vApp.
void NetworkPage::addBridge | ( | ) | [private, slot] |
Adds a bridge to the bridge list box.
Definition at line 175 of file NetworkPage.cpp.
References VMessageBox::Ok, ui, validateBridge(), and VMessageBox::warning().
Referenced by NetworkPage().
bool NetworkPage::apply | ( | QString & | errmsg | ) | [virtual] |
Applies the network configuration settings to Tor. Returns true if the settings were applied successfully. Otherwise, errmsg is set and false is returned.
Applies the network configuration settings to Tor. Returns true if the * settings were applied successfully. Otherwise, errmsg is set and * false is returned.
Reimplemented from ConfigPage.
Definition at line 95 of file NetworkPage.cpp.
References NetworkSettings::apply(), and Vidalia::torControl().
void NetworkPage::bridgeContextMenuRequested | ( | const QPoint & | pos | ) | [private, slot] |
Called when the user right-clicks on a bridge and displays a context menu.
Definition at line 223 of file NetworkPage.cpp.
References copySelectedBridgesToClipboard(), IMG_COPY, and ui.
Referenced by NetworkPage().
void NetworkPage::bridgeRequestFinished | ( | const QStringList & | bridges | ) | [private, slot] |
Called when a previous bridge request initiated by the findBridges() method has completed. bridges contains a list of all bridges received.
Definition at line 433 of file NetworkPage.cpp.
References ConfigPage::helpRequested(), ui, and validateBridge().
Referenced by findBridges(), and NetworkPage().
void NetworkPage::bridgeSelectionChanged | ( | ) | [private, slot] |
Called when the user changes which bridges they have selected.
Definition at line 242 of file NetworkPage.cpp.
References ui.
Referenced by NetworkPage().
bool NetworkPage::changedSinceLastApply | ( | ) | [virtual] |
Returns true if the user has changed their server settings since the last time they were applied to Tor.
Returns true if the user has changed their server settings since the * last time they were applied to Tor.
Reimplemented from ConfigPage.
Definition at line 103 of file NetworkPage.cpp.
References AbstractTorSettings::changedSinceLastApply(), and Vidalia::torControl().
void NetworkPage::copySelectedBridgesToClipboard | ( | ) | [private, slot] |
Copies all selected bridges to the clipboard.
Definition at line 205 of file NetworkPage.cpp.
Referenced by bridgeContextMenuRequested(), and NetworkPage().
void NetworkPage::findBridges | ( | ) | [private, slot] |
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.
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.
Definition at line 386 of file NetworkPage.cpp.
References _bridgeDownloader, bridgeRequestFinished(), BridgeDownloader::cancelBridgeRequest(), ConfigPage::helpRequested(), and startBridgeRequest().
Referenced by NetworkPage().
void NetworkPage::load | ( | ) | [virtual] |
Loads the settings for this page
Loads previously saved settings
Implements ConfigPage.
Definition at line 331 of file NetworkPage.cpp.
References NetworkSettings::getBridgeList(), NetworkSettings::getFascistFirewall(), NetworkSettings::getProxyAddress(), NetworkSettings::getProxyPassword(), NetworkSettings::getProxyType(), NetworkSettings::getProxyUsername(), NetworkSettings::getReachablePorts(), NetworkSettings::getUseBridges(), NetworkSettings::HttpHttpsProxy, NetworkSettings::HttpProxy, NetworkSettings::NoProxy, NetworkSettings::Socks4Proxy, NetworkSettings::Socks5Proxy, Vidalia::torControl(), ui, and vApp.
void NetworkPage::onLinkActivated | ( | const QString & | url | ) | [private, slot] |
Called when a link in a label is clicked. url is the target of the clicked link.
Definition at line 120 of file NetworkPage.cpp.
References ConfigPage::helpRequested().
Referenced by NetworkPage().
void NetworkPage::proxyTypeChanged | ( | int | selection | ) | [private, slot] |
Disable proxy username and password fields when the user wants to use a SOCKS 4 proxy.
Definition at line 467 of file NetworkPage.cpp.
References NetworkSettings::Socks4Proxy, and ui.
Referenced by NetworkPage().
void NetworkPage::removeBridge | ( | ) | [private, slot] |
Removes one or more selected bridges from the bridge list box.
Definition at line 198 of file NetworkPage.cpp.
References ui.
Referenced by NetworkPage().
void NetworkPage::retranslateUi | ( | ) | [virtual] |
Called when the user changes the UI translation.
Reimplemented from ConfigPage.
Definition at line 86 of file NetworkPage.cpp.
References ui.
void NetworkPage::revert | ( | ) | [virtual] |
Reverts the server configuration settings to their values at the last time they were successfully applied to Tor.
Reverts the server configuration settings to their values at the last * time they were successfully applied to Tor.
Reimplemented from ConfigPage.
Definition at line 111 of file NetworkPage.cpp.
References AbstractTorSettings::revert(), and Vidalia::torControl().
bool NetworkPage::save | ( | QString & | errmsg | ) | [virtual] |
Saves the changes on this page
Saves changes made to settings on the Firewall settings page.
Implements ConfigPage.
Definition at line 251 of file NetworkPage.cpp.
References i(), NetworkSettings::NoProxy, NetworkSettings::ProxyTypeMax, NetworkSettings::ProxyTypeMin, NetworkSettings::setBridgeList(), NetworkSettings::setFascistFirewall(), NetworkSettings::setProxyAddress(), NetworkSettings::setProxyPassword(), NetworkSettings::setProxyType(), NetworkSettings::setProxyUsername(), NetworkSettings::setReachablePorts(), NetworkSettings::setUseBridges(), Vidalia::torControl(), and ui.
void NetworkPage::startBridgeRequest | ( | ) | [private, slot] |
Starts a new request for additional bridge addresses.
Definition at line 416 of file NetworkPage.cpp.
References _bridgeDownloader, BridgeDownloader::downloadBridges(), BridgeDownloader::DownloadMethodHttps, NetworkSettings::HttpHttpsProxy, BridgeDownloader::setProxy(), and ui.
Referenced by findBridges().
bool NetworkPage::validateBridge | ( | const QString & | bridge, |
QString * | out | ||
) | [private] |
Verifies that bridge is a valid bridge identifier and places a normalized identifier in out. The normalized identifier will have all spaces removed from the fingerprint portion (if any) and all hexadecimal characters converted to uppercase. Returns true if bridge is a valid bridge identifier, false otherwise.
Definition at line 131 of file NetworkPage.cpp.
References string_is_hex().
Referenced by addBridge(), and bridgeRequestFinished().
BridgeDownloader* NetworkPage::_bridgeDownloader [private] |
Helper class used to facilitate downloading one or more bridge addresses.
Definition at line 93 of file NetworkPage.h.
Referenced by findBridges(), NetworkPage(), and startBridgeRequest().
Ui::NetworkPage NetworkPage::ui [private] |
Qt Designer generated object
Definition at line 96 of file NetworkPage.h.
Referenced by addBridge(), bridgeContextMenuRequested(), bridgeRequestFinished(), bridgeSelectionChanged(), copySelectedBridgesToClipboard(), load(), NetworkPage(), proxyTypeChanged(), removeBridge(), retranslateUi(), save(), and startBridgeRequest().