From 018b84a1e117249128ca6f1067d377cc0c0a18cc Mon Sep 17 00:00:00 2001 From: joss17 Date: Wed, 13 Jan 2010 21:30:44 +0000 Subject: [PATCH] change the design of the connect friends wizard git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2023 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3connmgr.cc | 5 +- libretroshare/src/rsserver/p3peers.cc | 129 +++++++++--------- .../src/gui/connect/ConnectFriendWizard.cpp | 12 +- .../images/connect/connectFriendBanner.png | Bin 481 -> 588 bytes 4 files changed, 78 insertions(+), 68 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index dfc094d6f..cae28aa59 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -2958,6 +2958,7 @@ bool p3ConnectMgr::loadList(std::list load) /* add ownConfig */ setOwnNetConfig(pitem->netMode, pitem->visState); ownState.gpg_id = AuthGPG::getAuthGPG()->getGPGOwnId(); + ownState.location = AuthSSL::getAuthSSL()->getOwnLocation(); } else { @@ -2968,8 +2969,8 @@ bool p3ConnectMgr::loadList(std::list load) #endif /* ************* */ addFriend(pitem->pid, pitem->gpg_id, pitem->netMode, pitem->visState, pitem->lastContact); - } - setLocation(pitem->pid, pitem->location); + setLocation(pitem->pid, pitem->location); + } setLocalAddress(pitem->pid, pitem->currentlocaladdr); setExtAddress(pitem->pid, pitem->currentremoteaddr); setAddressList(pitem->pid, pitem->ipAddressList); diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index fe6310b30..bc9bfd8df 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -40,10 +40,10 @@ #include #endif -const std::string CERT_SSL_ID = "---SSLID---"; -const std::string CERT_LOCATION = "---LOCATION---"; -const std::string CERT_LOCAL_IP = "---LOCAL---"; -const std::string CERT_EXT_IP = "---EXT---"; +const std::string CERT_SSL_ID = "--SSLID--"; +const std::string CERT_LOCATION = "--LOCATION--"; +const std::string CERT_LOCAL_IP = "--LOCAL--"; +const std::string CERT_EXT_IP = "--EXT--"; @@ -790,16 +790,16 @@ p3Peers::GetRetroshareInvite() //add the sslid, location, ip local and external address after the signature RsPeerDetails ownDetail; if (getPeerDetails(rsPeers->getOwnId(), ownDetail)) { - invite += CERT_SSL_ID + ownDetail.id + ";\n"; + invite += CERT_SSL_ID + ownDetail.id + ";"; invite += CERT_LOCATION + ownDetail.location + ";\n"; invite += CERT_LOCAL_IP + ownDetail.localAddr + ":"; std::ostringstream out; out << ownDetail.localPort; - invite += out.str() + ";\n"; + invite += out.str() + ";"; invite += CERT_EXT_IP + ownDetail.extAddr + ":"; std::ostringstream out2; out2 << ownDetail.extPort; - invite += out2.str() + ";\n"; + invite += out2.str() + ";"; } std::cerr << "p3Peers::GetRetroshareInvite() returns : \n"; @@ -895,82 +895,83 @@ bool p3Peers::loadDetailsFromStringCert(std::string certstr, RsPeerDetails &pd) //let's parse the ssl id parsePosition = certstr.find(CERT_SSL_ID); std::cerr << "sslid position : " << parsePosition << std::endl; - if (parsePosition == std::string::npos) - return true; - parsePosition += CERT_SSL_ID.length(); - std::string subCert = certstr.substr(parsePosition); - parsePosition = subCert.find(";"); - if (parsePosition == std::string::npos) - return true; - std::string ssl_id = subCert.substr(0, parsePosition); - std::cerr << "SSL id : " << ssl_id << std::endl; - pd.id = ssl_id; + if (parsePosition != std::string::npos) { + parsePosition += CERT_SSL_ID.length(); + std::string subCert = certstr.substr(parsePosition); + parsePosition = subCert.find(";"); + if (parsePosition != std::string::npos) { + std::string ssl_id = subCert.substr(0, parsePosition); + std::cerr << "SSL id : " << ssl_id << std::endl; + pd.id = ssl_id; + } + } //let's parse the location parsePosition = certstr.find(CERT_LOCATION); std::cerr << "location position : " << parsePosition << std::endl; - if (parsePosition == std::string::npos) - return true; - parsePosition += CERT_LOCATION.length(); - subCert = certstr.substr(parsePosition); - parsePosition = subCert.find(";"); - if (parsePosition == std::string::npos) - return true; - std::string location = subCert.substr(0, parsePosition); - std::cerr << "location : " << location << std::endl; - pd.location = location; + if (parsePosition != std::string::npos) { + parsePosition += CERT_LOCATION.length(); + std::string subCert = certstr.substr(parsePosition); + parsePosition = subCert.find(";"); + if (parsePosition != std::string::npos) { + std::string location = subCert.substr(0, parsePosition); + std::cerr << "location : " << location << std::endl; + pd.location = location; + } + } //let's parse ip local address parsePosition = certstr.find(CERT_LOCAL_IP); std::cerr << "local ip position : " << parsePosition << std::endl; - if (parsePosition == std::string::npos) - return true; - parsePosition += CERT_LOCAL_IP.length(); - subCert = certstr.substr(parsePosition); - parsePosition = subCert.find(":"); - if (parsePosition == std::string::npos) - return true; - std::string local_ip = subCert.substr(0, parsePosition); - std::cerr << "Local Ip : " << local_ip << std::endl; - pd.localAddr = local_ip; + if (parsePosition != std::string::npos) { + parsePosition += CERT_LOCAL_IP.length(); + std::string subCert = certstr.substr(parsePosition); + parsePosition = subCert.find(":"); + if (parsePosition != std::string::npos) { + std::string local_ip = subCert.substr(0, parsePosition); + std::cerr << "Local Ip : " << local_ip << std::endl; + pd.localAddr = local_ip; - //let's parse local port - subCert = subCert.substr(parsePosition + 1); - parsePosition = subCert.find(";"); - if (parsePosition == std::string::npos) - return true; - std::string local_port = subCert.substr(0, parsePosition); - std::cerr << "Local port : " << local_port << std::endl; - pd.localPort = (boost::lexical_cast(local_port)); + //let's parse local port + subCert = subCert.substr(parsePosition + 1); + parsePosition = subCert.find(";"); + if (parsePosition != std::string::npos) { + std::string local_port = subCert.substr(0, parsePosition); + std::cerr << "Local port : " << local_port << std::endl; + pd.localPort = (boost::lexical_cast(local_port)); + } + } + } //let's parse ip ext address parsePosition = certstr.find(CERT_EXT_IP); std::cerr << "Ext ip position : " << parsePosition << std::endl; - if (parsePosition == std::string::npos) - return true; - parsePosition = parsePosition + CERT_EXT_IP.length(); - subCert = certstr.substr(parsePosition); - parsePosition = subCert.find(":"); - if (parsePosition == std::string::npos) - return true; - std::string ext_ip = subCert.substr(0, parsePosition); - std::cerr << "Ext Ip : " << ext_ip << std::endl; - pd.extAddr = ext_ip; + if (parsePosition != std::string::npos) { + parsePosition = parsePosition + CERT_EXT_IP.length(); + std::string subCert = certstr.substr(parsePosition); + parsePosition = subCert.find(":"); + if (parsePosition != std::string::npos) { + std::string ext_ip = subCert.substr(0, parsePosition); + std::cerr << "Ext Ip : " << ext_ip << std::endl; + pd.extAddr = ext_ip; + + //let's parse ext port + subCert = subCert.substr(parsePosition + 1); + parsePosition = subCert.find(";"); + if (parsePosition != std::string::npos) { + std::string ext_port = subCert.substr(0, parsePosition); + std::cerr << "Ext port : " << ext_port << std::endl; + pd.extPort = (boost::lexical_cast(ext_port)); + } + } + } - //let's parse ext port - subCert = subCert.substr(parsePosition + 1); - parsePosition = subCert.find(";"); - if (parsePosition == std::string::npos) - return true; - std::string ext_port = subCert.substr(0, parsePosition); - std::cerr << "Ext port : " << ext_port << std::endl; - pd.extPort = (boost::lexical_cast(ext_port)); } catch (...) { std::cerr << "ConnectFriendWizard : Parse ip address error." << std::endl; } - return true;; + return true; } diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 6629bf9fc..6d5e3c340 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -84,6 +84,7 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) setWizardStyle(ModernStyle); #endif + // at this moment I don't know, what information should be in help // setOption(HaveHelpButton, true); // connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp())); @@ -204,6 +205,13 @@ TextPage::TextPage(QWidget *parent) userCertEdit->setText(QString::fromStdString(invite)); userCertEdit->setReadOnly(true); userCertEdit->setMinimumHeight(200); + userCertEdit->setMinimumWidth(450); + QFont font; + font.setPointSize(10); + font.setBold(false); + font.setStyleHint(QFont::TypeWriter, QFont::PreferDefault); + //font.setWeight(75); + userCertEdit->setFont(font); std::cerr << "TextPage() getting Invite: " << invite << std::endl; @@ -752,11 +760,11 @@ ConclusionPage::ConclusionPage(QWidget *parent) : QWizardPage(parent) { peerGPGIdEdit = new QLineEdit(this); peerGPGIdEdit->setVisible(false); - registerField(SSL_ID_FIELD_CONNECT_FRIEND_WIZARD,peerGPGIdEdit); + registerField(GPG_ID_FIELD_CONNECT_FRIEND_WIZARD,peerGPGIdEdit); peerLocation = new QLineEdit(this); peerLocation->setVisible(false); - registerField(GPG_ID_FIELD_CONNECT_FRIEND_WIZARD,peerLocation); + registerField(LOCATION_FIELD_CONNECT_FRIEND_WIZARD,peerLocation); peerCertStringEdit = new QLineEdit(this); peerCertStringEdit->setVisible(false); diff --git a/retroshare-gui/src/gui/images/connect/connectFriendBanner.png b/retroshare-gui/src/gui/images/connect/connectFriendBanner.png index 0b07445bf0e0aa086bc2ae1387aa1ac35c149f0b..3dcf8470a00ff986213207a5e46b6ee3680a0893 100644 GIT binary patch literal 588 zcmeAS@N?(olHy`uVBq!ia0y~yU@`@=y*QYFY zhW{YAVDIwDKoQOYkH}&M25vzRW~@(%p9mCWFY)wsWxvJ9Evl`hWR_P0H06w^i(^Q| zt+#h}7an#HVR5|Ep5nvhdvU(a&2+xiyPO-0xArp}|NZFF^zRaXh8zA23;Y>s^5^f_&+f3n|8yPGfjXv!*>=9aIU5q@ zw|!S;@OY>G-Ik%NcGG-@7hf}93NxIv+xea`!JhGe@BD55+gTUvm|ruW+hL=BT|JY+ zjpe!ai~(;Z1NCuyJ6X%$@T~5VIzv@$6-eLTC*Rc>nto^A_Ge)E{bV1z!zTZC)lg=U zJy6A7yV^LQh{*TJc8nKZU%vew?7o8Q>R`v*yLX=%XxW|b3>sjgpMZ?+sx1PFURS?w z4|Y=Q{B8H=gPdH;wBY*k^JQQ;u=79Fu`qlSW{CNgc?)9d_W55p8{+0q1BS#&yPN(D zFMyI?Pkslv&7|FqQQ(e$KTztR-OqoZkT`Y$>~tM}MxY*$e>eD_w@l^H($KW#PX2txhU>v)i~$owAG0)Q0tK0XG?V#m28|QDE^#sh12L;5 zkVw86_K~6IX-uj(L+~j*2CkxBVTNNxQ)3x=Jk=RQRO}cz4@9g>?_ubXo zk19xmCeR>{9-z`s5|XGOX@P=$|0eDR&E3L4@r~Au2|iYg z3l5wGsVdye-Czi`mKCJOCYfb{!%bF)#&V#oKwCt9gxfH%0&Nm`q7IZ_HYJupB;qJ@ zfC9)BGC=QuywvmrXt~c*EueL$r}{BS82bTz_w^l1!^Szea~KS!?gr}ed0JJ@bRgoJ znIFT9Q+L0Eg9>Dsg8NO@0}SAATKwW`Rqa%~) fK+Lwgz<~O%mdpIexg*;S7-tNgu6{1-oD!M<^VF;d