From 05be7641867cad1fb6e00f5a4cc489c1339b1039 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 4 Sep 2014 17:01:28 +0000 Subject: [PATCH] Added a new Statistics Window git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7501 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/FileTransfer/TransfersDialog.cpp | 13 - retroshare-gui/src/gui/MainWindow.cpp | 30 +- retroshare-gui/src/gui/MainWindow.h | 2 +- .../src/gui/bwctrl/BwCtrlWindow.cpp | 82 +- retroshare-gui/src/gui/bwctrl/BwCtrlWindow.h | 23 +- retroshare-gui/src/gui/dht/DhtWindow.cpp | 152 +- retroshare-gui/src/gui/dht/DhtWindow.h | 21 +- retroshare-gui/src/gui/dht/DhtWindow.ui | 1359 ++++++++--------- retroshare-gui/src/gui/images.qrc | 3 + retroshare-gui/src/gui/images/dht32.png | Bin 0 -> 4690 bytes .../gui/images/office-chart-area-stacked.png | Bin 0 -> 1116 bytes .../src/gui/images/office-chart-line.png | Bin 0 -> 877 bytes .../src/gui/statistics/StatisticsWindow.cpp | 198 +++ .../src/gui/statistics/StatisticsWindow.h | 78 + .../src/gui/statistics/StatisticsWindow.ui | 151 ++ retroshare-gui/src/retroshare-gui.pro | 3 + 16 files changed, 1175 insertions(+), 940 deletions(-) create mode 100644 retroshare-gui/src/gui/images/dht32.png create mode 100644 retroshare-gui/src/gui/images/office-chart-area-stacked.png create mode 100644 retroshare-gui/src/gui/images/office-chart-line.png create mode 100644 retroshare-gui/src/gui/statistics/StatisticsWindow.cpp create mode 100644 retroshare-gui/src/gui/statistics/StatisticsWindow.h create mode 100644 retroshare-gui/src/gui/statistics/StatisticsWindow.ui diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index 587082f19..cfb194b13 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -58,15 +58,6 @@ #include #include -/**** - * #define SHOW_RTT_STATISTICS 1 - ****/ -#define SHOW_RTT_STATISTICS 1 - -#ifdef SHOW_RTT_STATISTICS - #include "gui/RttStatistics.h" -#endif - /* Images for context menu icons */ #define IMAGE_INFO ":/images/fileinfo.png" #define IMAGE_CANCEL ":/images/delete.png" @@ -339,10 +330,6 @@ TransfersDialog::TransfersDialog(QWidget *parent) ui.tabWidget->addTab(localSharedFiles = new LocalSharedFilesDialog(), QIcon(IMAGE_MYFILES), tr("My files")) ; -#ifdef SHOW_RTT_STATISTICS - ui.tabWidget->addTab( new RttStatistics(), tr("RTT Statistics")) ; -#endif - //ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ; //ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ; diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 29dc057ac..b4d95d132 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -48,12 +48,10 @@ #include "NewsFeed.h" #include "ShareManager.h" #include "NetworkView.h" -//#include "ForumsDialog.h" #include "FriendsDialog.h" #include "ChatLobbyWidget.h" #include "HelpDialog.h" #include "AboutDialog.h" -//#include "ChannelFeed.h" #include "bwgraph/bwgraph.h" #include "help/browser/helpbrowser.h" #include "chat/ChatDialog.h" @@ -98,6 +96,7 @@ #include "gui/Circles/CirclesDialog.h" #include "gui/WikiPoos/WikiDialog.h" #include "gui/Posted/PostedDialog.h" +#include "gui/statistics/StatisticsWindow.h" #include "gui/connect/ConnectFriendWizard.h" #include "gui/common/RsCollectionFile.h" @@ -110,19 +109,6 @@ #include #include -/**** - * - * #define USE_DHTWINDOW 1 - * #define USE_BWCTRLWINDOW 1 - * - ****/ -#define USE_DHTWINDOW 1 - -#ifdef USE_DHTWINDOW -#include "dht/DhtWindow.h" -#endif - - /* Images for toolbar icons */ //#define IMAGE_NETWORK2 ":/images/rs1.png" //#define IMAGE_PEERS ":/images/groupchat.png" @@ -613,9 +599,8 @@ void MainWindow::createTrayIcon() trayMenu->addAction(QIcon(IMAGE_RSM16), tr("Open Messenger"), this, SLOT(showMessengerWindow())); trayMenu->addAction(QIcon(IMAGE_MESSAGES), tr("Open Messages"), this, SLOT(showMess())); trayMenu->addAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth Graph"), _bandwidthGraph, SLOT(showWindow())); -#ifdef USE_DHTWINDOW - trayMenu->addAction(QIcon(IMAGE_DHT), tr("Statistics"), this, SLOT(showDhtWindow())); -#endif + trayMenu->addAction(QIcon(IMAGE_DHT), tr("Statistics"), this, SLOT(showStatisticsWindow())); + #ifdef UNFINISHED trayMenu->addAction(QIcon(IMAGE_UNFINISHED), tr("Applications"), this, SLOT(showApplWindow())); @@ -1096,12 +1081,11 @@ void MainWindow::showMessengerWindow() MessengerWindow::showYourself(); } -/** Shows Dht window */ -void MainWindow::showDhtWindow() +/** Shows Statistics window */ +void MainWindow::showStatisticsWindow() { -#ifdef USE_DHTWINDOW - DhtWindow::showYourself(); -#endif + StatisticsWindow::showYourself(); + } /** Shows Application window */ diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index ffcd2c713..8bfa4d21e 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -204,7 +204,7 @@ private slots: void addFriend(); void newRsCollection(); void showMessengerWindow(); - void showDhtWindow(); + void showStatisticsWindow(); void servicePermission(); #ifdef UNFINISHED diff --git a/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.cpp b/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.cpp index a46ad79bb..171ddc9c8 100644 --- a/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.cpp +++ b/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.cpp @@ -163,84 +163,30 @@ QSize BWListDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QM return QSize(50,17); } -/**************************************************************************************************/ -/********************************************** STATIC WINDOW *************************************/ -/*BwCtrlWindow * BwCtrlWindow::mInstance = NULL; -void BwCtrlWindow::showYourself() +BwCtrlWindow::BwCtrlWindow(QWidget *parent) +: RsAutoUpdatePage(1000,parent) { - if (mInstance == NULL) { - mInstance = new BwCtrlWindow(); - } - - mInstance->show(); - mInstance->activateWindow(); -} - -BwCtrlWindow* BwCtrlWindow::getInstance() -{ - return mInstance; -} - -void BwCtrlWindow::releaseInstance() -{ - if (mInstance) { - delete mInstance; - } -}*/ - -/********************************************** STATIC WINDOW *************************************/ + setupUi(this); + BWDelegate = new BWListDelegate(); + bwTreeWidget->setItemDelegate(BWDelegate); + + /* Set header resize modes and initial section sizes Peer TreeView*/ + QHeaderView * _header = bwTreeWidget->header () ; + _header->resizeSection ( COLUMN_RSNAME, 170 ); + -BwCtrlWindow::BwCtrlWindow(QWidget *parent) : - QWidget(parent), - ui(new Ui::BwCtrlWindow) -{ - ui->setupUi(this); - - setAttribute ( Qt::WA_DeleteOnClose, true ); - - BWDelegate = new BWListDelegate(); - ui->bwTreeWidget->setItemDelegate(BWDelegate); - - //ui->tabWidget->addTab(dhtdetails = new DhtWindow(),QIcon(), tr("DHT")); - - - // tick for gui update. - QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(update())); - timer->start(1000); } BwCtrlWindow::~BwCtrlWindow() { - //delete ui; - //mInstance = NULL; + } -/* -void BwCtrlWindow::changeEvent(QEvent *e) +void BwCtrlWindow::updateDisplay() { - QMainWindow::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -}*/ - -void BwCtrlWindow::update() -{ - if (!isVisible()) - { -#ifdef DEBUG_BWCTRLWINDOW - //std::cerr << "BwCtrlWindow::update() !Visible" << std::endl; -#endif - return; - } /* do nothing if locked, or not visible */ if (RsAutoUpdatePage::eventsLocked() == true) @@ -269,7 +215,7 @@ void BwCtrlWindow::update() void BwCtrlWindow::updateBandwidth() { - QTreeWidget *peerTreeWidget = ui->bwTreeWidget; + QTreeWidget *peerTreeWidget = bwTreeWidget; peerTreeWidget->clear(); @@ -427,6 +373,6 @@ void BwCtrlWindow::updateBandwidth() void BwCtrlWindow::updateGraph(qreal bytesRead, qreal bytesWritten) { /* Graph only cares about kilobytes */ - ui->frmGraph->addPoints(bytesRead/*/1024.0*/, bytesWritten/*/1024.0*/); + frmGraph->addPoints(bytesRead/*/1024.0*/, bytesWritten/*/1024.0*/); } diff --git a/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.h b/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.h index 85d3d5f1e..d0febb1b1 100644 --- a/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.h +++ b/retroshare-gui/src/gui/bwctrl/BwCtrlWindow.h @@ -26,6 +26,9 @@ #include +#include "RsAutoUpdatePage.h" +#include "ui_BwCtrlWindow.h" + // Defines for download list list columns #define COLUMN_RSNAME 0 #define COLUMN_PEERID 1 @@ -63,36 +66,26 @@ public slots: signals: }; -namespace Ui { - class BwCtrlWindow; -} - -class BwCtrlWindow : public QWidget { +class BwCtrlWindow : public RsAutoUpdatePage, public Ui::BwCtrlWindow { Q_OBJECT public: - //static void showYourself (); - //static BwCtrlWindow* getInstance(); - //static void releaseInstance(); - - BwCtrlWindow(QWidget *parent = 0); ~BwCtrlWindow(); void updateBandwidth(); public slots: - void update(); + virtual void updateDisplay() ; + /** Adds new data to the graph */ - void updateGraph(qreal bytesRead, qreal bytesWritten); + void updateGraph(qreal bytesRead, qreal bytesWritten); protected: //void changeEvent(QEvent *e); - + private: - Ui::BwCtrlWindow *ui; - //static BwCtrlWindow *mInstance; BWListDelegate *BWDelegate; diff --git a/retroshare-gui/src/gui/dht/DhtWindow.cpp b/retroshare-gui/src/gui/dht/DhtWindow.cpp index 54c679e0b..6353ca920 100644 --- a/retroshare-gui/src/gui/dht/DhtWindow.cpp +++ b/retroshare-gui/src/gui/dht/DhtWindow.cpp @@ -21,6 +21,7 @@ #include "DhtWindow.h" #include "ui_DhtWindow.h" + #include #include @@ -34,90 +35,20 @@ #include "retroshare/rsconfig.h" #include "retroshare/rspeers.h" -#include -#include -#include - -/********************************************** STATIC WINDOW *************************************/ -DhtWindow * DhtWindow::mInstance = NULL; - -void DhtWindow::showYourself() +DhtWindow::DhtWindow(QWidget *parent) +: RsAutoUpdatePage(1000,parent) { - if (mInstance == NULL) { - mInstance = new DhtWindow(); - } + ui.setupUi(this); - mInstance->show(); - mInstance->activateWindow(); -} - -DhtWindow* DhtWindow::getInstance() -{ - return mInstance; -} - -void DhtWindow::releaseInstance() -{ - if (mInstance) { - delete mInstance; - } -} - -/********************************************** STATIC WINDOW *************************************/ - - - -DhtWindow::DhtWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::DhtWindow) -{ - ui->setupUi(this); - - setAttribute ( Qt::WA_DeleteOnClose, true ); - - BwCtrlWindow *bwdlg = new BwCtrlWindow ; - ui->tabWidget->addTab(bwdlg, tr("Bandwidth details")); - - TurtleRouterStatistics *trs = new TurtleRouterStatistics ; - ui->tabWidget->addTab(trs,tr("Turtle router")) ; - - GlobalRouterStatistics *grs = new GlobalRouterStatistics ; - ui->tabWidget->addTab(grs,tr("Global router")) ; - - // tick for gui update. - QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(update())); - timer->start(1000); } DhtWindow::~DhtWindow() { - delete ui; - mInstance = NULL; + } -void DhtWindow::changeEvent(QEvent *e) +void DhtWindow::updateDisplay() { - QMainWindow::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -void DhtWindow::update() -{ - if (!isVisible()) - { -#ifdef DEBUG_DHTWINDOW - //std::cerr << "DhtWindow::update() !Visible" << std::endl; -#endif - return; - } - /* do nothing if locked, or not visible */ if (RsAutoUpdatePage::eventsLocked() == true) { @@ -155,23 +86,23 @@ void DhtWindow::updateNetStatus() #if 0 status = QString::fromStdString(mPeerNet->getPeerStatusString()); - oldstatus = ui->peerLine->text(); + oldstatus = ui.peerLine->text(); if (oldstatus != status) { - ui->peerLine->setText(status); + ui.peerLine->setText(status); } #endif status = QString::fromStdString(rsDht->getUdpAddressString()); - oldstatus = ui->peerAddressLabel->text(); + oldstatus = ui.peerAddressLabel->text(); if (oldstatus != status) { - ui->peerAddressLabel->setText(status); + ui.peerAddressLabel->setText(status); } uint32_t netMode = rsConfig->getNetworkMode(); - QLabel *label = ui->networkLabel; + QLabel *label = ui.networkLabel; switch(netMode) { case RSNET_NETWORK_UNKNOWN: @@ -191,7 +122,7 @@ void DhtWindow::updateNetStatus() break; } - label = ui->natTypeLabel; + label = ui.natTypeLabel; uint32_t natType = rsConfig->getNatTypeMode(); switch(natType) @@ -221,7 +152,7 @@ void DhtWindow::updateNetStatus() - label = ui->natHoleLabel; + label = ui.natHoleLabel; uint32_t natHole = rsConfig->getNatHoleMode(); switch(natHole) @@ -245,7 +176,7 @@ void DhtWindow::updateNetStatus() uint32_t connect = rsConfig->getConnectModes(); - label = ui->connectLabel; + label = ui.connectLabel; QString connOut; if (connect & RSNET_CONNECT_OUTGOING_TCP) { @@ -272,7 +203,7 @@ void DhtWindow::updateNetStatus() uint32_t netState = rsConfig->getNetState(); - label = ui->netStatusLabel; + label = ui.netStatusLabel; switch(netState) { case RSNET_NETSTATE_BAD_UNKNOWN: @@ -310,7 +241,7 @@ void DhtWindow::updateNetStatus() void DhtWindow::updateNetPeers() { - QTreeWidget *peerTreeWidget = ui->peerTreeWidget; + QTreeWidget *peerTreeWidget = ui.peerTreeWidget; std::list peerIds; std::list::iterator it; @@ -350,11 +281,11 @@ void DhtWindow::updateNetPeers() int itemCount = peerTreeWidget->topLevelItemCount(); for (int nIndex = 0; nIndex < itemCount;) { - QTreeWidgetItem *tmp_item = peerTreeWidget->topLevelItem(nIndex); + QTreeWidgetItem *tmp_item = ui.peerTreeWidget->topLevelItem(nIndex); std::string tmpid = tmp_item->data(PTW_COL_PEERID, Qt::DisplayRole).toString().toStdString(); if (peerIds.end() == std::find(peerIds.begin(), peerIds.end(), tmpid)) { - peerTreeWidget->removeItemWidget(tmp_item, 0); + ui.peerTreeWidget->removeItemWidget(tmp_item, 0); /* remove it! */ itemCount--; } @@ -364,7 +295,7 @@ void DhtWindow::updateNetPeers() } } #endif - peerTreeWidget->clear(); + ui.peerTreeWidget->clear(); for(it = peerIds.begin(); it != peerIds.end(); it++) { @@ -372,10 +303,10 @@ void DhtWindow::updateNetPeers() QTreeWidgetItem *peer_item = NULL; #if 0 QString qpeerid = QString::fromStdString(*it); - int itemCount = peerTreeWidget->topLevelItemCount(); + int itemCount = ui.peerTreeWidget->topLevelItemCount(); for (int nIndex = 0; nIndex < itemCount; nIndex++) { - QTreeWidgetItem *tmp_item = peerTreeWidget->topLevelItem(nIndex); + QTreeWidgetItem *tmp_item = ui.peerTreeWidget->topLevelItem(nIndex); if (tmp_item->data(PTW_COL_PEERID, Qt::DisplayRole).toString() == qpeerid) { peer_item = tmp_item; @@ -388,8 +319,13 @@ void DhtWindow::updateNetPeers() { /* insert */ peer_item = new QTreeWidgetItem(); - peerTreeWidget->addTopLevelItem(peer_item); + ui.peerTreeWidget->addTopLevelItem(peer_item); } + + /* Set header resize modes and initial section sizes Peer TreeView*/ + QHeaderView * _header = ui.peerTreeWidget->header () ; + _header->resizeSection ( PTW_COL_RSNAME, 170 ); + /* update the data */ RsDhtNetPeer status; @@ -530,17 +466,17 @@ void DhtWindow::updateNetPeers() connstr += tr(",#relay:") + QString::number(nRelayPeers); connstr += ")";*/ - ui->label_peers->setText(QString::number(nPeers)); - ui->label_offline->setText(QString::number(nOfflinePeers)); - ui->label_unreachable->setText(QString::number(nUnreachablePeers)); - ui->label_online->setText(QString::number(nOnlinePeers)); + ui.label_peers->setText(QString::number(nPeers)); + ui.label_offline->setText(QString::number(nOfflinePeers)); + ui.label_unreachable->setText(QString::number(nUnreachablePeers)); + ui.label_online->setText(QString::number(nOnlinePeers)); - ui->label_disconnected->setText(QString::number(nDisconnPeers)); - ui->label_direct->setText(QString::number(nDirectPeers)); - ui->label_proxy->setText(QString::number(nProxyPeers)); - ui->label_relay->setText(QString::number(nRelayPeers)); + ui.label_disconnected->setText(QString::number(nDisconnPeers)); + ui.label_direct->setText(QString::number(nDirectPeers)); + ui.label_proxy->setText(QString::number(nProxyPeers)); + ui.label_relay->setText(QString::number(nRelayPeers)); - //ui->peerSummaryLabel->setText(connstr); + //peerSummaryLabel->setText(connstr); } @@ -548,7 +484,7 @@ void DhtWindow::updateNetPeers() void DhtWindow::updateRelays() { - QTreeWidget *relayTreeWidget = ui->relayTreeWidget; + QTreeWidget *relayTreeWidget = ui.relayTreeWidget; std::list relayEnds; std::list relayProxies; @@ -576,7 +512,7 @@ void DhtWindow::updateRelays() { /* find the entry */ QTreeWidgetItem *item = new QTreeWidgetItem(); - relayTreeWidget->addTopLevelItem(item); + ui.relayTreeWidget->addTopLevelItem(item); QString typestr = tr("RELAY END"); QString srcstr = tr("Yourself"); @@ -606,7 +542,7 @@ void DhtWindow::updateRelays() { /* find the entry */ QTreeWidgetItem *item = new QTreeWidgetItem(); - relayTreeWidget->addTopLevelItem(item); + ui.relayTreeWidget->addTopLevelItem(item); QString typestr = tr("RELAY PROXY"); QString srcstr = QString::fromStdString(rpit->mSrcAddr); @@ -665,8 +601,8 @@ void DhtWindow::updateDhtPeers() { /* Hackish display of all Dht peers, should be split into buckets (as children) */ - //QString status = QString::fromStdString(mPeerNet->getDhtStatusString()); - //ui->dhtLabel->setText(status); + //QString status = QString::fromStdString(mPeerNet->getDhtStatusString()); + //dhtLabel->setText(status); std::list allpeers; std::list::iterator it; @@ -682,9 +618,9 @@ void DhtWindow::updateDhtPeers() } } - QTreeWidget *dhtTreeWidget = ui->dhtTreeWidget; + QTreeWidget *dhtTreeWidget = ui.dhtTreeWidget; - dhtTreeWidget->clear(); + ui.dhtTreeWidget->clear(); time_t now = time(NULL); for(it = allpeers.begin(); it != allpeers.end(); it++) @@ -722,7 +658,7 @@ void DhtWindow::updateDhtPeers() dht_item -> setData(DTW_COL_SEND, Qt::DisplayRole, lastsendstr); dht_item -> setData(DTW_COL_RECV, Qt::DisplayRole, lastrecvstr); - dhtTreeWidget->addTopLevelItem(dht_item); + ui.dhtTreeWidget->addTopLevelItem(dht_item); } } diff --git a/retroshare-gui/src/gui/dht/DhtWindow.h b/retroshare-gui/src/gui/dht/DhtWindow.h index 7c7686a8d..6f9feca82 100644 --- a/retroshare-gui/src/gui/dht/DhtWindow.h +++ b/retroshare-gui/src/gui/dht/DhtWindow.h @@ -22,21 +22,14 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ -#include -namespace Ui { - class DhtWindow; -} +#include "RsAutoUpdatePage.h" +#include "ui_DhtWindow.h" -class DhtWindow : public QMainWindow { +class DhtWindow : public RsAutoUpdatePage/*, public Ui::DhtWindow*/ { Q_OBJECT public: - static void showYourself (); - static DhtWindow* getInstance(); - static void releaseInstance(); - - DhtWindow(QWidget *parent = 0); ~DhtWindow(); @@ -46,15 +39,15 @@ public: void updateRelays(); public slots: - void update(); + virtual void updateDisplay() ; protected: - void changeEvent(QEvent *e); + //void changeEvent(QEvent *e); private: - Ui::DhtWindow *ui; - static DhtWindow *mInstance; + /** Qt Designer generated object */ + Ui::DhtWindow ui; }; diff --git a/retroshare-gui/src/gui/dht/DhtWindow.ui b/retroshare-gui/src/gui/dht/DhtWindow.ui index 8c4b17e76..88ff851ea 100644 --- a/retroshare-gui/src/gui/dht/DhtWindow.ui +++ b/retroshare-gui/src/gui/dht/DhtWindow.ui @@ -1,698 +1,661 @@ - - - DhtWindow - - - true - - - - 0 - 0 - 777 - 604 - - - - Statistics - - - - :/images/dht16.png:/images/dht16.png - - - - - - - 0 - - - - DHT Details - - - - - - - - - - - 75 - true - - - - Net Status: - - - - - - - Qt::LeftToRight - - - Net Status - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - - - - 75 - true - - - - Network Mode: - - - - - - - Network Mode - - - - - - - - - - - - 75 - true - - - - Nat Type: - - - - - - - Nat Type - - - - - - - - - - - - 75 - true - - - - Nat Hole: - - - - - - - Nat Hole - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - 75 - true - - - - Connect Mode: - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Connect Options - - - - - - - - - - - - 75 - true - - - - Peer Address: - - - - - - - - 0 - 0 - - - - Peer Address - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 75 - true - - - - DHT - - - - - - - - - 75 - true - - - - Unreachable: - - - - - - - - 50 - false - - - - - - - - - - - - - - - - 75 - true - - - - Online: - - - - - - - - 50 - false - - - - - - - - - - - - - - - - 75 - true - - - - Offline: - - - - - - - - 50 - false - - - - - - - - - - - - - - - - 75 - true - - - - Peers: - - - - - - - - 50 - false - - - - - - - - - - - - - - - - - 75 - true - - - - Connections - - - - - - - - - 75 - true - - - - Disconnected: - - - - - - - - 50 - false - - - - - - - - - - - - - - - - 75 - true - - - - Direct: - - - - - - - - 50 - false - - - - - - - - - - - - - - - - 75 - true - - - - Proxy: - - - - - - - - 50 - false - - - - - - - - - - - - - - - - 75 - true - - - - Relay: - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Qt::Vertical - - - - - 0 - - - - - true - - - - Name - - - - - PeerId - - - - - DHT Status - - - - - ConnectLogic - - - - - Connect Status - - - - - Connect Mode - - - - - Request Status - - - - - Cb Status - - - - - RsId - - - - - - - - - - - - DHT Details - - - - - - - true - - - - Bucket - - - - - IP:Port - - - - - Key - - - - - Status Flags - - - - - Found - - - - - Last Sent - - - - - Last Recv - - - - - - - - - true - - - - Relay Mode - - - - - Source - - - - - Proxy - - - - - Destination - - - - - Class - - - - - Age - - - - - Last Sent - - - - - Bandwidth - - - - - - - - - - - - - - - 0 - 0 - 777 - 21 - - - - - - - - - - - + + + DhtWindow + + + + 0 + 0 + 694 + 478 + + + + DHT + + + + + + + + + + + 75 + true + + + + Net Status: + + + + + + + Qt::LeftToRight + + + Net Status + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 75 + true + + + + Network Mode: + + + + + + + Network Mode + + + + + + + + + + + + 75 + true + + + + Nat Type: + + + + + + + Nat Type + + + + + + + + + + + + 75 + true + + + + Nat Hole: + + + + + + + Nat Hole + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + 75 + true + + + + Connect Mode: + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Connect Options + + + + + + + + + + + + 75 + true + + + + Peer Address: + + + + + + + + 0 + 0 + + + + Peer Address + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 75 + true + + + + DHT + + + + + + + + + 75 + true + + + + Unreachable: + + + + + + + + 50 + false + + + + + + + + + + + + + + + + 75 + true + + + + Online: + + + + + + + + 50 + false + + + + + + + + + + + + + + + + 75 + true + + + + Offline: + + + + + + + + 50 + false + + + + + + + + + + + + + + + + 75 + true + + + + Peers: + + + + + + + + 50 + false + + + + + + + + + + + + + + + + + 75 + true + + + + Connections + + + + + + + + + 75 + true + + + + Disconnected: + + + + + + + + 50 + false + + + + + + + + + + + + + + + + 75 + true + + + + Direct: + + + + + + + + 50 + false + + + + + + + + + + + + + + + + 75 + true + + + + Proxy: + + + + + + + + 50 + false + + + + + + + + + + + + + + + + 75 + true + + + + Relay: + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Vertical + + + + + 0 + + + + + true + + + + Name + + + + + PeerId + + + + + DHT Status + + + + + ConnectLogic + + + + + Connect Status + + + + + Connect Mode + + + + + Request Status + + + + + Cb Status + + + + + RsId + + + + + + + + + + + + DHT Details + + + + + + + true + + + + Bucket + + + + + IP:Port + + + + + Key + + + + + Status Flags + + + + + Found + + + + + Last Sent + + + + + Last Recv + + + + + + + + + true + + + + Relay Mode + + + + + Source + + + + + Proxy + + + + + Destination + + + + + Class + + + + + Age + + + + + Last Sent + + + + + Bandwidth + + + + + + + + + + diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 21dbb34c3..54e0256d9 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -53,6 +53,7 @@ images/connect_creating.png images/connect_no.png images/dht16.png + images/dht32.png images/edit-clear-history.png images/edit_16.png images/feedback_arrow.png @@ -379,6 +380,8 @@ images/no_avatar_70.png images/no_avatar_background.png images/openimage.png + images/office-chart-area-stacked.png + images/office-chart-line.png images/pasterslink.png images/package_games1.png images/pin32.png diff --git a/retroshare-gui/src/gui/images/dht32.png b/retroshare-gui/src/gui/images/dht32.png new file mode 100644 index 0000000000000000000000000000000000000000..05e9bea0efb40a0cb7bc486d23761029f19a6ace GIT binary patch literal 4690 zcmV-Y60PltP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ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Q~UTIwqQJg>4RCMo>q zFC1ETRGSt7uhVxcx^MOdmaA6zy~^WjtrpiwWpv8M)jPg#2-Czt^oH161z7ZFZD-yr z$z$fRzfktdiqEqiO47P*zM#E9OmaBIF!X(f)21_`$DTdj+o?~?U0*CjC?^Sc3M|b| zZa#L+;BMRZ#8Y19NXMK2RFT5+$6tQ%Wrk%yf<0_%vMLUbQN(}OaG8?)@;=w7vC-Ul z>=G+PW-1~R;}}i}LL|7YH^i&We?9a4C%>uk*an*CRTZnX%5;UAhb)s>NQyueAu!<@ z<#F$XV*~&kmLHFt-T$kjf?AiWj7&%;vM9R7OqWHELqAtvaC;Hy@>?aJ1eT*`Ee|D0 zhTknZ0?oaS;SR53xZ{pmv+2V&H1Y3&t5z!~gvQD#SeOi>Lyl4R#e32l2Do>)>4UC1 zA`>v&Om&u{A^Bx|^WlZJ3BmY1>5c=(NUy!cG3r^IS)6pgQq6;=C@>riUd6&Y;m6@u zTR*<=&)(nRR?Od{KPUoqle0861!aq?le0C8KtTHR!&kri{L21;%i{;{wxj#+0IF3P UGQg--ivR!s07*qoM6N<$f&r1tVgLXD literal 0 HcmV?d00001 diff --git a/retroshare-gui/src/gui/images/office-chart-area-stacked.png b/retroshare-gui/src/gui/images/office-chart-area-stacked.png new file mode 100644 index 0000000000000000000000000000000000000000..02e45c83cc031e75e85955b2b7888c6fe90696f5 GIT binary patch literal 1116 zcmV-i1f%Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L02{9W02{9XUK)`c00007bV*G`2iXD< z3>F*oX90o$00Z1fL_t(|+U-~0Yg=U)e!g=~cTTFd3(IC(yYZF|HAm z`**PlI302xJpF(jzztxP4~#L?6Y={tHA%)#dN#Bi%3lBZ?iCWKv+Lbmqf+p9Iv;&% zOW<%6=EmDE{woQb*)h~4QFQG)bXO$CHtih7O0X*WAG|5?p*_1u^7lI)4{sSf@&YWU z5#RzaSk-&r9}nS2cRpmt2SQh7KKz&{kszA?gJ^D^==z*G&l40@w*|5x(zDk`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S=6VnL3w6(9 zs2{wNBL8s|M{Yu-+d@)#&r*5Iq*!fJ&!H?&EKUBX7KbMk<$FufGDUx0z8?NOb z0|vKcAf>~!(f|NIk%wA`QVw5eo9dnpKi}Q>odZJN40b-6@fu6LwSQ}~buqZzFkpD- zM)@A$IqHf7V5$2F_$h!LwvW#O+J2^ehIZVTF$M%R0!~7Z_waPH9~roSs2=E@w_C3eb~D@(VY6> z4>0|nI|LIO>_qGW+)9$q13VP<-aJiMwwwD2Hp3=S(gE1Iny{jc8%F>C7n z{`lcY-vv_2d}bbr(Vk|#Xm}4rG;K_;VlP4l5^ui%qZe0MT5;J|00000NkvXXu0mjf D1ptdC literal 0 HcmV?d00001 diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp new file mode 100644 index 000000000..5d8d1e1bf --- /dev/null +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp @@ -0,0 +1,198 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2011 Robert Fernie + * + * 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. + ****************************************************************/ + +#include "StatisticsWindow.h" +#include "ui_StatisticsWindow.h" +#include +#include + +#include +#include +#include +#include + +#include "retroshare-gui/RsAutoUpdatePage.h" +#include "retroshare/rsconfig.h" +#include "retroshare/rspeers.h" +#include + +#include +#include +#include +#include + +/**** + * #define SHOW_RTT_STATISTICS 1 + ****/ +#define SHOW_RTT_STATISTICS 1 + +#ifdef SHOW_RTT_STATISTICS + #include "gui/RttStatistics.h" +#endif + +#define IMAGE_DHT ":/images/dht32.png" +#define IMAGE_TURTLE ":images/turtle.png" +#define IMAGE_BWGRAPH ":/images/ksysguard.png" +#define IMAGE_GLOBALROUTER ":/images/network32.png" +#define IMAGE_BANDWIDTH ":images/office-chart-area-stacked.png" +#define IMAGE_RTT ":images/office-chart-line.png" + +/********************************************** STATIC WINDOW *************************************/ +StatisticsWindow * StatisticsWindow::mInstance = NULL; + +void StatisticsWindow::showYourself() +{ + if (mInstance == NULL) { + mInstance = new StatisticsWindow(); + } + + mInstance->show(); + mInstance->activateWindow(); +} + +StatisticsWindow* StatisticsWindow::getInstance() +{ + return mInstance; +} + +void StatisticsWindow::releaseInstance() +{ + if (mInstance) { + delete mInstance; + } +} + +/********************************************** STATIC WINDOW *************************************/ + + + +StatisticsWindow::StatisticsWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::StatisticsWindow) +{ + ui->setupUi(this); + + initStackedPage(); + connect(ui->stackPages, SIGNAL(currentChanged(int)), this, SLOT(setNewPage(int))); + ui->stackPages->setCurrentIndex(0); + +} + +StatisticsWindow::~StatisticsWindow() +{ + delete ui; + mInstance = NULL; +} + +void StatisticsWindow::changeEvent(QEvent *e) +{ + QMainWindow::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +/** Initialyse Stacked Page*/ +void StatisticsWindow::initStackedPage() +{ + + QList > notify; + + /* Create the Main pages and actions */ + QActionGroup *grp = new QActionGroup(this); + QAction *action; + + ui->stackPages->add(dhtw = new DhtWindow(ui->stackPages), + action = createPageAction(QIcon(IMAGE_DHT), tr("DHT"), grp)); + + ui->stackPages->add(bwdlg = new BwCtrlWindow(ui->stackPages), + action = createPageAction(QIcon(IMAGE_BANDWIDTH), tr("Bandwidth"), grp)); + + ui->stackPages->add(trsdlg = new TurtleRouterStatistics(ui->stackPages), + action = createPageAction(QIcon(IMAGE_TURTLE), tr("Turtle Router"), grp)); + + ui->stackPages->add(grsdlg = new GlobalRouterStatistics(ui->stackPages), + action = createPageAction(QIcon(IMAGE_GLOBALROUTER), tr("Global Router"), grp)); + +#ifdef SHOW_RTT_STATISTICS + + ui->stackPages->add(rttdlg = new RttStatistics(ui->stackPages), + action = createPageAction(QIcon(IMAGE_RTT), tr("RTT Statistics"), grp)); +#endif + + std::cerr << "Looking for interfaces in existing plugins:" << std::endl; + for(int i = 0;inbPlugins();++i) + { + QIcon icon ; + + if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_page() != NULL) + { + if(rsPlugins->plugin(i)->qt_icon() != NULL) + icon = *rsPlugins->plugin(i)->qt_icon() ; + else + icon = QIcon(":images/extension_48.png") ; + + std::cerr << " Addign widget page for plugin " << rsPlugins->plugin(i)->getPluginName() << std::endl; + MainPage *pluginPage = rsPlugins->plugin(i)->qt_page(); + QAction *pluginAction = createPageAction(icon, QString::fromUtf8(rsPlugins->plugin(i)->getPluginName().c_str()), grp); + ui->stackPages->add(pluginPage, pluginAction); + //notify.push_back(QPair(pluginPage, pluginAction)); + } + else if(rsPlugins->plugin(i) == NULL) + std::cerr << " No plugin object !" << std::endl; + else + std::cerr << " No plugin page !" << std::endl; + + } + + /* Create the toolbar */ + ui->toolBar->addActions(grp->actions()); + + connect(grp, SIGNAL(triggered(QAction *)), ui->stackPages, SLOT(showPage(QAction *))); + + } + +/** Creates a new action associated with a main page. */ +QAction *StatisticsWindow::createPageAction(const QIcon &icon, const QString &text, QActionGroup *group) +{ + QFont font; + QAction *action = new QAction(icon, text, group); + font = action->font(); + font.setPointSize(9); + action->setCheckable(true); + action->setFont(font); + return action; +} + +/** Selection page. */ +void StatisticsWindow::setNewPage(int page) +{ + MainPage *pagew = dynamic_cast(ui->stackPages->widget(page)) ; + + if(pagew) + { + ui->stackPages->setCurrentIndex(page); + } +} diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.h b/retroshare-gui/src/gui/statistics/StatisticsWindow.h new file mode 100644 index 000000000..30c225b33 --- /dev/null +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.h @@ -0,0 +1,78 @@ +#ifndef RSSTATS_WINDOW_H +#define RSSTATS_WINDOW_H + +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2011 Robert Fernie + * + * 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. + ****************************************************************/ + +#include + +namespace Ui { + class StatisticsWindow; +} + +class MainPage; +class QActionGroup; + +class DhtWindow; +class BwCtrlWindow; +class TurtleRouterStatistics; +class GlobalRouterStatistics; +class RttStatistics; + +class StatisticsWindow : public QMainWindow { + Q_OBJECT +public: + + static void showYourself (); + static StatisticsWindow* getInstance(); + static void releaseInstance(); + + + StatisticsWindow(QWidget *parent = 0); + ~StatisticsWindow(); + + DhtWindow *dhtw; + GlobalRouterStatistics *grsdlg; + BwCtrlWindow *bwdlg; + TurtleRouterStatistics *trsdlg; + RttStatistics *rttdlg; + + +public slots: + void setNewPage(int page); + +protected: + void changeEvent(QEvent *e); + +private: + void initStackedPage(); + + Ui::StatisticsWindow *ui; + + static StatisticsWindow *mInstance; + + /** Creates a new action for a Main page. */ + QAction* createPageAction(const QIcon &icon, const QString &text, QActionGroup *group); + +}; + +#endif // RSDHT_WINDOW_H + diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.ui b/retroshare-gui/src/gui/statistics/StatisticsWindow.ui new file mode 100644 index 000000000..08ae47cd3 --- /dev/null +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.ui @@ -0,0 +1,151 @@ + + + StatisticsWindow + + + + 0 + 0 + 571 + 450 + + + + RetroShare Statistics + + + + + 0 + + + + + Qt::Horizontal + + + 2 + + + + + + + + + + Qt::CustomContextMenu + + + Qt::ToolButtonTextUnderIcon + + + TopToolBarArea + + + false + + + + + + + :/images/user/add_user24.png:/images/user/add_user24.png + + + Add Friend + + + Add a Friend Wizard + + + + + + :/images/add-share24.png:/images/add-share24.png + + + Add Share + + + + + + :/images/kcmsystem24.png:/images/kcmsystem24.png + + + Options + + + + + + :/images/messenger.png:/images/messenger.png + + + Messenger + + + true + + + + + + :/images/informations_24x24.png:/images/informations_24x24.png + + + About + + + + + SMPlayer + + + + + + :/images/exit_24x24.png:/images/exit_24x24.png + + + Quit + + + + + + :/images/tools_wizard.png:/images/tools_wizard.png + + + Quick Start Wizard + + + Quick Start Wizard + + + + + + :/images/admin-24.png:/images/admin-24.png + + + ServicePermissions + + + Service permissions matrix + + + + + + MainPageStack + QWidget +
gui/mainpagestack.h
+
+
+ + + + +
diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index f3f04fe92..433977d09 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -518,6 +518,7 @@ HEADERS += rshare.h \ gui/connect/ConnectProgressDialog.h \ gui/groups/CreateGroup.h \ gui/dht/DhtWindow.h \ + gui/statistics/StatisticsWindow.h \ gui/bwctrl/BwCtrlWindow.h \ gui/channels/ShareKey.h \ gui/GetStartedDialog.h \ @@ -629,6 +630,7 @@ FORMS += gui/StartDialog.ui \ gui/common/RSFeedWidget.ui \ gui/style/StyleDialog.ui \ gui/dht/DhtWindow.ui \ + gui/statistics/StatisticsWindow.ui \ gui/bwctrl/BwCtrlWindow.ui \ gui/channels/ShareKey.ui \ gui/GetStartedDialog.ui \ @@ -843,6 +845,7 @@ SOURCES += main.cpp \ gui/connect/ConnectProgressDialog.cpp \ gui/groups/CreateGroup.cpp \ gui/dht/DhtWindow.cpp \ + gui/statistics/StatisticsWindow.cpp \ gui/bwctrl/BwCtrlWindow.cpp \ gui/channels/ShareKey.cpp \ gui/GetStartedDialog.cpp \