remove DHT from the gui

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1873 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-12-14 13:47:04 +00:00
parent cd01b0df43
commit 61c570b0f0
9 changed files with 150 additions and 370 deletions

View file

@ -219,7 +219,6 @@ HEADERS += rshare.h \
gui/help/browser/helpbrowser.h \ gui/help/browser/helpbrowser.h \
gui/help/browser/helptextbrowser.h \ gui/help/browser/helptextbrowser.h \
gui/statusbar/peerstatus.h \ gui/statusbar/peerstatus.h \
gui/statusbar/dhtstatus.h \
gui/statusbar/natstatus.h \ gui/statusbar/natstatus.h \
gui/statusbar/ratesstatus.h \ gui/statusbar/ratesstatus.h \
gui/advsearch/advancedsearchdialog.h \ gui/advsearch/advancedsearchdialog.h \
@ -396,7 +395,6 @@ SOURCES += main.cpp \
gui/common/rwindow.cpp \ gui/common/rwindow.cpp \
gui/common/html.cpp \ gui/common/html.cpp \
gui/statusbar/peerstatus.cpp \ gui/statusbar/peerstatus.cpp \
gui/statusbar/dhtstatus.cpp \
gui/statusbar/natstatus.cpp \ gui/statusbar/natstatus.cpp \
gui/statusbar/ratesstatus.cpp \ gui/statusbar/ratesstatus.cpp \
gui/toaster/ChatToaster.cpp \ gui/toaster/ChatToaster.cpp \

View file

@ -42,7 +42,6 @@
#include "gui/TurtleRouterDialog.h" #include "gui/TurtleRouterDialog.h"
#include "statusbar/peerstatus.h" #include "statusbar/peerstatus.h"
#include "statusbar/dhtstatus.h"
#include "statusbar/natstatus.h" #include "statusbar/natstatus.h"
#include "statusbar/ratesstatus.h" #include "statusbar/ratesstatus.h"
@ -234,9 +233,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
peerstatus = new PeerStatus(); peerstatus = new PeerStatus();
statusBar()->addWidget(peerstatus); statusBar()->addWidget(peerstatus);
dhtstatus = new DHTStatus();
statusBar()->addWidget(dhtstatus);
natstatus = new NATStatus(); natstatus = new NATStatus();
statusBar()->addWidget(natstatus); statusBar()->addWidget(natstatus);
@ -279,7 +275,6 @@ MainWindow::~MainWindow()
delete _bandwidthGraph; delete _bandwidthGraph;
delete _messengerwindowAct; delete _messengerwindowAct;
delete peerstatus; delete peerstatus;
delete dhtstatus;
delete natstatus; delete natstatus;
delete ratesstatus; delete ratesstatus;
delete _settings; delete _settings;
@ -339,9 +334,6 @@ void MainWindow::updateStatus()
if (peerstatus) if (peerstatus)
peerstatus->getPeerStatus(); peerstatus->getPeerStatus();
if (dhtstatus)
dhtstatus->getDHTStatus();
if (natstatus) if (natstatus)
natstatus->getNATStatus(); natstatus->getNATStatus();

View file

@ -46,7 +46,6 @@
#include "ui_MainWindow.h" #include "ui_MainWindow.h"
class PeerStatus; class PeerStatus;
class DHTStatus;
class NATStatus; class NATStatus;
class RatesStatus; class RatesStatus;
@ -180,7 +179,6 @@ private:
QMenu *menu; QMenu *menu;
PeerStatus *peerstatus; PeerStatus *peerstatus;
DHTStatus *dhtstatus;
NATStatus *natstatus; NATStatus *natstatus;
RatesStatus *ratesstatus; RatesStatus *ratesstatus;

View file

@ -797,15 +797,6 @@ void NetworkDialog::updateNetworkStatus()
ui.iconlabel_upnp->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png")); ui.iconlabel_upnp->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
} }
if(config.netDhtOk)
{
ui.iconlabel_dht->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
}
else
{
ui.iconlabel_dht->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
}
if(config.netStunOk) if(config.netStunOk)
{ {
ui.iconlabel_udp->setPixmap(QPixmap::QPixmap(":/images/ledon1.png")); ui.iconlabel_udp->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));

View file

@ -294,33 +294,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="iconlabel_dht">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabel_dht">
<property name="text">
<string>DHT</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View file

@ -140,14 +140,6 @@ void ServerPage::load()
} }
ui.netModeComboBox->setCurrentIndex(netIndex); ui.netModeComboBox->setCurrentIndex(netIndex);
/* set dht/disc */
netIndex = 1;
if (detail.visState & RS_VS_DHT_ON)
{
netIndex = 0;
}
ui.dhtComboBox->setCurrentIndex(netIndex);
netIndex = 1; netIndex = 1;
if (detail.visState & RS_VS_DISC_ON) if (detail.visState & RS_VS_DISC_ON)
{ {
@ -290,11 +282,6 @@ void ServerPage::toggleUPnP()
if (settingChangeable) if (settingChangeable)
{ {
ui.dhtComboBox->setEnabled(true);
// disabled until we've got it all working.
//ui.discComboBox->setEnabled(true);
ui.discComboBox->setEnabled(false);
ui.localAddress->setEnabled(false); ui.localAddress->setEnabled(false);
ui.localPort -> setEnabled(true); ui.localPort -> setEnabled(true);
ui.extAddress -> setEnabled(false); ui.extAddress -> setEnabled(false);
@ -302,9 +289,6 @@ void ServerPage::toggleUPnP()
} }
else else
{ {
ui.dhtComboBox->setEnabled(false);
ui.discComboBox->setEnabled(false);
ui.localAddress->setEnabled(false); ui.localAddress->setEnabled(false);
ui.localPort -> setEnabled(false); ui.localPort -> setEnabled(false);
ui.extAddress -> setEnabled(false); ui.extAddress -> setEnabled(false);
@ -357,11 +341,6 @@ void ServerPage::saveAddresses()
visState |= RS_VS_DISC_ON; visState |= RS_VS_DISC_ON;
} }
if (0 == ui.dhtComboBox->currentIndex())
{
visState |= RS_VS_DHT_ON;
}
if (visState != detail.visState) if (visState != detail.visState)
{ {
rsPeers->setVisState(ownId, visState); rsPeers->setVisState(ownId, visState);

View file

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>467</width> <width>467</width>
<height>448</height> <height>394</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -504,16 +504,19 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title"> <property name="title">
<string>Network Configuration (takes effect after restart)</string> <string>Network Configuration (restart not needed)</string>
</property> </property>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<item> <item>
<layout class="QVBoxLayout"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QHBoxLayout"/>
</item>
<item> <item>
<widget class="QComboBox" name="netModeComboBox"> <widget class="QComboBox" name="netModeComboBox">
<item> <item>
<property name="text"> <property name="text">
<string>Automatic</string> <string>Automatic (Upnp)</string>
</property> </property>
</item> </item>
<item> <item>
@ -523,45 +526,11 @@
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Forwarded Port</string> <string>Manual Forwarded Port</string>
</property> </property>
</item> </item>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QComboBox" name="dhtComboBox">
<item>
<property name="text">
<string>DHT Enabled</string>
</property>
</item>
<item>
<property name="text">
<string>DHT Disabled</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="discComboBox">
<item>
<property name="text">
<string>Discovery Enabled</string>
</property>
</item>
<item>
<property name="text">
<string>Discovery Disabled</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
@ -575,6 +544,25 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QComboBox" name="discComboBox">
<property name="toolTip">
<string>Should be disabled if you don't want to share connection information between peers.</string>
</property>
<item>
<property name="text">
<string>Discovery Enabled</string>
</property>
</item>
<item>
<property name="text">
<string>Discovery Disabled</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -660,20 +648,24 @@
<string>Network Configuration</string> <string>Network Configuration</string>
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="2" column="0">
<widget class="QCheckBox" name="allowTunnelConnectionCB">
<property name="toolTip">
<string>If you unckeck this, RetroShare will not use tunnel connection between peers that are firewalled and cannot connect directly. This is independant from F2F routing (turtle router).</string>
</property>
<property name="text">
<string>Allow Tunnel Connection</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Network Configuration</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<item> <item>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout">
<item> <item>
@ -694,6 +686,9 @@
</item> </item>
<item> <item>
<layout class="QGridLayout"> <layout class="QGridLayout">
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLineEdit" name="localAddress"/> <widget class="QLineEdit" name="localAddress"/>
</item> </item>
@ -744,21 +739,18 @@
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="3" column="0">
<widget class="QCheckBox" name="allowTunnelConnectionCB"> <spacer name="verticalSpacer">
<property name="toolTip"> <property name="orientation">
<string>If you unckeck this, RetroShare will not use tunnel connection between peers that are firewalled and cannot connect directly. This is independant from F2F routing (turtle router).</string> <enum>Qt::Vertical</enum>
</property> </property>
<property name="text"> <property name="sizeHint" stdset="0">
<string>Allow Tunnel Connection</string> <size>
<width>20</width>
<height>40</height>
</size>
</property> </property>
<property name="checked"> </spacer>
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -768,19 +760,6 @@
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>IP check service</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QListWidget" name="IPServersLV">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="allowIpDeterminationCB"> <widget class="QCheckBox" name="allowIpDeterminationCB">
<property name="toolTip"> <property name="toolTip">
<string>If you unckeck this, RetroShare can only determine your IP <string>If you unckeck this, RetroShare can only determine your IP
@ -796,7 +775,11 @@ behind a firewall or a VPN.</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="1" column="0">
<widget class="QListWidget" name="IPServersLV">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -1,89 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2009 RetroShare Team
*
* 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 "dhtstatus.h"
#include <QtGui>
#include <QString>
#include <QLayout>
#include <QLabel>
#include <QIcon>
#include <QPainter>
#include <QPixmap>
#include "rsiface/rsiface.h"
#include "rsiface/rspeers.h"
#include <sstream>
#include <iomanip>
DHTStatus::DHTStatus(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *hbox = new QHBoxLayout();
hbox->setMargin(0);
hbox->setSpacing(6);
statusDHT = new QLabel( tr("<strong>DHT:</strong>"), this );
//statusDHT->setMinimumSize( statusPeers->frameSize().width() + 0, 0 );
hbox->addWidget(statusDHT);
iconLabel = new QLabel( this );
iconLabel->setPixmap(QPixmap::QPixmap(":/images/grayled.png"));
// iconLabel doesn't change over time, so we didn't need a minimum size
hbox->addWidget(iconLabel);
setLayout( hbox );
}
DHTStatus::~DHTStatus()
{
}
void DHTStatus::getDHTStatus()
{
rsiface->lockData(); /* Lock Interface */
/* now the extra bit .... switch on check boxes */
const RsConfig &config = rsiface->getConfig();
if (config.netDhtOk)
{
iconLabel->setPixmap(QPixmap::QPixmap(":/images/greenled.png"));
iconLabel->setToolTip(tr("DHT OK"));
}
else
{
iconLabel->setPixmap(QPixmap::QPixmap(":/images/redled.png"));
iconLabel->setToolTip(tr("DHT DOWN"));
}
rsiface->unlockData(); /* UnLock Interface */
}

View file

@ -1,45 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2009 RetroShare Team
*
* 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.
****************************************************************/
#ifndef DHTSTATUS_H
#define DHTSTATUS_H
#include "gui/MainWindow.h"
#include <QWidget>
class DHTStatus : public QWidget
{
Q_OBJECT
public:
DHTStatus(QWidget *parent = 0);
~DHTStatus();
void getDHTStatus( );
private:
class QLabel *iconLabel, *statusDHT;
};
#endif