From 71edea37758aabc8babaa290ccb8ab027e8bdb16 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 10 Nov 2020 22:02:49 +0100 Subject: [PATCH] added proper display of local/ext IPs and DNS in connect friend wizard --- .../src/gui/connect/ConnectFriendWizard.cpp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index e822499a1..09db7d48e 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -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);