#include <ConfigDialog.h>
Public Types | |
enum | Page { General = 0, Network, Server, Appearance, Advanced, Service } |
Public Slots | |
void | showWindow (Page page=General) |
Signals | |
void | checkForUpdates () |
Public Member Functions | |
ConfigDialog (QWidget *parent=0) | |
Protected Member Functions | |
virtual void | retranslateUi () |
Private Slots | |
void | saveChanges () |
void | applyChanges () |
void | saveConf () |
void | help (const QString &topic) |
void | help () |
void | onCheckForUpdates () |
Private Member Functions | |
void | loadSettings () |
QAction * | createPageAction (const QIcon &img, const QString &text, const QString &data, QActionGroup *group) |
void | addAction (QAction *action, const char *slot=0) |
Private Attributes | |
Ui::ConfigDialog | ui |
Definition at line 27 of file ConfigDialog.h.
enum ConfigDialog::Page |
Config dialog pages.
General | |
Network |
General configuration page. |
Server |
Network configuration page. |
Appearance |
Server configuration page. |
Advanced |
Appearance configuration page. |
Service |
Advanced configuration page. Service Configuration page |
Definition at line 33 of file ConfigDialog.h.
ConfigDialog::ConfigDialog | ( | QWidget * | parent = 0 |
) |
Default Constructor
Constructor
Definition at line 43 of file ConfigDialog.cpp.
References addAction(), applyChanges(), checkForUpdates(), createPageAction(), Vidalia::createShortcut(), help(), VidaliaWindow::helpRequested(), IMAGE_ADVANCED, IMAGE_APPEARANCE, IMAGE_GENERAL, IMAGE_HELP, IMAGE_NETWORK, IMAGE_SERVER, IMAGE_SERVICE, onCheckForUpdates(), saveChanges(), Vidalia::torControl(), and ui.
void ConfigDialog::addAction | ( | QAction * | action, | |
const char * | slot = 0 | |||
) | [private] |
Adds a new action to the toolbar.
Adds the given action to the toolbar and hooks its triggered() signal to the specified slot (if given).
Definition at line 138 of file ConfigDialog.cpp.
References ui.
Referenced by ConfigDialog().
void ConfigDialog::applyChanges | ( | ) | [private, slot] |
Called after Vidalia has authenticated to Tor and applies any changes made since the last time they were applied.
Definition at line 213 of file ConfigDialog.cpp.
References ConfigPage::apply(), VMessageBox::Cancel, ConfigPage::changedSinceLastApply(), p(), ConfigPage::revert(), saveConf(), VMessageBox::ShowSettings, VidaliaWindow::showWindow(), ConfigPage::title(), ui, and VMessageBox::warning().
Referenced by ConfigDialog(), and saveChanges().
void ConfigDialog::checkForUpdates | ( | ) | [signal] |
Emitted when the user clicks "Check Now" to initiate a check for software updates.
Referenced by ConfigDialog(), and onCheckForUpdates().
QAction * ConfigDialog::createPageAction | ( | const QIcon & | img, | |
const QString & | text, | |||
const QString & | data, | |||
QActionGroup * | group | |||
) | [private] |
Creates a new action for a config page.
Creates a new action associated with a config page.
Definition at line 126 of file ConfigDialog.cpp.
Referenced by ConfigDialog().
void ConfigDialog::help | ( | ) | [private, slot] |
Shows general help information for whichever settings page the user is currently viewing.
Shows help information for whichever settings page the user is currently viewing.
Definition at line 264 of file ConfigDialog.cpp.
References Advanced, Appearance, Network, Server, and ui.
Referenced by ConfigDialog().
void ConfigDialog::help | ( | const QString & | topic | ) | [private, slot] |
Called when a ConfigPage in the dialog requests help on a specific topic.
Definition at line 296 of file ConfigDialog.cpp.
References VidaliaWindow::helpRequested().
void ConfigDialog::loadSettings | ( | ) | [private] |
Loads the current configuration settings
Loads the saved ConfigDialog settings.
Definition at line 172 of file ConfigDialog.cpp.
References ConfigPage::load(), and ui.
Referenced by showWindow().
void ConfigDialog::onCheckForUpdates | ( | ) | [private, slot] |
Stub method that relays the checkForUpdates() signal from the General settings page to the owner of the config dialog (MainWindow).
Definition at line 287 of file ConfigDialog.cpp.
References checkForUpdates().
Referenced by ConfigDialog().
void ConfigDialog::retranslateUi | ( | ) | [protected, virtual] |
Called when the user changes the UI translation.
Reimplemented from VidaliaWindow.
Definition at line 158 of file ConfigDialog.cpp.
References ConfigPage::retranslateUi(), and ui.
void ConfigDialog::saveChanges | ( | ) | [private, slot] |
Called when user clicks "Save Settings". Saves their settings to Vidalia's configuration file.
Saves changes made to settings. If Tor is running and Vidalia is connected, we will also attempt to apply the changes to Tor.
Definition at line 183 of file ConfigDialog.cpp.
References applyChanges(), TorControl::isConnected(), VMessageBox::Ok, p(), ConfigPage::save(), ConfigPage::title(), Vidalia::torControl(), ui, and VMessageBox::warning().
Referenced by ConfigDialog().
void ConfigDialog::saveConf | ( | ) | [private, slot] |
Sends Tor a SAVECONF to write its configuration to disk. If the SAVECONF is successful, then all settings are considered to be applied.
Definition at line 251 of file ConfigDialog.cpp.
References TorControl::saveConf(), and Vidalia::torControl().
Referenced by applyChanges().
void ConfigDialog::showWindow | ( | Page | page = General |
) | [slot] |
Shows the config dialog with focus set to the given page.
Definition at line 146 of file ConfigDialog.cpp.
References loadSettings(), VidaliaWindow::showWindow(), and ui.
Referenced by ServerPage::onAuthenticated(), and MainWindow::showConfigDialog().
Ui::ConfigDialog ConfigDialog::ui [private] |
Qt Designer generated object
Definition at line 89 of file ConfigDialog.h.
Referenced by addAction(), applyChanges(), ConfigDialog(), help(), loadSettings(), retranslateUi(), saveChanges(), and showWindow().