Merge pull request #892 from PhenomRetroShare/Add_MoveRelayPageToNetwork

Move Relay setting page to network one.
This commit is contained in:
csoler 2017-06-22 00:39:03 +02:00 committed by GitHub
commit 8950acc701
8 changed files with 721 additions and 845 deletions

View File

@ -1,281 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006 - 2010 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 "RelayPage.h"
#include "rshare.h"
#include <iostream>
#include <retroshare/rsiface.h>
#include <retroshare/rsfiles.h>
#include <retroshare/rspeers.h>
#include <retroshare/rsdht.h>
#include "util/misc.h"
#include <QTimer>
RelayPage::RelayPage(QWidget * parent, Qt::WindowFlags flags)
: ConfigPage(parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
QObject::connect(ui.noFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.noFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.noGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.bandFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.bandFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.bandGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.addPushButton,SIGNAL(clicked()),this,SLOT(addServer()));
QObject::connect(ui.removePushButton,SIGNAL(clicked()),this,SLOT(removeServer()));
QObject::connect(ui.DhtLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(checkKey()));
QObject::connect(ui.enableCheckBox,SIGNAL(stateChanged(int)),this,SLOT(updateEnabled()));
QObject::connect(ui.serverCheckBox,SIGNAL(stateChanged(int)),this,SLOT(updateEnabled()));
QObject::connect(ui.noFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.bandFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.noFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.bandFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.noGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.bandGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.enableCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
QObject::connect(ui.serverCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
}
QString RelayPage::helpText() const
{
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Relays</h1> \
<p>By activating relays, you allow your Retroshare node to act as a bridge between Retroshare \
users who cannot connect directly, e.g. because they're firewalled.</p> \
<p>You may choose to act as a relay by checking <i>enable relay connections</i>, or simply \
benefit from other peers acting as relay, by checking <i>use relay servers</i>. For the former,\
you may specify the bandwidth allocated when acting as a relay for friends of you, for friends \
of your friends, or anyone in the Retroshare network.</p> \
<p>In any case, a Retroshare node acting as a relay cannot see the relayed traffic, since it \
is encrypted and authenticated by the two relayed nodes.</p>") ;
}
void RelayPage::updateTotals()
{
int nFriends = ui.noFriendSpinBox->value();
int friendBandwidth = ui.bandFriendSpinBox->value();
int nFOF = ui.noFOFSpinBox->value();
int fofBandwidth = ui.bandFOFSpinBox->value();
int nGeneral = ui.noGeneralSpinBox->value();
int genBandwidth = ui.bandGeneralSpinBox->value();
int total = nFriends + nFOF + nGeneral;
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_ALL, total, 0);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, nFriends, 1024 * friendBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FOF, nFOF, 1024 * fofBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, nGeneral, 1024 * genBandwidth);
}
/** Saves the changes on this page */
void RelayPage::updateRelayMode()
{
uint32_t relayMode = 0;
if (ui.enableCheckBox->isChecked())
{
relayMode |= RSDHT_RELAY_ENABLED;
if (ui.serverCheckBox->isChecked())
{
relayMode |= RSDHT_RELAY_MODE_ON;
}
else
{
relayMode |= RSDHT_RELAY_MODE_OFF;
}
}
else
{
relayMode |= RSDHT_RELAY_MODE_OFF;
}
rsDht->setRelayMode(relayMode);
}
/** Loads the settings for this page */
void RelayPage::load()
{
uint32_t count;
uint32_t bandwidth;
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, count, bandwidth);
whileBlocking(ui.noFriendSpinBox)->setValue(count);
whileBlocking(ui.bandFriendSpinBox)->setValue(bandwidth / 1024);
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FOF, count, bandwidth);
whileBlocking(ui.noFOFSpinBox)->setValue(count);
whileBlocking(ui.bandFOFSpinBox)->setValue(bandwidth / 1024);
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, count, bandwidth);
whileBlocking(ui.noGeneralSpinBox)->setValue(count);
whileBlocking(ui.bandGeneralSpinBox)->setValue(bandwidth / 1024);
updateTotals();
uint32_t relayMode = rsDht->getRelayMode();
if (relayMode & RSDHT_RELAY_ENABLED)
{
whileBlocking(ui.enableCheckBox)->setCheckState(Qt::Checked);
if ((relayMode & RSDHT_RELAY_MODE_MASK) == RSDHT_RELAY_MODE_OFF)
{
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked);
}
else
{
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Checked);
}
}
else
{
whileBlocking(ui.enableCheckBox)->setCheckState(Qt::Unchecked);
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked);
}
loadServers();
updateRelayOptions();
updateEnabled();
checkKey();
}
void RelayPage::loadServers()
{
std::list<std::string> servers;
std::list<std::string>::iterator it;
rsDht->getRelayServerList(servers);
ui.serverTreeWidget->clear();
for(it = servers.begin(); it != servers.end(); ++it)
{
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0, Qt::DisplayRole, QString::fromStdString(*it));
ui.serverTreeWidget->addTopLevelItem(item);
}
}
void RelayPage::updateRelayOptions()
{
int nFriends = ui.noFriendSpinBox->value();
int friendBandwidth = ui.bandFriendSpinBox->value();
int nFOF = ui.noFOFSpinBox->value();
int fofBandwidth = ui.bandFOFSpinBox->value();
int nGeneral = ui.noGeneralSpinBox->value();
int genBandwidth = ui.bandGeneralSpinBox->value();
ui.totalFriendLineEdit->setText(QString::number(nFriends * friendBandwidth * 2));
ui.totalFOFLineEdit->setText(QString::number(nFOF * fofBandwidth * 2));
ui.totalGeneralLineEdit->setText(QString::number(nGeneral * genBandwidth * 2));
ui.totalBandwidthLineEdit->setText(QString::number((nFriends * friendBandwidth + nFOF * fofBandwidth + nGeneral * genBandwidth) * 2));
ui.noTotalLineEdit->setText(QString::number(nFriends + nFOF + nGeneral));
}
void RelayPage::updateEnabled()
{
std::cerr << "RelayPage::updateEnabled()" << std::endl;
if (ui.enableCheckBox->isChecked())
{
ui.relayOptionGBox->setEnabled(true);
if (ui.serverCheckBox->isChecked())
{
std::cerr << "RelayPage::updateEnabled() Both Enabled" << std::endl;
ui.serverGroupBox->setEnabled(true);
}
else
{
std::cerr << "RelayPage::updateEnabled() Options Only Enabled" << std::endl;
ui.serverGroupBox->setEnabled(false);
}
}
else
{
std::cerr << "RelayPage::updateEnabled() Both Disabled" << std::endl;
ui.relayOptionGBox->setEnabled(false);
ui.serverGroupBox->setEnabled(false);
}
}
void RelayPage::checkKey()
{
std::string server = ui.DhtLineEdit->text().toStdString();
std::cerr << "RelayPage::checkKey() length: " << server.length();
std::cerr << std::endl;
if (server.length() == 40)
{
ui.keyOkBox->setChecked(Qt::Checked);
}
else
{
ui.keyOkBox->setChecked(Qt::Unchecked);
}
}
void RelayPage::addServer()
{
std::cerr << "RelayPage::addServer()";
std::cerr << std::endl;
if (!ui.keyOkBox->isChecked())
{
return;
}
std::string server = ui.DhtLineEdit->text().toStdString();
bool ok = rsDht->addRelayServer(server);
if (ok)
{
ui.DhtLineEdit->setText(QString(""));
}
loadServers();
}
void RelayPage::removeServer()
{
QTreeWidgetItem *item = ui.serverTreeWidget->currentItem();
if (item)
{
std::string server = item->data(0, Qt::DisplayRole).toString().toStdString();
rsDht->removeRelayServer(server);
}
loadServers();
}

View File

@ -1,61 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006 - 2010 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 RELAYPAGE_H
#define RELAYPAGE_H
# include <QWidget>
#include <retroshare-gui/configpage.h>
#include "ui_RelayPage.h"
class RelayPage: public ConfigPage
{
Q_OBJECT
public:
RelayPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~RelayPage() {}
/** Loads the settings for this page */
virtual void load();
virtual QPixmap iconPixmap() const { return QPixmap(":/icons/settings/server.svg") ; }
virtual QString pageName() const { return tr("Relay") ; }
virtual QString helpText() const ;
public slots:
void updateRelayOptions();
void updateEnabled();
void checkKey();
void addServer();
void removeServer();
void loadServers();
void updateTotals();
void updateRelayMode();
private:
Ui::RelayPage ui;
};
#endif //RELAYPAGE_H

View File

@ -1,416 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RelayPage</class>
<widget class="QWidget" name="RelayPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>794</width>
<height>546</height>
</rect>
</property>
<layout class="QVBoxLayout" name="RelayPageVLayout">
<item>
<layout class="QHBoxLayout" name="topHLayout">
<item>
<widget class="QCheckBox" name="enableCheckBox">
<property name="text">
<string>Enable Relay Connections</string>
</property>
</widget>
</item>
<item>
<spacer name="topLeftHSpacer">
<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="QCheckBox" name="serverCheckBox">
<property name="text">
<string>Use Relay Servers</string>
</property>
</widget>
</item>
<item>
<spacer name="topRightHSpacer">
<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>
</item>
<item>
<widget class="QGroupBox" name="relayOptionGBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Relay options</string>
</property>
<layout class="QGridLayout" name="relayOptionGBoxGLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<spacer name="optionHeaderLHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>110</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLabel" name="headerNumberLabel">
<property name="text">
<string>Number</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="optionHeaderRHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>6</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QLabel" name="headerBandwidthLabel">
<property name="text">
<string>Bandwidth per link</string>
</property>
</widget>
</item>
<item row="0" column="4" rowspan="7">
<widget class="Line" name="totalVLine">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="headerTotalLabel">
<property name="text">
<string>Total Bandwidth</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2">
<widget class="QLabel" name="friendLabel">
<property name="text">
<string>Friends</string>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2">
<widget class="QSpinBox" name="noFriendSpinBox">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="2" rowspan="2">
<widget class="QLabel" name="xFriendLabel">
<property name="text">
<string notr="true">x</string>
</property>
</widget>
</item>
<item row="1" column="3" rowspan="2">
<widget class="QSpinBox" name="bandFriendSpinBox">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QLineEdit" name="totalFriendLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" rowspan="2">
<widget class="QLabel" name="fofLabel">
<property name="text">
<string>Friends of Friends</string>
</property>
</widget>
</item>
<item row="3" column="1" rowspan="2">
<widget class="QSpinBox" name="noFOFSpinBox">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="2" rowspan="2">
<widget class="QLabel" name="xFOFLabel">
<property name="text">
<string notr="true">x</string>
</property>
</widget>
</item>
<item row="3" column="3" rowspan="2">
<widget class="QSpinBox" name="bandFOFSpinBox">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="4" column="5">
<widget class="QLineEdit" name="totalFOFLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" rowspan="2">
<widget class="QLabel" name="generalLabel">
<property name="text">
<string>General</string>
</property>
</widget>
</item>
<item row="5" column="1" rowspan="2">
<widget class="QSpinBox" name="noGeneralSpinBox">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="5" column="2" rowspan="2">
<widget class="QLabel" name="xGeneralLabel">
<property name="text">
<string notr="true">x</string>
</property>
</widget>
</item>
<item row="5" column="3" rowspan="2">
<widget class="QSpinBox" name="bandGeneralSpinBox">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="6" column="5">
<widget class="QLineEdit" name="totalGeneralLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0" colspan="6">
<widget class="Line" name="totalHLine">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="totalLabel">
<property name="text">
<string>Total:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="noTotalLineEdit">
<property name="focusPolicy">
<enum>Qt::WheelFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="2" colspan="2">
<spacer name="totalHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>123</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="5">
<widget class="QLineEdit" name="totalBandwidthLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0" colspan="6">
<widget class="QLabel" name="warningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"> border: 1px solid #DCDC41;
border-radius: 6px;
background: #FFFFD7;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
</string>
</property>
<property name="text">
<string>Warning: This bandwidth adds up to the max bandwidth.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="serverGroupBox">
<property name="title">
<string>Relay Server Setup</string>
</property>
<layout class="QGridLayout" name="serverGroupBoxGLayout">
<item row="0" column="0">
<widget class="QLineEdit" name="DhtLineEdit">
<property name="inputMask">
<string notr="true">HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="keyOkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="addPushButton">
<property name="text">
<string>Add Server</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QTreeWidget" name="serverTreeWidget">
<column>
<property name="text">
<string>Server DHT Key</string>
</property>
</column>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="removePushButton">
<property name="text">
<string>Remove Server</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="mainVSpacer">
<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>
<resources/>
<connections/>
</ui>

View File

@ -29,10 +29,11 @@
#include <iostream>
#include <retroshare/rsbanlist.h>
#include <retroshare/rsconfig.h>
#include <retroshare/rsdht.h>
#include <retroshare/rspeers.h>
#include <retroshare/rsturtle.h>
#include <retroshare/rsbanlist.h>
#include <QMovie>
#include <QMenu>
@ -170,6 +171,32 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
connect(ui.totalUploadRate, SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
//Relay Tab
QObject::connect(ui.noFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.noFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.noGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.bandFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.bandFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.bandGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions()));
QObject::connect(ui.addPushButton,SIGNAL(clicked()),this,SLOT(addServer()));
QObject::connect(ui.removePushButton,SIGNAL(clicked()),this,SLOT(removeServer()));
QObject::connect(ui.DhtLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(checkKey()));
QObject::connect(ui.enableCheckBox,SIGNAL(stateChanged(int)),this,SLOT(updateEnabled()));
QObject::connect(ui.serverCheckBox,SIGNAL(stateChanged(int)),this,SLOT(updateEnabled()));
QObject::connect(ui.noFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.bandFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.noFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.bandFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.noGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.bandGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
QObject::connect(ui.enableCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
QObject::connect(ui.serverCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
}
void ServerPage::saveAndTestInProxy()
@ -373,6 +400,49 @@ void ServerPage::load()
updateOutProxyIndicator();
}
//Relay Tab
uint32_t count;
uint32_t bandwidth;
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, count, bandwidth);
whileBlocking(ui.noFriendSpinBox)->setValue(count);
whileBlocking(ui.bandFriendSpinBox)->setValue(bandwidth / 1024);
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FOF, count, bandwidth);
whileBlocking(ui.noFOFSpinBox)->setValue(count);
whileBlocking(ui.bandFOFSpinBox)->setValue(bandwidth / 1024);
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, count, bandwidth);
whileBlocking(ui.noGeneralSpinBox)->setValue(count);
whileBlocking(ui.bandGeneralSpinBox)->setValue(bandwidth / 1024);
updateTotals();
uint32_t relayMode = rsDht->getRelayMode();
if (relayMode & RSDHT_RELAY_ENABLED)
{
whileBlocking(ui.enableCheckBox)->setCheckState(Qt::Checked);
if ((relayMode & RSDHT_RELAY_MODE_MASK) == RSDHT_RELAY_MODE_OFF)
{
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked);
}
else
{
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Checked);
}
}
else
{
whileBlocking(ui.enableCheckBox)->setCheckState(Qt::Unchecked);
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked);
}
loadServers();
updateRelayOptions();
updateEnabled();
checkKey();
}
void ServerPage::toggleAutoIncludeFriends(bool b)
@ -1732,3 +1802,161 @@ void ServerPage::handleNetworkReply(QNetworkReply *reply)
reply->close();
}
//#####################################################################
//## Relay Tab
//#####################################################################
void ServerPage::updateTotals()
{
int nFriends = ui.noFriendSpinBox->value();
int friendBandwidth = ui.bandFriendSpinBox->value();
int nFOF = ui.noFOFSpinBox->value();
int fofBandwidth = ui.bandFOFSpinBox->value();
int nGeneral = ui.noGeneralSpinBox->value();
int genBandwidth = ui.bandGeneralSpinBox->value();
int total = nFriends + nFOF + nGeneral;
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_ALL, total, 0);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, nFriends, 1024 * friendBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FOF, nFOF, 1024 * fofBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, nGeneral, 1024 * genBandwidth);
}
/** Saves the changes on this page */
void ServerPage::updateRelayMode()
{
uint32_t relayMode = 0;
if (ui.enableCheckBox->isChecked())
{
relayMode |= RSDHT_RELAY_ENABLED;
if (ui.serverCheckBox->isChecked())
{
relayMode |= RSDHT_RELAY_MODE_ON;
}
else
{
relayMode |= RSDHT_RELAY_MODE_OFF;
}
}
else
{
relayMode |= RSDHT_RELAY_MODE_OFF;
}
rsDht->setRelayMode(relayMode);
}
void ServerPage::loadServers()
{
std::list<std::string> servers;
std::list<std::string>::iterator it;
rsDht->getRelayServerList(servers);
ui.serverTreeWidget->clear();
for(it = servers.begin(); it != servers.end(); ++it)
{
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0, Qt::DisplayRole, QString::fromStdString(*it));
ui.serverTreeWidget->addTopLevelItem(item);
}
}
void ServerPage::updateRelayOptions()
{
int nFriends = ui.noFriendSpinBox->value();
int friendBandwidth = ui.bandFriendSpinBox->value();
int nFOF = ui.noFOFSpinBox->value();
int fofBandwidth = ui.bandFOFSpinBox->value();
int nGeneral = ui.noGeneralSpinBox->value();
int genBandwidth = ui.bandGeneralSpinBox->value();
ui.totalFriendLineEdit->setText(QString::number(nFriends * friendBandwidth * 2));
ui.totalFOFLineEdit->setText(QString::number(nFOF * fofBandwidth * 2));
ui.totalGeneralLineEdit->setText(QString::number(nGeneral * genBandwidth * 2));
ui.totalBandwidthLineEdit->setText(QString::number((nFriends * friendBandwidth + nFOF * fofBandwidth + nGeneral * genBandwidth) * 2));
ui.noTotalLineEdit->setText(QString::number(nFriends + nFOF + nGeneral));
}
void ServerPage::updateEnabled()
{
std::cerr << "RelayPage::updateEnabled()" << std::endl;
if (ui.enableCheckBox->isChecked())
{
ui.relayOptionGBox->setEnabled(true);
if (ui.serverCheckBox->isChecked())
{
std::cerr << "RelayPage::updateEnabled() Both Enabled" << std::endl;
ui.serverGroupBox->setEnabled(true);
}
else
{
std::cerr << "RelayPage::updateEnabled() Options Only Enabled" << std::endl;
ui.serverGroupBox->setEnabled(false);
}
}
else
{
std::cerr << "RelayPage::updateEnabled() Both Disabled" << std::endl;
ui.relayOptionGBox->setEnabled(false);
ui.serverGroupBox->setEnabled(false);
}
}
void ServerPage::checkKey()
{
std::string server = ui.DhtLineEdit->text().toStdString();
std::cerr << "RelayPage::checkKey() length: " << server.length();
std::cerr << std::endl;
if (server.length() == 40)
{
ui.keyOkBox->setChecked(Qt::Checked);
}
else
{
ui.keyOkBox->setChecked(Qt::Unchecked);
}
}
void ServerPage::addServer()
{
std::cerr << "RelayPage::addServer()";
std::cerr << std::endl;
if (!ui.keyOkBox->isChecked())
{
return;
}
std::string server = ui.DhtLineEdit->text().toStdString();
bool ok = rsDht->addRelayServer(server);
if (ok)
{
ui.DhtLineEdit->setText(QString(""));
}
loadServers();
}
void ServerPage::removeServer()
{
QTreeWidgetItem *item = ui.serverTreeWidget->currentItem();
if (item)
{
std::string server = item->data(0, Qt::DisplayRole).toString().toStdString();
rsDht->removeRelayServer(server);
}
loadServers();
}

View File

@ -114,6 +114,16 @@ private slots:
void connectionWithoutCert();
//Relay Tab
void updateRelayOptions();
void updateEnabled();
void checkKey();
void addServer();
void removeServer();
void loadServers();
void updateTotals();
void updateRelayMode();
// autoProxyCallback interface
public:
void taskFinished(taskTicket *&ticket);

View File

@ -811,7 +811,7 @@ behind a firewall or a VPN.</string>
<attribute name="title">
<string>Hidden Service Configuration</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="tabHiddenConfHLayout">
<item>
<widget class="QTabWidget" name="hiddenServiceTab">
<property name="sizePolicy">
@ -827,7 +827,7 @@ behind a firewall or a VPN.</string>
<attribute name="title">
<string>Outgoing Manual Tor/I2P</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="hiddenServiceTabManualVLayout">
<item>
<widget class="QLabel" name="hiddenpage_outHeader">
<property name="text">
@ -836,7 +836,7 @@ behind a firewall or a VPN.</string>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_4">
<layout class="QGridLayout" name="hiddenpage_proxyOKHLayoutGLayout">
<item row="0" column="2">
<widget class="QSpinBox" name="hiddenpage_proxyPort_tor">
<property name="toolTip">
@ -996,9 +996,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<attribute name="title">
<string>Automatic I2P/BOB</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_12">
<layout class="QVBoxLayout" name="hiddenServiceTabI2PBOBVLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<layout class="QHBoxLayout" name="bobHLayout">
<item>
<widget class="QCheckBox" name="cb_enableBob">
<property name="text">
@ -1007,7 +1007,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<spacer name="bobHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -1036,9 +1036,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<property name="title">
<string>I2P Basic Open Bridge</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QVBoxLayout" name="gbBobVLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_21">
<layout class="QHBoxLayout" name="i2pBobHLayout">
<property name="topMargin">
<number>0</number>
</property>
@ -1046,9 +1046,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_22">
<item>
<widget class="QLabel" name="label_17">
<widget class="QLabel" name="i2pInstAddLabel">
<property name="text">
<string>I2P Instance address</string>
</property>
@ -1068,7 +1066,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item>
<widget class="QLabel" name="label_22">
<widget class="QLabel" name="i2pProxyPortLabel">
<property name="text">
<string>I2P proxy port</string>
</property>
@ -1085,7 +1083,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_23">
<layout class="QHBoxLayout" name="bobAccHLayout">
<item>
<widget class="QLabel" name="iconlabel_i2p_outgoing_2">
<property name="text">
@ -1097,7 +1095,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item>
<widget class="QLabel" name="label_18">
<widget class="QLabel" name="bobAccLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This led is green when the port listen on the left is active on your computer. It does not&lt;/p&gt;&lt;p&gt;mean that your Retroshare traffic transits though I2P. It will do so only if &lt;/p&gt;&lt;p&gt;you connect to Hidden nodes, or if you are running a Hidden node yourself.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -1110,10 +1108,8 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<layout class="QHBoxLayout" name="bobB32AddrHLayout">
<item>
<widget class="QLabel" name="lBobB32Addr">
<property name="sizePolicy">
@ -1161,10 +1157,10 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<bool>true</bool>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_9">
<widget class="QWidget" name="gbBobSimplePage">
<layout class="QVBoxLayout" name="gbBobSimplePageVLayout">
<item>
<widget class="QPlainTextEdit" name="pteBobSimple">
<property name="sizePolicy">
@ -1193,14 +1189,14 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</item>
</layout>
</widget>
<widget class="QWidget" name="gbBobAdvancedPage1">
<layout class="QVBoxLayout" name="verticalLayout_8">
<widget class="QWidget" name="gbBobAdvancedPage">
<layout class="QVBoxLayout" name="gbBobAdvancedPageVLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<layout class="QVBoxLayout" name="bobAdvTunnelVLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<layout class="QHBoxLayout" name="bobAdvTunLenHLayout">
<item>
<widget class="QLabel" name="label_13">
<widget class="QLabel" name="bobAdvTunLenLabel">
<property name="text">
<string>Tunnel length (in/out)</string>
</property>
@ -1241,9 +1237,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<layout class="QHBoxLayout" name="bobAdvTunQuaHLayout">
<item>
<widget class="QLabel" name="label_21">
<widget class="QLabel" name="bobAdvTunQuaLabel">
<property name="text">
<string>Tunnel quantity (in/out)</string>
</property>
@ -1290,9 +1286,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<layout class="QHBoxLayout" name="bobAdvTunVarHLayout">
<item>
<widget class="QLabel" name="label_16">
<widget class="QLabel" name="bobAdvTunVarLabel">
<property name="text">
<string>Tunnel variance (in/out)</string>
</property>
@ -1338,11 +1334,11 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_13">
<layout class="QVBoxLayout" name="bobAdvServKeyVLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_25">
<layout class="QHBoxLayout" name="bobAdvServKeyHLayout">
<item>
<widget class="QLabel" name="label_20">
<widget class="QLabel" name="bobAdvServKeyLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -1355,7 +1351,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<spacer name="bobAdvServKeyHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -1399,9 +1395,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_24">
<layout class="QHBoxLayout" name="bobToolBarHLayout">
<item>
<spacer name="horizontalSpacer_4">
<spacer name="bobToolBarHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -1457,7 +1453,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<spacer name="gbBobVSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -1475,7 +1471,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<attribute name="title">
<string>Incoming</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="hiddenServiceTabIncomingVLayout">
<item>
<widget class="QLabel" name="hiddenpage_inHeader">
<property name="text">
@ -1548,7 +1544,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget>
</item>
<item row="1" column="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="serviceIncomingHLayout">
<item>
<widget class="QLabel" name="iconlabel_service_incoming">
<property name="maximumSize">
@ -1673,6 +1669,411 @@ If you have issues connecting over Tor check the Tor logs too.</string>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabRelay">
<attribute name="title">
<string>Relay</string>
</attribute>
<layout class="QVBoxLayout" name="RelayPageVLayout">
<item>
<layout class="QHBoxLayout" name="relayTopHLayout">
<item>
<widget class="QCheckBox" name="enableCheckBox">
<property name="text">
<string>Enable Relay Connections</string>
</property>
</widget>
</item>
<item>
<spacer name="relayTopLeftHSpacer">
<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="QCheckBox" name="serverCheckBox">
<property name="text">
<string>Use Relay Servers</string>
</property>
</widget>
</item>
<item>
<spacer name="relayTopRightHSpacer">
<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>
</item>
<item>
<widget class="QGroupBox" name="relayOptionGBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Relay options</string>
</property>
<layout class="QGridLayout" name="relayOptionGBoxGLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<spacer name="optionHeaderLHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>110</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLabel" name="headerNumberLabel">
<property name="text">
<string>Number</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="optionHeaderRHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>6</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QLabel" name="headerBandwidthLabel">
<property name="text">
<string>Bandwidth per link</string>
</property>
</widget>
</item>
<item row="0" column="4" rowspan="7">
<widget class="Line" name="totalVLine">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="headerTotalLabel">
<property name="text">
<string>Total Bandwidth</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2">
<widget class="QLabel" name="friendLabel">
<property name="text">
<string>Friends</string>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2">
<widget class="QSpinBox" name="noFriendSpinBox">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="2" rowspan="2">
<widget class="QLabel" name="xFriendLabel">
<property name="text">
<string notr="true">x</string>
</property>
</widget>
</item>
<item row="1" column="3" rowspan="2">
<widget class="QSpinBox" name="bandFriendSpinBox">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QLineEdit" name="totalFriendLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" rowspan="2">
<widget class="QLabel" name="fofLabel">
<property name="text">
<string>Friends of Friends</string>
</property>
</widget>
</item>
<item row="3" column="1" rowspan="2">
<widget class="QSpinBox" name="noFOFSpinBox">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="2" rowspan="2">
<widget class="QLabel" name="xFOFLabel">
<property name="text">
<string notr="true">x</string>
</property>
</widget>
</item>
<item row="3" column="3" rowspan="2">
<widget class="QSpinBox" name="bandFOFSpinBox">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="4" column="5">
<widget class="QLineEdit" name="totalFOFLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" rowspan="2">
<widget class="QLabel" name="generalLabel">
<property name="text">
<string>General</string>
</property>
</widget>
</item>
<item row="5" column="1" rowspan="2">
<widget class="QSpinBox" name="noGeneralSpinBox">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="5" column="2" rowspan="2">
<widget class="QLabel" name="xGeneralLabel">
<property name="text">
<string notr="true">x</string>
</property>
</widget>
</item>
<item row="5" column="3" rowspan="2">
<widget class="QSpinBox" name="bandGeneralSpinBox">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="6" column="5">
<widget class="QLineEdit" name="totalGeneralLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0" colspan="6">
<widget class="Line" name="totalHLine">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="totalLabel">
<property name="text">
<string>Total:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="noTotalLineEdit">
<property name="focusPolicy">
<enum>Qt::WheelFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="2" colspan="2">
<spacer name="totalHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>123</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="5">
<widget class="QLineEdit" name="totalBandwidthLineEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0" colspan="6">
<widget class="QLabel" name="warningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"> border: 1px solid #DCDC41;
border-radius: 6px;
background: #FFFFD7;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
</string>
</property>
<property name="text">
<string>Warning: This bandwidth adds up to the max bandwidth.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="serverGroupBox">
<property name="title">
<string>Relay Server Setup</string>
</property>
<layout class="QGridLayout" name="serverGroupBoxGLayout">
<item row="0" column="0">
<widget class="QLineEdit" name="DhtLineEdit">
<property name="inputMask">
<string notr="true">HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="keyOkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="addPushButton">
<property name="text">
<string>Add Server</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QTreeWidget" name="serverTreeWidget">
<column>
<property name="text">
<string>Server DHT Key</string>
</property>
</column>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="removePushButton">
<property name="text">
<string>Remove Server</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="relayVSpacer">
<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>
</item>
</layout>

View File

@ -32,7 +32,6 @@
#include "FileAssociationsPage.h"
#include "SoundPage.h"
#include "TransferPage.h"
#include "RelayPage.h"
#include "ChatPage.h"
#include "ChannelPage.h"
#include "PeoplePage.h"
@ -156,7 +155,6 @@ SettingsPage::initStackedWidget()
addPage(new ForumPage()); // FORUMS
addPage(new PostedPage()); // POSTED RENAME TO LINKS
addPage(new NotifyPage()); // NOTIFY
addPage(new RelayPage() ); // RELAY SHOUD BE INSIDE NETWORK AS A TAB
addPage(new PluginsPage() ); // PLUGINS
addPage(new AppearancePage()); // APPEARENCE
addPage(new SoundPage() ); // SOUND

View File

@ -460,7 +460,6 @@ HEADERS += rshare.h \
gui/settings/ChatPage.h \
gui/settings/ChannelPage.h \
gui/settings/PostedPage.h \
gui/settings/RelayPage.h \
gui/settings/ServicePermissionsPage.h \
gui/settings/AddFileAssociationDialog.h \
gui/settings/GroupFrameSettingsWidget.h \
@ -643,7 +642,6 @@ FORMS += gui/StartDialog.ui \
gui/settings/ChatPage.ui \
gui/settings/ChannelPage.ui \
gui/settings/PostedPage.ui \
gui/settings/RelayPage.ui \
gui/settings/ServicePermissionsPage.ui \
gui/settings/PluginItem.ui \
gui/settings/GroupFrameSettingsWidget.ui \
@ -870,7 +868,6 @@ SOURCES += main.cpp \
gui/settings/ChatPage.cpp \
gui/settings/ChannelPage.cpp \
gui/settings/PostedPage.cpp \
gui/settings/RelayPage.cpp \
gui/settings/ServicePermissionsPage.cpp \
gui/settings/AddFileAssociationDialog.cpp \
gui/settings/GroupFrameSettingsWidget.cpp \