#include <networkpage.h>
Public Member Functions | |
NetworkPage (QWidget *parent=0) | |
bool | save (QString &errmsg) |
void | load () |
bool | apply (QString &errmsg) |
void | revert () |
bool | changedSinceLastApply () |
Private Slots | |
void | addBridge () |
void | removeBridge () |
void | copySelectedBridgesToClipboard () |
void | bridgeContextMenuRequested (const QPoint &pos) |
void | bridgeSelectionChanged () |
void | onAuthenticated () |
void | onDisconnected () |
void | onLinkActivated (const QString &url) |
Private Member Functions | |
bool | validateBridge (const QString &bridge, QString *out) |
Private Attributes | |
Ui::NetworkPage | ui |
Definition at line 27 of file networkpage.h.
NetworkPage::NetworkPage | ( | QWidget * | parent = 0 |
) |
Default Constructor
Constructor
Definition at line 33 of file networkpage.cpp.
References addBridge(), bridgeContextMenuRequested(), bridgeSelectionChanged(), copySelectedBridgesToClipboard(), onAuthenticated(), onDisconnected(), onLinkActivated(), removeBridge(), Vidalia::torControl(), ui, and vApp.
void NetworkPage::addBridge | ( | ) | [private, slot] |
Adds a bridge to the bridge list box.
Definition at line 177 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 76 of file networkpage.cpp.
References 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 225 of file networkpage.cpp.
References copySelectedBridgesToClipboard(), IMG_COPY, and ui.
Referenced by NetworkPage().
void NetworkPage::bridgeSelectionChanged | ( | ) | [private, slot] |
Called when the user changes which bridges they have selected.
Definition at line 244 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 84 of file networkpage.cpp.
References Vidalia::torControl().
void NetworkPage::copySelectedBridgesToClipboard | ( | ) | [private, slot] |
Copies all selected bridges to the clipboard.
Definition at line 207 of file networkpage.cpp.
Referenced by bridgeContextMenuRequested(), and NetworkPage().
void NetworkPage::load | ( | ) | [virtual] |
Loads the settings for this page
Loads previously saved settings
Implements ConfigPage.
Definition at line 325 of file networkpage.cpp.
References NetworkSettings::getBridgeList(), NetworkSettings::getFascistFirewall(), NetworkSettings::getHttpProxy(), NetworkSettings::getHttpProxyAuthenticator(), NetworkSettings::getReachablePorts(), NetworkSettings::getUseBridges(), NetworkSettings::getUseHttpProxy(), NetworkSettings::getUseHttpsProxy(), Vidalia::torControl(), and ui.
void NetworkPage::onAuthenticated | ( | ) | [private, slot] |
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.
Definition at line 102 of file networkpage.cpp.
References TorControl::getTorVersion(), Vidalia::torControl(), and ui.
Referenced by NetworkPage().
void NetworkPage::onDisconnected | ( | ) | [private, slot] |
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.
Definition at line 115 of file networkpage.cpp.
References ui.
Referenced by NetworkPage().
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 124 of file networkpage.cpp.
References ConfigPage::helpRequested().
Referenced by NetworkPage().
void NetworkPage::removeBridge | ( | ) | [private, slot] |
Removes one or more selected bridges from the bridge list box.
Definition at line 200 of file networkpage.cpp.
References ui.
Referenced by NetworkPage().
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 92 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 253 of file networkpage.cpp.
References i(), NetworkSettings::setBridgeList(), NetworkSettings::setFascistFirewall(), NetworkSettings::setHttpProxy(), NetworkSettings::setHttpProxyAuthenticator(), NetworkSettings::setHttpsProxy(), NetworkSettings::setHttpsProxyAuthenticator(), NetworkSettings::setReachablePorts(), NetworkSettings::setUseBridges(), NetworkSettings::setUseHttpProxy(), NetworkSettings::setUseHttpsProxy(), Vidalia::torControl(), and ui.
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 135 of file networkpage.cpp.
References string_is_hex().
Referenced by addBridge().
Ui::NetworkPage NetworkPage::ui [private] |
Qt Designer generated object
Definition at line 84 of file networkpage.h.
Referenced by addBridge(), bridgeContextMenuRequested(), bridgeSelectionChanged(), copySelectedBridgesToClipboard(), load(), NetworkPage(), onAuthenticated(), onDisconnected(), removeBridge(), and save().