Vidalia 0.3.1
|
#include <ServerPage.h>
Public Member Functions | |
ServerPage (QWidget *parent=0) | |
~ServerPage () | |
bool | save (QString &errmsg) |
void | load () |
bool | apply (QString &errmsg) |
void | revert () |
bool | changedSinceLastApply () |
virtual void | retranslateUi () |
![]() | |
ConfigPage (QWidget *parent=0, const QString title=QString()) | |
QString | title () const |
virtual void | load ()=0 |
virtual bool | save (QString &errmsg)=0 |
virtual bool | changedSinceLastApply () |
virtual bool | apply (QString &errmsg) |
virtual void | revert () |
virtual void | retranslateUi () |
Private Types | |
enum | BwRateIndex { CableDsl256 = 0 , CableDsl512 , CableDsl768 , T1CableDsl1500 , GreaterThan1500 , CustomBwLimits } |
Private Slots | |
void | serverModeChanged (bool enabled) |
void | bandwidthHelp () |
void | exitPolicyHelp () |
void | rateChanged (int rate) |
void | customRateChanged () |
void | onAuthenticated () |
void | onDisconnected () |
void | copyBridgeIdentity () |
void | testUpnp () |
void | upnpHelp () |
void | linkActivated (const QString &url) |
Private Member Functions | |
int | selectedIndex () |
void | saveBandwidthLimits () |
void | loadBandwidthLimits () |
void | saveExitPolicies () |
void | loadExitPolicies () |
void | loadBridgeIdentity () |
void | displayBridgeUsage () |
Private Attributes | |
ServerSettings * | _settings |
Ui::ServerPage | ui |
QString | _tmpDirPort |
bool | _tmpMirror |
Additional Inherited Members | |
![]() | |
void | helpRequested (const QString &topic) |
Definition at line 30 of file ServerPage.h.
|
private |
Index values of rate values in the bandwidth limits dropdown box.
Definition at line 87 of file ServerPage.h.
ServerPage::ServerPage | ( | QWidget * | parent = 0 | ) |
Default Constructor
Constructor
Definition at line 71 of file ServerPage.cpp.
References _settings, _tmpDirPort, _tmpMirror, bandwidthHelp(), connect(), copyBridgeIdentity(), customRateChanged(), exitPolicyHelp(), linkActivated(), MAX_BANDWIDTH_RATE, MIN_BANDWIDTH_RATE, onAuthenticated(), onDisconnected(), rateChanged(), serverModeChanged(), testUpnp(), Vidalia::torControl(), ui, and upnpHelp().
ServerPage::~ServerPage | ( | ) |
|
virtual |
Applies the server 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 280 of file ServerPage.cpp.
References _settings, and ServerSettings::apply().
|
privateslot |
Called when the user clicks the bandwidth help button
Shows the bandwidth rate limiting help information
Definition at line 394 of file ServerPage.cpp.
References ConfigPage::helpRequested().
Referenced by ServerPage().
|
virtual |
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 271 of file ServerPage.cpp.
References _settings, and AbstractTorSettings::changedSinceLastApply().
|
privateslot |
Copies the user's bridge relay identity to the clipboard.
Definition at line 180 of file ServerPage.cpp.
Referenced by ServerPage().
|
privateslot |
Called when the user edits the max or average bandwidth limits.
Called when the user edits the long-term average or maximum bandwidth limit. This ensures that the average bandwidth rate is greater than MIN_RATE (20KB/s) and that the max rate is greater than the average rate.
Definition at line 557 of file ServerPage.cpp.
References MAX_BANDWIDTH_RATE, MIN_BANDWIDTH_RATE, quint32, and ui.
Referenced by save(), and ServerPage().
|
private |
Retrieves bridge usage history from Tor, parses and validates it, and then displays it in a new dialog.
Definition at line 612 of file ServerPage.cpp.
References err(), TorControl::getInfo(), string_parse_keyvals(), Vidalia::torControl(), and BridgeUsageDialog::update().
Referenced by linkActivated().
|
privateslot |
Called when the user clicks the exit policy help button
Shows exit policy related help information
Definition at line 387 of file ServerPage.cpp.
References ConfigPage::helpRequested().
Referenced by ServerPage().
|
privateslot |
Called when the user clicks on a QLabel containing a hyperlink.
Definition at line 601 of file ServerPage.cpp.
References displayBridgeUsage(), and ConfigPage::helpRequested().
Referenced by ServerPage().
|
virtual |
Loads the settings for this page
Loads previously saved settings
Implements ConfigPage.
Definition at line 350 of file ServerPage.cpp.
References _settings, ServerSettings::getContactInfo(), ServerSettings::getDirPort(), ServerSettings::getExitPolicy(), ServerSettings::getNickname(), ServerSettings::getORPort(), ServerSettings::isBridgeEnabled(), TorControl::isConnected(), ServerSettings::isDirectoryMirror(), ServerSettings::isNonExitEnabled(), ServerSettings::isServerEnabled(), ServerSettings::isUpnpEnabled(), loadBandwidthLimits(), loadBridgeIdentity(), loadExitPolicies(), ServerSettings::publishServerDescriptor(), Vidalia::torControl(), ExitPolicy::toString(), and ui.
|
private |
Loads the server's bandwidth average and burst limits.
Definition at line 401 of file ServerPage.cpp.
References _settings, CABLE256_AVG_RATE, CABLE256_MAX_RATE, CABLE512_AVG_RATE, CABLE512_MAX_RATE, CABLE768_AVG_RATE, CABLE768_MAX_RATE, CableDsl256, CableDsl512, CableDsl768, CustomBwLimits, ServerSettings::getBandwidthAvgRate(), ServerSettings::getBandwidthBurstRate(), GreaterThan1500, HIGHBW_AVG_RATE, HIGHBW_MAX_RATE, quint32, T1_AVG_RATE, T1_MAX_RATE, T1CableDsl1500, and ui.
Referenced by load().
|
private |
Loads the user's bridge relay identity into the appropriate widgets. If the user's bridge is not running, then "Not Running" will be displayed. Otherwise, either the bridge's "address:port", "fingerprint", or "address:port fingerprint" will be displayed, depending on whether our GETCONF and GETINFO commands are successful.
Definition at line 193 of file ServerPage.cpp.
References Vidalia::torControl(), and ui.
Referenced by load().
|
private |
Loads the server's exit policies.
Definition at line 473 of file ServerPage.cpp.
References _settings, ExitPolicy::acceptsPorts(), ExitPolicy::contains(), ServerSettings::getExitPolicy(), PORTS_HTTP, PORTS_HTTPS, PORTS_IM, PORTS_IRC, PORTS_MAIL, Policy::RejectAll, ExitPolicy::rejectsPorts(), and ui.
Referenced by load().
|
privateslot |
Called when Vidalia has authenticated to Tor. If the user's Tor is not recent enough, this disables the bridge server option and displays a warning if the user had previously configured Tor as a bridge.
Definition at line 146 of file ServerPage.cpp.
References VMessageBox::Cancel, TorControl::getTorVersion(), p(), quint32, ConfigDialog::Server, VMessageBox::ShowSettings, ConfigDialog::showWindow(), Vidalia::torControl(), ui, and VMessageBox::warning().
Referenced by ServerPage().
|
privateslot |
Called when Vidalia disconnects from Tor. This method reenables the bridge server option.
Definition at line 173 of file ServerPage.cpp.
References ui.
Referenced by ServerPage().
|
privateslot |
Called when the user selects a new value from the rate combo box
Called when the user selects a new value from the rate combo box.
Definition at line 546 of file ServerPage.cpp.
References CustomBwLimits, and ui.
Referenced by ServerPage().
|
virtual |
Called when the user changes the UI translation.
Reimplemented from ConfigPage.
Definition at line 137 of file ServerPage.cpp.
References ui.
|
virtual |
Reverts the server configuration settings to their values at the last time they were successfully 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 288 of file ServerPage.cpp.
References _settings, and AbstractTorSettings::revert().
|
virtual |
Saves the changes on this page
Saves changes made to settings on the Server settings page.
Implements ConfigPage.
Definition at line 295 of file ServerPage.cpp.
References _settings, customRateChanged(), saveBandwidthLimits(), saveExitPolicies(), ServerSettings::setBridgeEnabled(), ServerSettings::setContactInfo(), ServerSettings::setDirectoryMirror(), ServerSettings::setDirPort(), ServerSettings::setNickname(), ServerSettings::setNonExitEnabled(), ServerSettings::setORPort(), ServerSettings::setPublishServerDescriptor(), ServerSettings::setServerEnabled(), ServerSettings::setUpnpEnabled(), and ui.
|
private |
Saves the server's bandwidth average and burst limits.
Definition at line 437 of file ServerPage.cpp.
References _settings, CABLE256_AVG_RATE, CABLE256_MAX_RATE, CABLE512_AVG_RATE, CABLE512_MAX_RATE, CABLE768_AVG_RATE, CABLE768_MAX_RATE, CableDsl256, CableDsl512, CableDsl768, GreaterThan1500, HIGHBW_AVG_RATE, HIGHBW_MAX_RATE, quint32, ServerSettings::setBandwidthAvgRate(), ServerSettings::setBandwidthBurstRate(), T1_AVG_RATE, T1_MAX_RATE, T1CableDsl1500, and ui.
Referenced by save().
|
private |
Saves the server's exit policies.
Definition at line 500 of file ServerPage.cpp.
References _settings, ExitPolicy::addAcceptedPorts(), ExitPolicy::addPolicy(), ExitPolicy::addRejectedPorts(), ExitPolicy::Middleman, PORTS_HTTP, PORTS_HTTPS, PORTS_IM, PORTS_IRC, PORTS_MAIL, Policy::RejectAll, ServerSettings::setExitPolicy(), and ui.
Referenced by save().
|
private |
Returns the index of the selected item in lstExitPolicies
Called when the user toggles any one of the server mode radio buttons and hides or displays the server configuration tabs appropriately.
Definition at line 221 of file ServerPage.cpp.
References _tmpDirPort, _tmpMirror, isConnected(), Vidalia::torControl(), and ui.
Referenced by ServerPage().
|
privateslot |
Tests automatic port forwarding with UPnP.
Tests automatic port forwarding using UPnP.
Definition at line 580 of file ServerPage.cpp.
References connect(), ui, and upnpHelp().
Referenced by ServerPage().
|
privateslot |
Called when the user clicks the UPnP test dialog's help button.
Definition at line 594 of file ServerPage.cpp.
References ConfigPage::helpRequested().
Referenced by ServerPage(), and testUpnp().
|
private |
A ServerSettings object used to get and set information about how a local Tor server is configured.
Definition at line 119 of file ServerPage.h.
Referenced by apply(), changedSinceLastApply(), load(), loadBandwidthLimits(), loadExitPolicies(), revert(), save(), saveBandwidthLimits(), saveExitPolicies(), ServerPage(), and ~ServerPage().
|
private |
Used to store the dirport value and if the user wants to mirror the directory so that they can be emptied when selecting being a bridge and re-added when selecting relay
Definition at line 127 of file ServerPage.h.
Referenced by serverModeChanged(), and ServerPage().
|
private |
Definition at line 128 of file ServerPage.h.
Referenced by serverModeChanged(), and ServerPage().
|
private |
Qt Designer generated object
Definition at line 122 of file ServerPage.h.
Referenced by copyBridgeIdentity(), customRateChanged(), load(), loadBandwidthLimits(), loadBridgeIdentity(), loadExitPolicies(), onAuthenticated(), onDisconnected(), rateChanged(), retranslateUi(), save(), saveBandwidthLimits(), saveExitPolicies(), serverModeChanged(), ServerPage(), and testUpnp().