mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04: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
1 changed files with 126 additions and 114 deletions
|
@ -18,6 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include <gpgme.h>
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QFileDialog>
|
||||
|
@ -392,9 +393,9 @@ void NetworkDialog::insertConnect()
|
|||
QList<QTreeWidgetItem *> unvalidItems;
|
||||
for(it = neighs.begin(); it != neighs.end(); it++)
|
||||
{
|
||||
#ifdef NET_DEBUG
|
||||
#ifdef NET_DEBUG
|
||||
std::cerr << "NetworkDialog::insertConnect() inserting gpg key : " << *it << std::endl;
|
||||
#endif
|
||||
#endif
|
||||
if (*it == rsPeers->getGPGOwnId()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -416,9 +417,9 @@ void NetworkDialog::insertConnect()
|
|||
item = list.front();
|
||||
} else {
|
||||
//create new item
|
||||
#ifdef NET_DEBUG
|
||||
#ifdef NET_DEBUG
|
||||
std::cerr << "NetworkDialog::insertConnect() creating new tree widget item : " << *it << std::endl;
|
||||
#endif
|
||||
#endif
|
||||
item = new RSTreeWidgetItem(NULL, 0);
|
||||
item -> setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
||||
item -> setSizeHint(0, QSize( 18,18 ) );
|
||||
|
@ -431,21 +432,32 @@ void NetworkDialog::insertConnect()
|
|||
}
|
||||
}
|
||||
|
||||
QString TrustLevelString ;
|
||||
|
||||
/* (2) Key validity */
|
||||
if (detail.ownsign) {
|
||||
item -> setText(2, tr("Authenticated"));
|
||||
item -> setToolTip(2, tr("GPG key signed"));
|
||||
} else {
|
||||
item -> setText(2, tr("Not Authenticated"));
|
||||
item -> setToolTip(2, tr("GPG key not signed"));
|
||||
if (detail.ownsign)
|
||||
{
|
||||
item -> setText(2, tr("Personal signature"));
|
||||
item -> setToolTip(2, tr("GPG key signed by you"));
|
||||
}
|
||||
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 */
|
||||
if (detail.hasSignedMe)
|
||||
item -> setText(3, tr("Has authenticated me"));
|
||||
else
|
||||
item -> setText(3, tr("Unknown"));
|
||||
PeerAuthenticationString = tr("Has authenticated me");
|
||||
|
||||
item->setText(3,PeerAuthenticationString) ;
|
||||
|
||||
/**
|
||||
* Determinated the Background Color
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue