Vidalia 0.3.1
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
32{
33 Q_OBJECT
34
35public:
36 /** Default constructor */
37 BandwidthGraph(QStatusBar *st = 0, QWidget *parent = 0);
38
39protected:
40 /** Called when the user changes the UI translation. */
41 virtual void retranslateUi();
42
43private 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
57private:
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. */
65 /** A VidaliaSettings object that handles getting/saving settings */
67
68 QStatusBar *_statusBar;
69
70 /** Qt Designer generated object */
71 Ui::BandwidthGraph ui;
72};
73
74#endif
75
virtual void retranslateUi()
Ui::BandwidthGraph ui
void showSettingsFrame(bool show)
void updateGraph(quint64 bytesRead, quint64 bytesWritten)
TorControl * _torControl
QStatusBar * _statusBar
void setOpacity(int value)
BandwidthGraph(QStatusBar *st=0, QWidget *parent=0)
VidaliaSettings * _settings