add address list to gui

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1812 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-11-11 22:12:50 +00:00
parent d2f9f1c4f1
commit e0543329ad
5 changed files with 26 additions and 4 deletions

View File

@ -3850,5 +3850,4 @@ void peerConnectState::printIpAddressList(std::list<IpAddressTimed> ipTimedList)
std::cerr << " seenTime : " << ipListIt->seenTime << std::endl; std::cerr << " seenTime : " << ipListIt->seenTime << std::endl;
#endif #endif
} }
} }

View File

@ -96,7 +96,8 @@ class RsPeerDetails
std::string localAddr; std::string localAddr;
uint16_t localPort; uint16_t localPort;
std::string extAddr; std::string extAddr;
uint16_t extPort; uint16_t extPort;
std::list<std::string> ipAddressList;
uint32_t netMode; uint32_t netMode;
uint32_t tryNetMode; /* only for ownState */ uint32_t tryNetMode; /* only for ownState */

View File

@ -368,6 +368,15 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
d.extPort = ntohs(best_servr_addr.sin_port); d.extPort = ntohs(best_servr_addr.sin_port);
d.lastConnect = pcs.lastcontact; d.lastConnect = pcs.lastcontact;
d.connectPeriod = 0; d.connectPeriod = 0;
std::list<std::string> ipAddressList;
std::list<IpAddressTimed> pcsList = pcs.getIpAddressList();
for (std::list<IpAddressTimed>::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 */ /* Translate */

View File

@ -126,6 +126,10 @@ void ConfCertDialog::loadDialog()
ui.extAddress->setText(QString::fromStdString(detail.extAddr)); ui.extAddress->setText(QString::fromStdString(detail.extAddr));
ui.extPort -> setValue(detail.extPort); ui.extPort -> setValue(detail.extPort);
ui.ipAddressList->clear();
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
ui.ipAddressList->addItem(QString::fromStdString(*it));
/* set the url for DNS access (OLD) */ /* set the url for DNS access (OLD) */
//ui.extName->setText(QString::fromStdString("")); //ui.extName->setText(QString::fromStdString(""));

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>493</width> <width>493</width>
<height>428</height> <height>513</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -706,6 +706,16 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Addresses list</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="ipAddressList"/>
</item>
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
@ -857,7 +867,6 @@
</tabstops> </tabstops>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../images.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>