* minor changes required to get the gui working with PGP,

* improved NetworkView to show signatures, and friends.

I expect these will be cleaned up later - these were purely functional so i could test pgp.

Enable using RS_USE_PGPSSL in rsiface/rsinit.h
   


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1266 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2009-05-23 15:13:01 +00:00
parent 5f28f76b07
commit 100cf75439
19 changed files with 695 additions and 208 deletions

View file

@ -49,6 +49,28 @@ GenCertDialog::GenCertDialog(QWidget *parent, Qt::WFlags flags)
ui.genName->setFocus(Qt::OtherFocusReason);
#ifdef RS_USE_PGPSSL
/* get all available pgp private certificates....
* mark last one as default.
*/
std::cerr << "Finding PGPUsers" << std::endl;
std::list<std::string> pgpIds;
std::list<std::string>::iterator it;
if (RsInit::GetLogins(pgpIds))
{
for(it = pgpIds.begin(); it != pgpIds.end(); it++)
{
const QVariant & userData = QVariant(QString::fromStdString(*it));
std::string name, email;
RsInit::GetLoginDetails(*it, name, email);
std::cerr << "Adding PGPUser: " << name << " id: " << *it << std::endl;
ui.genPGPuser->addItem(QString::fromStdString(name), userData);
}
}
#endif
}
/** Destructor. */
@ -92,7 +114,28 @@ void GenCertDialog::genPerson()
std::string passwd = ui.genPasswd->text().toStdString();
std::string passwd2 = ui.genPasswd2->text().toStdString();
std::string err;
#ifdef RS_USE_PGPSSL
std::string PGPpasswd = ui.genPGPpassword->text().toStdString();
int pgpidx = ui.genPGPuser->currentIndex();
if (pgpidx < 0)
{
/* Message Dialog */
QMessageBox::StandardButton sb = QMessageBox::warning ( NULL,
"Generate ID Failure",
"Missing PGP Certificate",
QMessageBox::Ok);
return;
}
QVariant data = ui.genPGPuser->itemData(pgpidx);
std::string PGPId = (data.toString()).toStdString();
#endif
if (genName.length() >= 3)
{
/* name passes basic test */
@ -125,6 +168,13 @@ void GenCertDialog::genPerson()
return;
}
#ifdef RS_USE_PGPSSL
/* Initialise the PGP user first */
RsInit::LoadGPGPassword(PGPId, PGPpasswd);
#endif
bool okGen = RsInit::RsGenerateCertificate(genName, genOrg, genLoc, genCountry, passwd, err);
if (okGen)