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 <iostream>
#include <retroshare/rsbanlist.h>
#include <retroshare/rsconfig.h> #include <retroshare/rsconfig.h>
#include <retroshare/rsdht.h>
#include <retroshare/rspeers.h> #include <retroshare/rspeers.h>
#include <retroshare/rsturtle.h> #include <retroshare/rsturtle.h>
#include <retroshare/rsbanlist.h>
#include <QMovie> #include <QMovie>
#include <QMenu> #include <QMenu>
@ -170,6 +171,32 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates())); connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
connect(ui.totalUploadRate, 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() void ServerPage::saveAndTestInProxy()
@ -373,6 +400,49 @@ void ServerPage::load()
updateOutProxyIndicator(); 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) void ServerPage::toggleAutoIncludeFriends(bool b)
@ -1732,3 +1802,161 @@ void ServerPage::handleNetworkReply(QNetworkReply *reply)
reply->close(); 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(); void connectionWithoutCert();
//Relay Tab
void updateRelayOptions();
void updateEnabled();
void checkKey();
void addServer();
void removeServer();
void loadServers();
void updateTotals();
void updateRelayMode();
// autoProxyCallback interface // autoProxyCallback interface
public: public:
void taskFinished(taskTicket *&ticket); void taskFinished(taskTicket *&ticket);

View File

@ -811,7 +811,7 @@ behind a firewall or a VPN.</string>
<attribute name="title"> <attribute name="title">
<string>Hidden Service Configuration</string> <string>Hidden Service Configuration</string>
</attribute> </attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="tabHiddenConfHLayout">
<item> <item>
<widget class="QTabWidget" name="hiddenServiceTab"> <widget class="QTabWidget" name="hiddenServiceTab">
<property name="sizePolicy"> <property name="sizePolicy">
@ -827,7 +827,7 @@ behind a firewall or a VPN.</string>
<attribute name="title"> <attribute name="title">
<string>Outgoing Manual Tor/I2P</string> <string>Outgoing Manual Tor/I2P</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="hiddenServiceTabManualVLayout">
<item> <item>
<widget class="QLabel" name="hiddenpage_outHeader"> <widget class="QLabel" name="hiddenpage_outHeader">
<property name="text"> <property name="text">
@ -836,7 +836,7 @@ behind a firewall or a VPN.</string>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="hiddenpage_proxyOKHLayoutGLayout">
<item row="0" column="2"> <item row="0" column="2">
<widget class="QSpinBox" name="hiddenpage_proxyPort_tor"> <widget class="QSpinBox" name="hiddenpage_proxyPort_tor">
<property name="toolTip"> <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"> <attribute name="title">
<string>Automatic I2P/BOB</string> <string>Automatic I2P/BOB</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_12"> <layout class="QVBoxLayout" name="hiddenServiceTabI2PBOBVLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="bobHLayout">
<item> <item>
<widget class="QCheckBox" name="cb_enableBob"> <widget class="QCheckBox" name="cb_enableBob">
<property name="text"> <property name="text">
@ -1007,7 +1007,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_5"> <spacer name="bobHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -1036,9 +1036,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<property name="title"> <property name="title">
<string>I2P Basic Open Bridge</string> <string>I2P Basic Open Bridge</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="gbBobVLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_21"> <layout class="QHBoxLayout" name="i2pBobHLayout">
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -1046,74 +1046,70 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_22"> <widget class="QLabel" name="i2pInstAddLabel">
<property name="text">
<string>I2P Instance address</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="hiddenpage_proxyAddress_i2p_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="placeholderText">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="i2pProxyPortLabel">
<property name="text">
<string>I2P proxy port</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="hiddenpage_proxyPort_i2p_2">
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="bobAccHLayout">
<item> <item>
<widget class="QLabel" name="label_17"> <widget class="QLabel" name="iconlabel_i2p_outgoing_2">
<property name="text"> <property name="text">
<string>I2P Instance address</string> <string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/ledoff1.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="hiddenpage_proxyAddress_i2p_2"> <widget class="QLabel" name="bobAccLabel">
<property name="sizePolicy"> <property name="toolTip">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <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>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="placeholderText">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_22">
<property name="text"> <property name="text">
<string>I2P proxy port</string> <string>BOB accessible</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QSpinBox" name="hiddenpage_proxyPort_i2p_2">
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_23">
<item>
<widget class="QLabel" name="iconlabel_i2p_outgoing_2">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_18">
<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>
<property name="text">
<string>BOB accessible</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_14"> <layout class="QHBoxLayout" name="bobB32AddrHLayout">
<item> <item>
<widget class="QLabel" name="lBobB32Addr"> <widget class="QLabel" name="lBobB32Addr">
<property name="sizePolicy"> <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> <bool>true</bool>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="gbBobSimplePage">
<layout class="QVBoxLayout" name="verticalLayout_9"> <layout class="QVBoxLayout" name="gbBobSimplePageVLayout">
<item> <item>
<widget class="QPlainTextEdit" name="pteBobSimple"> <widget class="QPlainTextEdit" name="pteBobSimple">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1193,14 +1189,14 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="gbBobAdvancedPage1"> <widget class="QWidget" name="gbBobAdvancedPage">
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QVBoxLayout" name="gbBobAdvancedPageVLayout">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="bobAdvTunnelVLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_13"> <layout class="QHBoxLayout" name="bobAdvTunLenHLayout">
<item> <item>
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="bobAdvTunLenLabel">
<property name="text"> <property name="text">
<string>Tunnel length (in/out)</string> <string>Tunnel length (in/out)</string>
</property> </property>
@ -1241,9 +1237,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="bobAdvTunQuaHLayout">
<item> <item>
<widget class="QLabel" name="label_21"> <widget class="QLabel" name="bobAdvTunQuaLabel">
<property name="text"> <property name="text">
<string>Tunnel quantity (in/out)</string> <string>Tunnel quantity (in/out)</string>
</property> </property>
@ -1290,9 +1286,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="bobAdvTunVarHLayout">
<item> <item>
<widget class="QLabel" name="label_16"> <widget class="QLabel" name="bobAdvTunVarLabel">
<property name="text"> <property name="text">
<string>Tunnel variance (in/out)</string> <string>Tunnel variance (in/out)</string>
</property> </property>
@ -1338,11 +1334,11 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_13"> <layout class="QVBoxLayout" name="bobAdvServKeyVLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_25"> <layout class="QHBoxLayout" name="bobAdvServKeyHLayout">
<item> <item>
<widget class="QLabel" name="label_20"> <widget class="QLabel" name="bobAdvServKeyLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1355,7 +1351,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="bobAdvServKeyHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -1399,9 +1395,9 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_24"> <layout class="QHBoxLayout" name="bobToolBarHLayout">
<item> <item>
<spacer name="horizontalSpacer_4"> <spacer name="bobToolBarHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -1457,7 +1453,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_3"> <spacer name="gbBobVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -1475,7 +1471,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
<attribute name="title"> <attribute name="title">
<string>Incoming</string> <string>Incoming</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="hiddenServiceTabIncomingVLayout">
<item> <item>
<widget class="QLabel" name="hiddenpage_inHeader"> <widget class="QLabel" name="hiddenpage_inHeader">
<property name="text"> <property name="text">
@ -1548,7 +1544,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="1" column="3">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="serviceIncomingHLayout">
<item> <item>
<widget class="QLabel" name="iconlabel_service_incoming"> <widget class="QLabel" name="iconlabel_service_incoming">
<property name="maximumSize"> <property name="maximumSize">
@ -1673,6 +1669,411 @@ If you have issues connecting over Tor check the Tor logs too.</string>
</item> </item>
</layout> </layout>
</widget> </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> </widget>
</item> </item>
</layout> </layout>

View File

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

View File

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