mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-10 10:05:19 -04:00
* 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:
parent
5f28f76b07
commit
100cf75439
19 changed files with 695 additions and 208 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue