Vidalia  0.3.1
Public Slots | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
NetViewer Class Reference

#include <NetViewer.h>

Inheritance diagram for NetViewer:
VidaliaTab

Public Slots

void loadConnections ()
 
void addCircuit (const Circuit &circuit)
 
void addStream (const Stream &stream)
 
void newDescriptors (const QStringList &ids)
 
void addressMapped (const QString &from, const QString &to, const QDateTime &expires)
 
void clear ()
 

Public Member Functions

 NetViewer (QWidget *parent=0)
 
- Public Member Functions inherited from VidaliaTab
 VidaliaTab (const QString &title, const QString &name="", QWidget *parent=0)
 
 ~VidaliaTab ()
 
QString getTitle () const
 
void setTitle (const QString &title)
 
void setShortcut (const QString &shortcut, const char *slot)
 
QVariant getSetting (QString name, QVariant defaultValue)
 
void saveSetting (QString name, QVariant value)
 
void setOnTop (bool top)
 

Protected Member Functions

void retranslateUi ()
 
- Protected Member Functions inherited from VidaliaTab
virtual void changeEvent (QEvent *e)
 
virtual void closeEvent (QCloseEvent *event)
 

Private Slots

void help ()
 
void refresh ()
 
void circuitSelected (const Circuit &circuit)
 
void routerSelected (const QList< RouterDescriptor > &routers)
 
void onAuthenticated ()
 
void onDisconnected ()
 
void displayRouterInfo (const QString &id)
 
void zoomIn ()
 
void zoomOut ()
 
void toggleFullScreen ()
 
void onRouterSearch ()
 

Private Member Functions

void setupGeoIpResolver ()
 
void loadNetworkStatus ()
 
void loadAddressMap ()
 
void addRouter (const RouterDescriptor &rd)
 

Private Attributes

TorControl_torControl
 
QTimer _refreshTimer
 
GeoIpResolver _geoip
 
AddressMap _addressMap
 
TorMapImageView_map
 
Ui::NetViewer ui
 

Additional Inherited Members

- Signals inherited from VidaliaTab
void helpRequested (const QString &topic)
 
void closeTab ()
 
- Protected Attributes inherited from VidaliaTab
bool _onTop
 

Detailed Description

Definition at line 41 of file NetViewer.h.

Constructor & Destructor Documentation

NetViewer::NetViewer ( QWidget *  parent = 0)

Member Function Documentation

void NetViewer::addCircuit ( const Circuit circuit)
slot

Adds circuit to the list and the map

Adds circuit to the map and the list

Definition at line 291 of file NetViewer.cpp.

References _map, TorMapImageView::addCircuit(), Circuit::id(), Circuit::routerIDs(), and ui.

Referenced by loadConnections(), and NetViewer().

void NetViewer::addressMapped ( const QString &  from,
const QString &  to,
const QDateTime &  expires 
)
slot

Called when Tor has mapped the address from to the address to. expires indicates the time at which when the address mapping will no longer be considered valid.

Definition at line 320 of file NetViewer.cpp.

References _addressMap, and AddressMap::add().

Referenced by NetViewer().

void NetViewer::addRouter ( const RouterDescriptor rd)
private

Adds a router to our list of servers and retrieves geographic location information for the server.

Definition at line 354 of file NetViewer.cpp.

References _geoip, _map, TorMapImageView::addRouter(), GeoIpRecord::ip(), RouterDescriptor::ip(), GeoIpRecord::isValid(), RouterListItem::location(), GeoIpResolver::resolve(), RouterListItem::setLocation(), and ui.

Referenced by loadNetworkStatus(), and newDescriptors().

void NetViewer::addStream ( const Stream stream)
slot

Adds stream to the list of circuits, under the appropriate circuit.

Adds stream to its associated circuit on the list of all circuits.

Definition at line 301 of file NetViewer.cpp.

References _addressMap, Stream::circuitId(), Stream::id(), AddressMap::isMapped(), AddressMap::mappedTo(), Stream::New, Stream::status(), Stream::targetAddress(), Stream::targetPort(), and ui.

Referenced by loadConnections(), and NetViewer().

void NetViewer::circuitSelected ( const Circuit circuit)
privateslot

Called when the user selects a circuit on the circuit list

Called when the user selects a circuit from the circuit and streams list.

Definition at line 389 of file NetViewer.cpp.

References _map, RouterListItem::descriptor(), TorMapImageView::deselectAll(), Circuit::id(), Circuit::routerIDs(), TorMapImageView::selectCircuit(), and ui.

Referenced by NetViewer().

void NetViewer::clear ( )
slot

Clears all known information

Clears the lists and the map

Definition at line 240 of file NetViewer.cpp.

References _addressMap, _map, TorMapImageView::clear(), and ui.

Referenced by onDisconnected(), and refresh().

void NetViewer::displayRouterInfo ( const QString &  id)
privateslot

Called when the user selects a router on the network map. Displays a dialog with detailed information for the router specified by id.

Definition at line 431 of file NetViewer.cpp.

References _map, _torControl, TorControl::getRouterDescriptorText(), TorControl::getRouterStatus(), RouterListItem::location(), VMessageBox::Ok, GeoIpRecord::toString(), ui, and VMessageBox::warning().

Referenced by NetViewer().

void NetViewer::help ( )
privateslot

Called when the user selects the "Help" action on the toolbar.

Called when the user selects the "Help" action from the toolbar.

Definition at line 328 of file NetViewer.cpp.

References VidaliaTab::helpRequested().

Referenced by NetViewer().

void NetViewer::loadAddressMap ( )
private

Loads a list of address mappings from Tor.

Loads a list of all current address mappings.

Definition at line 263 of file NetViewer.cpp.

References _addressMap, _torControl, TorControl::getAddressMap(), and AddressMap::reverse().

Referenced by refresh().

void NetViewer::loadConnections ( )
slot

Displays the network map window. Loads a list of current circuits and streams.

Loads a list of all current circuits and streams.

Definition at line 272 of file NetViewer.cpp.

References _map, _torControl, addCircuit(), addStream(), TorControl::getCircuits(), and TorControl::getStreams().

Referenced by refresh().

void NetViewer::loadNetworkStatus ( )
private

Retrieves a list of all running routers from Tor and their descriptors, and adds them to the RouterListWidget.

Definition at line 336 of file NetViewer.cpp.

References _torControl, addRouter(), TorControl::getNetworkStatus(), TorControl::getRouterDescriptor(), RouterStatus::id(), RouterDescriptor::isEmpty(), and RouterStatus::isRunning().

Referenced by refresh().

void NetViewer::newDescriptors ( const QStringList &  ids)
slot

Called when a NEWDESC event arrives. Retrieves new router descriptors for the router identities given in ids and updates the router list and network map.

Definition at line 377 of file NetViewer.cpp.

References _torControl, addRouter(), TorControl::getRouterDescriptor(), and RouterDescriptor::isEmpty().

Referenced by NetViewer().

void NetViewer::onAuthenticated ( )
privateslot

Handles when we get connected to Tor network

Loads data into map, lists and starts timer when we get connected

Definition at line 201 of file NetViewer.cpp.

References _refreshTimer, refresh(), and ui.

Referenced by NetViewer().

void NetViewer::onDisconnected ( )
privateslot

Handles when we get disconnected from Tor network

Clears map, lists and stops timer when we get disconnected

Definition at line 210 of file NetViewer.cpp.

References _refreshTimer, clear(), and ui.

Referenced by NetViewer().

void NetViewer::onRouterSearch ( )
privateslot

Called when the search of a router is triggered by the signal returnPressed from the search field.

Definition at line 256 of file NetViewer.cpp.

References ui.

Referenced by NetViewer().

void NetViewer::refresh ( )
privateslot

Called when the user selects the "Refresh" action on the toolbar

Reloads the lists of routers, circuits that Tor knows about

Definition at line 219 of file NetViewer.cpp.

References clear(), loadAddressMap(), loadConnections(), loadNetworkStatus(), and ui.

Referenced by NetViewer(), and onAuthenticated().

void NetViewer::retranslateUi ( )
protectedvirtual

Called when the user changes the UI translation.

Reimplemented from VidaliaTab.

Definition at line 152 of file NetViewer.cpp.

References RouterListItem::descriptor(), Circuit::routerIDs(), VidaliaTab::setTitle(), and ui.

void NetViewer::routerSelected ( const QList< RouterDescriptor > &  routers)
privateslot

Called when the user selects one or more routers in the list.

Called when the user selects one or more routers from the router list.

Definition at line 413 of file NetViewer.cpp.

References _map, TorMapImageView::deselectAll(), TorMapImageView::selectRouter(), and ui.

Referenced by NetViewer().

void NetViewer::setupGeoIpResolver ( )
private
void NetViewer::toggleFullScreen ( )
privateslot

Called when the user clicks "Full Screen" or presses Escape on the map. Toggles the map between normal and a full screen viewing modes.

Definition at line 492 of file NetViewer.cpp.

References _map, and ui.

Referenced by NetViewer().

void NetViewer::zoomIn ( )
privateslot

Called when the user clicks the "Zoom In" button.

Definition at line 469 of file NetViewer.cpp.

References _map, and ZImageView::zoomIn().

Referenced by NetViewer().

void NetViewer::zoomOut ( )
privateslot

Called when the user clicks the "Zoom Out" button.

Definition at line 480 of file NetViewer.cpp.

References _map, and ZImageView::zoomOut().

Referenced by NetViewer().

Member Data Documentation

AddressMap NetViewer::_addressMap
private

Stores a list of address mappings from Tor.

Definition at line 127 of file NetViewer.h.

Referenced by addressMapped(), addStream(), clear(), and loadAddressMap().

GeoIpResolver NetViewer::_geoip
private

GeoIpResolver used to geolocate routers by IP address.

Definition at line 125 of file NetViewer.h.

Referenced by addRouter(), and setupGeoIpResolver().

TorMapImageView* NetViewer::_map
private

Widget that displays the Tor network map.

Definition at line 133 of file NetViewer.h.

Referenced by addCircuit(), addRouter(), circuitSelected(), clear(), displayRouterInfo(), loadConnections(), NetViewer(), routerSelected(), toggleFullScreen(), zoomIn(), and zoomOut().

QTimer NetViewer::_refreshTimer
private

Timer that fires once an hour to update the router list.

Definition at line 123 of file NetViewer.h.

Referenced by NetViewer(), onAuthenticated(), and onDisconnected().

TorControl* NetViewer::_torControl
private

TorControl object used to talk to Tor.

Definition at line 121 of file NetViewer.h.

Referenced by displayRouterInfo(), loadAddressMap(), loadConnections(), loadNetworkStatus(), NetViewer(), and newDescriptors().

Ui::NetViewer NetViewer::ui
private

The documentation for this class was generated from the following files: