Vidalia  0.3.1
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ConfigDialog Class Reference

#include <ConfigDialog.h>

Inheritance diagram for ConfigDialog:
VidaliaWindow

Public Types

enum  Page {
  General = 0, Network, Server, Service,
  Appearance, Advanced
}
 

Public Slots

void showWindow (Page page=General)
 
- Public Slots inherited from VidaliaWindow
virtual void setVisible (bool visible)
 
virtual void showWindow ()
 

Signals

void checkForUpdates ()
 
void restartTor ()
 
- Signals inherited from VidaliaWindow
void helpRequested (const QString &topic)
 

Public Member Functions

 ConfigDialog (QWidget *parent=0)
 
- Public Member Functions inherited from VidaliaWindow
 VidaliaWindow (const QString &name, QWidget *parent=0, Qt::WFlags flags=0)
 
 ~VidaliaWindow ()
 
void setShortcut (const QString &shortcut, const char *slot)
 
void saveWindowState ()
 
void restoreWindowState ()
 
QVariant getSetting (QString name, QVariant defaultValue)
 
void saveSetting (QString name, QVariant value)
 

Protected Member Functions

virtual void retranslateUi ()
 
- Protected Member Functions inherited from VidaliaWindow
virtual void changeEvent (QEvent *e)
 

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
 

Detailed Description

Definition at line 26 of file ConfigDialog.h.

Member Enumeration Documentation

§ Page

Config dialog pages.

Enumerator
General 
Network 

General configuration page.

Server 

Network configuration page.

Service 

Server configuration page.

Appearance 

Service Configuration page

Advanced 

Appearance configuration page. Advanced configuration page.

Definition at line 32 of file ConfigDialog.h.

Constructor & Destructor Documentation

§ ConfigDialog()

ConfigDialog::ConfigDialog ( QWidget *  parent = 0)

Member Function Documentation

§ addAction()

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 141 of file ConfigDialog.cpp.

References connect(), and ui.

Referenced by ConfigDialog().

§ applyChanges

void ConfigDialog::applyChanges ( )
privateslot

Called after Vidalia has authenticated to Tor and applies any changes made since the last time they were applied.

Definition at line 216 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().

§ checkForUpdates

void ConfigDialog::checkForUpdates ( )
signal

Emitted when the user clicks "Check Now" to initiate a check for software updates.

Referenced by ConfigDialog(), and onCheckForUpdates().

§ createPageAction()

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 129 of file ConfigDialog.cpp.

Referenced by ConfigDialog().

§ help [1/2]

void ConfigDialog::help ( const QString &  topic)
privateslot

Called when a ConfigPage in the dialog requests help on a specific topic.

Definition at line 299 of file ConfigDialog.cpp.

References VidaliaWindow::helpRequested().

§ help [2/2]

void ConfigDialog::help ( )
privateslot

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 267 of file ConfigDialog.cpp.

References Advanced, Appearance, Network, Server, and ui.

Referenced by ConfigDialog().

§ loadSettings()

void ConfigDialog::loadSettings ( )
private

Loads the current configuration settings

Loads the saved ConfigDialog settings.

Definition at line 175 of file ConfigDialog.cpp.

References ConfigPage::load(), and ui.

Referenced by showWindow().

§ onCheckForUpdates

void ConfigDialog::onCheckForUpdates ( )
privateslot

Stub method that relays the checkForUpdates() signal from the General settings page to the owner of the config dialog (MainWindow).

Definition at line 290 of file ConfigDialog.cpp.

References checkForUpdates().

Referenced by ConfigDialog().

§ restartTor

void ConfigDialog::restartTor ( )
signal

Emitted when the user changes torrc file to restart Tor

Referenced by ConfigDialog().

§ retranslateUi()

void ConfigDialog::retranslateUi ( )
protectedvirtual

Called when the user changes the UI translation.

Reimplemented from VidaliaWindow.

Definition at line 161 of file ConfigDialog.cpp.

References ConfigPage::retranslateUi(), and ui.

§ saveChanges

void ConfigDialog::saveChanges ( )
privateslot

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 186 of file ConfigDialog.cpp.

References applyChanges(), TorControl::isConnected(), VMessageBox::Ok, p(), ConfigPage::save(), ConfigPage::title(), Vidalia::torControl(), ui, and VMessageBox::warning().

Referenced by ConfigDialog().

§ saveConf

void ConfigDialog::saveConf ( )
privateslot

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 254 of file ConfigDialog.cpp.

References TorControl::saveConf(), AbstractTorSettings::setChanged(), and Vidalia::torControl().

Referenced by applyChanges().

§ showWindow

void ConfigDialog::showWindow ( Page  page = General)
slot

Shows the config dialog with focus set to the given page.

Definition at line 149 of file ConfigDialog.cpp.

References loadSettings(), VidaliaWindow::showWindow(), and ui.

Referenced by ServerPage::onAuthenticated(), and MainWindow::showConfigDialog().

Member Data Documentation

§ ui

Ui::ConfigDialog ConfigDialog::ui
private

Qt Designer generated object

Definition at line 90 of file ConfigDialog.h.

Referenced by addAction(), applyChanges(), ConfigDialog(), help(), loadSettings(), retranslateUi(), saveChanges(), and showWindow().


The documentation for this class was generated from the following files: