update the QuickStartWizard with the changes for the Discovery combobox

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3762 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-11-08 16:27:48 +00:00
parent f3ec123b88
commit 4c43c471ec
2 changed files with 64 additions and 17 deletions

View File

@ -403,11 +403,36 @@ void QuickStartWizard::loadNetwork()
}
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.discoveryComboBox->setCurrentIndex(netIndex);
rsiface->lockData(); /* Lock Interface */
@ -448,22 +473,34 @@ void QuickStartWizard::saveChanges()
break;
default:
case 0:
netMode = RS_NETMODE_UPNP;
netMode = RS_NETMODE_UPNP;
break;
}
rsPeers->setNetworkMode(ownId, netMode);
rsPeers->setNetworkMode(ownId, netMode);
uint32_t visState = 0;
/* Check if vis has changed */
if (0 == ui.discoveryComboBox->currentIndex())
{
visState |= RS_VS_DISC_ON;
}
uint32_t visState = 0;
/* Check if vis has changed */
switch(ui.discoveryComboBox->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);
}
if (visState != detail.visState)
{
rsPeers->setVisState(ownId, visState);
}
/*if (0 != netIndex)
{

View File

@ -437,12 +437,22 @@ p, li { white-space: pre-wrap; }
<widget class="QComboBox" name="discoveryComboBox">
<item>
<property name="text">
<string>Share Ip and information with your friend (Disc On)</string>
<string>Public: DHT &amp; Discovery</string>
</property>
</item>
<item>
<property name="text">
<string>Don't share any information (Disc Off)</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>