* Enabled Statistics for ApplicationWindow

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1037 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-02-12 00:30:40 +00:00
parent bcfb410ba4
commit 516b1684f9
6 changed files with 775 additions and 551 deletions

View file

@ -53,6 +53,7 @@
#include "MsgFeed.h"
#include "ChannelFeed.h"
#include "LibraryDialog.h"
#include "StatisticDialog.h"
/* for smplayer */
@ -72,7 +73,7 @@
#define IMAGE_CHAT ":/images/chats_24x24.png"
#define IMAGE_RETROSHARE ":/images/RetroShare16.png"
#define IMAGE_ABOUT ":/images/informations_24x24.png"
#define IMAGE_STATISTIC ":/images/utilities-system-monitor.png"
#define IMAGE_STATISTIC ":/images/ksysguard32.png"
#define IMAGE_GAMES ":/images/kgames.png"
#define IMAGE_PHOTO ":/images/lphoto.png"
#define IMAGE_BWGRAPH ":/images/ksysguard.png"
@ -126,9 +127,9 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
//ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
// createPageAction(QIcon(IMAGE_NEWSFEED), tr("News Feed"), grp));
//PluginsPage *pluginsPage = NULL;
//ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages),
// createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
StatisticDialog *statisticDialog = NULL;
ui.stackPages->add(statisticDialog = new StatisticDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp));
PeersFeed *peersFeed = NULL;
ui.stackPages->add(peersFeed = new PeersFeed(ui.stackPages),

View file

@ -23,6 +23,7 @@
#include "rshare.h"
#include "StatisticDialog.h"
//#include <control/bandwidthevent.h>
#include "rsiface/rsiface.h"
/** Constructor */
@ -38,10 +39,6 @@ StatisticDialog::StatisticDialog(QWidget *parent)
/* Bind events to actions */
createActions();
/* Ask Tor to notify us about bandwidth updates */
// _torControl = Vidalia::torControl();
// _torControl->setEvent(TorEvents::Bandwidth, this, true);
/* Initialize Sent/Receive data counters */
reset();
@ -58,6 +55,10 @@ StatisticDialog::StatisticDialog(QWidget *parent)
#if defined(Q_WS_X11)
ui.frmOpacity->setVisible(false);
#endif
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updategraph2status()));
timer->start(5113);
}
/** Default destructor */
@ -108,7 +109,19 @@ void
StatisticDialog::updateGraph(quint64 bytesRead, quint64 bytesWritten)
{
/* Graph only cares about kilobytes */
ui.frmGraph->addPoints(bytesRead/1024.0, bytesWritten/1024.0);
ui.frmGraph->addPoints(bytesRead, bytesWritten);
}
void
StatisticDialog::updategraph2status( )
{
/* set users/friends/network */
float downKb = 0;
float upKb = 0;
rsicontrol -> ConfigGetDataRates(downKb, upKb);
updateGraph(downKb,upKb);
}
/**
@ -223,20 +236,5 @@ StatisticDialog::setOpacity(int value)
#endif
}
/**
Overloads the default show() slot so we can set opacity
void
StatisticDialog::show()
{
loadSettings();
if(!this->isVisible()) {
QMainWindow::show();
} else {
QMainWindow::activateWindow();
setWindowState(windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
QMainWindow::raise();
}
}
*/

View file

@ -25,6 +25,8 @@
#include <QFileDialog>
#include <QDateTime>
//#include <QEvent>
#include <QTimer>
#include <gui/Preferences/rsharesettings.h>
@ -62,6 +64,9 @@ private slots:
/** Called when the reset button is pressed */
void reset();
void updategraph2status();
private:
/** Create and bind actions to events **/
void createActions();

View file

@ -1,279 +1,480 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>StatisticDialog</class>
<widget class="QWidget" name="StatisticDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>701</width>
<height>449</height>
</rect>
</property>
<property name="palette" >
<palette>
<active>
<color>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<color>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>192</red>
<green>192</green>
<blue>192</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<color>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
<color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
@ -292,18 +493,30 @@
<enum>Qt::NoContextMenu</enum>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>9</number>
</property>
<item>
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<widget class="QTreeWidget" name="treeWidget" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeIncrement" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<column>
<property name="text" >
<string>Statistics</string>
@ -314,7 +527,8 @@
<string>Download</string>
</property>
<property name="icon" >
<iconset resource="images.qrc" >:/images/downloads_24x24.png</iconset>
<iconset>
<normaloff>:/images/downloads_24x24.png</normaloff>:/images/downloads_24x24.png</iconset>
</property>
<item>
<property name="text" >
@ -357,7 +571,8 @@
<string>Upload</string>
</property>
<property name="icon" >
<iconset resource="images.qrc" >:/images/uploads_24x24.png</iconset>
<iconset>
<normaloff>:/images/uploads_24x24.png</normaloff>:/images/uploads_24x24.png</iconset>
</property>
<item>
<property name="text" >
@ -400,7 +615,8 @@
<string>Connections:</string>
</property>
<property name="icon" >
<iconset resource="images.qrc" >:/images/connections_24x24.png</iconset>
<iconset>
<normaloff>:/images/connections_24x24.png</normaloff>:/images/connections_24x24.png</iconset>
</property>
<item>
<property name="text" >
@ -490,6 +706,12 @@
</item>
</widget>
<widget class="QFrame" name="frame" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
@ -497,14 +719,14 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>9</number>
</property>
<item>
<widget class="GraphFrame" name="frmGraph" >
<widget class="GraphFrame" native="1" name="frmGraph" >
<property name="minimumSize" >
<size>
<width>120</width>
@ -529,12 +751,12 @@
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="btnToggleSettings" >
<property name="text" >
@ -550,7 +772,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>21</width>
<height>20</height>
@ -570,9 +792,7 @@
<item>
<widget class="QFrame" name="frmSettings" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -599,20 +819,20 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>3</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>3</number>
</property>
<item>
<widget class="QCheckBox" name="chkReceiveRate" >
<property name="font" >
@ -702,7 +922,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>21</height>
@ -724,20 +944,20 @@
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>3</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="lblPercentOpacity" >
<property name="minimumSize" >
@ -833,7 +1053,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>20</height>
@ -849,7 +1069,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>21</width>
<height>20</height>
@ -859,12 +1079,12 @@
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>1</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="btnSaveSettings" >
<property name="text" >
@ -890,14 +1110,12 @@
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>GraphFrame</class>
<extends>QWidget</extends>
<header>gui/graphframe.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<resources>

View file

@ -183,6 +183,7 @@
<file>images/konversation.png</file>
<file>images/konversation16.png</file>
<file>images/ksysguard.png</file>
<file>images/ksysguard32.png</file>
<file>images/ktorrent.png</file>
<file>images/ktorrent32.png</file>
<file>images/knewsticker24.png</file>
@ -209,6 +210,7 @@
<file>images/message-mail.png</file>
<file>images/message-mail-read.png</file>
<file>images/message-mail-imapdelete.png</file>
<file>images/message-mail-replied-read.png</file>
<file>images/message-news.png</file>
<file>images/message.png</file>
<file>images/messenger.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB