added to settings for tray message enable/disable

fixed to get work Export Certificate on NetworkDialog
added to display on uploads extensions icons


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3137 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-06-15 11:34:58 +00:00
parent f1da09ad93
commit db9dd0f04d
6 changed files with 111 additions and 39 deletions

View file

@ -662,22 +662,38 @@ void NetworkDialog::on_actionExportKey_activated()
{
qDebug() << " exportcert";
QString qdir = QFileDialog::getSaveFileName(this,
"Please choose a filename",
QDir::homePath(),
"RetroShare Certificate (*.pqi)");
if ( rsPeers->saveCertificateToFile(rsPeers->getOwnId(), qdir.toStdString()) )
{
std::string cert = rsPeers->saveCertificateToString(rsPeers->getOwnId());
if (cert.empty()) {
QMessageBox::information(this, tr("RetroShare"),
tr("Certificate file successfully created"),
tr("Sorry, create certificate failed"),
QMessageBox::Ok, QMessageBox::Ok);
return;
}
else
{
QMessageBox::information(this, tr("RetroShare"),
tr("Sorry, certificate file creation failed"),
QMessageBox::Ok, QMessageBox::Ok);
QString qdir = QFileDialog::getSaveFileName(this,
tr("Please choose a filename"),
QDir::homePath(),
tr("RetroShare Certificate (*.rsc );;All Files (*)"));
//Todo: move save to file to p3Peers::SaveCertificateToFile
if (qdir.isEmpty() == false) {
QFile CertFile (qdir);
if (CertFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
if (CertFile.write(QByteArray(cert.c_str())) > 0) {
QMessageBox::information(this, tr("RetroShare"),
tr("Certificate file successfully created"),
QMessageBox::Ok, QMessageBox::Ok);
} else {
QMessageBox::information(this, tr("RetroShare"),
tr("Sorry, certificate file creation failed"),
QMessageBox::Ok, QMessageBox::Ok);
}
CertFile.close();
} else {
QMessageBox::information(this, tr("RetroShare"),
tr("Sorry, certificate file creation failed"),
QMessageBox::Ok, QMessageBox::Ok);
}
}
}