#include <bwgraph.h>
Public Slots | |
void | showWindow () |
Public Member Functions | |
BandwidthGraph (QWidget *parent=0, Qt::WFlags flags=0) | |
Protected Member Functions | |
void | customEvent (QEvent *event) |
Private Slots | |
void | updateGraph (quint64 bytesRead, quint64 bytesWritten) |
void | showSettingsFrame (bool show) |
void | setOpacity (int value) |
void | saveChanges () |
void | cancelChanges () |
void | reset () |
Private Member Functions | |
void | createActions () |
void | loadSettings () |
Private Attributes | |
TorControl * | _torControl |
VidaliaSettings * | _settings |
Ui::BandwidthGraph | ui |
Definition at line 33 of file bwgraph.h.
BandwidthGraph::BandwidthGraph | ( | QWidget * | parent = 0 , |
|
Qt::WFlags | flags = 0 | |||
) |
Default constructor
Definition at line 43 of file bwgraph.cpp.
References _torControl, TorEvents::Bandwidth, createActions(), loadSettings(), reset(), TorControl::setEvent(), VidaliaWindow::setShortcut(), showSettingsFrame(), Vidalia::torControl(), and ui.
void BandwidthGraph::showWindow | ( | ) | [virtual, slot] |
Overloaded QWidget.show
Overloads the default show() slot so we can set opacity.
Reimplemented from VidaliaWindow.
Definition at line 266 of file bwgraph.cpp.
References loadSettings(), and VidaliaWindow::showWindow().
void BandwidthGraph::customEvent | ( | QEvent * | event | ) | [protected] |
Called to deliver a bandwidth update event from Tor.
Custom event handler. Checks if the event is a bandwidth update event. If it is, it will add the data point to the history and updates the graph.
Definition at line 84 of file bwgraph.cpp.
References CustomEventType::BandwidthEvent, BandwidthEvent::bytesRead(), BandwidthEvent::bytesWritten(), and updateGraph().
void BandwidthGraph::updateGraph | ( | quint64 | bytesRead, | |
quint64 | bytesWritten | |||
) | [private, slot] |
Adds new data to the graph
Adds new data to the graph.
Definition at line 114 of file bwgraph.cpp.
References ui.
Referenced by customEvent().
void BandwidthGraph::showSettingsFrame | ( | bool | show | ) | [private, slot] |
Called when settings button is toggled
Toggles the Settings pane on and off, changes toggle button text.
Definition at line 217 of file bwgraph.cpp.
References ui.
Referenced by BandwidthGraph(), cancelChanges(), createActions(), and saveChanges().
void BandwidthGraph::setOpacity | ( | int | value | ) | [private, slot] |
Called when the settings button is toggled
Sets the opacity of the Bandwidth Graph window.
Definition at line 245 of file bwgraph.cpp.
References ui.
Referenced by createActions(), loadSettings(), and saveChanges().
void BandwidthGraph::saveChanges | ( | ) | [private, slot] |
Called when the user saves settings
Saves the Bandwidth Graph settings and adjusts the graph if necessary.
Definition at line 169 of file bwgraph.cpp.
References ADD_TO_FILTER, BWGRAPH_LINE_RECV, BWGRAPH_LINE_SEND, VidaliaWindow::saveSetting(), setOpacity(), SETTING_ALWAYS_ON_TOP, SETTING_FILTER, SETTING_OPACITY, SETTING_STYLE, showSettingsFrame(), and ui.
Referenced by createActions().
void BandwidthGraph::cancelChanges | ( | ) | [private, slot] |
Called when the user cancels changes settings
Simply restores the previously saved settings.
Definition at line 206 of file bwgraph.cpp.
References loadSettings(), and showSettingsFrame().
Referenced by createActions().
void BandwidthGraph::reset | ( | ) | [private, slot] |
Called when the reset button is pressed
Resets the log start time.
Definition at line 157 of file bwgraph.cpp.
References DATETIME_FMT, and ui.
Referenced by BandwidthGraph(), and createActions().
void BandwidthGraph::createActions | ( | ) | [private] |
Create and bind actions to events
Binds events to actions.
Definition at line 94 of file bwgraph.cpp.
References cancelChanges(), reset(), saveChanges(), setOpacity(), showSettingsFrame(), and ui.
Referenced by BandwidthGraph().
void BandwidthGraph::loadSettings | ( | ) | [private] |
Loads the saved Bandwidth Graph settings
Loads the saved Bandwidth Graph settings.
Definition at line 122 of file bwgraph.cpp.
References BWGRAPH_LINE_RECV, BWGRAPH_LINE_SEND, DEFAULT_ALWAYS_ON_TOP, DEFAULT_FILTER, DEFAULT_OPACITY, DEFAULT_STYLE, VidaliaWindow::getSetting(), setOpacity(), SETTING_ALWAYS_ON_TOP, SETTING_FILTER, SETTING_OPACITY, SETTING_STYLE, and ui.
Referenced by BandwidthGraph(), cancelChanges(), and showWindow().
TorControl* BandwidthGraph::_torControl [private] |
A TorControl object used to talk to Tor.
Definition at line 70 of file bwgraph.h.
Referenced by BandwidthGraph().
VidaliaSettings* BandwidthGraph::_settings [private] |
A VidaliaSettings object that handles getting/saving settings
Reimplemented from VidaliaWindow.
Ui::BandwidthGraph BandwidthGraph::ui [private] |
Qt Designer generated object
Definition at line 75 of file bwgraph.h.
Referenced by BandwidthGraph(), createActions(), loadSettings(), reset(), saveChanges(), setOpacity(), showSettingsFrame(), and updateGraph().