Used GPGME_VALIDITY_... constants in ConfCertDialog and NetworkDialog.

Changed the usage of RsPeerDetails.validLvl to RsPeerDetails.trustLvl for the display in the column "Did I authenticated peer" in NetworkDialog.
Added an icon to the MessageBox of the NotifySysMessage.
Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3926 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-12-21 21:13:08 +00:00
parent ab42691a31
commit 312f23bd4e
7 changed files with 38 additions and 34 deletions

View File

@ -1652,7 +1652,7 @@ int AuthGPGimpl::privateRevokeCertificate(const std::string &id)
int AuthGPGimpl::privateTrustCertificate(const std::string &id, int trustlvl) int AuthGPGimpl::privateTrustCertificate(const std::string &id, int trustlvl)
{ {
/* The certificate should be in Peers list ??? */ /* The certificate should be in Peers list ??? */
if(!isGPGAccepted(id)) { if(!isGPGAccepted(id)) {
std::cerr << "Invalid Certificate" << std::endl; std::cerr << "Invalid Certificate" << std::endl;
return 0; return 0;
} }

View File

@ -1199,11 +1199,12 @@ bool p3Peers::trustGPGCertificate(const std::string &id, uint32_t trustlvl)
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
//check if we've got a ssl or gpg id //check if we've got a ssl or gpg id
if (getGPGId(id) == "") { std::string gpgId = getGPGId(id);
if (gpgId.empty()) {
//if no result then it must be a gpg id //if no result then it must be a gpg id
return AuthGPG::getAuthGPG()->TrustCertificate(id, trustlvl); return AuthGPG::getAuthGPG()->TrustCertificate(id, trustlvl);
} else { } else {
return AuthGPG::getAuthGPG()->TrustCertificate(getGPGId(id), trustlvl); return AuthGPG::getAuthGPG()->TrustCertificate(gpgId, trustlvl);
} }
} }

View File

@ -368,7 +368,7 @@ void NetworkDialog::insertConnect()
while (index < connectWidget->topLevelItemCount()) { while (index < connectWidget->topLevelItemCount()) {
std::string gpg_widget_id = (connectWidget->topLevelItem(index))->text(4).toStdString(); std::string gpg_widget_id = (connectWidget->topLevelItem(index))->text(4).toStdString();
RsPeerDetails detail; RsPeerDetails detail;
if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || (detail.validLvl < 3 && !detail.accept_connection)) { if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || (detail.validLvl < GPGME_VALIDITY_MARGINAL && !detail.accept_connection)) {
delete (connectWidget->takeTopLevelItem(index)); delete (connectWidget->takeTopLevelItem(index));
} else { } else {
index++; index++;
@ -378,7 +378,7 @@ void NetworkDialog::insertConnect()
while (index < ui.unvalidGPGkeyWidget->topLevelItemCount()) { while (index < ui.unvalidGPGkeyWidget->topLevelItemCount()) {
std::string gpg_widget_id = (ui.unvalidGPGkeyWidget->topLevelItem(index))->text(4).toStdString(); std::string gpg_widget_id = (ui.unvalidGPGkeyWidget->topLevelItem(index))->text(4).toStdString();
RsPeerDetails detail; RsPeerDetails detail;
if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || detail.validLvl >= 3 || detail.accept_connection) { if (!rsPeers->getGPGDetails(gpg_widget_id, detail) || detail.validLvl >= GPGME_VALIDITY_MARGINAL || detail.accept_connection) {
delete (ui.unvalidGPGkeyWidget->takeTopLevelItem(index)); delete (ui.unvalidGPGkeyWidget->takeTopLevelItem(index));
} else { } else {
index++; index++;
@ -437,9 +437,9 @@ void NetworkDialog::insertConnect()
item -> setToolTip(2, tr("GPG key signed by you")); item -> setToolTip(2, tr("GPG key signed by you"));
} }
else else
switch(detail.validLvl) switch(detail.trustLvl)
{ {
case GPGME_VALIDITY_MARGINAL: item->setText(2,tr("Marginally trusted peer")) ; break; case GPGME_VALIDITY_MARGINAL: item->setText(2,tr("Marginally trusted peer")) ; break;
case GPGME_VALIDITY_FULL: case GPGME_VALIDITY_FULL:
case GPGME_VALIDITY_ULTIMATE: item->setText(2,tr("Fully trusted peer")) ; break ; case GPGME_VALIDITY_ULTIMATE: item->setText(2,tr("Fully trusted peer")) ; break ;
case GPGME_VALIDITY_UNKNOWN: case GPGME_VALIDITY_UNKNOWN:
@ -499,7 +499,7 @@ void NetworkDialog::insertConnect()
item -> setBackground(i,QBrush(backgrndcolor)); item -> setBackground(i,QBrush(backgrndcolor));
/* add to the list */ /* add to the list */
if (detail.accept_connection || detail.validLvl >= 3) if (detail.accept_connection || detail.validLvl >= GPGME_VALIDITY_MARGINAL)
{ {
/* add gpg item to the list. If item is already in the list, it won't be duplicated thanks to Qt */ /* add gpg item to the list. If item is already in the list, it won't be duplicated thanks to Qt */
connectWidget->addTopLevelItem(item); connectWidget->addTopLevelItem(item);

View File

@ -18,6 +18,8 @@
* 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 "ConfCertDialog.h" #include "ConfCertDialog.h"
#include <QMessageBox> #include <QMessageBox>
@ -237,7 +239,7 @@ void ConfCertDialog::load()
} }
//web of trust //web of trust
if (detail.trustLvl == 5) { if (detail.trustLvl == GPGME_VALIDITY_ULTIMATE) {
//trust is ultimate, it means it's one of our own keys //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.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(); ui.radioButton_trust_fully->hide();
@ -247,19 +249,19 @@ void ConfCertDialog::load()
ui.radioButton_trust_fully->show(); ui.radioButton_trust_fully->show();
ui.radioButton_trust_marginnaly->show(); ui.radioButton_trust_marginnaly->show();
ui.radioButton_trust_never->show(); ui.radioButton_trust_never->show();
if (detail.trustLvl == 4) { if (detail.trustLvl == GPGME_VALIDITY_FULL) {
ui.web_of_trust_label->setText(tr("Your trust in this peer is 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->setChecked(true);
ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-48.png")); 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_marginnaly->setIcon(QIcon(":/images/security-medium-off-48.png"));
ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-off-48.png")); ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-off-48.png"));
} else if (detail.trustLvl == 3) { } else if (detail.trustLvl == GPGME_VALIDITY_MARGINAL) {
ui.web_of_trust_label->setText(tr("Your trust in this peer is 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->setChecked(true);
ui.radioButton_trust_marginnaly->setIcon(QIcon(":/images/security-medium-48.png")); 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_never->setIcon(QIcon(":/images/security-low-off-48.png"));
ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-off-48.png")); ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-off-48.png"));
} else if (detail.trustLvl == 2) { } else if (detail.trustLvl == GPGME_VALIDITY_NEVER) {
ui.web_of_trust_label->setText(tr("Your trust in this peer is none.")); ui.web_of_trust_label->setText(tr("Your trust in this peer is none."));
ui.radioButton_trust_never->setChecked(true); ui.radioButton_trust_never->setChecked(true);
ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-48.png")); ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-48.png"));
@ -331,13 +333,13 @@ void ConfCertDialog::applyDialog()
} }
//check the GPG trustlvl //check the GPG trustlvl
if (ui.radioButton_trust_fully->isChecked() && detail.trustLvl != 4) { if (ui.radioButton_trust_fully->isChecked() && detail.trustLvl != GPGME_VALIDITY_FULL) {
//trust has changed to fully //trust has changed to fully
rsPeers->trustGPGCertificate(detail.id, 4); rsPeers->trustGPGCertificate(detail.id, GPGME_VALIDITY_FULL);
} else if (ui.radioButton_trust_marginnaly->isChecked() && detail.trustLvl != 3) { } else if (ui.radioButton_trust_marginnaly->isChecked() && detail.trustLvl != GPGME_VALIDITY_MARGINAL) {
rsPeers->trustGPGCertificate(detail.id, 3); rsPeers->trustGPGCertificate(detail.id, GPGME_VALIDITY_MARGINAL);
} else if (ui.radioButton_trust_never->isChecked() && detail.trustLvl != 2) { } else if (ui.radioButton_trust_never->isChecked() && detail.trustLvl != GPGME_VALIDITY_NEVER) {
rsPeers->trustGPGCertificate(detail.id, 2); rsPeers->trustGPGCertificate(detail.id, GPGME_VALIDITY_NEVER);
} }
if (!detail.isOnlyGPGdetail) { if (!detail.isOnlyGPGdetail) {

View File

@ -35,6 +35,7 @@
#endif #endif
#include "RsAutoUpdatePage.h" #include "RsAutoUpdatePage.h"
#include "MainWindow.h"
#ifndef MINIMAL_RSGUI #ifndef MINIMAL_RSGUI
#include "toaster/OnlineToaster.h" #include "toaster/OnlineToaster.h"
@ -508,18 +509,18 @@ void NotifyQt::UpdateGUI()
switch(type) switch(type)
{ {
case RS_SYS_ERROR: case RS_SYS_ERROR:
QMessageBox::critical(0, QMessageBox::critical(MainWindow::getInstance(),
QString::fromStdString(title), QString::fromStdString(title),
QString::fromStdString(msg)); QString::fromStdString(msg));
break; break;
case RS_SYS_WARNING: case RS_SYS_WARNING:
QMessageBox::warning(0, QMessageBox::warning(MainWindow::getInstance(),
QString::fromStdString(title), QString::fromStdString(title),
QString::fromStdString(msg)); QString::fromStdString(msg));
break; break;
default: default:
case RS_SYS_INFO: case RS_SYS_INFO:
QMessageBox::information(0, QMessageBox::information(MainWindow::getInstance(),
QString::fromStdString(title), QString::fromStdString(title),
QString::fromStdString(msg)); QString::fromStdString(msg));
break; break;

View File

@ -1474,7 +1474,7 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location line="-178"/> <location line="-178"/>
<source>Your trust in this peer is:</source> <source>Your trust in this peer is:</source>
<translation>Ihr Vertrauen zu diesem Nachbar ist:</translation> <translation>Dein Vertrauen zu diesem Nachbar ist:</translation>
</message> </message>
<message> <message>
<location line="+89"/> <location line="+89"/>
@ -1514,7 +1514,7 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location line="+28"/> <location line="+28"/>
<source>Status</source> <source>Status</source>
<translation type="unfinished">Status</translation> <translation>Status</translation>
</message> </message>
<message> <message>
<location line="+30"/> <location line="+30"/>
@ -1582,27 +1582,27 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location line="+27"/> <location line="+27"/>
<source>Your trust in this peer is ultimate, it&apos;s probably a key you own.</source> <source>Your trust in this peer is ultimate, it&apos;s probably a key you own.</source>
<translation>Sie haben das höchste Vertrauen in diesen Nachbarn. Es ist wahrscheinlich ein Schlüssel von Ihnen.</translation> <translation>Du hast das höchste Vertrauen in diesen Nachbarn. Es ist wahrscheinlich ein Schlüssel von Dir.</translation>
</message> </message>
<message> <message>
<location line="+9"/> <location line="+9"/>
<source>Your trust in this peer is full.</source> <source>Your trust in this peer is full.</source>
<translation>Sie vertrauen diesem Nachbarn voll.</translation> <translation>Du vertraust diesem Nachbarn voll.</translation>
</message> </message>
<message> <message>
<location line="+6"/> <location line="+6"/>
<source>Your trust in this peer is marginal.</source> <source>Your trust in this peer is marginal.</source>
<translation>Sie vertrauen diesem Nachbarn geringfügig.</translation> <translation>Du vertraust diesem Nachbarn geringfügig.</translation>
</message> </message>
<message> <message>
<location line="+6"/> <location line="+6"/>
<source>Your trust in this peer is none.</source> <source>Your trust in this peer is none.</source>
<translation>Sie vertrauen diesem Nachbarn nicht.</translation> <translation>Du vertraust diesem Nachbarn nicht.</translation>
</message> </message>
<message> <message>
<location line="+6"/> <location line="+6"/>
<source>Your trust in this peer is not set.</source> <source>Your trust in this peer is not set.</source>
<translation>Ihr Vertrauen in diesen Nachbarn ist nicht festgelegt.</translation> <translation>Dein Vertrauen in diesen Nachbarn ist nicht festgelegt.</translation>
</message> </message>
<message> <message>
<location line="+22"/> <location line="+22"/>
@ -6634,27 +6634,27 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../gui/NetworkDialog.cpp" line="+436"/> <location filename="../gui/NetworkDialog.cpp" line="+436"/>
<source>Personal signature</source> <source>Personal signature</source>
<translation type="unfinished"></translation> <translation>Persönliche Unterschrift</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
<source>GPG key signed by you</source> <source>GPG key signed by you</source>
<translation type="unfinished"></translation> <translation>GPG Schlüssel von dir unterzeichnet</translation>
</message> </message>
<message> <message>
<location line="+5"/> <location line="+5"/>
<source>Marginally trusted peer</source> <source>Marginally trusted peer</source>
<translation type="unfinished"></translation> <translation>Geringfügig vertrauter Nachbar</translation>
</message> </message>
<message> <message>
<location line="+2"/> <location line="+2"/>
<source>Fully trusted peer</source> <source>Fully trusted peer</source>
<translation type="unfinished"></translation> <translation>Voll vertrauter Nachbar</translation>
</message> </message>
<message> <message>
<location line="+4"/> <location line="+4"/>
<source>Untrusted peer</source> <source>Untrusted peer</source>
<translation type="unfinished"></translation> <translation>Nicht vertrauter Nachbar</translation>
</message> </message>
<message> <message>
<location line="+6"/> <location line="+6"/>
@ -7348,7 +7348,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>PeersDialog</name> <name>PeersDialog</name>
<message> <message>
<location filename="../gui/PeersDialog.cpp" line="+454"/> <location filename="../gui/PeersDialog.cpp" line="+455"/>
<source>Chat</source> <source>Chat</source>
<translation>Chat</translation> <translation>Chat</translation>
</message> </message>