From e0543329ade5ea7b936281da429a911a8639eabf Mon Sep 17 00:00:00 2001 From: joss17 Date: Wed, 11 Nov 2009 22:12:50 +0000 Subject: [PATCH] add address list to gui git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1812 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3connmgr.cc | 1 - libretroshare/src/rsiface/rspeers.h | 3 ++- libretroshare/src/rsserver/p3peers.cc | 9 +++++++++ retroshare-gui/src/gui/connect/ConfCertDialog.cpp | 4 ++++ retroshare-gui/src/gui/connect/ConfCertDialog.ui | 13 +++++++++++-- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index 44cf67dfd..30b7852a7 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -3850,5 +3850,4 @@ void peerConnectState::printIpAddressList(std::list ipTimedList) std::cerr << " seenTime : " << ipListIt->seenTime << std::endl; #endif } - } diff --git a/libretroshare/src/rsiface/rspeers.h b/libretroshare/src/rsiface/rspeers.h index ca7d5cf12..832fc10e1 100644 --- a/libretroshare/src/rsiface/rspeers.h +++ b/libretroshare/src/rsiface/rspeers.h @@ -96,7 +96,8 @@ class RsPeerDetails std::string localAddr; uint16_t localPort; std::string extAddr; - uint16_t extPort; + uint16_t extPort; + std::list ipAddressList; uint32_t netMode; uint32_t tryNetMode; /* only for ownState */ diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 5a2d4c157..a97de86e8 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -368,6 +368,15 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d) d.extPort = ntohs(best_servr_addr.sin_port); d.lastConnect = pcs.lastcontact; d.connectPeriod = 0; + std::list ipAddressList; + std::list pcsList = pcs.getIpAddressList(); + for (std::list::iterator ipListIt = pcsList.begin(); ipListIt!=(pcsList.end()); ipListIt++) { + std::ostringstream toto; + toto << ntohs(ipListIt->ipAddr.sin_port); + ipAddressList.push_back(std::string(inet_ntoa(ipListIt->ipAddr.sin_addr)) + ":" + toto.str()); + } + d.ipAddressList = ipAddressList; + /* Translate */ diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index 0e09e7b72..82063851f 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -126,6 +126,10 @@ void ConfCertDialog::loadDialog() ui.extAddress->setText(QString::fromStdString(detail.extAddr)); ui.extPort -> setValue(detail.extPort); + ui.ipAddressList->clear(); + for(std::list::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it) + ui.ipAddressList->addItem(QString::fromStdString(*it)); + /* set the url for DNS access (OLD) */ //ui.extName->setText(QString::fromStdString("")); diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.ui b/retroshare-gui/src/gui/connect/ConfCertDialog.ui index 3b959fcee..4c77a7ba5 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.ui +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.ui @@ -7,7 +7,7 @@ 0 0 493 - 428 + 513 @@ -706,6 +706,16 @@ + + + + Addresses list + + + + + + @@ -857,7 +867,6 @@ -