mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-21 23:40:26 -04:00
removed old includes of gpgme. Updated values for trust
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5279 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
93f08ae730
commit
fa6674fd01
9 changed files with 68 additions and 188 deletions
|
@ -18,7 +18,6 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include <gpgme.h>
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QDebug>
|
||||
|
@ -311,50 +310,6 @@ void NetworkDialog::copyLink()
|
|||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
|
||||
/** Open a QFileDialog to browse for a pem/pqi file. */
|
||||
//void NetworkDialog::loadcert()
|
||||
//{
|
||||
// use misc::getOpenFileName
|
||||
// /* Create a new input dialog, which allows users to create files, too */
|
||||
// QFileDialog dialog (this, tr("Select a pem/pqi File"));
|
||||
// //dialog.setDirectory(QFileInfo(ui.lineTorConfig->text()).absoluteDir());
|
||||
// //dialog.selectFile(QFileInfo(ui.lineTorConfig->text()).fileName());
|
||||
// dialog.setFileMode(QFileDialog::AnyFile);
|
||||
// dialog.setReadOnly(false);
|
||||
//
|
||||
// /* Prompt the user to select a file or create a new one */
|
||||
// if (!dialog.exec() || dialog.selectedFiles().isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
// QString filename = QDir::convertSeparators(dialog.selectedFiles().at(0));
|
||||
//
|
||||
// /* Check if the file exists */
|
||||
// QFile torrcFile(filename);
|
||||
// if (!QFileInfo(filename).exists()) {
|
||||
// /* The given file does not exist. Should we create it? */
|
||||
// int response = VMessageBox::question(this,
|
||||
// tr("File Not Found"),
|
||||
// tr("%1 does not exist. Would you like to create it?")
|
||||
// .arg(filename),
|
||||
// VMessageBox::Yes, VMessageBox::No);
|
||||
//
|
||||
// if (response == VMessageBox::No) {
|
||||
// /* Don't create it. Just bail. */
|
||||
// return;
|
||||
// }
|
||||
// /* Attempt to create the specified file */
|
||||
// if (!torrcFile.open(QIODevice::WriteOnly)) {
|
||||
// VMessageBox::warning(this,
|
||||
// tr("Failed to Create File"),
|
||||
// tr("Unable to create %1 [%2]").arg(filename)
|
||||
// .arg(torrcFile.errorString()),
|
||||
// VMessageBox::Ok);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// //ui.lineTorConfig->setText(filename);
|
||||
//}
|
||||
|
||||
void NetworkDialog::updateDisplay()
|
||||
{
|
||||
insertConnect() ;
|
||||
|
@ -393,7 +348,7 @@ void NetworkDialog::insertConnect()
|
|||
while (index < connectWidget->topLevelItemCount()) {
|
||||
std::string gpg_widget_id = (connectWidget->topLevelItem(index))->text(COLUMN_PEERID).toStdString();
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || (detail.validLvl < GPGME_VALIDITY_MARGINAL && !detail.accept_connection)) {
|
||||
if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || (detail.validLvl < RS_TRUST_LVL_MARGINAL && !detail.accept_connection)) {
|
||||
delete (connectWidget->takeTopLevelItem(index));
|
||||
} else {
|
||||
index++;
|
||||
|
@ -403,7 +358,7 @@ void NetworkDialog::insertConnect()
|
|||
while (index < ui.unvalidGPGkeyWidget->topLevelItemCount()) {
|
||||
std::string gpg_widget_id = (ui.unvalidGPGkeyWidget->topLevelItem(index))->text(COLUMN_PEERID).toStdString();
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || detail.validLvl >= GPGME_VALIDITY_MARGINAL || detail.accept_connection) {
|
||||
if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || detail.validLvl >= RS_TRUST_LVL_MARGINAL || detail.accept_connection) {
|
||||
delete (ui.unvalidGPGkeyWidget->takeTopLevelItem(index));
|
||||
} else {
|
||||
index++;
|
||||
|
@ -464,12 +419,12 @@ void NetworkDialog::insertConnect()
|
|||
else
|
||||
switch(detail.trustLvl)
|
||||
{
|
||||
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:
|
||||
case RS_TRUST_LVL_MARGINAL: item->setText(2,tr("Marginally trusted peer")) ; break;
|
||||
case RS_TRUST_LVL_FULL:
|
||||
case RS_TRUST_LVL_ULTIMATE: item->setText(2,tr("Fully trusted peer")) ; break ;
|
||||
case RS_TRUST_LVL_UNKNOWN:
|
||||
case RS_TRUST_LVL_UNDEFINED:
|
||||
case RS_TRUST_LVL_NEVER:
|
||||
default: item->setText(2,tr("Untrusted peer")) ; break ;
|
||||
}
|
||||
|
||||
|
@ -524,7 +479,7 @@ void NetworkDialog::insertConnect()
|
|||
item -> setBackground(i,QBrush(backgrndcolor));
|
||||
|
||||
/* add to the list */
|
||||
if (detail.accept_connection || detail.validLvl >= GPGME_VALIDITY_MARGINAL)
|
||||
if (detail.accept_connection || detail.validLvl >= RS_TRUST_LVL_MARGINAL)
|
||||
{
|
||||
/* add gpg item to the list. If item is already in the list, it won't be duplicated thanks to Qt */
|
||||
connectWidget->addTopLevelItem(item);
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsdisc.h>
|
||||
|
||||
#include <gpgme.h>
|
||||
|
||||
#include <deque>
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
|
@ -160,12 +158,12 @@ void NetworkView::updateDisplay()
|
|||
|
||||
switch(detail.trustLvl)
|
||||
{
|
||||
case GPGME_VALIDITY_MARGINAL: auth = GraphWidget::ELASTIC_NODE_AUTH_MARGINAL ; break;
|
||||
case GPGME_VALIDITY_FULL:
|
||||
case GPGME_VALIDITY_ULTIMATE: auth = GraphWidget::ELASTIC_NODE_AUTH_FULL ; break;
|
||||
case GPGME_VALIDITY_UNKNOWN:
|
||||
case GPGME_VALIDITY_UNDEFINED:
|
||||
case GPGME_VALIDITY_NEVER:
|
||||
case RS_TRUST_LVL_MARGINAL: auth = GraphWidget::ELASTIC_NODE_AUTH_MARGINAL ; break;
|
||||
case RS_TRUST_LVL_FULL:
|
||||
case RS_TRUST_LVL_ULTIMATE: auth = GraphWidget::ELASTIC_NODE_AUTH_FULL ; break;
|
||||
case RS_TRUST_LVL_UNKNOWN:
|
||||
case RS_TRUST_LVL_UNDEFINED:
|
||||
case RS_TRUST_LVL_NEVER:
|
||||
default: auth = GraphWidget::ELASTIC_NODE_AUTH_UNKNOWN ; break ;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include <gpgme.h>
|
||||
|
||||
#include "ConfCertDialog.h"
|
||||
|
||||
|
@ -268,7 +267,7 @@ void ConfCertDialog::load()
|
|||
}
|
||||
|
||||
//web of trust
|
||||
if (detail.trustLvl == GPGME_VALIDITY_ULTIMATE) {
|
||||
if (detail.trustLvl == RS_TRUST_LVL_ULTIMATE) {
|
||||
//trust is ultimate, it means it's one of our own keys
|
||||
ui.web_of_trust_label->setText(tr("Your trust in this peer is ultimate, it's probably a key you own."));
|
||||
ui.radioButton_trust_fully->hide();
|
||||
|
@ -278,19 +277,19 @@ void ConfCertDialog::load()
|
|||
ui.radioButton_trust_fully->show();
|
||||
ui.radioButton_trust_marginnaly->show();
|
||||
ui.radioButton_trust_never->show();
|
||||
if (detail.trustLvl == GPGME_VALIDITY_FULL) {
|
||||
if (detail.trustLvl == RS_TRUST_LVL_FULL) {
|
||||
ui.web_of_trust_label->setText(tr("Your trust in this peer is full."));
|
||||
ui.radioButton_trust_fully->setChecked(true);
|
||||
ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-48.png"));
|
||||
ui.radioButton_trust_marginnaly->setIcon(QIcon(":/images/security-medium-off-48.png"));
|
||||
ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-off-48.png"));
|
||||
} else if (detail.trustLvl == GPGME_VALIDITY_MARGINAL) {
|
||||
} else if (detail.trustLvl == RS_TRUST_LVL_MARGINAL) {
|
||||
ui.web_of_trust_label->setText(tr("Your trust in this peer is marginal."));
|
||||
ui.radioButton_trust_marginnaly->setChecked(true);
|
||||
ui.radioButton_trust_marginnaly->setIcon(QIcon(":/images/security-medium-48.png"));
|
||||
ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-off-48.png"));
|
||||
ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-off-48.png"));
|
||||
} else if (detail.trustLvl == GPGME_VALIDITY_NEVER) {
|
||||
} else if (detail.trustLvl == RS_TRUST_LVL_NEVER) {
|
||||
ui.web_of_trust_label->setText(tr("Your trust in this peer is none."));
|
||||
ui.radioButton_trust_never->setChecked(true);
|
||||
ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-48.png"));
|
||||
|
@ -379,13 +378,13 @@ void ConfCertDialog::applyDialog()
|
|||
}
|
||||
|
||||
//check the GPG trustlvl
|
||||
if (ui.radioButton_trust_fully->isChecked() && detail.trustLvl != GPGME_VALIDITY_FULL) {
|
||||
if (ui.radioButton_trust_fully->isChecked() && detail.trustLvl != RS_TRUST_LVL_FULL) {
|
||||
//trust has changed to fully
|
||||
rsPeers->trustGPGCertificate(detail.id, GPGME_VALIDITY_FULL);
|
||||
} else if (ui.radioButton_trust_marginnaly->isChecked() && detail.trustLvl != GPGME_VALIDITY_MARGINAL) {
|
||||
rsPeers->trustGPGCertificate(detail.id, GPGME_VALIDITY_MARGINAL);
|
||||
} else if (ui.radioButton_trust_never->isChecked() && detail.trustLvl != GPGME_VALIDITY_NEVER) {
|
||||
rsPeers->trustGPGCertificate(detail.id, GPGME_VALIDITY_NEVER);
|
||||
rsPeers->trustGPGCertificate(detail.id, RS_TRUST_LVL_FULL);
|
||||
} else if (ui.radioButton_trust_marginnaly->isChecked() && detail.trustLvl != RS_TRUST_LVL_MARGINAL) {
|
||||
rsPeers->trustGPGCertificate(detail.id, RS_TRUST_LVL_MARGINAL);
|
||||
} else if (ui.radioButton_trust_never->isChecked() && detail.trustLvl != RS_TRUST_LVL_NEVER) {
|
||||
rsPeers->trustGPGCertificate(detail.id, RS_TRUST_LVL_NEVER);
|
||||
}
|
||||
|
||||
if (!detail.isOnlyGPGdetail) {
|
||||
|
|
|
@ -1144,7 +1144,7 @@ void ConclusionPage::initializePage() {
|
|||
case RS_TRUST_LVL_MARGINAL:
|
||||
trustString = "Marginal";
|
||||
break;
|
||||
case RS_TRUST_LVL_NONE:
|
||||
case RS_TRUST_LVL_NEVER:
|
||||
trustString = "None";
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue