Vidalia
0.3.1
Main Page
Namespaces
Classes
Files
File List
File Members
src
vidalia
bwgraph
BandwidthGraph.h
Go to the documentation of this file.
1
/*
2
** This file is part of Vidalia, and is subject to the license terms in the
3
** LICENSE file, found in the top level directory of this distribution. If you
4
** did not receive the LICENSE file with this file, you may obtain it from the
5
** Vidalia source package distributed by the Vidalia Project at
6
** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7
** including this file, may be copied, modified, propagated, or distributed
8
** except according to the terms described in the LICENSE file.
9
*/
10
11
/*
12
** \file BandwidthGraph.h
13
** \brief Displays a graph of Tor's bandwidth usage
14
*/
15
16
#ifndef _BWGRAPH_H
17
#define _BWGRAPH_H
18
19
#include "ui_BandwidthGraph.h"
20
#include "
VidaliaTab.h
"
21
#include "
VidaliaSettings.h
"
22
#include "
TorControl.h
"
23
24
#include <QDateTime>
25
#include <QEvent>
26
27
/** Redraw graph every 1000ms **/
28
#define REFRESH_RATE 1000
29
30
31
class
BandwidthGraph
:
public
VidaliaTab
32
{
33
Q_OBJECT
34
35
public
:
36
/** Default constructor */
37
BandwidthGraph
(QStatusBar *st = 0, QWidget *parent = 0);
38
39
protected
:
40
/** Called when the user changes the UI translation. */
41
virtual
void
retranslateUi
();
42
43
private
slots:
44
/** Adds new data to the graph */
45
void
updateGraph
(quint64 bytesRead, quint64 bytesWritten);
46
/** Called when settings button is toggled */
47
void
showSettingsFrame
(
bool
show);
48
/** Called when the settings button is toggled */
49
void
setOpacity
(
int
value);
50
/** Called when the user saves settings */
51
void
saveChanges
();
52
/** Called when the user cancels changes settings */
53
void
cancelChanges
();
54
/** Called when the reset button is pressed */
55
void
reset
();
56
57
private
:
58
/** Create and bind actions to events **/
59
void
createActions
();
60
/** Loads the saved Bandwidth Graph settings */
61
void
loadSettings
();
62
63
/** A TorControl object used to talk to Tor. */
64
TorControl
*
_torControl
;
65
/** A VidaliaSettings object that handles getting/saving settings */
66
VidaliaSettings
*
_settings
;
67
68
QStatusBar *
_statusBar
;
69
70
/** Qt Designer generated object */
71
Ui::BandwidthGraph
ui
;
72
};
73
74
#endif
75
Generated on Mon Jan 14 2013 08:44:27 for Vidalia by
1.8.3