#include <serverpage.h>
Public Member Functions | |
ServerPage (QWidget *parent=0) | |
~ServerPage () | |
bool | save (QString &errmsg) |
void | load () |
Private Types | |
enum | BwRateIndex { CableDsl256 = 0, CableDsl512, CableDsl768, T1CableDsl1500, GreaterThan1500, CustomBwLimits } |
Private Slots | |
void | bandwidthHelp () |
void | exitPolicyHelp () |
void | rateChanged (int rate) |
void | customRateChanged () |
Private Member Functions | |
int | selectedIndex () |
void | saveBandwidthLimits () |
void | loadBandwidthLimits () |
void | saveExitPolicies () |
void | loadExitPolicies () |
Private Attributes | |
TorControl * | _torControl |
ServerSettings * | _settings |
Ui::ServerPage | ui |
Definition at line 42 of file serverpage.h.
enum ServerPage::BwRateIndex [private] |
Index values of rate values in the bandwidth limits dropdown box.
CableDsl256 | Cable/DSL 256 Kbps |
CableDsl512 | Cable/DSL 512 Kbps |
CableDsl768 | Cable/DSL 768 Kbps |
T1CableDsl1500 | T1/Cable/DSL 1.5 Mbps |
GreaterThan1500 | > 1.5 Mbps |
CustomBwLimits | Custom bandwidth limits |
Definition at line 68 of file serverpage.h.
ServerPage::ServerPage | ( | QWidget * | parent = 0 |
) |
Default Constructor
Constructor
Definition at line 80 of file serverpage.cpp.
References _settings, _torControl, bandwidthHelp(), customRateChanged(), exitPolicyHelp(), MAX_BANDWIDTH_RATE, MIN_BANDWIDTH_RATE, rateChanged(), Vidalia::torControl(), and ui.
ServerPage::~ServerPage | ( | ) |
bool ServerPage::save | ( | QString & | errmsg | ) | [virtual] |
Saves the changes on this page
Saves changes made to settings on the Server settings page.
Implements ConfigPage.
Definition at line 120 of file serverpage.cpp.
References _settings, _torControl, ServerSettings::apply(), ServerSettings::changedSinceLastApply(), customRateChanged(), TorControl::isConnected(), ServerSettings::revert(), saveBandwidthLimits(), saveExitPolicies(), ServerSettings::setContactInfo(), ServerSettings::setDirectoryMirror(), ServerSettings::setDirPort(), ServerSettings::setNickname(), ServerSettings::setORPort(), ServerSettings::setServerEnabled(), and ui.
void ServerPage::load | ( | ) | [virtual] |
Loads the settings for this page
Loads previously saved settings
Implements ConfigPage.
Definition at line 162 of file serverpage.cpp.
References _settings, ServerSettings::getContactInfo(), ServerSettings::getDirPort(), ServerSettings::getNickname(), ServerSettings::getORPort(), ServerSettings::isDirectoryMirror(), ServerSettings::isServerEnabled(), loadBandwidthLimits(), loadExitPolicies(), and ui.
void ServerPage::bandwidthHelp | ( | ) | [private, slot] |
Called when the user clicks the bandwidth help button
Shows the bandwidth rate limiting help information
Definition at line 186 of file serverpage.cpp.
References BANDWIDTH_HELP, and Vidalia::help().
Referenced by ServerPage().
void ServerPage::exitPolicyHelp | ( | ) | [private, slot] |
Called when the user clicks the exit policy help button
Shows exit policy related help information
Definition at line 179 of file serverpage.cpp.
References EXIT_POLICY_HELP, and Vidalia::help().
Referenced by ServerPage().
void ServerPage::rateChanged | ( | int | index | ) | [private, slot] |
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 333 of file serverpage.cpp.
References CustomBwLimits, and ui.
Referenced by ServerPage().
void ServerPage::customRateChanged | ( | ) | [private, slot] |
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 344 of file serverpage.cpp.
References MAX_BANDWIDTH_RATE, MIN_BANDWIDTH_RATE, and ui.
Referenced by save(), and ServerPage().
int ServerPage::selectedIndex | ( | ) | [private] |
Returns the index of the selected item in lstExitPolicies
void ServerPage::saveBandwidthLimits | ( | ) | [private] |
Saves the server's bandwidth average and burst limits.
Definition at line 229 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, ServerSettings::setBandwidthAvgRate(), ServerSettings::setBandwidthBurstRate(), T1_AVG_RATE, T1_MAX_RATE, T1CableDsl1500, and ui.
Referenced by save().
void ServerPage::loadBandwidthLimits | ( | ) | [private] |
Loads the server's bandwidth average and burst limits.
Definition at line 193 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, T1_AVG_RATE, T1_MAX_RATE, T1CableDsl1500, and ui.
Referenced by load().
void ServerPage::saveExitPolicies | ( | ) | [private] |
Saves the server's exit policies.
Definition at line 292 of file serverpage.cpp.
References _settings, ExitPolicy::addAcceptedPorts(), ExitPolicy::addPolicy(), ExitPolicy::addRejectedPorts(), PORTS_HTTP, PORTS_HTTPS, PORTS_IM, PORTS_IRC, PORTS_MAIL, Policy::RejectAll, ServerSettings::setExitPolicy(), and ui.
Referenced by save().
void ServerPage::loadExitPolicies | ( | ) | [private] |
Loads the server's exit policies.
Definition at line 265 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().
TorControl* ServerPage::_torControl [private] |
A TorControl object used to talk to Tor
Definition at line 90 of file serverpage.h.
Referenced by save(), and ServerPage().
ServerSettings* ServerPage::_settings [private] |
A ServerSettings object used to get and set information about how a local Tor server is configured.
Definition at line 93 of file serverpage.h.
Referenced by load(), loadBandwidthLimits(), loadExitPolicies(), save(), saveBandwidthLimits(), saveExitPolicies(), ServerPage(), and ~ServerPage().
Ui::ServerPage ServerPage::ui [private] |
Qt Designer generated object
Definition at line 96 of file serverpage.h.
Referenced by customRateChanged(), load(), loadBandwidthLimits(), loadExitPolicies(), rateChanged(), save(), saveBandwidthLimits(), saveExitPolicies(), and ServerPage().