Vidalia Class Reference

#include <vidalia.h>

List of all members.

Public Slots

static void help (QString topic=QString())

Signals

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 TorControltorControl ()
static QString dataDirectory ()
static QString defaultDataDirectory ()
static QString pidFile ()
static Log::LogMessage log (Log::LogLevel level, QString msg)

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 HelpBrowser_help = 0
static Log _log


Detailed Description

Definition at line 58 of file vidalia.h.


Constructor & Destructor Documentation

Vidalia::Vidalia ( QStringList  args,
int &  argc,
char **  argv 
)

Constructor.

Constructor. Parses the command-line arguments, resets Vidalia's configuration (if requested), and sets up the GUI style and language translation.

Definition at line 88 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(), VidaliaSettings::reset(), setLanguage(), Log::setLogLevel(), setStyle(), and Log::stringToLogLevel().

Vidalia::~Vidalia (  ) 

Destructor.

Destructor

Definition at line 123 of file vidalia.cpp.

References _help, and _torControl.


Member Function Documentation

static QMap<QString, QString> Vidalia::arguments (  )  [inline, static]

Return the map of command-line arguments and values.

Definition at line 69 of file vidalia.h.

References _args.

bool Vidalia::validateArguments ( QString &  errmsg  )  [static]

Validates that all arguments were well-formed.

Verifies that all specified arguments were valid.

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

void Vidalia::showUsageMessageBox (  )  [static]

Displays usage information for command-line args.

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

bool Vidalia::showUsage (  )  [static]

Returns true if the user wants to see usage information.

Definition at line 145 of file vidalia.cpp.

References _args, and ARG_HELP.

Referenced by main().

bool Vidalia::setLanguage ( QString  languageCode = QString()  )  [static]

Sets the current language.

Sets the translation Vidalia will use. If one was specified on the command-line, we will use that. Otherwise, we'll check to see if one was saved previously. If not, we'll default to one appropriate for the system locale.

Definition at line 260 of file vidalia.cpp.

References _language, VidaliaSettings::getLanguageCode(), and LanguageSupport::translate().

Referenced by Vidalia().

bool Vidalia::setStyle ( QString  styleKey = QString()  )  [static]

Sets the current GUI style.

Sets the GUI style Vidalia will use. If one was specified on the command-line, we will use that. Otherwise, we'll check to see if one was saved previously. If not, we'll default to one appropriate for the operating system.

Definition at line 280 of file vidalia.cpp.

References _style, and VidaliaSettings::getInterfaceStyle().

Referenced by AppearancePage::save(), and Vidalia().

static QString Vidalia::language (  )  [inline, static]

Returns the current language.

Definition at line 83 of file vidalia.h.

References _language.

Referenced by HelpBrowser::language(), and HelpTextBrowser::loadResource().

static QString Vidalia::style (  )  [inline, static]

Returns the current GUI style.

Definition at line 85 of file vidalia.h.

References _style.

Referenced by AppearancePage::load().

static QString Vidalia::version (  )  [inline, static]

Returns Vidalia's application version.

Definition at line 87 of file vidalia.h.

References VIDALIA_VERSION.

Referenced by AboutDialog::AboutDialog(), and main().

static TorControl* Vidalia::torControl (  )  [inline, static]

Returns Vidalia's main TorControl object.

Definition at line 90 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.

Returns the directory Vidalia uses for its data files.

Definition at line 307 of file vidalia.cpp.

References _args, ARG_DATADIR, and defaultDataDirectory().

Referenced by GeoIpCache::saveToDisk().

QString Vidalia::defaultDataDirectory (  )  [static]

Returns the default location of Vidalia's data directory.

Definition at line 317 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 328 of file vidalia.cpp.

References _args, and ARG_PIDFILE.

Referenced by main().

Log::LogMessage Vidalia::log ( Log::LogLevel  level,
QString  msg 
) [static]

Writes msg with severity level to Vidalia's log.

Definition at line 337 of file vidalia.cpp.

References _log, and Log::log().

void Vidalia::help ( QString  topic = QString()  )  [static, slot]

Shows the specified help topic, or the default if empty.

Displays the help page associated with the specified topic. If no topic is specified, then the default help page will be displayed.

Definition at line 298 of file vidalia.cpp.

References _help, and HelpBrowser::showWindow().

Referenced by ServerPage::bandwidthHelp(), MainWindow::connectFailed(), ServerPage::exitPolicyHelp(), NetViewer::help(), MessageLog::help(), ConfigDialog::help(), MainWindow::startFailed(), MainWindow::stop(), and MainWindow::stopped().

void Vidalia::shutdown (  )  [signal]

Signals that the application needs to shutdown now.

void Vidalia::qt_msg_handler ( QtMsgType  type,
const char *  s 
) [static, private]

Catches debugging messages from Qt and sends them to Vidalia's logs.

Catches debugging messages from Qt and sends them to Vidalia's logs. If Qt emits a QtFatalMsg, we will write the message to the log and then abort().

Definition at line 62 of file vidalia.cpp.

References vDebug, vError, vNotice, and vWarn.

Referenced by Vidalia().

void Vidalia::parseArguments ( QStringList  args  )  [private]

Parse the list of command-line arguments.

Parses the list of command-line arguments for their argument names and values.

Definition at line 199 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.

Returns true if the specified argument expects a value.

Definition at line 186 of file vidalia.cpp.

References ARG_DATADIR, ARG_GUISTYLE, ARG_LANGUAGE, ARG_LOGFILE, ARG_LOGLEVEL, and ARG_PIDFILE.

Referenced by parseArguments().


Member Data Documentation

QMap< QString, QString > Vidalia::_args [static, private]

List of command-line arguments.

Definition at line 127 of file vidalia.h.

Referenced by arguments(), dataDirectory(), parseArguments(), pidFile(), showUsage(), validateArguments(), and Vidalia().

QString Vidalia::_style [static, private]

The current GUI style.

Definition at line 128 of file vidalia.h.

Referenced by setStyle(), and style().

QString Vidalia::_language [static, private]

The current language.

Definition at line 129 of file vidalia.h.

Referenced by language(), and setLanguage().

TorControl * Vidalia::_torControl = 0 [static, private]

Vidalia's main TorControl object.

Main TorControl object.

Definition at line 131 of file vidalia.h.

Referenced by torControl(), Vidalia(), and ~Vidalia().

HelpBrowser * Vidalia::_help = 0 [static, private]

Vidalia's configurable settings.

Vidalia's help system.

Definition at line 132 of file vidalia.h.

Referenced by help(), and ~Vidalia().

Log Vidalia::_log [static, private]

Logs debugging messages to file or stdout.

Definition at line 134 of file vidalia.h.

Referenced by log(), validateArguments(), and Vidalia().


The documentation for this class was generated from the following files:
Generated on Wed Sep 5 15:49:29 2007 for Vidalia by  doxygen 1.5.3