Add the setDynDNS to the confcertdialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2756 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-04-22 18:49:51 +00:00
parent 50e2e5f672
commit d70e7a3b71
3 changed files with 14 additions and 3 deletions

View File

@ -2691,7 +2691,7 @@ bool p3ConnectMgr::setDynDNS(std::string id, std::string dyndns)
if (mOthersList.end() == (it = mOthersList.find(id))) if (mOthersList.end() == (it = mOthersList.find(id)))
{ {
#ifdef CONN_DEBUG #ifdef CONN_DEBUG
std::cerr << "p3ConnectMgr::setLocalAddress() cannot add addres info : peer id not found in friend list id: " << id << std::endl; std::cerr << "p3ConnectMgr::setDynDNS() cannot add dyn dns info : peer id not found in friend list id: " << id << std::endl;
#endif #endif
return false; return false;
} }

View File

@ -733,6 +733,9 @@ bool p3Peers::setExtAddress(std::string id, std::string addr_str, uint16_t port
bool p3Peers::setDynDNS(std::string id, std::string dyndns) bool p3Peers::setDynDNS(std::string id, std::string dyndns)
{ {
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::setDynDNS() called with id: " << id << " dyndns: " << dyndns <<std::endl;
#endif
return mConnMgr->setDynDNS(id, dyndns); return mConnMgr->setDynDNS(id, dyndns);
} }

View File

@ -150,6 +150,8 @@ 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.dynDNS->setText(QString::fromStdString(detail.dyndns));
ui.ipAddressList->clear(); ui.ipAddressList->clear();
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it) for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
ui.ipAddressList->addItem(QString::fromStdString(*it)); ui.ipAddressList->addItem(QString::fromStdString(*it));
@ -311,7 +313,7 @@ void ConfCertDialog::applyDialog()
/* check if the data is the same */ /* check if the data is the same */
bool localChanged = false; bool localChanged = false;
bool extChanged = false; bool extChanged = false;
bool fwChanged = false; bool dnsChanged = false;
/* set local address */ /* set local address */
if ((detail.localAddr != ui.localAddress->text().toStdString()) || (detail.localPort != ui.localPort -> value())) if ((detail.localAddr != ui.localAddress->text().toStdString()) || (detail.localPort != ui.localPort -> value()))
@ -320,6 +322,9 @@ void ConfCertDialog::applyDialog()
if ((detail.extAddr != ui.extAddress->text().toStdString()) || (detail.extPort != ui.extPort -> value())) if ((detail.extAddr != ui.extAddress->text().toStdString()) || (detail.extPort != ui.extPort -> value()))
extChanged = true; extChanged = true;
if ((detail.dyndns != ui.dynDNS->text().toStdString()))
dnsChanged = true;
/* now we can action the changes */ /* now we can action the changes */
if (localChanged) if (localChanged)
rsPeers->setLocalAddress(mId, ui.localAddress->text().toStdString(), ui.localPort->value()); rsPeers->setLocalAddress(mId, ui.localAddress->text().toStdString(), ui.localPort->value());
@ -327,7 +332,10 @@ void ConfCertDialog::applyDialog()
if (extChanged) if (extChanged)
rsPeers->setExtAddress(mId,ui.extAddress->text().toStdString(), ui.extPort->value()); rsPeers->setExtAddress(mId,ui.extAddress->text().toStdString(), ui.extPort->value());
if(localChanged || extChanged) if (dnsChanged)
rsPeers->setDynDNS(mId, ui.dynDNS->text().toStdString());
if(localChanged || extChanged || dnsChanged)
emit configChanged() ; emit configChanged() ;
} }