MainWindow Class Reference

#include <mainwindow.h>

List of all members.

Public Slots

void close ()

Public Member Functions

 MainWindow ()
 ~MainWindow ()

Private Slots

void start ()
void startFailed (QString errmsg)
void started ()
void stop ()
void stopped (int errorCode, QProcess::ExitStatus exitStatus)
void connected ()
void connectFailed (QString errmsg)
void disconnected ()
void showAbout ()
void showMessageLog ()
void showBandwidthGraph ()
void showConfig ()
void showHelp ()
void showNetwork ()
void newIdentity ()

Private Member Functions

void createActions ()
void createTrayMenu ()
void createMenuBar ()
bool initiateServerShutdown ()

Private Attributes

bool _isIntentionalExit
MessageLog_messageLog
BandwidthGraph_bandwidthGraph
HelpBrowser_helpBrowser
NetViewer_netViewer
TorControl_torControl
TrayIcon_trayIcon
QMenu * _trayMenu
QAction * _startAct
QAction * _stopAct
QAction * _configAct
QAction * _aboutAct
QAction * _exitAct
QAction * _bandwidthAct
QAction * _messageAct
QAction * _helpAct
QAction * _networkAct
QAction * _newIdentityAct


Detailed Description

Definition at line 44 of file mainwindow.h.


Constructor & Destructor Documentation

MainWindow::MainWindow (  ) 

Default constructor

Definition at line 75 of file mainwindow.cpp.

References _bandwidthGraph, _messageLog, _netViewer, _torControl, _trayIcon, _trayMenu, connected(), connectFailed(), createActions(), createMenuBar(), createTrayMenu(), disconnected(), IMG_APP_ICON, IMG_TOR_STOPPED, TorControl::isRunning(), VidaliaSettings::runTorAtStart(), TrayIcon::show(), start(), started(), startFailed(), stopped(), and Vidalia::torControl().

MainWindow::~MainWindow (  ) 

Destructor.

Definition at line 128 of file mainwindow.cpp.

References _messageLog, _netViewer, _trayIcon, and TrayIcon::hide().


Member Function Documentation

void MainWindow::close (  )  [slot]

Called when the user exits Vidalia.

Definition at line 140 of file mainwindow.cpp.

References _torControl, TorControl::disconnect(), TorControl::isConnected(), TorControl::isVidaliaRunningTor(), and TorControl::stop().

Referenced by createActions().

void MainWindow::start (  )  [private, slot]

Called when the user selects "Start" from the menu.

Definition at line 274 of file mainwindow.cpp.

References _isIntentionalExit, _startAct, _torControl, and TorControl::start().

Referenced by createActions(), and MainWindow().

void MainWindow::startFailed ( QString  errmsg  )  [private, slot]

Called when the Tor process fails to start.

Definition at line 290 of file mainwindow.cpp.

References _startAct, ConfigDialog::General, Vidalia::help(), VMessageBox::Help, VMessageBox::Ok, ConfigDialog::show(), VMessageBox::ShowSettings, and VMessageBox::warning().

Referenced by MainWindow().

void MainWindow::started (  )  [private, slot]

Called when the Tor process has successfully started.

Definition at line 319 of file mainwindow.cpp.

References _isIntentionalExit, _startAct, _stopAct, _torControl, _trayIcon, TorControl::connect(), IMG_TOR_STARTING, and TrayIcon::update().

Referenced by MainWindow().

void MainWindow::stop (  )  [private, slot]

Called when the user selects "Stop" form the menu.

Definition at line 402 of file mainwindow.cpp.

References _isIntentionalExit, _stopAct, _torControl, _trayIcon, Vidalia::help(), VMessageBox::Help, IMG_TOR_RUNNING, IMG_TOR_STOPPING, initiateServerShutdown(), ServerSettings::isServerEnabled(), VMessageBox::Ok, p(), TorControl::stop(), TrayIcon::update(), and VMessageBox::warning().

Referenced by createActions().

void MainWindow::stopped ( int  errorCode,
QProcess::ExitStatus  exitStatus 
) [private, slot]

Called when the Tor process has exited, either expectedly or not.

Definition at line 443 of file mainwindow.cpp.

References _isIntentionalExit, _startAct, _stopAct, _trayIcon, Vidalia::help(), VMessageBox::Help, IMG_TOR_STOPPED, VMessageBox::Ok, VMessageBox::ShowLog, showMessageLog(), TrayIcon::update(), and VMessageBox::warning().

Referenced by MainWindow().

void MainWindow::connected (  )  [private, slot]

Called when the control socket has connected to Tor.

Definition at line 475 of file mainwindow.cpp.

References _newIdentityAct, _torControl, _trayIcon, ServerSettings::apply(), ServerSettings::changedSinceLastApply(), IMG_TOR_RUNNING, VMessageBox::Ok, p(), ConfigDialog::Server, ConfigDialog::show(), VMessageBox::ShowLog, showMessageLog(), VMessageBox::ShowSettings, TrayIcon::update(), and VMessageBox::warning().

Referenced by MainWindow().

void MainWindow::connectFailed ( QString  errmsg  )  [private, slot]

Called when the control connection fails.

Definition at line 336 of file mainwindow.cpp.

References _torControl, TorControl::connect(), Vidalia::help(), VMessageBox::Help, VMessageBox::Ok, p(), VMessageBox::Retry, TorControl::stop(), and VMessageBox::warning().

Referenced by MainWindow().

void MainWindow::disconnected (  )  [private, slot]

Called when the control socket has been disconnected.

Definition at line 508 of file mainwindow.cpp.

References _newIdentityAct.

Referenced by MainWindow().

void MainWindow::showAbout (  )  [private, slot]

Called when the user selects "About" from the menu.

Definition at line 516 of file mainwindow.cpp.

References AboutDialog::show().

Referenced by createActions().

void MainWindow::showMessageLog (  )  [private, slot]

Called when the user selects "Message Log" from the menu.

Definition at line 525 of file mainwindow.cpp.

References _messageLog, and VidaliaWindow::show().

Referenced by connected(), createActions(), and stopped().

void MainWindow::showBandwidthGraph (  )  [private, slot]

Called when the user selects "Bandwidth Graph" from the menu.

Definition at line 533 of file mainwindow.cpp.

References _bandwidthGraph, and BandwidthGraph::show().

Referenced by createActions().

void MainWindow::showConfig (  )  [private, slot]

Called when the user selects "Configuration" from the menu.

Definition at line 541 of file mainwindow.cpp.

References ConfigDialog::show().

Referenced by createActions().

void MainWindow::showHelp (  )  [private, slot]

Called when the user selects "Help" from the menu.

Definition at line 550 of file mainwindow.cpp.

References Vidalia::help().

Referenced by createActions().

void MainWindow::showNetwork (  )  [private, slot]

Called when the user selects "View Network" from the menu

Definition at line 558 of file mainwindow.cpp.

References _netViewer, and VidaliaWindow::show().

Referenced by createActions().

void MainWindow::newIdentity (  )  [private, slot]

Called when the user selects the "New Identity" action from the menu.

Definition at line 565 of file mainwindow.cpp.

References _torControl, VMessageBox::information(), TorSignal::NewNym, VMessageBox::Ok, TorControl::signal(), and VMessageBox::warning().

Referenced by createActions().

void MainWindow::createActions (  )  [private]

Create the actions on the tray menu or menubar

Definition at line 162 of file mainwindow.cpp.

References _aboutAct, _bandwidthAct, _configAct, _exitAct, _helpAct, _messageAct, _networkAct, _newIdentityAct, _startAct, _stopAct, close(), IMG_ABOUT, IMG_BWGRAPH, IMG_CONFIG, IMG_EXIT, IMG_HELP, IMG_IDENTITY, IMG_MESSAGELOG, IMG_NETWORK, IMG_START, IMG_STOP, newIdentity(), showAbout(), showBandwidthGraph(), showConfig(), showHelp(), showMessageLog(), showNetwork(), start(), and stop().

Referenced by MainWindow().

void MainWindow::createTrayMenu (  )  [private]

Create the tray popup menu and it's submenus

Definition at line 203 of file mainwindow.cpp.

References _aboutAct, _bandwidthAct, _configAct, _exitAct, _helpAct, _messageAct, _networkAct, _newIdentityAct, _startAct, _stopAct, and _trayMenu.

Referenced by MainWindow().

void MainWindow::createMenuBar (  )  [private]

Creates a default menubar on Mac

Definition at line 226 of file mainwindow.cpp.

References _aboutAct, _bandwidthAct, _configAct, _exitAct, _helpAct, _messageAct, _networkAct, _newIdentityAct, _startAct, and _stopAct.

Referenced by MainWindow().

bool MainWindow::initiateServerShutdown (  )  [private]

Starts a graceful server shutdown

Definition at line 363 of file mainwindow.cpp.

References _torControl, _trayIcon, IMG_TOR_RUNNING, VMessageBox::No, p(), VMessageBox::question(), TorSignal::Shutdown, TorControl::signal(), TrayIcon::update(), VMessageBox::warning(), and VMessageBox::Yes.

Referenced by stop().


Member Data Documentation

bool MainWindow::_isIntentionalExit [private]

Definition at line 101 of file mainwindow.h.

Referenced by start(), started(), stop(), and stopped().

MessageLog* MainWindow::_messageLog [private]

A MessageLog object which handles logging Tor messages

Definition at line 103 of file mainwindow.h.

Referenced by MainWindow(), showMessageLog(), and ~MainWindow().

BandwidthGraph* MainWindow::_bandwidthGraph [private]

A BandwidthGraph object which handles monitoring Tor bandwidth usage

Definition at line 105 of file mainwindow.h.

Referenced by MainWindow(), and showBandwidthGraph().

HelpBrowser* MainWindow::_helpBrowser [private]

A HelpBrowser object which handles displaying help files

Definition at line 107 of file mainwindow.h.

NetViewer* MainWindow::_netViewer [private]

A NetViewer object which displays the Tor network graphically

Definition at line 109 of file mainwindow.h.

Referenced by MainWindow(), showNetwork(), and ~MainWindow().

TorControl* MainWindow::_torControl [private]

A TorControl object that handles communication with Tor

Definition at line 111 of file mainwindow.h.

Referenced by close(), connected(), connectFailed(), initiateServerShutdown(), MainWindow(), newIdentity(), start(), started(), and stop().

TrayIcon* MainWindow::_trayIcon [private]

Instance of a tray icon that will appear in the system tray

Definition at line 113 of file mainwindow.h.

Referenced by connected(), initiateServerShutdown(), MainWindow(), started(), stop(), stopped(), and ~MainWindow().

QMenu* MainWindow::_trayMenu [private]

Define the popup menus for the system tray icon

Definition at line 116 of file mainwindow.h.

Referenced by createTrayMenu(), and MainWindow().

QAction* MainWindow::_startAct [private]

Defines the actions for the tray menu

Definition at line 118 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), createTrayMenu(), start(), started(), startFailed(), and stopped().

QAction* MainWindow::_stopAct [private]

Definition at line 119 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), createTrayMenu(), started(), stop(), and stopped().

QAction* MainWindow::_configAct [private]

Definition at line 120 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), and createTrayMenu().

QAction* MainWindow::_aboutAct [private]

Definition at line 121 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), and createTrayMenu().

QAction* MainWindow::_exitAct [private]

Definition at line 122 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), and createTrayMenu().

QAction* MainWindow::_bandwidthAct [private]

Definition at line 123 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), and createTrayMenu().

QAction* MainWindow::_messageAct [private]

Definition at line 124 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), and createTrayMenu().

QAction* MainWindow::_helpAct [private]

Definition at line 125 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), and createTrayMenu().

QAction* MainWindow::_networkAct [private]

Definition at line 126 of file mainwindow.h.

Referenced by createActions(), createMenuBar(), and createTrayMenu().

QAction* MainWindow::_newIdentityAct [private]

Definition at line 127 of file mainwindow.h.

Referenced by connected(), createActions(), createMenuBar(), createTrayMenu(), and disconnected().


The documentation for this class was generated from the following files:
Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0