* Enabled network configuration control from GUI.

* Added Safe configuration save before quit().
 * Updated libretroshare's interface files.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@337 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-02-07 16:20:14 +00:00
parent 806b8285f2
commit b7abbda1fb
5 changed files with 296 additions and 229 deletions

View File

@ -455,12 +455,14 @@ void MainWindow::doQuit()
if (confirm->result() == QDialog::Accepted) if (confirm->result() == QDialog::Accepted)
{ {
rsicontrol->ConfigFinalSave();
qApp->quit(); qApp->quit();
} else { } else {
delete confirm; delete confirm;
} }
} else { } else {
rsicontrol->ConfigFinalSave();
qApp->quit(); qApp->quit();
} }
} }

View File

@ -23,6 +23,7 @@
#include <rshare.h> #include <rshare.h>
#include "ServerDialog.h" #include "ServerDialog.h"
#include <iostream> #include <iostream>
#include <sstream>
#include "rsiface/rsiface.h" #include "rsiface/rsiface.h"
#include "rsiface/rspeers.h" #include "rsiface/rspeers.h"
@ -35,14 +36,13 @@ ServerDialog::ServerDialog(QWidget *parent)
{ {
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
/* Create RshareSettings object */
_settings = new RshareSettings();
connect( ui.ManualButton, SIGNAL( toggled( bool ) ), this, SLOT( toggleUPnP( ) ) ); /* Create RshareSettings object */
connect( ui.UPnPButton, SIGNAL( toggled( bool ) ), this, SLOT( toggleUPnP( ) ) ); _settings = new RshareSettings();
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -66,85 +66,104 @@ ServerDialog::save(QString &errmsg)
} }
/** Loads the settings for this page */ /** Loads the settings for this page */
void void ServerDialog::load()
ServerDialog::load()
{ {
/* get the shared directories */
rsiface->lockData(); /* Lock Interface */
/* set local address */ /* load up configuration from rsPeers */
ui.localAddress->setText(QString::fromStdString(rsiface->getConfig().localAddr)); RsPeerDetails detail;
ui.localPort -> setValue(rsiface->getConfig().localPort); if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail))
/* set the server address */
ui.extAddress->setText(QString::fromStdString(rsiface->getConfig().extAddr));
ui.extPort -> setValue(rsiface->getConfig().extPort);
/* set the flags */
ui.chkFirewall ->setChecked(rsiface->getConfig().firewalled);
ui.chkForwarded ->setChecked(rsiface->getConfig().forwardPort);
/* now handle networking options */
if (rsiface->getConfig().DHTActive)
{ {
ui.DHTButton -> setChecked(true); return;
}
else
{
ui.noDHTButton -> setChecked(true);
} }
int dhtPeers = rsiface->getConfig().DHTPeers; /* set net mode */
if (!dhtPeers) int netIndex = 0;
switch(detail.netMode)
{ {
ui.dhtStatus -> setText("DHT Off/Unavailable"); case RS_NETMODE_EXT:
} netIndex = 2;
else if (dhtPeers < 20)
{
ui.dhtStatus -> setText("DHT Initialising");
}
else
{
ui.dhtStatus -> setText("DHT Active");
}
switch(rsiface->getConfig().uPnPState)
{
case UPNP_STATE_ACTIVE:
ui.upnpStatus -> setText("Forwarding Active");
break; break;
case UPNP_STATE_FAILED_UDP: case RS_NETMODE_UDP:
ui.upnpStatus -> setText("TCP Active/UDP Failed"); netIndex = 1;
break; break;
case UPNP_STATE_FAILED_TCP:
ui.upnpStatus -> setText("Forwarding Failed");
break;
case UPNP_STATE_READY:
ui.upnpStatus -> setText("uPnP Ready");
break;
case UPNP_STATE_UNAVAILABILE:
ui.upnpStatus -> setText("uPnP Unavailable");
break;
case UPNP_STATE_UNINITIALISED:
default: default:
ui.upnpStatus -> setText("uPnP Uninitialised"); case RS_NETMODE_UPNP:
netIndex = 0;
break; break;
}
ui.netModeComboBox->setCurrentIndex(netIndex);
} /* set dht/disc */
ui.upnpStatus->setReadOnly(true); netIndex = 1;
ui.dhtStatus ->setReadOnly(true); if (detail.visState & RS_VS_DHT_ON)
if (rsiface->getConfig().uPnPActive)
{ {
/* flag uPnP */ netIndex = 0;
ui.UPnPButton->setChecked(true);
/* shouldn't fiddle with port */
} }
ui.dhtComboBox->setCurrentIndex(netIndex);
netIndex = 1;
if (detail.visState & RS_VS_DISC_ON)
{
netIndex = 0;
}
ui.discComboBox->setCurrentIndex(netIndex);
/* set the addresses */
/* set local address */
ui.localAddress->setText(QString::fromStdString(detail.localAddr));
ui.localPort -> setValue(detail.localPort);
/* set the server address */
ui.extAddress->setText(QString::fromStdString(detail.extAddr));
ui.extPort -> setValue(detail.extPort);
/* set status */
std::ostringstream out;
out << "Network Mode: ";
switch(detail.netMode)
{
case RS_NETMODE_EXT:
out << "External Forwarded Port (UltraPEER Mode)";
break;
case RS_NETMODE_UDP:
out << "Firewalled";
break;
default:
case RS_NETMODE_UPNP:
out << "Automatic: UPnP Forwarded Port";
break;
}
out << std::endl;
out << "\tLocal Address: " << detail.localAddr;
out << ":" << detail.localPort;
out << std::endl;
out << "\tExternal Address: " << detail.extAddr;
out << ":" << detail.extPort;
out << std::endl;
out << "UPnP Status: ";
out << std::endl;
out << "DHT Status: ";
if (detail.visState & RS_VS_DHT_ON)
out << " Enabled";
else else
{ out << " Disabled";
/* noobie */ out << std::endl;
ui.ManualButton->setChecked(true);
} out << "Discovery Status: ";
if (detail.visState & RS_VS_DISC_ON)
out << " Enabled";
else
out << " Disabled";
out << std::endl;
ui.netStatusBox->setText(QString::fromStdString(out.str()));
ui.netStatusBox ->setReadOnly(true);
rsiface->lockData(); /* Lock Interface */
ui.totalRate->setValue(rsiface->getConfig().maxDataRate); ui.totalRate->setValue(rsiface->getConfig().maxDataRate);
ui.indivRate->setValue(rsiface->getConfig().maxIndivDataRate); ui.indivRate->setValue(rsiface->getConfig().maxIndivDataRate);
@ -158,28 +177,32 @@ void ServerDialog::toggleUPnP()
{ {
/* switch on the radioButton */ /* switch on the radioButton */
bool settingChangeable = false; bool settingChangeable = false;
if (ui.ManualButton->isChecked()) if (0 != ui.netModeComboBox->currentIndex())
{ {
settingChangeable = true; settingChangeable = true;
} }
if (settingChangeable) if (settingChangeable)
{ {
ui.dhtComboBox->setEnabled(true);
// disabled until we've got it all working.
//ui.discComboBox->setEnabled(true);
ui.discComboBox->setEnabled(false);
ui.localAddress->setEnabled(true); ui.localAddress->setEnabled(true);
ui.localPort -> setEnabled(true); ui.localPort -> setEnabled(true);
ui.extAddress -> setEnabled(true); ui.extAddress -> setEnabled(true);
ui.extPort -> setEnabled(true); ui.extPort -> setEnabled(true);
ui.chkFirewall-> setEnabled(true);
ui.chkForwarded->setEnabled(true);
} }
else else
{ {
ui.dhtComboBox->setEnabled(false);
ui.discComboBox->setEnabled(false);
ui.localAddress->setEnabled(false); ui.localAddress->setEnabled(false);
ui.localPort -> setEnabled(false); ui.localPort -> setEnabled(false);
ui.extAddress -> setEnabled(false); ui.extAddress -> setEnabled(false);
ui.extPort -> setEnabled(false); ui.extPort -> setEnabled(false);
ui.chkFirewall-> setEnabled(false);
ui.chkForwarded->setEnabled(false);
} }
} }
@ -188,10 +211,57 @@ void ServerDialog::saveAddresses()
QString str; QString str;
bool saveAddr = false; bool saveAddr = false;
//rsicontrol -> NetworkDHTActive(ui.DHTButton->isChecked());
//rsicontrol -> NetworkUPnPActive(ui.UPnPButton->isChecked());
if (ui.ManualButton->isChecked())
RsPeerDetails detail;
std::string ownId = rsPeers->getOwnId();
if (!rsPeers->getPeerDetails(ownId, detail))
{
return;
}
int netIndex = ui.netModeComboBox->currentIndex();
/* Check if netMode has changed */
int netMode = 0;
switch(netIndex)
{
case 2:
netMode = RS_NETMODE_EXT;
break;
case 1:
netMode = RS_NETMODE_UDP;
break;
default:
case 0:
netMode = RS_NETMODE_UPNP;
break;
}
if (detail.netMode != netMode)
{
rsPeers->setNetworkMode(ownId, netMode);
}
int visState = 0;
/* Check if vis has changed */
if (0 == ui.discComboBox->currentIndex())
{
visState |= RS_VS_DISC_ON;
}
if (0 == ui.dhtComboBox->currentIndex())
{
visState |= RS_VS_DHT_ON;
}
if (visState != detail.visState)
{
rsPeers->setVisState(ownId, visState);
}
if (0 != netIndex)
{ {
saveAddr = true; saveAddr = true;
} }
@ -199,7 +269,6 @@ void ServerDialog::saveAddresses()
if (saveAddr) if (saveAddr)
{ {
rsPeers->setLocalAddress(rsPeers->getOwnId(), ui.localAddress->text().toStdString(), ui.localPort->value()); rsPeers->setLocalAddress(rsPeers->getOwnId(), ui.localAddress->text().toStdString(), ui.localPort->value());
//rsicontrol->ConfigSetLanConfig(ui.chkFirewall->isChecked(), ui.chkForwarded->isChecked());
rsPeers->setExtAddress(rsPeers->getOwnId(), ui.extAddress->text().toStdString(), ui.extPort->value()); rsPeers->setExtAddress(rsPeers->getOwnId(), ui.extAddress->text().toStdString(), ui.extPort->value());
} }

View File

@ -5,14 +5,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>419</width> <width>416</width>
<height>371</height> <height>345</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -522,30 +520,36 @@
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<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>
<item> <item>
<widget class="QLabel" name="label_14" > <widget class="QLabel" name="label_14" >
<property name="text" > <property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css"> <string>Total Rate (KB/s) </string>
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Total Rate (KB/s) &lt;/p>&lt;/body>&lt;/html></string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="totalRate" > <widget class="QSpinBox" name="totalRate" >
<property name="maximum" >
<number>4096</number>
</property>
<property name="minimum" > <property name="minimum" >
<number>1</number> <number>1</number>
</property> </property>
<property name="maximum" >
<number>4096</number>
</property>
<property name="value" > <property name="value" >
<number>1</number> <number>1</number>
</property> </property>
@ -563,30 +567,36 @@ p, li { white-space: pre-wrap; }
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<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>
<item> <item>
<widget class="QLabel" name="label_12" > <widget class="QLabel" name="label_12" >
<property name="text" > <property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css"> <string>Per Person </string>
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Per Person &lt;/p>&lt;/body>&lt;/html></string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="indivRate" > <widget class="QSpinBox" name="indivRate" >
<property name="maximum" >
<number>1024</number>
</property>
<property name="minimum" > <property name="minimum" >
<number>1</number> <number>1</number>
</property> </property>
<property name="maximum" >
<number>1024</number>
</property>
<property name="value" > <property name="value" >
<number>1</number> <number>1</number>
</property> </property>
@ -605,36 +615,47 @@ p, li { white-space: pre-wrap; }
</rect> </rect>
</property> </property>
<property name="title" > <property name="title" >
<string>Firewall/Router Configuration</string> <string>External Visibility / Discovery Configuration</string>
</property> </property>
<widget class="QRadioButton" name="ManualButton" > <widget class="QComboBox" name="dhtComboBox" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>230</x> <x>30</x>
<y>20</y> <y>10</y>
<width>161</width> <width>161</width>
<height>18</height> <height>22</height>
</rect> </rect>
</property> </property>
<property name="text" > <item>
<string>Manual router setup.</string> <property name="text" >
</property> <string>DHT Enabled</string>
</property>
</item>
<item>
<property name="text" >
<string>DHT Disabled</string>
</property>
</item>
</widget> </widget>
<widget class="QRadioButton" name="UPnPButton" > <widget class="QComboBox" name="discComboBox" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>220</x>
<y>20</y> <y>10</y>
<width>211</width> <width>161</width>
<height>18</height> <height>22</height>
</rect> </rect>
</property> </property>
<property name="text" > <item>
<string>Use uPnP to configure router</string> <property name="text" >
</property> <string>Discovery Enabled</string>
<property name="checked" > </property>
<bool>true</bool> </item>
</property> <item>
<property name="text" >
<string>Discovery Disabled</string>
</property>
</item>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_2" > <widget class="QGroupBox" name="groupBox_2" >
@ -649,34 +670,30 @@ p, li { white-space: pre-wrap; }
<property name="title" > <property name="title" >
<string>Network Address Configuration (takes effect after restart)</string> <string>Network Address Configuration (takes effect after restart)</string>
</property> </property>
<widget class="QRadioButton" name="DHTButton" > <widget class="QComboBox" name="netModeComboBox" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>30</x>
<y>20</y> <y>10</y>
<width>211</width> <width>351</width>
<height>18</height> <height>22</height>
</rect> </rect>
</property> </property>
<property name="text" > <item>
<string>Use DHT to locate friends </string> <property name="text" >
</property> <string>Automatic (Firewalled)</string>
<property name="checked" > </property>
<bool>true</bool> </item>
</property> <item>
</widget> <property name="text" >
<widget class="QRadioButton" name="noDHTButton" > <string>Firewalled + No UPnP</string>
<property name="geometry" > </property>
<rect> </item>
<x>230</x> <item>
<y>20</y> <property name="text" >
<width>161</width> <string>External (Forwarded) Port</string>
<height>18</height> </property>
</rect> </item>
</property>
<property name="text" >
<string>Manual IP Addresses</string>
</property>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox" > <widget class="QGroupBox" name="groupBox" >
@ -694,31 +711,49 @@ p, li { white-space: pre-wrap; }
<widget class="QWidget" name="layoutWidget" > <widget class="QWidget" name="layoutWidget" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>110</x> <x>93</x>
<y>20</y> <y>20</y>
<width>274</width> <width>291</width>
<height>159</height> <height>152</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<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>
<item> <item>
<widget class="QLineEdit" name="dhtStatus" /> <widget class="QTextEdit" name="netStatusBox" />
</item>
<item>
<widget class="QLineEdit" name="upnpStatus" />
</item> </item>
<item> <item>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
@ -726,12 +761,12 @@ p, li { white-space: pre-wrap; }
</item> </item>
<item row="0" column="2" > <item row="0" column="2" >
<widget class="QSpinBox" name="localPort" > <widget class="QSpinBox" name="localPort" >
<property name="maximum" >
<number>65535</number>
</property>
<property name="minimum" > <property name="minimum" >
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" > <property name="value" >
<number>7812</number> <number>7812</number>
</property> </property>
@ -747,35 +782,23 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>6</number> <number>6</number>
</property> </property>
<item> <property name="verticalSpacing" >
<widget class="QCheckBox" name="chkFirewall" >
<property name="text" >
<string>Firewalled</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkForwarded" >
<property name="text" >
<string>Forwarded Port</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
@ -783,12 +806,12 @@ p, li { white-space: pre-wrap; }
</item> </item>
<item row="0" column="2" > <item row="0" column="2" >
<widget class="QSpinBox" name="extPort" > <widget class="QSpinBox" name="extPort" >
<property name="maximum" >
<number>65535</number>
</property>
<property name="minimum" > <property name="minimum" >
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" > <property name="value" >
<number>7812</number> <number>7812</number>
</property> </property>
@ -797,10 +820,7 @@ p, li { white-space: pre-wrap; }
<item row="0" column="1" > <item row="0" column="1" >
<widget class="QLabel" name="label_4" > <widget class="QLabel" name="label_4" >
<property name="text" > <property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css"> <string>Port:</string>
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Port:&lt;/p>&lt;/body>&lt;/html></string>
</property> </property>
</widget> </widget>
</item> </item>
@ -818,10 +838,7 @@ p, li { white-space: pre-wrap; }
</rect> </rect>
</property> </property>
<property name="text" > <property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css"> <string>External Address</string>
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">External Address:&lt;/p>&lt;/body>&lt;/html></string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_6" > <widget class="QLabel" name="label_6" >
@ -834,54 +851,27 @@ p, li { white-space: pre-wrap; }
</rect> </rect>
</property> </property>
<property name="text" > <property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css"> <string>Network Status</string>
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">DHT Status&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
<widget class="QLabel" name="label_3" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>80</width>
<height>21</height>
</rect>
</property>
<property name="text" >
<string>uPnP Status</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label" > <widget class="QLabel" name="label" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>
<y>90</y> <y>130</y>
<width>81</width> <width>81</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>
<property name="text" > <property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css"> <string>Local Address</string>
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Local Address:&lt;/p>&lt;/body>&lt;/html></string>
</property> </property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>DHTButton</tabstop>
<tabstop>noDHTButton</tabstop>
<tabstop>UPnPButton</tabstop>
<tabstop>ManualButton</tabstop>
<tabstop>dhtStatus</tabstop>
<tabstop>upnpStatus</tabstop>
<tabstop>localAddress</tabstop> <tabstop>localAddress</tabstop>
<tabstop>localPort</tabstop> <tabstop>localPort</tabstop>
<tabstop>chkFirewall</tabstop>
<tabstop>chkForwarded</tabstop>
<tabstop>extAddress</tabstop> <tabstop>extAddress</tabstop>
<tabstop>extPort</tabstop> <tabstop>extPort</tabstop>
<tabstop>totalRate</tabstop> <tabstop>totalRate</tabstop>

View File

@ -256,7 +256,7 @@ virtual int ConfigSetIncomingDir( std::string dir ) = 0;
virtual int ConfigSetDataRates( int total, int indiv ) = 0; virtual int ConfigSetDataRates( int total, int indiv ) = 0;
virtual int ConfigSetBootPrompt( bool on ) = 0; virtual int ConfigSetBootPrompt( bool on ) = 0;
//virtual int ConfigSave( ) = 0; virtual void ConfigFinalSave( ) = 0;
/****************************************/ /****************************************/

View File

@ -45,6 +45,10 @@ const uint32_t RS_NETMODE_UDP = 0x0001;
const uint32_t RS_NETMODE_UPNP = 0x0002; const uint32_t RS_NETMODE_UPNP = 0x0002;
const uint32_t RS_NETMODE_EXT = 0x0003; const uint32_t RS_NETMODE_EXT = 0x0003;
/* Visibility */
const uint32_t RS_VS_DHT_ON = 0x0001;
const uint32_t RS_VS_DISC_ON = 0x0002;
/* State */ /* State */
const uint32_t RS_PEER_STATE_FRIEND = 0x0001; const uint32_t RS_PEER_STATE_FRIEND = 0x0001;
const uint32_t RS_PEER_STATE_ONLINE = 0x0002; const uint32_t RS_PEER_STATE_ONLINE = 0x0002;
@ -90,6 +94,7 @@ class RsPeerDetails
uint16_t extPort; uint16_t extPort;
uint32_t netMode; uint32_t netMode;
uint32_t visState;
/* basic stats */ /* basic stats */
uint32_t lastConnect; /* how long ago */ uint32_t lastConnect; /* how long ago */
@ -129,6 +134,7 @@ virtual bool connectAttempt(std::string id) = 0;
virtual bool setLocalAddress(std::string id, std::string addr, uint16_t port) = 0; virtual bool setLocalAddress(std::string id, std::string addr, uint16_t port) = 0;
virtual bool setExtAddress( std::string id, std::string addr, uint16_t port) = 0; virtual bool setExtAddress( std::string id, std::string addr, uint16_t port) = 0;
virtual bool setNetworkMode(std::string id, uint32_t netMode) = 0; virtual bool setNetworkMode(std::string id, uint32_t netMode) = 0;
virtual bool setVisState(std::string id, uint32_t vis) = 0;
/* Auth Stuff */ /* Auth Stuff */
virtual std::string GetRetroshareInvite() = 0; virtual std::string GetRetroshareInvite() = 0;