#include <configdialog.h>
Public Types | |
enum | Page { General = 0, Network, Server, Appearance, Advanced, Service } |
Public Slots | |
void | showWindow (Page page=General) |
Public Member Functions | |
ConfigDialog (QWidget *parent=0) | |
Private Slots | |
void | saveChanges () |
void | applyChanges () |
void | saveConf () |
void | help (const QString &topic) |
void | help () |
Private Member Functions | |
void | loadSettings () |
QAction * | createPageAction (QIcon img, QString text, QActionGroup *group) |
void | addAction (QAction *action, const char *slot=0) |
Private Attributes | |
Ui::ConfigDialog | ui |
Definition at line 34 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 40 of file configdialog.h.
ConfigDialog::ConfigDialog | ( | QWidget * | parent = 0 |
) |
Default Constructor
Constructor
Definition at line 46 of file configdialog.cpp.
References addAction(), applyChanges(), createPageAction(), Vidalia::createShortcut(), help(), VidaliaWindow::helpRequested(), IMAGE_ADVANCED, IMAGE_APPEARANCE, IMAGE_GENERAL, IMAGE_HELP, IMAGE_NETWORK, IMAGE_SERVER, IMAGE_SERVICE, 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 135 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 196 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().
QAction * ConfigDialog::createPageAction | ( | QIcon | img, | |
QString | text, | |||
QActionGroup * | group | |||
) | [private] |
Creates a new action for a config page.
Creates a new action associated with a config page.
Definition at line 125 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 247 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 270 of file configdialog.cpp.
References VidaliaWindow::helpRequested().
void ConfigDialog::loadSettings | ( | ) | [private] |
Loads the current configuration settings
Loads the saved ConfigDialog settings.
Definition at line 155 of file configdialog.cpp.
References ConfigPage::load(), and ui.
Referenced by showWindow().
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 166 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 234 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 143 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 83 of file configdialog.h.
Referenced by addAction(), applyChanges(), ConfigDialog(), help(), loadSettings(), saveChanges(), and showWindow().