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); ui.netModeComboBox->setCurrentIndex(netIndex);
netIndex = 1; /* DHT + Discovery: (public)
* Discovery only: (private)
* DHT only: (inverted)
* None: (dark net)
*/
netIndex = 3; // NONE.
if (detail.visState & RS_VS_DHT_ON)
{
if (detail.visState & RS_VS_DISC_ON) if (detail.visState & RS_VS_DISC_ON)
{ {
netIndex = 0; 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); ui.discoveryComboBox->setCurrentIndex(netIndex);
rsiface->lockData(); /* Lock Interface */ rsiface->lockData(); /* Lock Interface */
@ -451,13 +476,25 @@ void QuickStartWizard::saveChanges()
netMode = RS_NETMODE_UPNP; netMode = RS_NETMODE_UPNP;
break; break;
} }
rsPeers->setNetworkMode(ownId, netMode); rsPeers->setNetworkMode(ownId, netMode);
uint32_t visState = 0; uint32_t visState = 0;
/* Check if vis has changed */ /* Check if vis has changed */
if (0 == ui.discoveryComboBox->currentIndex()) switch(ui.discoveryComboBox->currentIndex())
{ {
case 0:
visState |= (RS_VS_DISC_ON | RS_VS_DHT_ON);
break;
case 1:
visState |= RS_VS_DISC_ON; visState |= RS_VS_DISC_ON;
break;
case 2:
visState |= RS_VS_DHT_ON;
break;
case 3:
default:
break;
} }
if (visState != detail.visState) if (visState != detail.visState)

View file

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