#include <vidalia.h>
Signals | |
void | shutdown () |
Public Member Functions | |
Vidalia (QStringList args, int &argc, char **argv) | |
~Vidalia () | |
bool | validateArguments (QString &errmsg) |
void | printUsage (QString errmsg=QString()) |
Static Public Member Functions | |
static QMap< QString, QString > | arguments () |
static bool | setLanguage (QString languageCode=QString()) |
static bool | setStyle (QString styleKey=QString()) |
static void | help (QString topic=QString()) |
static QString | language () |
static QString | style () |
static QString | version () |
static TorControl * | torControl () |
static QString | dataDirectory () |
static QString | defaultDataDirectory () |
static QString | pidFile () |
Private Member Functions | |
void | parseArguments (QStringList args) |
bool | argNeedsValue (QString argName) |
Static Private Attributes | |
static QMap< QString, QString > | _args |
static QString | _style |
static QString | _language |
static VidaliaSettings | _settings |
static TorControl * | _torControl |
static HelpBrowser * | _help |
Definition at line 48 of file vidalia.h.
Vidalia::Vidalia | ( | QStringList | args, | |
int & | argc, | |||
char ** | argv | |||
) |
Constructor.
Translate the GUI to the appropriate language.
Set the GUI style appropriately.
Creates a TorControl object, used to talk to Tor.
Create a help browser object, used to dispaly various help topics.
Definition at line 56 of file vidalia.cpp.
References _args, _help, _settings, _torControl, ARG_GUISTYLE, ARG_LANGUAGE, ARG_RESET, parseArguments(), VidaliaSettings::reset(), setLanguage(), and setStyle().
Vidalia::~Vidalia | ( | ) |
static QMap<QString, QString> Vidalia::arguments | ( | ) | [inline, static] |
bool Vidalia::validateArguments | ( | QString & | errmsg | ) |
Validates that all arguments were well-formed.
Definition at line 164 of file vidalia.cpp.
References _args, ARG_GUISTYLE, ARG_HELP, ARG_LANGUAGE, and LanguageSupport::isValidLanguageCode().
Referenced by main().
void Vidalia::printUsage | ( | QString | errmsg = QString() |
) |
Prints usage information to the given text stream.
Definition at line 101 of file vidalia.cpp.
References ARG_DATADIR, ARG_GUISTYLE, ARG_HELP, ARG_LANGUAGE, ARG_PIDFILE, ARG_RESET, and LanguageSupport::languageCodes().
Referenced by main().
bool Vidalia::setLanguage | ( | QString | languageCode = QString() |
) | [static] |
Sets the current language.
Definition at line 191 of file vidalia.cpp.
References _language, _settings, VidaliaSettings::getLanguageCode(), and LanguageSupport::translate().
Referenced by Vidalia().
bool Vidalia::setStyle | ( | QString | styleKey = QString() |
) | [static] |
Sets the current GUI style.
Definition at line 210 of file vidalia.cpp.
References _settings, _style, and VidaliaSettings::getInterfaceStyle().
Referenced by AppearancePage::save(), and Vidalia().
void Vidalia::help | ( | QString | topic = QString() |
) | [static] |
Shows the specified help topic, or the default if empty.
Definition at line 227 of file vidalia.cpp.
References _help, and HelpBrowser::show().
Referenced by ServerPage::bandwidthHelp(), MainWindow::connectFailed(), ServerPage::exitPolicyHelp(), NetViewer::help(), MessageLog::help(), ConfigDialog::help(), MainWindow::showHelp(), MainWindow::startFailed(), MainWindow::stop(), and MainWindow::stopped().
static QString Vidalia::language | ( | ) | [inline, static] |
Returns the current language.
Definition at line 73 of file vidalia.h.
References _language.
Referenced by HelpBrowser::getResourcePath(), HelpBrowser::HelpBrowser(), and HelpTextBrowser::loadResource().
static QString Vidalia::style | ( | ) | [inline, static] |
Returns the current GUI style.
Definition at line 75 of file vidalia.h.
References _style.
Referenced by AppearancePage::load().
static QString Vidalia::version | ( | ) | [inline, static] |
Returns Vidalia's application version.
Definition at line 77 of file vidalia.h.
References VIDALIA_VERSION.
Referenced by AboutDialog::AboutDialog().
static TorControl* Vidalia::torControl | ( | ) | [inline, static] |
Returns Vidalia's main TorControl object.
Definition at line 80 of file vidalia.h.
References _torControl.
Referenced by AboutDialog::AboutDialog(), BandwidthGraph::BandwidthGraph(), MainWindow::MainWindow(), MessageLog::MessageLog(), NetViewer::NetViewer(), and ServerPage::ServerPage().
QString Vidalia::dataDirectory | ( | ) | [static] |
Returns the location Vidalia uses for its data files.
Definition at line 234 of file vidalia.cpp.
References _args, ARG_DATADIR, and defaultDataDirectory().
Referenced by pidFile(), and GeoIpCache::saveToDisk().
QString Vidalia::defaultDataDirectory | ( | ) | [static] |
Returns the default location of Vidalia's data directory.
Definition at line 244 of file vidalia.cpp.
References win32_app_data_folder().
Referenced by dataDirectory().
QString Vidalia::pidFile | ( | ) | [static] |
Returns the location of Vidalia's pid file.
Definition at line 255 of file vidalia.cpp.
References _args, ARG_PIDFILE, and dataDirectory().
Referenced by main().
void Vidalia::shutdown | ( | ) | [signal] |
Signals that the application needs to shutdown now.
void Vidalia::parseArguments | ( | QStringList | args | ) | [private] |
Parse the list of command-line arguments.
Definition at line 139 of file vidalia.cpp.
References _args, argNeedsValue(), and i().
Referenced by Vidalia().
bool Vidalia::argNeedsValue | ( | QString | argName | ) | [private] |
Returns true if the specified arguments wants a value.
Definition at line 128 of file vidalia.cpp.
References ARG_DATADIR, ARG_GUISTYLE, ARG_LANGUAGE, and ARG_PIDFILE.
Referenced by parseArguments().
QMap< QString, QString > Vidalia::_args [static, private] |
List of command-line arguments.
Definition at line 106 of file vidalia.h.
Referenced by arguments(), dataDirectory(), parseArguments(), pidFile(), validateArguments(), and Vidalia().
QString Vidalia::_style [static, private] |
The current GUI style.
Definition at line 107 of file vidalia.h.
Referenced by setStyle(), and style().
QString Vidalia::_language [static, private] |
The current language.
Definition at line 108 of file vidalia.h.
Referenced by language(), and setLanguage().
VidaliaSettings Vidalia::_settings [static, private] |
Vidalia's configurable settings.
Definition at line 109 of file vidalia.h.
Referenced by setLanguage(), setStyle(), and Vidalia().
TorControl * Vidalia::_torControl [static, private] |
Vidalia's main TorControl object.
Definition at line 111 of file vidalia.h.
Referenced by torControl(), Vidalia(), and ~Vidalia().
HelpBrowser * Vidalia::_help [static, private] |
Vidalia's configurable settings.
Definition at line 112 of file vidalia.h.
Referenced by help(), Vidalia(), and ~Vidalia().