Vidalia 0.3.1
|
#include <CircuitListWidget.h>
Public Types | |
enum | Columns { ConnectionColumn = 0 , StatusColumn = 1 } |
Public Slots | |
void | clearCircuits () |
Signals | |
void | circuitSelected (Circuit circuit) |
void | circuitRemoved (CircuitId circid) |
void | closeCircuit (CircuitId circid) |
void | closeStream (StreamId streamid) |
void | zoomToCircuit (CircuitId circid) |
Public Member Functions | |
CircuitListWidget (QWidget *parent=0) | |
void | addCircuit (const Circuit &circuit) |
void | addStream (const Stream &stream) |
QList< Circuit > | circuits () |
void | retranslateUi () |
Private Slots | |
void | removeCircuit () |
void | removeStream () |
void | onSelectionChanged (QTreeWidgetItem *cur, QTreeWidgetItem *prev) |
void | customContextMenuRequested (const QPoint &pos) |
void | closeSelectedConnections () |
Private Member Functions | |
void | removeCircuit (CircuitItem *circuit) |
void | removeStream (StreamItem *stream) |
CircuitItem * | findCircuitItem (const CircuitId &circid) |
StreamItem * | findStreamItem (const StreamId &streamid) |
void | scheduleCircuitRemoval (CircuitItem *circuit, int delay) |
void | scheduleStreamRemoval (StreamItem *stream, int delay) |
Private Attributes | |
QList< CircuitItem * > | _circuitRemovalList |
QList< StreamItem * > | _streamRemovalList |
Definition at line 29 of file CircuitListWidget.h.
Circuit list columns.
Enumerator | |
---|---|
ConnectionColumn | Column for either the circuit or stream |
StatusColumn | Status of the connection. |
Definition at line 35 of file CircuitListWidget.h.
CircuitListWidget::CircuitListWidget | ( | QWidget * | parent = 0 | ) |
Default constructor
Default constructor.
Definition at line 33 of file CircuitListWidget.cpp.
References closeSelectedConnections(), connect(), customContextMenuRequested(), onSelectionChanged(), and vApp.
Adds a circuit to the list. If the circuit already exists in the list, the status and path will be updated.
Adds a circuit to the list. If the circuit already exists in the list, the status and path will be updated.
Definition at line 144 of file CircuitListWidget.cpp.
References Circuit::Closed, CLOSED_CIRCUIT_REMOVE_DELAY, Circuit::Failed, FAILED_CIRCUIT_REMOVE_DELAY, findCircuitItem(), Circuit::id(), scheduleCircuitRemoval(), Circuit::status(), and CircuitItem::update().
Adds a stream to the list. If the stream already exists in the list, the status and path will be updated.
Definition at line 170 of file CircuitListWidget.cpp.
References CircuitItem::addStream(), Stream::circuitId(), Stream::Closed, CLOSED_STREAM_REMOVE_DELAY, Stream::Failed, FAILED_STREAM_REMOVE_DELAY, findCircuitItem(), findStreamItem(), Stream::id(), scheduleStreamRemoval(), Stream::status(), and StreamItem::update().
Emitted when a circuit is removed from the list.
Referenced by removeCircuit().
CircuitList CircuitListWidget::circuits | ( | ) |
Returns a list of circuits currently in the widget.
Definition at line 351 of file CircuitListWidget.cpp.
References CircuitItem::circuit(), and i().
Emitted when a circuit item is selected.
Referenced by onSelectionChanged().
|
slot |
Clears all circuits and streams from the list.
Definition at line 281 of file CircuitListWidget.cpp.
References _circuitRemovalList, and _streamRemovalList.
Emitted when the user selects a circuit to be closed.
Referenced by closeSelectedConnections(), and customContextMenuRequested().
|
privateslot |
Closes all selected circuits or streams.
Definition at line 125 of file CircuitListWidget.cpp.
References closeCircuit(), closeStream(), CircuitItem::id(), and StreamItem::id().
Referenced by CircuitListWidget().
Emitted when the user selects a stream to be closed.
Referenced by closeSelectedConnections(), and customContextMenuRequested().
|
privateslot |
Called when the user requests a context menu on a circuit or stream in the list and displays a context menu appropriate for whichever type of item is currently selected.
Definition at line 70 of file CircuitListWidget.cpp.
References Circuit::Built, CircuitItem::circuit(), closeCircuit(), closeStream(), CircuitItem::id(), StreamItem::id(), IMG_CLOSE, IMG_ZOOM, Circuit::status(), and zoomToCircuit().
Referenced by CircuitListWidget().
|
private |
Finds the circuit with the given ID.
Finds the circuit with the given ID and returns a pointer to that circuit's item in the list.
Definition at line 291 of file CircuitListWidget.cpp.
References i(), and CircuitItem::id().
Referenced by addCircuit(), and addStream().
|
private |
Finds the stream with the given ID.
Finds the stream with the given ID and returns a pointer to that stream's item in the list.
Definition at line 306 of file CircuitListWidget.cpp.
References i(), and StreamItem::id().
Referenced by addStream().
|
privateslot |
Called when the current item selectio has changed.
Called when the current item selection has changed.
Definition at line 327 of file CircuitListWidget.cpp.
References CircuitItem::circuit(), and circuitSelected().
Referenced by CircuitListWidget().
|
privateslot |
Removes the first circuit scheduled to be removed.
Definition at line 218 of file CircuitListWidget.cpp.
References _circuitRemovalList, CircuitItem::circuit(), circuitRemoved(), Circuit::id(), and removeCircuit().
Referenced by removeCircuit(), and scheduleCircuitRemoval().
|
private |
Removes the given circuit item and all streams on that circuit.
Definition at line 230 of file CircuitListWidget.cpp.
References _streamRemovalList, CircuitItem::removeStream(), and CircuitItem::streams().
|
privateslot |
Removes the first stream scheduled to be removed.
Definition at line 254 of file CircuitListWidget.cpp.
References _streamRemovalList, and removeStream().
Referenced by removeStream(), and scheduleStreamRemoval().
|
private |
Removes the given stream item.
Definition at line 264 of file CircuitListWidget.cpp.
References CircuitItem::removeStream().
void CircuitListWidget::retranslateUi | ( | ) |
Called when the user changes the UI translation.
Definition at line 53 of file CircuitListWidget.cpp.
References CircuitItem::circuit(), i(), StreamItem::stream(), CircuitItem::streams(), CircuitItem::update(), and StreamItem::update().
|
private |
Schedules the given circuit item to be removed after the given timeout.
Schedules the given circuit to be removed after the specified timeout.
Definition at line 198 of file CircuitListWidget.cpp.
References _circuitRemovalList, and removeCircuit().
Referenced by addCircuit().
|
private |
Schedules a stream to be removed after the given timeout.
Schedules the given stream to be removed after the specified timeout.
Definition at line 208 of file CircuitListWidget.cpp.
References _streamRemovalList, and removeStream().
Referenced by addStream().
Emitted when the user selects a circuit to zoom to.
Referenced by customContextMenuRequested().
|
private |
List of circuit items to be removed.
Definition at line 99 of file CircuitListWidget.h.
Referenced by clearCircuits(), removeCircuit(), and scheduleCircuitRemoval().
|
private |
List of stream items to be removed.
Definition at line 101 of file CircuitListWidget.h.
Referenced by clearCircuits(), removeCircuit(), removeStream(), and scheduleStreamRemoval().