BandwidthGraph.h

Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.vidalia-project.net/. No part of Vidalia, including this file,
00007 **  may be copied, modified, propagated, or distributed except according to the
00008 **  terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file BandwidthGraph.h
00013 ** \version $Id: BandwidthGraph.h 4054 2009-08-17 02:25:08Z edmanm $
00014 ** \brief Displays a graph of Tor's bandwidth usage
00015 */
00016 
00017 #ifndef _BWGRAPH_H
00018 #define _BWGRAPH_H
00019 
00020 #include "ui_BandwidthGraph.h"
00021 #include "VidaliaWindow.h"
00022 #include "VidaliaSettings.h"
00023 #include "TorControl.h"
00024 
00025 #include <QDateTime>
00026 #include <QEvent>
00027 
00028 /** Redraw graph every 1000ms **/
00029 #define REFRESH_RATE    1000
00030 
00031 
00032 class BandwidthGraph : public VidaliaWindow
00033 {
00034   Q_OBJECT
00035 
00036 public:
00037   /** Default constructor */
00038   BandwidthGraph(QWidget *parent = 0, Qt::WFlags flags = 0);
00039 
00040 public slots:
00041   /** Overloaded QWidget.show */
00042   void showWindow();
00043 
00044 protected:
00045   /** Called when the user changes the UI translation. */
00046   virtual void retranslateUi();
00047 
00048 private slots:
00049   /** Adds new data to the graph */
00050   void updateGraph(quint64 bytesRead, quint64 bytesWritten);
00051   /** Called when settings button is toggled */
00052   void showSettingsFrame(bool show);
00053   /** Called when the settings button is toggled */
00054   void setOpacity(int value);
00055   /** Called when the user saves settings */
00056   void saveChanges();
00057   /** Called when the user cancels changes settings */
00058   void cancelChanges();
00059   /** Called when the reset button is pressed */
00060   void reset();
00061   
00062 private:
00063   /** Create and bind actions to events **/
00064   void createActions();
00065   /** Loads the saved Bandwidth Graph settings */
00066   void loadSettings();
00067 
00068   /** A TorControl object used to talk to Tor. */
00069   TorControl* _torControl;
00070   /** A VidaliaSettings object that handles getting/saving settings */
00071   VidaliaSettings* _settings;
00072   
00073   /** Qt Designer generated object */
00074   Ui::BandwidthGraph ui;
00075 };
00076 
00077 #endif
00078 

Generated on Mon Aug 30 19:14:02 2010 for Vidalia by  doxygen 1.5.9