2007-11-14 22:18:48 -05:00
|
|
|
/****************************************************************
|
2009-02-11 18:28:10 -05:00
|
|
|
* This file is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (c) 2006-2007, crypton
|
2007-12-08 06:27:01 -05:00
|
|
|
* Copyright (c) 2006, Matt Edman, Justin Hipple
|
2007-11-14 22:18:48 -05:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
2014-10-17 15:47:05 -04:00
|
|
|
#pragma once
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QEvent>
|
2009-02-11 18:28:10 -05:00
|
|
|
#include <QTimer>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
#include <gui/common/rwindow.h>
|
2015-07-09 23:24:39 -04:00
|
|
|
#include <gui/statistics/BWGraph.h>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2014-10-17 17:41:29 -04:00
|
|
|
#include "ui_BandwidthGraphWindow.h"
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2012-09-23 16:01:24 -04:00
|
|
|
/** Redraw graph every BWGRAPH_REFRESH_RATE ms **/
|
|
|
|
#define BWGRAPH_REFRESH_RATE 5113
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
class BandwidthGraph : public RWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-10-17 15:47:05 -04:00
|
|
|
enum { AreaGraph=0,LineGraph=1 } ;
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
/** Default constructor */
|
2013-10-18 17:10:33 -04:00
|
|
|
BandwidthGraph(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
/** Overloaded QWidget.show */
|
|
|
|
void showWindow();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
/** Called when settings button is toggled */
|
|
|
|
void showSettingsFrame(bool show);
|
|
|
|
/** Called when the settings button is toggled */
|
|
|
|
void setOpacity(int value);
|
|
|
|
/** Called when the user saves settings */
|
|
|
|
void saveChanges();
|
|
|
|
/** Called when the user cancels changes settings */
|
|
|
|
void cancelChanges();
|
|
|
|
/** Called when the reset button is pressed */
|
|
|
|
void reset();
|
2009-02-11 18:28:10 -05:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
private:
|
|
|
|
/** Create and bind actions to events **/
|
|
|
|
void createActions();
|
|
|
|
/** Loads the saved Bandwidth Graph settings */
|
|
|
|
void loadSettings();
|
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::BandwidthGraph ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
|