From c37679e8075e134368978034312d1dc4eaf2f5b4 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 14 Feb 2010 09:06:37 +0000 Subject: [PATCH] put the tunnel info as a new tab in the transfer page. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2310 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/TransfersDialog.cpp | 10 + retroshare-gui/src/gui/TransfersDialog.ui | 25 ++ retroshare-gui/src/gui/TurtleRouterDialog.cpp | 38 +-- retroshare-gui/src/gui/TurtleRouterDialog.h | 8 +- retroshare-gui/src/gui/TurtleRouterDialog.ui | 273 +++++++----------- .../src/gui/settings/TransferPage.cpp | 40 +-- .../src/gui/settings/TransferPage.h | 31 +- .../src/gui/settings/TransferPage.ui | 13 +- 8 files changed, 191 insertions(+), 247 deletions(-) diff --git a/retroshare-gui/src/gui/TransfersDialog.cpp b/retroshare-gui/src/gui/TransfersDialog.cpp index dc27446cb..be8191aee 100644 --- a/retroshare-gui/src/gui/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/TransfersDialog.cpp @@ -32,6 +32,7 @@ #include "DLListDelegate.h" #include "ULListDelegate.h" #include "FileTransferInfoWidget.h" +#include "TurtleRouterDialog.h" #include "xprogressbar.h" #include @@ -221,6 +222,15 @@ TransfersDialog::TransfersDialog(QWidget *parent) QObject::connect(ui.downloadList,SIGNAL(clicked(const QModelIndex&)),this,SLOT(showFileDetails())) ; + TurtleRouterDialog *trdl = new TurtleRouterDialog(); + ui.tunnelInfoWidget->setWidget(trdl); + ui.tunnelInfoWidget->setWidgetResizable(true); + ui.tunnelInfoWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + ui.tunnelInfoWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + ui.tunnelInfoWidget->viewport()->setBackgroundRole(QPalette::NoRole); + ui.tunnelInfoWidget->setFrameStyle(QFrame::NoFrame); + ui.tunnelInfoWidget->setFocusPolicy(Qt::NoFocus); + /* Hide platform specific features */ #ifdef Q_WS_WIN diff --git a/retroshare-gui/src/gui/TransfersDialog.ui b/retroshare-gui/src/gui/TransfersDialog.ui index e660ef6c0..8648aa18e 100644 --- a/retroshare-gui/src/gui/TransfersDialog.ui +++ b/retroshare-gui/src/gui/TransfersDialog.ui @@ -819,6 +819,30 @@ p, li { white-space: pre-wrap; } + + + Tunneling + + + + + + true + + + + + 0 + 0 + 578 + 117 + + + + + + + @@ -826,6 +850,7 @@ p, li { white-space: pre-wrap; } + diff --git a/retroshare-gui/src/gui/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/TurtleRouterDialog.cpp index 6add5ba0d..b8484eae1 100644 --- a/retroshare-gui/src/gui/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/TurtleRouterDialog.cpp @@ -8,17 +8,12 @@ TurtleRouterDialog *TurtleRouterDialog::_instance = NULL ; TurtleRouterDialog::TurtleRouterDialog(QWidget *parent) - : QWidget(parent) + : RsAutoUpdatePage(2000,parent) { setupUi(this) ; - - _timer = new QTimer ; - - connect(_timer,SIGNAL(timeout()),this,SLOT(update())) ; - - _timer->start(2000) ; - connect( _hashes_TW, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showCtxMenu(const QPoint&))); + + _hashes_TW->setToolTip(tr("As a helper, you can manually remove hashes\nfrom there. Warning: doing so on currently\nactive transfers will block the transfer process.")) ; } void TurtleRouterDialog::showCtxMenu(const QPoint& point) @@ -62,26 +57,23 @@ void TurtleRouterDialog::removeFileHash() rsTurtle->stopMonitoringFileTunnels(hash) ; } -void TurtleRouterDialog::update() +void TurtleRouterDialog::updateDisplay() { - if(isVisible()) - { - std::cout << "updatign turtle router console."<< std::endl ; + std::cout << "updatign turtle router console."<< std::endl ; - std::vector > hashes_info ; - std::vector > tunnels_info ; - std::vector > search_reqs_info ; - std::vector > tunnel_reqs_info ; + std::vector > hashes_info ; + std::vector > tunnels_info ; + std::vector > search_reqs_info ; + std::vector > tunnel_reqs_info ; - rsTurtle->getInfo(hashes_info,tunnels_info,search_reqs_info,tunnel_reqs_info) ; + rsTurtle->getInfo(hashes_info,tunnels_info,search_reqs_info,tunnel_reqs_info) ; - // now display this in the QTableWidgets + // now display this in the QTableWidgets - fillTable( _hashes_TW, hashes_info) ; - fillTable( _tunnels_TW, tunnels_info) ; - fillTable( _tunnel_reqs_TW, tunnel_reqs_info) ; - fillTable( _search_reqs_TW, search_reqs_info) ; - } + fillTable( _hashes_TW, hashes_info) ; + fillTable( _tunnels_TW, tunnels_info) ; + fillTable( _tunnel_reqs_TW, tunnel_reqs_info) ; + fillTable( _search_reqs_TW, search_reqs_info) ; } void TurtleRouterDialog::fillTable(QTableWidget *table,const std::vector >& data) diff --git a/retroshare-gui/src/gui/TurtleRouterDialog.h b/retroshare-gui/src/gui/TurtleRouterDialog.h index c55f16abd..875589bb6 100644 --- a/retroshare-gui/src/gui/TurtleRouterDialog.h +++ b/retroshare-gui/src/gui/TurtleRouterDialog.h @@ -2,24 +2,26 @@ #include #include "ui_TurtleRouterDialog.h" +#include "RsAutoUpdatePage.h" -class TurtleRouterDialog: public QWidget, public Ui::TurtleRouterDialogForm +class TurtleRouterDialog: public RsAutoUpdatePage, public Ui::TurtleRouterDialogForm { Q_OBJECT public: + TurtleRouterDialog(QWidget *parent = NULL) ; static void showUp() ; /** Default Constructor */ protected slots: - void update() ; void showCtxMenu(const QPoint&) ; void removeFileHash() ; private: void fillTable(QTableWidget *table,const std::vector >&) ; - TurtleRouterDialog(QWidget *parent = NULL) ; QTimer *_timer ; + virtual void updateDisplay() ; + static TurtleRouterDialog *_instance ; } ; diff --git a/retroshare-gui/src/gui/TurtleRouterDialog.ui b/retroshare-gui/src/gui/TurtleRouterDialog.ui index df4cc3fb5..577f562d4 100644 --- a/retroshare-gui/src/gui/TurtleRouterDialog.ui +++ b/retroshare-gui/src/gui/TurtleRouterDialog.ui @@ -6,8 +6,8 @@ 0 0 - 555 - 406 + 865 + 553 @@ -17,171 +17,114 @@ :/images/rstray3.png:/images/rstray3.png - + - - - 0 + + + Qt::CustomContextMenu - - - Hashes and Tunnels - - - - - - Handled file hashes - - - - - - Qt::CustomContextMenu - - - QAbstractItemView::SingleSelection - - - true - - - - File hash - - - - - File Name - - - - - Active tunnels - - - - - Last tunnel request - - - - - - - - - - - Current tunnels - - - - - - true - - - - Tunnel id - - - - - Source - - - - - Destination - - - - - Hash - - - - - Last transfer - - - - - - - - - - - - Tunnels / Search Requests - - - - - - Tunnel Requests - - - - - - true - - - - Request id - - - - - Origin - - - - - Age - - - - - - - - - - - Search Requests - - - - - - true - - - - Request id - - - - - Origin - - - - - Age - - - - - - - - - + + QAbstractItemView::SingleSelection + + + true + + + + Handled file hash + + + + + File Name + + + + + Active tunnels + + + + + Last tunnel request + + + + + + + + true + + + + Current Tunnel id + + + + + Source + + + + + Destination + + + + + Hash + + + + + Last transfer + + + + + + + + true + + + + Tunnel request id + + + + + Origin + + + + + Age + + + + + + + + true + + + + Search request id + + + + + Origin + + + + + Age + + diff --git a/retroshare-gui/src/gui/settings/TransferPage.cpp b/retroshare-gui/src/gui/settings/TransferPage.cpp index 3b30482f8..ec07d0252 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.cpp +++ b/retroshare-gui/src/gui/settings/TransferPage.cpp @@ -20,7 +20,6 @@ ****************************************************************/ #include "TransferPage.h" -#include #include "rshare.h" @@ -38,11 +37,9 @@ TransferPage::TransferPage(QWidget * parent, Qt::WFlags flags) /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); - connect( ui._showTurtleDialogPB,SIGNAL(clicked()),this,SLOT( showTurtleRouterDialog() )) ; - - QTimer *timer = new QTimer(this); - timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus())); - timer->start(1000); +// QTimer *timer = new QTimer(this); +// timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus())); +// timer->start(1000); updateStatus(); @@ -53,13 +50,7 @@ TransferPage::TransferPage(QWidget * parent, Qt::WFlags flags) #endif } -void TransferPage::showTurtleRouterDialog() -{ - TurtleRouterDialog::showUp() ; -} - -void -TransferPage::closeEvent (QCloseEvent * event) +void TransferPage::closeEvent (QCloseEvent * event) { QWidget::closeEvent(event); } @@ -86,11 +77,11 @@ void TransferPage::load() { /* load up configuration from rsPeers */ - RsPeerDetails detail; - if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) - { - return; - } +// RsPeerDetails detail; +// if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) +// { +// return; +// } } @@ -98,15 +89,12 @@ void TransferPage::load() /** Loads the settings for this page */ void TransferPage::updateStatus() { - /* load up configuration from rsPeers */ - RsPeerDetails detail; - if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) - { - return; - } - - +// RsPeerDetails detail; +// if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) +// { +// return; +// } } diff --git a/retroshare-gui/src/gui/settings/TransferPage.h b/retroshare-gui/src/gui/settings/TransferPage.h index ac37fbe1e..da24017b5 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.h +++ b/retroshare-gui/src/gui/settings/TransferPage.h @@ -29,30 +29,25 @@ class TransferPage: public ConfigPage { - Q_OBJECT + Q_OBJECT - public: - TransferPage(QWidget * parent = 0, Qt::WFlags flags = 0); - ~TransferPage() {} + public: + TransferPage(QWidget * parent = 0, Qt::WFlags flags = 0); + ~TransferPage() {} - /** Saves the changes on this page */ - bool save(QString &errmsg); - /** Loads the settings for this page */ - void load(); + /** Saves the changes on this page */ + bool save(QString &errmsg); + /** Loads the settings for this page */ + void load(); -public slots: - void updateStatus(); + public slots: + void updateStatus(); -private slots: + private: - void showTurtleRouterDialog(); + void closeEvent (QCloseEvent * event); - - private: - - void closeEvent (QCloseEvent * event); - - Ui::TransferPage ui; + Ui::TransferPage ui; }; #endif // !TRANSFERPAGE_H diff --git a/retroshare-gui/src/gui/settings/TransferPage.ui b/retroshare-gui/src/gui/settings/TransferPage.ui index 632248cfd..863d0e76e 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.ui +++ b/retroshare-gui/src/gui/settings/TransferPage.ui @@ -17,7 +17,7 @@ - 0 + 1 @@ -130,17 +130,6 @@ F2F Routing - - - - - - Show router statistics - - - - -