Vidalia
0.3.1
|
#include <VidaliaSettings.h>
Public Types | |
enum | IconPosition { Tray, Dock, Both } |
Additional Inherited Members | |
![]() | |
static QString | settingsFile () |
static bool | settingsFileExists () |
static void | reset () |
![]() | |
void | setDefault (const QString &key, const QVariant &val) |
QVariant | defaultValue (const QString &key) const |
QMap< QString, QVariant > | allSettings () const |
Handles saving and restoring Vidalia's settings, such as the location of Tor, the control port, etc.
NOTE: Qt 4.1 documentation states that constructing a QSettings object is "very fast", so we shouldn't need to create a global instance of this class.
Definition at line 33 of file VidaliaSettings.h.
Enumerator | |
---|---|
Tray | |
Dock | |
Both |
Definition at line 38 of file VidaliaSettings.h.
VidaliaSettings::VidaliaSettings | ( | ) |
Default constructor.
Default Constructor
Definition at line 53 of file VidaliaSettings.cpp.
References Both, LanguageSupport::defaultLanguageCode(), VSettings::setDefault(), SETTING_BROWSER_EXECUTABLE, SETTING_CHECK_FOR_UPDATES, SETTING_ICON_PREF, SETTING_IM_EXECUTABLE, SETTING_LANGUAGE, SETTING_LAST_UPDATE_CHECK, SETTING_LOCAL_GEOIP_DATABASE, SETTING_PLUGIN_PATH, SETTING_PROXY_EXECUTABLE, SETTING_PROXY_EXECUTABLE_ARGUMENTS, SETTING_REMEMBER_SHUTDOWN, SETTING_RUN_PROXY_AT_START, SETTING_RUN_TOR_AT_START, SETTING_SHOW_MAINWINDOW_AT_START, SETTING_SKIP_VERSION_CHECK, SETTING_STYLE, SETTING_USE_LOCAL_GEOIP_DATABASE, and vApp.
VidaliaSettings::IconPosition VidaliaSettings::fromString | ( | QString | iconPref | ) |
Definition at line 369 of file VidaliaSettings.cpp.
References Both, Dock, and Tray.
Referenced by getIconPref().
QString VidaliaSettings::getBrowserDirectory | ( | ) | const |
Returns a fully-qualified path to the web browser directory
Definition at line 208 of file VidaliaSettings.cpp.
References SETTING_BROWSER_DIRECTORY, toString(), and VSettings::value().
QString VidaliaSettings::getBrowserExecutable | ( | ) | const |
If browserDirectory is empty, returns a fully-qualified path to the web browser, including the executable name. If browserDirectory is set, then returns the basename of the configured web browser
Definition at line 193 of file VidaliaSettings.cpp.
References SETTING_BROWSER_EXECUTABLE, toString(), and VSettings::value().
VidaliaSettings::IconPosition VidaliaSettings::getIconPref | ( | ) |
Get the icon preference
Definition at line 346 of file VidaliaSettings.cpp.
References fromString(), SETTING_ICON_PREF, toString(), and VSettings::value().
Referenced by AppearancePage::load(), MainWindow::MainWindow(), and MainWindow::setTrayIcon().
QString VidaliaSettings::getIMExecutable | ( | ) | const |
Returns a fully-qualified path to the IM client, including the executable name.
Definition at line 224 of file VidaliaSettings.cpp.
References SETTING_IM_EXECUTABLE, toString(), and VSettings::value().
QString VidaliaSettings::getInterfaceStyle | ( | ) |
Gets the interface style key (e.g., "windows", "motif", etc.)
Definition at line 111 of file VidaliaSettings.cpp.
References SETTING_STYLE, and VSettings::value().
Referenced by Vidalia::setStyle().
QString VidaliaSettings::getLanguageCode | ( | ) |
Gets the currently preferred language code for Vidalia.
Definition at line 97 of file VidaliaSettings.cpp.
References SETTING_LANGUAGE, and VSettings::value().
Referenced by AppearancePage::load(), AppearancePage::save(), and Vidalia::setLanguage().
QString VidaliaSettings::getProxyExecutable | ( | ) | const |
Returns a fully-qualified path to the proxy server, including the executable name.
Definition at line 255 of file VidaliaSettings.cpp.
References SETTING_PROXY_EXECUTABLE, toString(), and VSettings::value().
Referenced by GeneralPage::load().
QString VidaliaSettings::getProxyExecutableArguments | ( | ) | const |
Returns a list containing additional command line arguments to be passed to ProxyExecutable
Returns a string containing additional command line arguments to be passed to ProxyExecutable
Definition at line 271 of file VidaliaSettings.cpp.
References SETTING_PROXY_EXECUTABLE_ARGUMENTS, and VSettings::value().
Referenced by GeneralPage::load().
bool VidaliaSettings::isAutoUpdateEnabled | ( | ) | const |
Returns true if Vidalia should automatically check for software updates.
Definition at line 285 of file VidaliaSettings.cpp.
References SETTING_CHECK_FOR_UPDATES, and VSettings::value().
Referenced by MainWindow::circuitEstablished(), and MainWindow::running().
QDateTime VidaliaSettings::lastCheckedForUpdates | ( | ) | const |
Returns the time at which Vidalia last checked for software updates.
Definition at line 297 of file VidaliaSettings.cpp.
References SETTING_LAST_UPDATE_CHECK, and VSettings::value().
Referenced by MainWindow::circuitEstablished(), and MainWindow::running().
QString VidaliaSettings::localGeoIpDatabase | ( | ) | const |
Returns the file, if set, to be used as the local GeoIP database.
Definition at line 321 of file VidaliaSettings.cpp.
References SETTING_LOCAL_GEOIP_DATABASE, toString(), and VSettings::value().
Referenced by NetViewer::setupGeoIpResolver().
QString VidaliaSettings::pluginPath | ( | ) | const |
Returns the path where the plugins live
Definition at line 333 of file VidaliaSettings.cpp.
References SETTING_PLUGIN_PATH, toString(), and VSettings::value().
Referenced by PluginEngine::loadAllPlugins(), and PluginEngine::PluginEngine().
bool VidaliaSettings::rememberShutdown | ( | ) |
Returns true if Vidalia should not ask if the user wants to shutdown tor gracefully
Definition at line 384 of file VidaliaSettings.cpp.
References SETTING_REMEMBER_SHUTDOWN, and VSettings::value().
Referenced by MainWindow::stop().
bool VidaliaSettings::runProxyAtStart | ( | ) |
Returns true if Vidalia should start a proxy application when it starts.
Definition at line 240 of file VidaliaSettings.cpp.
References SETTING_RUN_PROXY_AT_START, and VSettings::value().
Referenced by GeneralPage::load().
bool VidaliaSettings::runTorAtStart | ( | ) |
Returns true if Vidalia should start Tor when it starts.
Returns true if Tor is to be run when Vidalia starts.
Definition at line 125 of file VidaliaSettings.cpp.
References SETTING_RUN_TOR_AT_START, and VSettings::value().
Referenced by GeneralPage::load(), and MainWindow::running().
bool VidaliaSettings::runVidaliaOnBoot | ( | ) |
Returns true if Vidalia should start on system boot.
Returns true if Vidalia is set to run on system boot.
Definition at line 155 of file VidaliaSettings.cpp.
References win32_registry_get_key_value().
Referenced by GeneralPage::load().
Sets to enabled whether Vidalia should automatically check for software updates or not.
Definition at line 291 of file VidaliaSettings.cpp.
References SETTING_CHECK_FOR_UPDATES, and VSettings::setValue().
void VidaliaSettings::setBrowserDirectory | ( | const QString & | browserDirectory | ) |
Sets the location and name of the web browser directory to the given string. If set to the empty string, the browser will not be started.
Definition at line 216 of file VidaliaSettings.cpp.
References SETTING_BROWSER_DIRECTORY, and VSettings::setValue().
void VidaliaSettings::setBrowserExecutable | ( | const QString & | browserExecutable | ) |
Sets the location and name of the web browser executable to the given string. If set to the empty string, the browser will not be started.
Definition at line 201 of file VidaliaSettings.cpp.
References SETTING_BROWSER_EXECUTABLE, and VSettings::setValue().
void VidaliaSettings::setIconPref | ( | const IconPosition | iconPref | ) |
Set the icon preference
Definition at line 353 of file VidaliaSettings.cpp.
References SETTING_ICON_PREF, VSettings::setValue(), and toString().
Referenced by AppearancePage::save().
void VidaliaSettings::setIMExecutable | ( | const QString & | IMExecutable | ) |
Sets the location and name of the IM client executable to the given string. If set to the empty string, the client will not be started.
Definition at line 232 of file VidaliaSettings.cpp.
References SETTING_IM_EXECUTABLE, and VSettings::setValue().
void VidaliaSettings::setInterfaceStyle | ( | QString | styleKey | ) |
Sets the interface style key.
Definition at line 118 of file VidaliaSettings.cpp.
References SETTING_STYLE, and VSettings::setValue().
Referenced by AppearancePage::save().
void VidaliaSettings::setLanguageCode | ( | QString | languageCode | ) |
Saves the preferred language code.
Sets the preferred language code.
Definition at line 104 of file VidaliaSettings.cpp.
References SETTING_LANGUAGE, and VSettings::setValue().
Referenced by AppearancePage::save().
void VidaliaSettings::setLastCheckedForUpdates | ( | const QDateTime & | checkedAt | ) |
Sets to checkedAt the time at which Vidalia last checked for available software updates.
Definition at line 303 of file VidaliaSettings.cpp.
References SETTING_LAST_UPDATE_CHECK, and VSettings::setValue().
void VidaliaSettings::setLocalGeoIpDatabase | ( | const QString & | databaseFile | ) |
Sets the file to use as a local GeoIP database.
Definition at line 327 of file VidaliaSettings.cpp.
References SETTING_LOCAL_GEOIP_DATABASE, and VSettings::setValue().
void VidaliaSettings::setPluginPath | ( | const QString & | path | ) |
Sets the path where the plugins live
Definition at line 339 of file VidaliaSettings.cpp.
References SETTING_PLUGIN_PATH, and VSettings::setValue().
void VidaliaSettings::setProxyExecutable | ( | const QString & | proxyExecutable | ) |
Sets the location and name of the proxy server executable to the given string. If set to the empty string, the proxy will not be started.
Definition at line 263 of file VidaliaSettings.cpp.
References SETTING_PROXY_EXECUTABLE, and VSettings::setValue().
Referenced by GeneralPage::save().
void VidaliaSettings::setProxyExecutableArguments | ( | const QString & | proxyExecutableArguments | ) |
Sets the additional arguments to be passed to Proxy Executable
Definition at line 278 of file VidaliaSettings.cpp.
References SETTING_PROXY_EXECUTABLE_ARGUMENTS, and VSettings::setValue().
Referenced by GeneralPage::save().
Sets RememberShutdown to val
Definition at line 390 of file VidaliaSettings.cpp.
References SETTING_REMEMBER_SHUTDOWN, and VSettings::setValue().
Set whether to run a proxy application when Vidalia starts.
Definition at line 247 of file VidaliaSettings.cpp.
References SETTING_RUN_PROXY_AT_START, and VSettings::setValue().
Referenced by GeneralPage::save().
Set whether to run Tor when Vidalia starts.
If run is set to true, then Tor will be run when Vidalia starts.
Definition at line 132 of file VidaliaSettings.cpp.
References SETTING_RUN_TOR_AT_START, and VSettings::setValue().
Referenced by GeneralPage::save().
Set whether to run Vidalia on system boot.
If run is set to true, then Vidalia will run on system boot.
Definition at line 171 of file VidaliaSettings.cpp.
References win32_registry_remove_key(), and win32_registry_set_key_value().
Referenced by GeneralPage::save().
Sets whether to show Vidalia's main window when the application starts.
Definition at line 147 of file VidaliaSettings.cpp.
References SETTING_SHOW_MAINWINDOW_AT_START, and VSettings::setValue().
Referenced by StatusTab::toggleShowOnStartup().
Enables or disables use of a local GeoIP database.
Definition at line 315 of file VidaliaSettings.cpp.
References SETTING_USE_LOCAL_GEOIP_DATABASE, and VSettings::setValue().
bool VidaliaSettings::showMainWindowAtStart | ( | ) |
Returns true if Vidalia's main window should be visible when the application starts.
Definition at line 140 of file VidaliaSettings.cpp.
References SETTING_SHOW_MAINWINDOW_AT_START, and VSettings::value().
Referenced by MainWindow::createTrayIcon().
bool VidaliaSettings::skipVersionCheck | ( | ) | const |
Returns true if Vidalia should skip the version check for tor
Definition at line 378 of file VidaliaSettings.cpp.
References SETTING_SKIP_VERSION_CHECK, and VSettings::value().
Referenced by MainWindow::checkTorVersion().
QString VidaliaSettings::toString | ( | const IconPosition | iconPref | ) |
Definition at line 359 of file VidaliaSettings.cpp.
Referenced by getBrowserDirectory(), getBrowserExecutable(), getIconPref(), getIMExecutable(), getProxyExecutable(), localGeoIpDatabase(), pluginPath(), and setIconPref().
bool VidaliaSettings::useLocalGeoIpDatabase | ( | ) | const |
Returns true if Vidalia is currently configured to use a local GeoIP database.
Definition at line 309 of file VidaliaSettings.cpp.
References SETTING_USE_LOCAL_GEOIP_DATABASE, and VSettings::value().
Referenced by NetViewer::setupGeoIpResolver().