added proper display of local/ext IPs and DNS in connect friend wizard

This commit is contained in:
csoler 2020-11-10 22:02:49 +01:00
parent 9a2749dbe5
commit 71edea3775

View File

@ -550,7 +550,25 @@ void ConnectFriendWizard::initializePage(int id)
}
ui->nodeEdit->setText(loc);
ui->ipEdit->setText(QString::fromStdString(peerDetails.isHiddenNode ? peerDetails.hiddenNodeAddress : peerDetails.extAddr));
std::string s;
if(peerDetails.isHiddenNode)
s += peerDetails.hiddenNodeAddress;
else
{
if(peerDetails.localAddr!="0.0.0.0")// This is not so nice, but because we deal we string there's no way
s += peerDetails.localAddr; // to ask about if the ip is null. We really need a proper IP class.
if(peerDetails.extAddr!="0.0.0.0")
{
if(!s.empty()) s += " / " ;
s += peerDetails.extAddr;
}
if(!peerDetails.dyndns.empty())
s += "(" + peerDetails.dyndns + ")" ;
}
ui->ipEdit->setText(QString::fromStdString(s));
ui->signersEdit->setPlainText(ts);
fillGroups(this, ui->groupComboBox, groupId);