fixed display of TOR information for hidden nodes (patch from Sehraf)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8108 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-04-02 18:22:55 +00:00
parent bdabfeea46
commit 65da6090fe
2 changed files with 84 additions and 42 deletions

View File

@ -217,17 +217,39 @@ void ConfCertDialog::load()
if (detail.isHiddenNode)
{
/* set local address */
ui.localAddress->setText("hidden");
ui.localPort -> setValue(0);
/* set the server address */
ui.extAddress->setText("hidden");
ui.extPort -> setValue(0);
// enable only the first row and set name of the first label to "Hidden Address"
ui.l_localAddress->setText(tr("Hidden Address"));
ui.dynDNS->setText(QString::fromStdString(detail.hiddenNodeAddress));
ui.l_extAddress->setEnabled(false);
ui.extAddress->setEnabled(false);
ui.l_portExternal->setEnabled(false);
ui.extPort->setEnabled(false);
ui.l_dynDNS->setEnabled(false);
ui.dynDNS->setEnabled(false);
/* set hidden address */
ui.localAddress->setText(QString::fromStdString(detail.hiddenNodeAddress));
ui.localPort -> setValue(detail.hiddenNodePort);
// set everything else to none
ui.extAddress->setText(tr("none"));
ui.extPort->setValue(0);
ui.dynDNS->setText(tr("none"));
}
else
{
// enable everything and set name of the first label to "Local Address"
ui.l_localAddress->setText(tr("Local Address"));
ui.l_extAddress->setEnabled(true);
ui.extAddress->setEnabled(true);
ui.l_portExternal->setEnabled(true);
ui.extPort->setEnabled(true);
ui.l_dynDNS->setEnabled(true);
ui.dynDNS->setEnabled(true);
/* set local address */
ui.localAddress->setText(QString::fromStdString(detail.localAddr));
ui.localPort -> setValue(detail.localPort);
@ -476,6 +498,7 @@ void ConfCertDialog::applyDialog()
}
if (!detail.isOnlyGPGdetail) {
if(!detail.isHiddenNode) {
/* check if the data is the same */
bool localChanged = false;
bool extChanged = false;
@ -503,6 +526,12 @@ void ConfCertDialog::applyDialog()
if(localChanged || extChanged || dnsChanged)
emit configChanged();
} else {
if((detail.hiddenNodeAddress != ui.localAddress->text().toStdString()) || (detail.hiddenNodePort != ui.localPort->value())) {
rsPeers->setHiddenNode(peerId,ui.localAddress->text().toStdString(), ui.localPort->value());
emit configChanged();
}
}
}
setServiceFlags() ;

View File

@ -285,12 +285,25 @@
<string>Peer Address</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0" colspan="2">
<item row="2" column="0" colspan="2">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>47</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="2" colspan="2">
<layout class="QHBoxLayout" name="_4">
<item>
<layout class="QVBoxLayout" name="_5">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="l_localAddress">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
@ -303,14 +316,14 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="l_extAddress">
<property name="text">
<string>External Address</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="l_dynDNS">
<property name="text">
<string>Dynamic DNS</string>
</property>
@ -334,14 +347,14 @@
<item>
<layout class="QVBoxLayout" name="_7">
<item>
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="l_portLocal">
<property name="text">
<string>Port</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="l_portExternal">
<property name="text">
<string>Port</string>
</property>