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

#include <BandwidthGraph.h>

Inheritance diagram for BandwidthGraph:
VidaliaTab

Public Member Functions

 BandwidthGraph (QStatusBar *st=0, 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

virtual void retranslateUi ()
 
- Protected Member Functions inherited from VidaliaTab
virtual void changeEvent (QEvent *e)
 
virtual void closeEvent (QCloseEvent *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
 
QStatusBar * _statusBar
 
Ui::BandwidthGraph 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 31 of file BandwidthGraph.h.

Constructor & Destructor Documentation

◆ BandwidthGraph()

BandwidthGraph::BandwidthGraph ( QStatusBar *  st = 0,
QWidget *  parent = 0 
)

Member Function Documentation

◆ cancelChanges

void BandwidthGraph::cancelChanges ( )
privateslot

Called when the user cancels changes settings

Simply restores the previously saved settings.

Definition at line 203 of file BandwidthGraph.cpp.

References loadSettings(), and showSettingsFrame().

Referenced by createActions().

◆ createActions()

void BandwidthGraph::createActions ( )
private

Create and bind actions to events

Binds events to actions.

Definition at line 90 of file BandwidthGraph.cpp.

References cancelChanges(), connect(), reset(), saveChanges(), setOpacity(), showSettingsFrame(), and ui.

Referenced by BandwidthGraph().

◆ loadSettings()

void BandwidthGraph::loadSettings ( )
private

Loads the saved Bandwidth Graph settings

Loads the saved Bandwidth Graph settings.

Definition at line 118 of file BandwidthGraph.cpp.

References BWGRAPH_LINE_RECV, BWGRAPH_LINE_SEND, DEFAULT_ALWAYS_ON_TOP, DEFAULT_FILTER, DEFAULT_OPACITY, DEFAULT_STYLE, VidaliaTab::getSetting(), setOpacity(), SETTING_ALWAYS_ON_TOP, SETTING_FILTER, SETTING_OPACITY, SETTING_STYLE, and ui.

Referenced by BandwidthGraph(), and cancelChanges().

◆ reset

void BandwidthGraph::reset ( )
privateslot

Called when the reset button is pressed

Resets the log start time.

Definition at line 153 of file BandwidthGraph.cpp.

References VidaliaTab::_onTop, _statusBar, DATETIME_FMT, and ui.

Referenced by BandwidthGraph(), and createActions().

◆ retranslateUi()

void BandwidthGraph::retranslateUi ( )
protectedvirtual

Called when the user changes the UI translation.

Reimplemented from VidaliaTab.

Definition at line 82 of file BandwidthGraph.cpp.

References VidaliaTab::setTitle(), and ui.

◆ saveChanges

void BandwidthGraph::saveChanges ( )
privateslot

Called when the user saves settings

Saves the Bandwidth Graph settings and adjusts the graph if necessary.

Definition at line 166 of file BandwidthGraph.cpp.

References ADD_TO_FILTER, BWGRAPH_LINE_RECV, BWGRAPH_LINE_SEND, VidaliaTab::saveSetting(), setOpacity(), SETTING_ALWAYS_ON_TOP, SETTING_FILTER, SETTING_OPACITY, SETTING_STYLE, showSettingsFrame(), and ui.

Referenced by createActions().

◆ setOpacity

void BandwidthGraph::setOpacity ( int  value)
privateslot

Called when the settings button is toggled

Sets the opacity of the Bandwidth Graph window.

Definition at line 242 of file BandwidthGraph.cpp.

References ui.

Referenced by createActions(), loadSettings(), and saveChanges().

◆ showSettingsFrame

void BandwidthGraph::showSettingsFrame ( bool  show)
privateslot

Called when settings button is toggled

Toggles the Settings pane on and off, changes toggle button text.

Definition at line 214 of file BandwidthGraph.cpp.

References ui.

Referenced by BandwidthGraph(), cancelChanges(), createActions(), and saveChanges().

◆ updateGraph

void BandwidthGraph::updateGraph ( quint64  bytesRead,
quint64  bytesWritten 
)
privateslot

Adds new data to the graph

Adds new data to the graph.

Definition at line 110 of file BandwidthGraph.cpp.

References ui.

Referenced by BandwidthGraph().

Member Data Documentation

◆ _settings

VidaliaSettings* BandwidthGraph::_settings
private

A VidaliaSettings object that handles getting/saving settings

Definition at line 66 of file BandwidthGraph.h.

◆ _statusBar

QStatusBar* BandwidthGraph::_statusBar
private

Definition at line 68 of file BandwidthGraph.h.

Referenced by reset().

◆ _torControl

TorControl* BandwidthGraph::_torControl
private

A TorControl object used to talk to Tor.

Definition at line 64 of file BandwidthGraph.h.

◆ ui

Ui::BandwidthGraph BandwidthGraph::ui
private

Qt Designer generated object

Definition at line 71 of file BandwidthGraph.h.

Referenced by BandwidthGraph(), createActions(), loadSettings(), reset(), retranslateUi(), saveChanges(), setOpacity(), showSettingsFrame(), and updateGraph().


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