#include <vidalia.h>
Signals | |
void | running () |
void | shutdown () |
Public Member Functions | |
Vidalia (QStringList args, int &argc, char **argv) | |
~Vidalia () | |
Static Public Member Functions | |
static QMap< QString, QString > | arguments () |
static bool | validateArguments (QString &errmsg) |
static void | showUsageMessageBox () |
static bool | showUsage () |
static bool | setLanguage (QString languageCode=QString()) |
static bool | setStyle (QString styleKey=QString()) |
static QString | language () |
static QString | style () |
static QString | version () |
static TorControl * | torControl () |
static QString | dataDirectory () |
static QString | defaultDataDirectory () |
static QString | pidFile () |
static Log::LogMessage | log (Log::LogLevel level, QString msg) |
static int | run () |
static void | createShortcut (const QKeySequence &key, QWidget *sender, QObject *receiver, const char *slot) |
static void | createShortcut (const QString &key, QWidget *sender, QObject *receiver, const char *slot) |
Private Slots | |
void | onEventLoopStarted () |
Private Member Functions | |
void | parseArguments (QStringList args) |
bool | argNeedsValue (QString argName) |
Static Private Member Functions | |
static void | qt_msg_handler (QtMsgType type, const char *msg) |
Static Private Attributes | |
static QMap< QString, QString > | _args |
static QString | _style |
static QString | _language |
static TorControl * | _torControl = 0 |
static Log | _log |
Definition at line 46 of file vidalia.h.
Vidalia::Vidalia | ( | QStringList | args, | |
int & | argc, | |||
char ** | argv | |||
) |
Constructor.
Definition at line 78 of file vidalia.cpp.
References _args, _log, _torControl, ARG_GUISTYLE, ARG_LANGUAGE, ARG_LOGFILE, ARG_LOGLEVEL, ARG_RESET, Log::Off, Log::open(), parseArguments(), qt_msg_handler(), VSettings::reset(), setLanguage(), Log::setLogLevel(), setStyle(), and Log::stringToLogLevel().
Vidalia::~Vidalia | ( | ) |
bool Vidalia::argNeedsValue | ( | QString | argName | ) | [private] |
Returns true if the specified arguments wants a value.
Definition at line 192 of file vidalia.cpp.
References ARG_DATADIR, ARG_GUISTYLE, ARG_LANGUAGE, ARG_LOGFILE, ARG_LOGLEVEL, and ARG_PIDFILE.
Referenced by parseArguments().
static QMap<QString, QString> Vidalia::arguments | ( | ) | [inline, static] |
void Vidalia::createShortcut | ( | const QString & | key, | |
QWidget * | sender, | |||
QObject * | receiver, | |||
const char * | slot | |||
) | [static] |
Creates and binds a shortcut such that when key is pressed in sender's context, receiver's slot will be called.
Definition at line 352 of file vidalia.cpp.
References createShortcut().
void Vidalia::createShortcut | ( | const QKeySequence & | key, | |
QWidget * | sender, | |||
QObject * | receiver, | |||
const char * | slot | |||
) | [static] |
Creates and binds a shortcut such that when key is pressed in sender's context, receiver's slot will be called.
Definition at line 342 of file vidalia.cpp.
Referenced by ConfigDialog::ConfigDialog(), MessageLog::createActions(), createShortcut(), HelpBrowser::HelpBrowser(), MainWindow::MainWindow(), and NetViewer::NetViewer().
QString Vidalia::dataDirectory | ( | ) | [static] |
Returns the location Vidalia uses for its data files.
Definition at line 303 of file vidalia.cpp.
References _args, ARG_DATADIR, and defaultDataDirectory().
Referenced by pidFile(), GeoIpCache::saveToDisk(), and TorSettings::TorSettings().
QString Vidalia::defaultDataDirectory | ( | ) | [static] |
Returns the default location of Vidalia's data directory.
Definition at line 313 of file vidalia.cpp.
References win32_app_data_folder().
Referenced by dataDirectory().
static QString Vidalia::language | ( | ) | [inline, static] |
Returns the current language.
Definition at line 71 of file vidalia.h.
References _language.
Referenced by HelpBrowser::language(), and HelpTextBrowser::loadResource().
Log::LogMessage Vidalia::log | ( | Log::LogLevel | level, | |
QString | msg | |||
) | [static] |
Writes msg with severity level to Vidalia's log.
Definition at line 334 of file vidalia.cpp.
References _log, and Log::log().
void Vidalia::onEventLoopStarted | ( | ) | [private, slot] |
Called when the application's main event loop has started. This method will emit the running() signal to indicate that the application's event loop is running.
Definition at line 131 of file vidalia.cpp.
References running().
Referenced by run().
void Vidalia::parseArguments | ( | QStringList | args | ) | [private] |
Parse the list of command-line arguments.
Definition at line 205 of file vidalia.cpp.
References _args, argNeedsValue(), and i().
Referenced by Vidalia().
QString Vidalia::pidFile | ( | ) | [static] |
Returns the location of Vidalia's pid file.
Definition at line 324 of file vidalia.cpp.
References _args, ARG_PIDFILE, and dataDirectory().
Referenced by main().
void Vidalia::qt_msg_handler | ( | QtMsgType | type, | |
const char * | msg | |||
) | [static, private] |
int Vidalia::run | ( | ) | [static] |
Enters the main event loop and waits until exit() is called. The signal running() will be emitted when the event loop has started.
Definition at line 121 of file vidalia.cpp.
References onEventLoopStarted(), and vApp.
Referenced by main().
void Vidalia::running | ( | ) | [signal] |
Emitted when the application is running and the main event loop has started.
Referenced by onEventLoopStarted().
bool Vidalia::setLanguage | ( | QString | languageCode = QString() |
) | [static] |
Sets the current language.
Definition at line 266 of file vidalia.cpp.
References _language, and LanguageSupport::translate().
Referenced by Vidalia().
bool Vidalia::setStyle | ( | QString | styleKey = QString() |
) | [static] |
Sets the current GUI style.
Definition at line 286 of file vidalia.cpp.
References _style.
Referenced by AppearancePage::save(), and Vidalia().
bool Vidalia::showUsage | ( | ) | [static] |
Returns true if the user wants to see usage information.
Definition at line 151 of file vidalia.cpp.
References _args, and ARG_HELP.
Referenced by main().
void Vidalia::showUsageMessageBox | ( | ) | [static] |
Displays usage information for command-line args.
Definition at line 158 of file vidalia.cpp.
References ARG_DATADIR, ARG_GUISTYLE, ARG_HELP, ARG_LANGUAGE, ARG_LOGFILE, ARG_LOGLEVEL, ARG_PIDFILE, ARG_RESET, VMessageBox::information(), LanguageSupport::languageCodes(), Log::logLevels(), VMessageBox::Ok, tcol(), and trow().
Referenced by main().
void Vidalia::shutdown | ( | ) | [signal] |
Signals that the application needs to shutdown now.
static QString Vidalia::style | ( | ) | [inline, static] |
Returns the current GUI style.
Definition at line 73 of file vidalia.h.
References _style.
Referenced by AppearancePage::load().
static TorControl* Vidalia::torControl | ( | ) | [inline, static] |
Returns Vidalia's main TorControl object.
Definition at line 78 of file vidalia.h.
References _torControl.
Referenced by AboutDialog::AboutDialog(), AdvancedPage::AdvancedPage(), NetworkPage::apply(), BandwidthGraph::BandwidthGraph(), NetworkPage::changedSinceLastApply(), ConfigDialog::ConfigDialog(), ServicePage::load(), NetworkPage::load(), ServerPage::loadBridgeIdentity(), MainWindow::MainWindow(), MessageLog::MessageLog(), NetViewer::NetViewer(), NetworkPage::NetworkPage(), ServerPage::onAuthenticated(), NetworkPage::onAuthenticated(), NetworkPage::revert(), ServicePage::save(), NetworkPage::save(), AdvancedPage::save(), ConfigDialog::saveChanges(), ConfigDialog::saveConf(), ServerPage::ServerPage(), and ServicePage::startServicesInTor().
bool Vidalia::validateArguments | ( | QString & | errmsg | ) | [static] |
Validates that all arguments were well-formed.
Definition at line 230 of file vidalia.cpp.
References _args, _log, ARG_GUISTYLE, ARG_LANGUAGE, ARG_LOGFILE, ARG_LOGLEVEL, Log::errorString(), Log::isOpen(), LanguageSupport::isValidLanguageCode(), and Log::logLevels().
Referenced by main().
static QString Vidalia::version | ( | ) | [inline, static] |
Returns Vidalia's application version.
Definition at line 75 of file vidalia.h.
Referenced by AboutDialog::AboutDialog(), and main().
QMap< QString, QString > Vidalia::_args [static, private] |
List of command-line arguments.
Definition at line 134 of file vidalia.h.
Referenced by arguments(), dataDirectory(), parseArguments(), pidFile(), showUsage(), validateArguments(), and Vidalia().
QString Vidalia::_language [static, private] |
The current language.
Definition at line 136 of file vidalia.h.
Referenced by language(), and setLanguage().
Log Vidalia::_log [static, private] |
Logs debugging messages to file or stdout.
Definition at line 138 of file vidalia.h.
Referenced by log(), validateArguments(), and Vidalia().
QString Vidalia::_style [static, private] |
The current GUI style.
Definition at line 135 of file vidalia.h.
Referenced by setStyle(), and style().
TorControl * Vidalia::_torControl = 0 [static, private] |
Vidalia's main TorControl object.
Definition at line 137 of file vidalia.h.
Referenced by torControl(), Vidalia(), and ~Vidalia().