removed useless IP whitelist options for hidden nodes

This commit is contained in:
csoler 2018-01-15 22:00:08 +01:00
parent fe0b22e9f1
commit c8a638c1d6
2 changed files with 21 additions and 8 deletions

View File

@ -435,15 +435,29 @@ void ConnectFriendWizard::initializePage(int id)
break;
case Page_Conclusion:
{
bool peerIsHiddenNode = peerDetails.isHiddenNode ;
bool amIHiddenNode = rsPeers->isHiddenNode(rsPeers->getOwnId()) ;
std::cerr << "Conclusion page id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
ui->_direct_transfer_CB_2 ->setChecked(false) ; //peerDetails.service_perm_flags & RS_NODE_PERM_DIRECT_DL) ;
ui->_allow_push_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
ui->_require_WL_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_REQUIRE_WL) ;
if(!peerIsHiddenNode && !amIHiddenNode)
ui->_require_WL_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_REQUIRE_WL) ;
else
{
ui->_require_WL_CB_2 ->setChecked(false) ;
ui->_require_WL_CB_2 ->hide() ;
ui->_addIPToWhiteList_CB_2->hide();
ui->_addIPToWhiteList_ComboBox_2->hide();
}
sockaddr_storage addr ;
std::cerr << "Cert IP = " << peerDetails.extAddr << std::endl;
std::cerr << "Cert IP = " << peerDetails.extAddr << std::endl;
if(sockaddr_storage_ipv4_aton(addr,peerDetails.extAddr.c_str()) && sockaddr_storage_isValidNet(addr))
{
QString ipstring0 = QString::fromStdString(sockaddr_storage_iptostring(addr));
@ -577,29 +591,28 @@ void ConnectFriendWizard::initializePage(int id)
ui->fr_avatar->setFrameType(AvatarWidget::NORMAL_FRAME);
setPixmap(QWizard::LogoPixmap, QPixmap(":/images/user/user_request48.png"));
ui->fr_signGPGCheckBox->setChecked(false);
//set the radio button to sign the GPG key
if (peerDetails.accept_connection && !peerDetails.ownsign) {
//gpg key connection is already accepted, don't propose to accept it again
ui->fr_signGPGCheckBox->setChecked(false);
ui->fr_acceptNoSignGPGCheckBox->hide();
ui->fr_signGPGCheckBox->show();
ui->fr_acceptNoSignGPGCheckBox->setChecked(false);
}
if (!peerDetails.accept_connection && peerDetails.ownsign) {
//gpg key is already signed, don't propose to sign it again
ui->fr_acceptNoSignGPGCheckBox->setChecked(true);
ui->fr_signGPGCheckBox->hide();
ui->fr_signGPGCheckBox->setChecked(false);
}
if (!peerDetails.accept_connection && !peerDetails.ownsign) {
ui->fr_acceptNoSignGPGCheckBox->setChecked(true);
ui->fr_signGPGCheckBox->show();
ui->fr_signGPGCheckBox->setChecked(false);
ui->fr_acceptNoSignGPGCheckBox->show();
}
if (peerDetails.accept_connection && peerDetails.ownsign) {
ui->fr_acceptNoSignGPGCheckBox->setChecked(false);
ui->fr_acceptNoSignGPGCheckBox->hide();
ui->fr_signGPGCheckBox->setChecked(false);
ui->fr_signGPGCheckBox->hide();
}

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>538</height>
<width>1161</width>
<height>1223</height>
</rect>
</property>
<property name="windowTitle">