moved turtle statistics info into config->turtle

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ImprovedGUI@6101 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-01-30 20:01:57 +00:00
parent 329369650e
commit 2f18162ef9
4 changed files with 45 additions and 30 deletions

View file

@ -42,8 +42,6 @@
#include "DLListDelegate.h" #include "DLListDelegate.h"
#include "ULListDelegate.h" #include "ULListDelegate.h"
#include "FileTransferInfoWidget.h" #include "FileTransferInfoWidget.h"
#include "TurtleRouterDialog.h"
//#include "TurtleRouterStatistics.h"
#include "SearchDialog.h" #include "SearchDialog.h"
#include "xprogressbar.h" #include "xprogressbar.h"
#include "settings/rsharesettings.h" #include "settings/rsharesettings.h"
@ -306,9 +304,9 @@ TransfersDialog::TransfersDialog(QWidget *parent)
QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ; QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ;
ui.tabWidget->insertTab(0,searchDialog = new SearchDialog(), QIcon(IMAGE_SEARCH), tr("Search")) ; ui.tabWidget->insertTab(0,searchDialog = new SearchDialog(), QIcon(IMAGE_SEARCH), tr("Search")) ;
//ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ;
ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ; //ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ;
//ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ;
for(int i=0;i<rsPlugins->nbPlugins();++i) for(int i=0;i<rsPlugins->nbPlugins();++i)
if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_transfers_tab() != NULL) if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_transfers_tab() != NULL)

View file

@ -45,11 +45,14 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
connect( ui.allowTunnelConnectionCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTunnelConnection(bool) ) ); connect( ui.allowTunnelConnectionCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTunnelConnection(bool) ) );
connect( ui._max_tr_up_per_sec_SB, SIGNAL( valueChanged( int ) ), this, SLOT( updateMaxTRUpRate(int) ) ); connect( ui._max_tr_up_per_sec_SB, SIGNAL( valueChanged( int ) ), this, SLOT( updateMaxTRUpRate(int) ) );
connect( ui._turtle_enabled_CB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTurtleRouting(bool) ) ); connect( ui._turtle_enabled_CB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTurtleRouting(bool) ) );
connect( ui._routing_info_PB, SIGNAL( clicked() ), this, SLOT( showRoutingInfo() ) );
QTimer *timer = new QTimer(this); QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus())); timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
timer->start(1000); timer->start(1000);
_routing_info_page = NULL ;
//load(); //load();
updateStatus(); updateStatus();
@ -74,6 +77,11 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
TurtleRouterStatistics *trs = new TurtleRouterStatistics ; TurtleRouterStatistics *trs = new TurtleRouterStatistics ;
trs->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding)) ; trs->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding)) ;
ui.tabWidget->widget(2)->layout()->addWidget(trs) ; ui.tabWidget->widget(2)->layout()->addWidget(trs) ;
ui.tabWidget->widget(2)->layout()->setContentsMargins(0,5,0,0) ;
QSpacerItem *verticalSpacer = new QSpacerItem(0,0,QSizePolicy::Expanding, QSizePolicy::Minimum);
ui.tabWidget->widget(2)->layout()->addItem(verticalSpacer) ;
ui.tabWidget->widget(2)->layout()->update() ; ui.tabWidget->widget(2)->layout()->update() ;
/* Hide platform specific features */ /* Hide platform specific features */
@ -82,6 +90,14 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
#endif #endif
} }
void ServerPage::showRoutingInfo()
{
if(_routing_info_page == NULL)
_routing_info_page = new TurtleRouterDialog ;
_routing_info_page->show() ;
}
void ServerPage::updateMaxTRUpRate(int b) void ServerPage::updateMaxTRUpRate(int b)
{ {
rsTurtle->setMaxTRForwardRate(b) ; rsTurtle->setMaxTRForwardRate(b) ;
@ -198,12 +214,14 @@ void ServerPage::load()
ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC); ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC);
ui._max_tr_up_per_sec_SB->setValue(rsTurtle->getMaxTRForwardRate()) ; ui._max_tr_up_per_sec_SB->setValue(rsTurtle->getMaxTRForwardRate()) ;
ui._turtle_enabled_CB->setChecked(rsTurtle->enabled()) ; ui._turtle_enabled_CB->setChecked(rsTurtle->enabled()) ;
} }
void ServerPage::toggleTurtleRouting(bool b) void ServerPage::toggleTurtleRouting(bool b)
{ {
ui._max_tr_up_per_sec_SB->setEnabled(b) ;
ui._routing_info_PB->setEnabled(true) ; // always enabled!
rsTurtle->setEnabled(b) ; rsTurtle->setEnabled(b) ;
} }

View file

@ -25,6 +25,8 @@
#include <retroshare-gui/configpage.h> #include <retroshare-gui/configpage.h>
#include "ui_ServerPage.h" #include "ui_ServerPage.h"
class TurtleRouterDialog ;
class ServerPage: public ConfigPage class ServerPage: public ConfigPage
{ {
Q_OBJECT Q_OBJECT
@ -47,6 +49,7 @@ public slots:
private slots: private slots:
void saveAddresses(); void saveAddresses();
void toggleUPnP(); void toggleUPnP();
void showRoutingInfo();
void toggleIpDetermination(bool) ; void toggleIpDetermination(bool) ;
void toggleTunnelConnection(bool) ; void toggleTunnelConnection(bool) ;
void updateMaxTRUpRate(int) ; void updateMaxTRUpRate(int) ;
@ -54,6 +57,8 @@ private slots:
private: private:
Ui::ServerPage ui; Ui::ServerPage ui;
TurtleRouterDialog *_routing_info_page ;
}; };
#endif // !SERVERPAGE_H #endif // !SERVERPAGE_H

View file

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>573</width> <width>632</width>
<height>683</height> <height>683</height>
</rect> </rect>
</property> </property>
@ -112,7 +112,7 @@ peers still need to trust each other to allow connection. </string>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -373,6 +373,23 @@ behind a firewall or a VPN.</string>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="_turtle_enabled_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;Unchecking this disables all anonymous routing activity, except cache cleaning. Incoming tunnel requests are discarded, and no tunnel requests are sent to anyone.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_routing_info_PB">
<property name="text">
<string>Show routing info</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
@ -405,31 +422,8 @@ The default value is 20.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="_turtle_enabled_CB">
<property name="toolTip">
<string>Unchecking this disables all anonymous routing activity, except cache cleaning. Incoming tunnel requests are discarded, and no tunnel requests are sent to anyone.</string>
</property>
<property name="text">
<string>Enable anonymous data routing</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>