make peer details work for GPG key in the network view gui

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2010 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-01-13 21:11:02 +00:00
parent 77b3c0afd0
commit 41600dc3cf
13 changed files with 472 additions and 486 deletions

View File

@ -912,7 +912,9 @@ bool AuthGPG::getPGPDetails(std::string id, RsPeerDetails &d)
d.trustLvl = it->second.trustLvl; d.trustLvl = it->second.trustLvl;
d.validLvl = it->second.validLvl; d.validLvl = it->second.validLvl;
d.ownsign = it->second.ownsign; d.ownsign = it->second.ownsign;
d.signers = it->second.signers; d.gpgSigners = it->second.signers;
std::cerr << "AuthGPG::getPGPDetails() get details for : " << id << std::endl;
std::cerr << "AuthGPG::getPGPDetails() Name : " << it->second.name << std::endl;
return true; return true;
} else { } else {
return false; return false;
@ -926,8 +928,7 @@ bool AuthGPG::decryptText(gpgme_data_t CIPHER, gpgme_data_t PLAIN) {
if (GPG_ERR_NO_ERROR != (ERR = gpgme_op_decrypt (CTX, CIPHER, PLAIN))) if (GPG_ERR_NO_ERROR != (ERR = gpgme_op_decrypt (CTX, CIPHER, PLAIN)))
{ {
ProcessPGPmeError(ERR); ProcessPGPmeError(ERR);
std::cerr << "AuthGPG::decryptText() Error decrypting text."; std::cerr << "AuthGPG::decryptText() Error decrypting text." << std::endl;
std::cerr << std::endl;
return false; return false;
} }

View File

@ -86,7 +86,7 @@ class RsPeerDetails
std::string fpr; /* pgp fingerprint */ std::string fpr; /* pgp fingerprint */
std::string authcode; std::string authcode;
std::list<std::string> signers; std::list<std::string> gpgSigners;
uint32_t trustLvl; uint32_t trustLvl;
uint32_t validLvl; uint32_t validLvl;
@ -140,6 +140,7 @@ virtual bool getPeerDetails(std::string id, RsPeerDetails &d) = 0;
/* Using PGP Ids */ /* Using PGP Ids */
virtual std::string getPGPOwnId() = 0; virtual std::string getPGPOwnId() = 0;
virtual std::string getPGPId(std::string ssl_id) = 0;
virtual bool getPGPFriendList(std::list<std::string> &ids) = 0; virtual bool getPGPFriendList(std::list<std::string> &ids) = 0;
virtual bool getPGPAllList(std::list<std::string> &ids) = 0; virtual bool getPGPAllList(std::list<std::string> &ids) = 0;
virtual bool getPGPDetails(std::string id, RsPeerDetails &d) = 0; virtual bool getPGPDetails(std::string id, RsPeerDetails &d) = 0;

View File

@ -314,7 +314,7 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
d.email = authDetail.email; d.email = authDetail.email;
d.location = authDetail.location; d.location = authDetail.location;
d.org = authDetail.org; d.org = authDetail.org;
d.signers = authDetail.signers; d.gpgSigners = authDetail.signers;
d.issuer = authDetail.issuer; d.issuer = authDetail.issuer;
@ -552,13 +552,12 @@ bool p3Peers::getPGPAllList(std::list<std::string> &ids)
bool p3Peers::getPGPDetails(std::string id, RsPeerDetails &d) bool p3Peers::getPGPDetails(std::string id, RsPeerDetails &d)
{ {
#ifdef P3PEERS_DEBUG #ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::getPgpDetails()"; std::cerr << "p3Peers::getPgpDetails() called for id : " << id;
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
/* get from mAuthMgr */ /* get from mAuthMgr */
AuthGPG::getAuthGPG()->getPGPDetails(id, d); return AuthGPG::getAuthGPG()->getPGPDetails(id, d);
return true;
} }
std::string p3Peers::getPGPOwnId() std::string p3Peers::getPGPOwnId()
@ -572,6 +571,16 @@ std::string p3Peers::getPGPOwnId()
return AuthGPG::getAuthGPG()->PGPOwnId(); return AuthGPG::getAuthGPG()->PGPOwnId();
} }
std::string p3Peers::getPGPId(std::string ssl_id)
{
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::getPGPId()";
std::cerr << std::endl;
#endif
/* get from mAuthMgr */
return AuthSSL::getAuthSSL()->getGPGId(ssl_id);
}
@ -970,8 +979,8 @@ std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail)
out << std::endl; out << std::endl;
std::list<std::string>::const_iterator it; std::list<std::string>::const_iterator it;
for(it = detail.signers.begin(); for(it = detail.gpgSigners.begin();
it != detail.signers.end(); it++) it != detail.gpgSigners.end(); it++)
{ {
out << "\t" << *it; out << "\t" << *it;
out << std::endl; out << std::endl;

View File

@ -55,6 +55,7 @@ virtual bool getPeerDetails(std::string id, RsPeerDetails &d);
/* Using PGP Ids */ /* Using PGP Ids */
virtual std::string getPGPOwnId(); virtual std::string getPGPOwnId();
virtual std::string getPGPId(std::string ssl_id);
virtual bool getPGPFriendList(std::list<std::string> &ids); virtual bool getPGPFriendList(std::list<std::string> &ids);
virtual bool getPGPAllList(std::list<std::string> &ids); virtual bool getPGPAllList(std::list<std::string> &ids);
virtual bool getPGPDetails(std::string id, RsPeerDetails &d); virtual bool getPGPDetails(std::string id, RsPeerDetails &d);

View File

@ -500,7 +500,7 @@ void p3disc::sendPeerDetails(std::string to, std::string about)
RsPeerDetails pd ; RsPeerDetails pd ;
std::string name = rsPeers->getPeerName(about) ; std::string name = rsPeers->getPeerName(about) ;
if(rsPeers->getPeerDetails(to,pd)) if(rsPeers->getPeerDetails(to,pd))
for(std::list<std::string>::const_iterator it(pd.signers.begin());it!=pd.signers.end();++it) for(std::list<std::string>::const_iterator it(pd.gpgSigners.begin());it!=pd.gpgSigners.end();++it)
if(*it == name) if(*it == name)
{ {
di->discFlags |= P3DISC_FLAGS_PEER_TRUSTS_ME; di->discFlags |= P3DISC_FLAGS_PEER_TRUSTS_ME;

View File

@ -178,7 +178,7 @@ void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier ); QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
contextMnu.clear(); contextMnu.clear();
std::string peer_id = wi->text(9).toStdString() ; std::string peer_id = wi->text(3).toStdString() ;
// That's what context menus are made for // That's what context menus are made for
RsPeerDetails detail; RsPeerDetails detail;
@ -380,7 +380,7 @@ void NetworkDialog::insertConnect()
/* (2) has me auth */ /* (2) has me auth */
bool hasSignedMe = false; bool hasSignedMe = false;
std::list<std::string>::iterator signersIt; std::list<std::string>::iterator signersIt;
for(signersIt = ownGPGDetails.signers.begin(); signersIt != ownGPGDetails.signers.end() ; ++signersIt) { for(signersIt = ownGPGDetails.gpgSigners.begin(); signersIt != ownGPGDetails.gpgSigners.end() ; ++signersIt) {
if (*signersIt == detail.id) { if (*signersIt == detail.id) {
hasSignedMe = true; hasSignedMe = true;
break; break;

View File

@ -341,7 +341,7 @@ void NetworkView::insertSignatures()
continue; continue;
} }
for(sit = detail.signers.begin(); sit != detail.signers.end(); sit++) for(sit = detail.gpgSigners.begin(); sit != detail.gpgSigners.end(); sit++)
{ {
if (*it != *sit) if (*it != *sit)

View File

@ -162,7 +162,7 @@ void TrustView::update()
int i = getRowColId(details.id) ; int i = getRowColId(details.id) ;
std::string issuer(details.issuer) ; // the one we check for trust. std::string issuer(details.issuer) ; // the one we check for trust.
for(list<string>::const_iterator it2(details.signers.begin());it2!=details.signers.end();++it2) for(list<string>::const_iterator it2(details.gpgSigners.begin());it2!=details.gpgSigners.end();++it2)
{ {
cout << *it2 << " " ; cout << *it2 << " " ;

View File

@ -25,6 +25,7 @@
#include "rsiface/rsdisc.h" #include "rsiface/rsdisc.h"
#include <QTime> #include <QTime>
#include <QtGui>
ConfCertDialog *ConfCertDialog::instance() ConfCertDialog *ConfCertDialog::instance()
{ {
@ -46,7 +47,7 @@ ConfCertDialog::ConfCertDialog(QWidget *parent, Qt::WFlags flags)
connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog())); connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg())); connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg()));
connect(ui._makeFriendPB, SIGNAL(clicked()), this, SLOT(makeFriend())); connect(ui.sign_button, SIGNAL(clicked()), this, SLOT(makeFriend()));
ui.applyButton->setToolTip(tr("Apply and Close")); ui.applyButton->setToolTip(tr("Apply and Close"));
@ -93,42 +94,60 @@ void ConfCertDialog::loadId(std::string id)
void ConfCertDialog::loadDialog() void ConfCertDialog::loadDialog()
{ {
isPGPId = false;
RsPeerDetails detail; RsPeerDetails detail;
if (!rsPeers->getPeerDetails(mId, detail)) if (!rsPeers->getPeerDetails(mId, detail))
{ {
/* fail */ isPGPId = true;
return; if (!rsPeers->getPGPDetails(mId, detail)) {
} QMessageBox::information(this,
tr("RetroShare"),
tr("Error : cannot get peer details."));
this->close();
}
}
ui.name->setText(QString::fromStdString(detail.name)); ui.name->setText(QString::fromStdString(detail.name));
ui.orgloc->setText(QString::fromStdString(detail.org));
ui.country->setText(QString::fromStdString(detail.location));
ui.peerid->setText(QString::fromStdString(detail.id)); ui.peerid->setText(QString::fromStdString(detail.id));
// Dont Show a timestamp in RS calculate the day if (!isPGPId) {
QDateTime date = QDateTime::fromTime_t(detail.lastConnect); ui.orgloc->setText(QString::fromStdString(detail.org));
QString stime = date.toString(Qt::LocalDate); ui.country->setText(QString::fromStdString(detail.location));
ui.lastcontact-> setText(stime); // Dont Show a timestamp in RS calculate the day
QDateTime date = QDateTime::fromTime_t(detail.lastConnect);
QString stime = date.toString(Qt::LocalDate);
ui.lastcontact-> setText(stime);
/* set retroshare version */ /* set retroshare version */
std::map<std::string, std::string>::iterator vit; std::map<std::string, std::string>::iterator vit;
std::map<std::string, std::string> versions; std::map<std::string, std::string> versions;
bool retv = rsDisc->getDiscVersions(versions); bool retv = rsDisc->getDiscVersions(versions);
if (retv && versions.end() != (vit = versions.find(detail.id))) if (retv && versions.end() != (vit = versions.find(detail.id)))
{ {
ui.version->setText(QString::fromStdString(vit->second)); ui.version->setText(QString::fromStdString(vit->second));
} }
/* set local address */ /* set local address */
ui.localAddress->setText(QString::fromStdString(detail.localAddr)); ui.localAddress->setText(QString::fromStdString(detail.localAddr));
ui.localPort -> setValue(detail.localPort); ui.localPort -> setValue(detail.localPort);
/* set the server address */ /* set the server address */
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(); 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));
} else {
ui.orgloc->hide();
ui.label_11->hide();
ui.country->hide();
ui.label_8->hide();
ui.lastcontact->hide();
ui.label_7->hide();
ui.version->hide();
ui.label_3->hide();
ui.groupBox->hide();
}
/* set the url for DNS access (OLD) */ /* set the url for DNS access (OLD) */
//ui.extName->setText(QString::fromStdString("")); //ui.extName->setText(QString::fromStdString(""));
@ -143,17 +162,37 @@ void ConfCertDialog::loadDialog()
//ui.trustLvl->setText(QString::fromStdString(RsPeerTrustString(detail.trustLvl))); //ui.trustLvl->setText(QString::fromStdString(RsPeerTrustString(detail.trustLvl)));
ui._peerTrustsMeCB->setChecked(rsPeers->isOnline(detail.id) || rsPeers->isTrustingMe(detail.id)) ; if (detail.ownsign) {
ui._peerTrustsMeCB->setEnabled(false); ui.sign_button->hide();
ui.signBox->setChecked(detail.ownsign) ; ui.signed_already_label->show();
ui.signBox->setEnabled(!detail.ownsign) ; } else {
ui.sign_button->show();
ui.signed_already_label->hide();
}
ui._peerAcceptedCB->setChecked(detail.state & RS_PEER_STATE_FRIEND) ; bool hasSignedMe = false;
ui._peerAcceptedCB->setEnabled(detail.ownsign) ; RsPeerDetails ownGPGDetails ;
rsPeers->getPGPDetails(rsPeers->getPGPOwnId(), ownGPGDetails);
std::list<std::string>::iterator signersIt;
for(signersIt = ownGPGDetails.gpgSigners.begin(); signersIt != ownGPGDetails.gpgSigners.end() ; ++signersIt) {
if (*signersIt == detail.id) {
hasSignedMe = true;
break;
}
}
if (hasSignedMe) {
ui.is_signing_me->setText(tr("Peer has acepted me as a friend and did not signed my GPG key"));
} else {
ui.is_signing_me->setText(tr("Peer has not acepted me as a friend and did not signed my GPG key"));
}
ui.signers->clear() ; ui.signers->clear() ;
for(std::list<std::string>::const_iterator it(detail.signers.begin());it!=detail.signers.end();++it) for(std::list<std::string>::const_iterator it(detail.gpgSigners.begin());it!=detail.gpgSigners.end();++it) {
ui.signers->append(QString::fromStdString(*it)) ; RsPeerDetails signerDetail;
if (rsPeers->getPGPDetails(*it, signerDetail)) {
ui.signers->append(QString::fromStdString(signerDetail.name));
}
}
} }
@ -172,8 +211,6 @@ void ConfCertDialog::applyDialog()
bool localChanged = false; bool localChanged = false;
bool extChanged = false; bool extChanged = false;
bool fwChanged = false; bool fwChanged = false;
bool signChanged = false;
bool trustChanged = 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()))
@ -182,14 +219,6 @@ 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.ownsign)
{
if (ui._peerAcceptedCB->isChecked() != ((detail.state & RS_PEER_STATE_FRIEND) > 0))
trustChanged = true;
}
else if (ui.signBox->isChecked())
signChanged = 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());
@ -197,61 +226,18 @@ 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 0
if (fwChanged)
rsicontrol -> FriendSetFirewall(mId, ui.chkFirewall->isChecked(),
ui.chkForwarded->isChecked());
#endif
if (signChanged)
{
std::cerr << "Signature changed. Signing certificate" << mId << std::endl ;
rsPeers->SignCertificate(mId);
}
if (trustChanged)
{
std::cerr << "Acceptance changed. Authing ceAuthrtificate" << mId << std::endl ;
if(ui._peerAcceptedCB->isChecked())
rsPeers->AuthCertificate(mId, "");
else
rsPeers->removeFriend(mId);
}
/* reload now */ /* reload now */
loadDialog(); loadDialog();
/* close the Dialog after the Changes applied */ /* close the Dialog after the Changes applied */
closeinfodlg(); closeinfodlg();
if(trustChanged || signChanged || localChanged || extChanged) if(localChanged || extChanged)
emit configChanged() ; emit configChanged() ;
} }
void ConfCertDialog::makeFriend() void ConfCertDialog::makeFriend()
{ {
ui.signBox->setChecked(true) ; rsPeers->SignGPGCertificate(mId);
ui._peerAcceptedCB->setChecked(true) ; loadDialog();
// rsPeers->TrustCertificate(mId, ui.trustBox->isChecked());
// rsPeers->SignCertificate(mId);
} }
#if 0
void ConfCertDialog::setInfo(std::string name,
std::string trust,
std::string org,
std::string loc,
std::string country,
std::string signers)
{
ui.name->setText(QString::fromStdString(name));
ui.trustLvl->setText(QString::fromStdString(trust));
ui.orgloc->setText(QString::fromStdString(org + loc));
//ui.loc->setText(QString::fromStdString(loc));
//ui.country->setText(QString::fromStdString(country));
//ui.signers->setText(QString::fromStdString(signers));
}
#endif

View File

@ -76,6 +76,7 @@ private:
void loadDialog(); void loadDialog();
std::string mId; std::string mId;
bool isPGPId;
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::ConfCertDialog ui; Ui::ConfCertDialog ui;

View File

@ -1,372 +1,359 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>ConfCertDialog</class> <class>ConfCertDialog</class>
<widget class="QDialog" name="ConfCertDialog"> <widget class="QDialog" name="ConfCertDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>506</width> <width>506</width>
<height>474</height> <height>523</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Peer Details</string> <string>Peer Details</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset> <normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="stabWidget"> <widget class="QTabWidget" name="stabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="icon"> <attribute name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/peerdetails_16x16.png</normaloff>:/images/peerdetails_16x16.png</iconset> <normaloff>:/images/peerdetails_16x16.png</normaloff>:/images/peerdetails_16x16.png</iconset>
</attribute> </attribute>
<attribute name="title"> <attribute name="title">
<string>Details</string> <string>Details</string>
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
<string>Peer Info</string> <string>Peer Info</string>
</property> </property>
<layout class="QGridLayout" name="_2"> <layout class="QGridLayout" name="_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="text"> <property name="text">
<string>Name:</string> <string>Name:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="name"> <widget class="QLineEdit" name="name">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
<property name="text"> <property name="text">
<string>Org / Loc:</string> <string>Org / Loc:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="orgloc"> <widget class="QLineEdit" name="orgloc">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
<property name="text"> <property name="text">
<string>Country/State:</string> <string>Country/State:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLineEdit" name="country"> <widget class="QLineEdit" name="country">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Peer ID</string> <string>Peer ID</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLineEdit" name="peerid"> <widget class="QLineEdit" name="peerid">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string>Last Contact</string> <string>Last Contact</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QLineEdit" name="lastcontact"> <widget class="QLineEdit" name="lastcontact">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QLineEdit" name="version"> <widget class="QLineEdit" name="version">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Version</string> <string>Version</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Peer Address</string> <string>Peer Address</string>
</property> </property>
<layout class="QVBoxLayout" name="_3"> <layout class="QVBoxLayout" name="_3">
<item> <item>
<layout class="QHBoxLayout" name="_4"> <layout class="QHBoxLayout" name="_4">
<item> <item>
<layout class="QVBoxLayout" name="_5"> <layout class="QVBoxLayout" name="_5">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="layoutDirection"> <property name="layoutDirection">
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
<property name="text"> <property name="text">
<string>Local Address:</string> <string>Local Address:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>External Address:</string> <string>External Address:</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="_6"> <layout class="QVBoxLayout" name="_6">
<item> <item>
<widget class="QLineEdit" name="localAddress"/> <widget class="QLineEdit" name="localAddress"/>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="extAddress"/> <widget class="QLineEdit" name="extAddress"/>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="_7"> <layout class="QVBoxLayout" name="_7">
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="text"> <property name="text">
<string>Port:</string> <string>Port:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Port:</string> <string>Port:</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="_8"> <layout class="QVBoxLayout" name="_8">
<item> <item>
<widget class="QSpinBox" name="localPort"> <widget class="QSpinBox" name="localPort">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>65535</number> <number>65535</number>
</property> </property>
<property name="value"> <property name="value">
<number>7812</number> <number>7812</number>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="extPort"> <widget class="QSpinBox" name="extPort">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>65535</number> <number>65535</number>
</property> </property>
<property name="value"> <property name="value">
<number>7812</number> <number>7812</number>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="text"> <property name="text">
<string>Addresses list</string> <string>Addresses list</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QListWidget" name="ipAddressList"/> <widget class="QListWidget" name="ipAddressList"/>
</item> </item>
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>47</height> <height>47</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_2"> <widget class="QWidget" name="tab_2">
<attribute name="icon"> <attribute name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/security-high-16.png</normaloff>:/images/security-high-16.png</iconset> <normaloff>:/images/security-high-16.png</normaloff>:/images/security-high-16.png</iconset>
</attribute> </attribute>
<attribute name="title"> <attribute name="title">
<string>Trust </string> <string>Trust </string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="_9"> <layout class="QVBoxLayout" name="_9">
<item> <item>
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="groupBox_3">
<property name="title"> <property name="title">
<string>Trust Settings</string> <string>Key signing settings</string>
</property> </property>
<layout class="QVBoxLayout" name="_10"> <layout class="QVBoxLayout" name="_10">
<item> <item>
<widget class="QCheckBox" name="signBox"> <widget class="QLabel" name="is_signing_me">
<property name="toolTip"> <property name="text">
<string comment="Once signed, you cannot unsign a certificate, only deny connexions."/> <string>Peer has signed my GPG key</string>
</property> </property>
<property name="text"> </widget>
<string>Sign this certificate</string> </item>
</property> <item>
</widget> <widget class="QGroupBox" name="groupBox_4">
</item> <property name="title">
<item> <string>Peer key is already signed by :</string>
<widget class="QCheckBox" name="_peerAcceptedCB"> </property>
<property name="text"> <layout class="QVBoxLayout" name="_11">
<string>Accept connexions from this peer</string> <item>
</property> <widget class="QTextBrowser" name="signers"/>
</widget> </item>
</item> </layout>
<item> </widget>
<widget class="QCheckBox" name="_peerTrustsMeCB"> </item>
<property name="toolTip"> <item>
<string/> <widget class="QLabel" name="signed_already_label">
</property> <property name="text">
<property name="text"> <string>Peer is already a friend of me (his GPG key is signed by me)</string>
<string>Peer has signed my certficate</string> </property>
</property> </widget>
</widget> </item>
</item> <item>
</layout> <widget class="QPushButton" name="sign_button">
</widget> <property name="text">
</item> <string>Make friend (Sign his GPG key)</string>
<item> </property>
<widget class="QGroupBox" name="groupBox_4"> </widget>
<property name="title"> </item>
<string>Certificate signers</string> </layout>
</property> </widget>
<layout class="QVBoxLayout" name="_11"> </item>
<item> <item>
<widget class="QTextBrowser" name="signers"/> <spacer>
</item> <property name="orientation">
</layout> <enum>Qt::Vertical</enum>
</widget> </property>
</item> <property name="sizeHint" stdset="0">
<item> <size>
<widget class="QPushButton" name="_makeFriendPB"> <width>451</width>
<property name="text"> <height>131</height>
<string>Make friend (Sign certificate and accept)</string> </size>
</property> </property>
</widget> </spacer>
</item> </item>
<item> </layout>
<spacer> </widget>
<property name="orientation"> </widget>
<enum>Qt::Vertical</enum> </item>
</property> <item row="1" column="0">
<property name="sizeHint" stdset="0"> <layout class="QGridLayout" name="_12">
<size> <item row="0" column="0">
<width>451</width> <spacer>
<height>131</height> <property name="orientation">
</size> <enum>Qt::Horizontal</enum>
</property> </property>
</spacer> <property name="sizeHint" stdset="0">
</item> <size>
</layout> <width>311</width>
</widget> <height>20</height>
</widget> </size>
</item> </property>
<item row="1" column="0"> </spacer>
<layout class="QGridLayout" name="_12"> </item>
<item row="0" column="0"> <item row="0" column="1">
<spacer> <widget class="QPushButton" name="cancelButton">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Cancel</string>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size> </item>
<width>311</width> <item row="0" column="2">
<height>20</height> <widget class="QPushButton" name="applyButton">
</size> <property name="text">
</property> <string>OK</string>
</spacer> </property>
</item> <property name="autoDefault">
<item row="0" column="1"> <bool>false</bool>
<widget class="QPushButton" name="cancelButton"> </property>
<property name="text"> <property name="default">
<string>Cancel</string> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> </layout>
<widget class="QPushButton" name="applyButton"> </item>
<property name="text"> </layout>
<string>OK</string> </widget>
</property> <resources>
<property name="autoDefault"> <include location="../images.qrc"/>
<bool>false</bool> </resources>
</property> <connections/>
<property name="default"> </ui>
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -130,7 +130,7 @@ void ConnectDialog::authAttempt()
/* well lets do it ! */ /* well lets do it ! */
std::cerr << "Attempting AuthCode:" << authCode << std::endl; std::cerr << "Attempting AuthCode:" << authCode << std::endl;
rsPeers->AuthCertificate(authId, authCode); //rsPeers->AuthCertificate(authId, authCode);
rsPeers->addFriend(authId); rsPeers->addFriend(authId);
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_NEIGHBOURS,1) ; rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_NEIGHBOURS,1) ;
@ -166,7 +166,7 @@ bool ConnectDialog::loadPeer(std::string id)
std::ostringstream out; std::ostringstream out;
std::list<std::string>::iterator it; std::list<std::string>::iterator it;
for(it = detail.signers.begin(); it != detail.signers.end(); it++) for(it = detail.gpgSigners.begin(); it != detail.gpgSigners.end(); it++)
{ {
out << rsPeers->getPeerName(*it) << " <" << *it << ">"; out << rsPeers->getPeerName(*it) << " <" << *it << ">";
out << std::endl; out << std::endl;

View File

@ -97,7 +97,7 @@ ConnectFriendWizard::accept()
std::string authId = field("idField").toString().toStdString(); std::string authId = field("idField").toString().toStdString();
std::string authCode = field("authCode").toString().toStdString(); std::string authCode = field("authCode").toString().toStdString();
rsPeers->AuthCertificate(authId, authCode ); //rsPeers->AuthCertificate(authId, authCode );
rsPeers->addFriend(authId); rsPeers->addFriend(authId);
//let's check if there is ip adresses in the wizard. //let's check if there is ip adresses in the wizard.
@ -485,7 +485,7 @@ void FofPage::updatePeersList(int e)
std::set<std::string> common_friends ; std::set<std::string> common_friends ;
for(std::list<std::string>::const_iterator it2(details.signers.begin());it2!=details.signers.end();++it2) for(std::list<std::string>::const_iterator it2(details.gpgSigners.begin());it2!=details.gpgSigners.end();++it2)
if(my_friends_names.find(*it2) != my_friends_names.end() && *it2 != details.name) if(my_friends_names.find(*it2) != my_friends_names.end() && *it2 != details.name)
common_friends.insert(*it2) ; common_friends.insert(*it2) ;
@ -565,7 +565,7 @@ void FofPage::signAllSelectedUsers()
if(it->first->isChecked()) if(it->first->isChecked())
{ {
std::cerr << "Making friend with " << it->second << std::endl ; std::cerr << "Making friend with " << it->second << std::endl ;
rsPeers->AuthCertificate(it->second, ""); //rsPeers->AuthCertificate(it->second, "");
rsPeers->addFriend(it->second); rsPeers->addFriend(it->second);
} }
@ -868,7 +868,7 @@ ConclusionPage::initializePage()
QString ts; QString ts;
std::list<std::string>::iterator it; std::list<std::string>::iterator it;
for(it = detail.signers.begin(); it != detail.signers.end(); it++) for(it = detail.gpgSigners.begin(); it != detail.gpgSigners.end(); it++)
{ {
ts.append(QString::fromStdString( rsPeers->getPeerName(*it) )); ts.append(QString::fromStdString( rsPeers->getPeerName(*it) ));
ts.append( "<" ) ; ts.append( "<" ) ;