mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-30 19:34:31 -04:00
Add certificate-save functionality
* usr can also choose where to save certificate git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@586 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8103b0c372
commit
6b4d072bb0
3 changed files with 52 additions and 17 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "InviteDialog.h"
|
||||
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "rsiface/rspeers.h"
|
||||
#include <util/WidgetBackgroundImage.h>
|
||||
|
||||
/** Default constructor */
|
||||
|
@ -37,6 +38,7 @@ InviteDialog::InviteDialog(QWidget *parent, Qt::WFlags flags)
|
|||
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelbutton()));
|
||||
connect(ui.emailButton, SIGNAL(clicked()), this, SLOT(emailbutton()));
|
||||
connect(ui.doneButton, SIGNAL(clicked()), this, SLOT(closebutton()));
|
||||
connect(ui.sCertButton, SIGNAL(clicked()), this, SLOT(savecertbutton()));
|
||||
|
||||
//setFixedSize(QSize(434, 462));
|
||||
}
|
||||
|
@ -103,4 +105,14 @@ void InviteDialog::setInfo(std::string invite)
|
|||
ui.emailText->setText(QString::fromStdString(invite));
|
||||
}
|
||||
|
||||
void InviteDialog::savecertbutton(void)
|
||||
{
|
||||
std::string filename = rsPeers->getPeerName(rsPeers->getOwnId()); // file name will be user name
|
||||
filename += ".pqi"; // append retroshare cert extension
|
||||
QString qdir = QFileDialog::getExistingDirectory(this, tr("Please Choose Directory to Save Certificate"), "",
|
||||
false); // get current directory
|
||||
|
||||
qdir += tr(filename.c_str()); // append file name to directory
|
||||
rsPeers->SaveCertificateToFile(rsPeers->getOwnId(), qdir.toStdString()); // save to file
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue