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

@ -796,16 +796,7 @@ 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,58 +526,43 @@
</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> <item>
<layout class="QHBoxLayout"> <spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</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> <item>
<widget class="QComboBox" name="dhtComboBox"> <property name="text">
<item> <string>Discovery Enabled</string>
<property name="text"> </property>
<string>DHT Enabled</string>
</property>
</item>
<item>
<property name="text">
<string>DHT Disabled</string>
</property>
</item>
</widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="discComboBox"> <property name="text">
<item> <string>Discovery Disabled</string>
<property name="text"> </property>
<string>Discovery Enabled</string>
</property>
</item>
<item>
<property name="text">
<string>Discovery Disabled</string>
</property>
</item>
</widget>
</item> </item>
</layout> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -660,106 +648,110 @@
<string>Network Configuration</string> <string>Network Configuration</string>
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="0" column="0"> <item row="2" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QCheckBox" name="allowTunnelConnectionCB">
<property name="sizePolicy"> <property name="toolTip">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <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>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="title"> <property name="text">
<string>Network Configuration</string> <string>Allow Tunnel Connection</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Local Address</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>External Address</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLineEdit" name="localAddress"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="localPort">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7812</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="extAddress"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="extPort">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7812</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<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>
</layout>
</widget> </widget>
</item> </item>
<item row="0" column="0">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Local Address</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>External Address</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout">
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLineEdit" name="localAddress"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="localPort">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7812</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="extAddress"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="extPort">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7812</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<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 class="QWidget" name="tab_2"> <widget class="QWidget" name="tab_2">
@ -768,35 +760,26 @@
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox_4"> <widget class="QCheckBox" name="allowIpDeterminationCB">
<property name="title"> <property name="toolTip">
<string>IP check service</string> <string>If you unckeck this, RetroShare can only determine your IP
</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">
<property name="toolTip">
<string>If you unckeck this, RetroShare can only determine your IP
when you connect to somebody. Leaving this checked helps when you connect to somebody. Leaving this checked helps
connecting when you have few friends. It also helps if you're connecting when you have few friends. It also helps if you're
behind a firewall or a VPN.</string> behind a firewall or a VPN.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Allow RetroShare to ask my ip to these websites:</string> <string>Allow RetroShare to ask my ip to these websites:</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</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