diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 6c12694dd..ef9cf3cbb 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -353,12 +353,11 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) menu->addSeparator(); menu->addAction(_messengerwindowAct); menu->addAction(_messagesAct); - + menu->addAction(_bandwidthAct); /* bandwidth only in development version */ #ifdef RS_RELEASE_VERSION #else - menu->addAction(_bandwidthAct); menu->addAction(_appAct); #endif menu->addAction(_prefsAct); diff --git a/retroshare-gui/src/gui/bwgraph/bwgraph.cpp b/retroshare-gui/src/gui/bwgraph/bwgraph.cpp index 8b012d2c5..402d32304 100644 --- a/retroshare-gui/src/gui/bwgraph/bwgraph.cpp +++ b/retroshare-gui/src/gui/bwgraph/bwgraph.cpp @@ -1,7 +1,7 @@ /**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2006-2007, crypton + * This file is distributed under the following license: + * + * Copyright (c) 2006-2007, crypton * Copyright (c) 2006, Matt Edman, Justin Hipple * * This program is free software; you can redistribute it and/or @@ -26,6 +26,9 @@ #include "bwgraph.h" #include "rsiface/rsiface.h" +#include +#include +#include #define BWGRAPH_LINE_SEND (1u<<0) #define BWGRAPH_LINE_RECV (1u<<1) @@ -84,6 +87,10 @@ BandwidthGraph::BandwidthGraph(QWidget *parent, Qt::WFlags flags) #if defined(Q_WS_X11) ui.frmOpacity->setVisible(false); #endif + + QTimer *timer = new QTimer(this); + timer->connect(timer, SIGNAL(timeout()), this, SLOT(updategraphstatus())); + timer->start(5113); } /** Custom event handler. Checks if the event is a bandwidth update event. If it @@ -98,15 +105,27 @@ BandwidthGraph::customEvent(QEvent *event) } void -BandwidthGraph::timerEvent( QTimerEvent * ) +BandwidthGraph::timerEvent( QTimerEvent * ) +{ + /* set users/friends/network */ + /*float downKb = 0; + float upKb = 0; + rsicontrol -> ConfigGetDataRates(downKb, upKb); + + updateGraph(downKb,upKb);*/ + +} + +void +BandwidthGraph::updategraphstatus( ) { /* set users/friends/network */ float downKb = 0; float upKb = 0; rsicontrol -> ConfigGetDataRates(downKb, upKb); - - updateGraph(downKb,upKb); - + + updateGraph(downKb,upKb); + } /** Binds events to actions. */ @@ -134,7 +153,7 @@ void BandwidthGraph::updateGraph(quint64 bytesRead, quint64 bytesWritten) { /* Graph only cares about kilobytes */ - ui.frmGraph->addPoints(bytesRead/1024.0, bytesWritten/1024.0); + ui.frmGraph->addPoints(bytesRead/*/1024.0*/, bytesWritten/*/1024.0*/); } /** Loads the saved Bandwidth Graph settings. */ diff --git a/retroshare-gui/src/gui/bwgraph/bwgraph.h b/retroshare-gui/src/gui/bwgraph/bwgraph.h index 41e2981a9..cd563dbdf 100644 --- a/retroshare-gui/src/gui/bwgraph/bwgraph.h +++ b/retroshare-gui/src/gui/bwgraph/bwgraph.h @@ -1,7 +1,7 @@ /**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2006-2007, crypton + * This file is distributed under the following license: + * + * Copyright (c) 2006-2007, crypton * Copyright (c) 2006, Matt Edman, Justin Hipple * * This program is free software; you can redistribute it and/or @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -66,6 +67,9 @@ private slots: void cancelChanges(); /** Called when the reset button is pressed */ void reset(); + + void updategraphstatus(); + private: /** Create and bind actions to events **/