mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
* Tweaks to switch DHT On/Off, (coupled with Discovery)
* display of DHT size. * Added CoreFoundation to .pro file. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3723 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5b70ef6076
commit
33282bfc77
@ -118,9 +118,12 @@ macx {
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error
|
||||
LIBS += ../../../miniupnpc-1.0/libminiupnpc.a
|
||||
LIBS += -framework CoreFoundation
|
||||
|
||||
INCLUDEPATH += .
|
||||
#DEFINES* = MAC_IDLE # for idle feature
|
||||
CONFIG -= uitools
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -135,11 +135,36 @@ void ServerPage::load()
|
||||
}
|
||||
ui.netModeComboBox->setCurrentIndex(netIndex);
|
||||
|
||||
netIndex = 1;
|
||||
if (detail.visState & RS_VS_DISC_ON)
|
||||
/* DHT + Discovery: (public)
|
||||
* Discovery only: (private)
|
||||
* DHT only: (inverted)
|
||||
* None: (dark net)
|
||||
*/
|
||||
|
||||
netIndex = 3; // NONE.
|
||||
if (detail.visState & RS_VS_DHT_ON)
|
||||
{
|
||||
netIndex = 0;
|
||||
if (detail.visState & RS_VS_DISC_ON)
|
||||
{
|
||||
netIndex = 0; // PUBLIC
|
||||
}
|
||||
else
|
||||
{
|
||||
netIndex = 2; // INVERTED
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (detail.visState & RS_VS_DISC_ON)
|
||||
{
|
||||
netIndex = 1; // PRIVATE
|
||||
}
|
||||
else
|
||||
{
|
||||
netIndex = 3; // NONE
|
||||
}
|
||||
}
|
||||
|
||||
ui.discComboBox->setCurrentIndex(netIndex);
|
||||
|
||||
rsiface->lockData(); /* Lock Interface */
|
||||
@ -249,8 +274,21 @@ void ServerPage::saveAddresses()
|
||||
|
||||
uint32_t visState = 0;
|
||||
/* Check if vis has changed */
|
||||
if (0 == ui.discComboBox->currentIndex())
|
||||
visState |= RS_VS_DISC_ON;
|
||||
switch(ui.discComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
visState |= (RS_VS_DISC_ON | RS_VS_DHT_ON);
|
||||
break;
|
||||
case 1:
|
||||
visState |= RS_VS_DISC_ON;
|
||||
break;
|
||||
case 2:
|
||||
visState |= RS_VS_DHT_ON;
|
||||
break;
|
||||
case 3:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (visState != detail.visState)
|
||||
rsPeers->setVisState(ownId, visState);
|
||||
|
@ -492,9 +492,6 @@
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
@ -546,17 +543,33 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="discComboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Should be disabled if you don't want to share connection information between peers.</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Discovery Enabled</string>
|
||||
<string>Public: DHT & Discovery</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Discovery Disabled</string>
|
||||
<string>Private: Discovery Only</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Inverted: DHT Only</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dark Net: None</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
@ -580,12 +593,6 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
|
@ -82,6 +82,15 @@ void DHTStatus::getDHTStatus()
|
||||
dhtstatusLabel->setPixmap(QPixmap(":/images/redled.png"));
|
||||
dhtstatusLabel->setToolTip(tr("DHT Off"));
|
||||
}
|
||||
|
||||
QString dhtsize;
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << (int) config.netDhtRsNetSize << " ( " << (int) config.netDhtNetSize << " )";
|
||||
dhtsize = QString::fromStdString(out.str());
|
||||
}
|
||||
|
||||
dhtnetworksizeLabel->setText(dhtsize);
|
||||
|
||||
rsiface->unlockData(); /* UnLock Interface */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user