mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-10 11:58:36 -05:00
added display of trust level in NetworkDialog
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3827 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1585606c4c
commit
58dcb79f42
@ -18,6 +18,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
#include <gpgme.h>
|
||||||
|
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
@ -392,9 +393,9 @@ void NetworkDialog::insertConnect()
|
|||||||
QList<QTreeWidgetItem *> unvalidItems;
|
QList<QTreeWidgetItem *> unvalidItems;
|
||||||
for(it = neighs.begin(); it != neighs.end(); it++)
|
for(it = neighs.begin(); it != neighs.end(); it++)
|
||||||
{
|
{
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
std::cerr << "NetworkDialog::insertConnect() inserting gpg key : " << *it << std::endl;
|
std::cerr << "NetworkDialog::insertConnect() inserting gpg key : " << *it << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (*it == rsPeers->getGPGOwnId()) {
|
if (*it == rsPeers->getGPGOwnId()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -416,9 +417,9 @@ void NetworkDialog::insertConnect()
|
|||||||
item = list.front();
|
item = list.front();
|
||||||
} else {
|
} else {
|
||||||
//create new item
|
//create new item
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
std::cerr << "NetworkDialog::insertConnect() creating new tree widget item : " << *it << std::endl;
|
std::cerr << "NetworkDialog::insertConnect() creating new tree widget item : " << *it << std::endl;
|
||||||
#endif
|
#endif
|
||||||
item = new RSTreeWidgetItem(NULL, 0);
|
item = new RSTreeWidgetItem(NULL, 0);
|
||||||
item -> setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
item -> setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
||||||
item -> setSizeHint(0, QSize( 18,18 ) );
|
item -> setSizeHint(0, QSize( 18,18 ) );
|
||||||
@ -431,21 +432,32 @@ void NetworkDialog::insertConnect()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString TrustLevelString ;
|
||||||
|
|
||||||
/* (2) Key validity */
|
/* (2) Key validity */
|
||||||
if (detail.ownsign) {
|
if (detail.ownsign)
|
||||||
item -> setText(2, tr("Authenticated"));
|
{
|
||||||
item -> setToolTip(2, tr("GPG key signed"));
|
item -> setText(2, tr("Personal signature"));
|
||||||
} else {
|
item -> setToolTip(2, tr("GPG key signed by you"));
|
||||||
item -> setText(2, tr("Not Authenticated"));
|
}
|
||||||
item -> setToolTip(2, tr("GPG key not signed"));
|
else
|
||||||
|
switch(detail.validLvl)
|
||||||
|
{
|
||||||
|
case GPGME_VALIDITY_MARGINAL: item->setText(2,tr("Marginally trusted peer")) ; break;
|
||||||
|
case GPGME_VALIDITY_FULL:
|
||||||
|
case GPGME_VALIDITY_ULTIMATE: item->setText(2,tr("Fully trusted peer")) ; break ;
|
||||||
|
case GPGME_VALIDITY_UNKNOWN:
|
||||||
|
case GPGME_VALIDITY_UNDEFINED:
|
||||||
|
case GPGME_VALIDITY_NEVER:
|
||||||
|
default: item->setText(2,tr("Untrusted peer")) ; break ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString PeerAuthenticationString = tr("Unknown") ;
|
||||||
/* (3) has me auth */
|
/* (3) has me auth */
|
||||||
if (detail.hasSignedMe)
|
if (detail.hasSignedMe)
|
||||||
item -> setText(3, tr("Has authenticated me"));
|
PeerAuthenticationString = tr("Has authenticated me");
|
||||||
else
|
|
||||||
item -> setText(3, tr("Unknown"));
|
|
||||||
|
|
||||||
|
item->setText(3,PeerAuthenticationString) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determinated the Background Color
|
* Determinated the Background Color
|
||||||
|
Loading…
x
Reference in New Issue
Block a user