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/helptextbrowser.h \
gui/statusbar/peerstatus.h \
gui/statusbar/dhtstatus.h \
gui/statusbar/natstatus.h \
gui/statusbar/ratesstatus.h \
gui/advsearch/advancedsearchdialog.h \
@ -396,7 +395,6 @@ SOURCES += main.cpp \
gui/common/rwindow.cpp \
gui/common/html.cpp \
gui/statusbar/peerstatus.cpp \
gui/statusbar/dhtstatus.cpp \
gui/statusbar/natstatus.cpp \
gui/statusbar/ratesstatus.cpp \
gui/toaster/ChatToaster.cpp \

View File

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

View File

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

View File

@ -797,15 +797,6 @@ void NetworkDialog::updateNetworkStatus()
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)
{
ui.iconlabel_udp->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));

View File

@ -294,33 +294,6 @@
</item>
</layout>
</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>
</item>
</layout>

View File

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

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>467</width>
<height>448</height>
<height>394</height>
</rect>
</property>
<property name="sizePolicy">
@ -504,16 +504,19 @@
</sizepolicy>
</property>
<property name="title">
<string>Network Configuration (takes effect after restart)</string>
<string>Network Configuration (restart not needed)</string>
</property>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QHBoxLayout"/>
</item>
<item>
<widget class="QComboBox" name="netModeComboBox">
<item>
<property name="text">
<string>Automatic</string>
<string>Automatic (Upnp)</string>
</property>
</item>
<item>
@ -523,58 +526,43 @@
</item>
<item>
<property name="text">
<string>Forwarded Port</string>
<string>Manual Forwarded Port</string>
</property>
</item>
</widget>
</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>
<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>
<property name="text">
<string>Discovery Enabled</string>
</property>
</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>
<property name="text">
<string>Discovery Disabled</string>
</property>
</item>
</layout>
</widget>
</item>
</layout>
</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>
</widget>
</item>
@ -660,106 +648,110 @@
<string>Network Configuration</string>
</attribute>
<layout class="QGridLayout">
<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>
<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="title">
<string>Network Configuration</string>
<property name="text">
<string>Allow Tunnel Connection</string>
</property>
<property name="checked">
<bool>true</bool>
</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>
</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>
</widget>
<widget class="QWidget" name="tab_2">
@ -768,35 +760,26 @@
</attribute>
<layout class="QGridLayout">
<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">
<property name="toolTip">
<string>If you unckeck this, RetroShare can only determine your IP
<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
connecting when you have few friends. It also helps if you're
behind a firewall or a VPN.</string>
</property>
<property name="text">
<string>Allow RetroShare to ask my ip to these websites:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</property>
<property name="text">
<string>Allow RetroShare to ask my ip to these websites:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QListWidget" name="IPServersLV">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
</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