2007-11-14 22:18:48 -05:00
|
|
|
/****************************************************************
|
|
|
|
* RShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006, crypton
|
|
|
|
*
|
|
|
|
* 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.
|
2009-02-11 19:30:40 -05:00
|
|
|
****************************************************************/
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
#ifndef _STATISTICDIALOG_H
|
2009-02-11 19:30:40 -05:00
|
|
|
#define _STATISTICDIALOG_H
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QDateTime>
|
2009-02-12 18:24:27 -05:00
|
|
|
#include <QEvent>
|
2009-02-11 19:30:40 -05:00
|
|
|
#include <QTimer>
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2009-02-11 19:30:40 -05:00
|
|
|
#include <gui/Preferences/rsharesettings.h>
|
|
|
|
|
|
|
|
#include "mainpage.h"
|
2007-11-14 22:18:48 -05:00
|
|
|
#include "ui_StatisticDialog.h"
|
|
|
|
#include "linetypes.h"
|
|
|
|
|
|
|
|
/** Redraw graph every 1000ms **/
|
2009-02-11 19:30:40 -05:00
|
|
|
#define REFRESH_RATE 1000
|
|
|
|
|
|
|
|
class StatisticDialog : public MainPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
|
|
|
StatisticDialog(QWidget *parent = 0);
|
2007-11-14 22:18:48 -05:00
|
|
|
/** Default Destructor */
|
2009-02-11 19:30:40 -05:00
|
|
|
~StatisticDialog();
|
2007-11-14 22:18:48 -05:00
|
|
|
protected:
|
2009-02-12 18:24:27 -05:00
|
|
|
/** Called to deliver a bandwidth update event from RetroShare. */
|
|
|
|
void customEvent(QEvent *event);
|
|
|
|
void timerEvent(QTimerEvent*);
|
|
|
|
|
2009-02-11 19:30:40 -05:00
|
|
|
|
|
|
|
private slots:
|
2007-11-14 22:18:48 -05:00
|
|
|
/** Adds new data to the graph */
|
|
|
|
void updateGraph(quint64 bytesRead, quint64 bytesWritten);
|
|
|
|
/** 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 */
|
2009-02-11 19:30:40 -05:00
|
|
|
void reset();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
2007-11-14 22:18:48 -05:00
|
|
|
/** Create and bind actions to events **/
|
|
|
|
void createActions();
|
|
|
|
/** Loads the saved Bandwidth Graph settings */
|
|
|
|
void loadSettings();
|
|
|
|
|
2009-02-12 18:24:27 -05:00
|
|
|
/** A RetroShareSettings object that handles getting/saving settings */
|
2007-11-14 22:18:48 -05:00
|
|
|
RshareSettings* _settings;
|
2009-02-11 19:30:40 -05:00
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::StatisticDialog ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|