diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-26 17:26:42 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-26 17:26:42 +0000 |
commit | be5a6539f80072a6d62e683883947cc1272b7efe (patch) | |
tree | f7ee37d80cd523b58fd37a97b954d09e7a4dc4e4 | |
parent | commenting and code shortening (diff) | |
download | gpg4usb-be5a6539f80072a6d62e683883947cc1272b7efe.tar.gz gpg4usb-be5a6539f80072a6d62e683883947cc1272b7efe.zip |
show messagebox, when key export failed. Added more comments
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@781 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | keydetailsdialog.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
@@ -51,6 +51,7 @@ Release 0.3.2 - resize dropdown button, cause letter are cut at the bottom - Change file encryption to single dialog for en- and decryption [DONE] - change docu on file de- and encryption +- qDebug messages with tr() (?) BUGS: - import key toolbar dropdown shows text, even if only icon should be shown diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp index 803c238..197c4eb 100644 --- a/keydetailsdialog.cpp +++ b/keydetailsdialog.cpp @@ -182,12 +182,15 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWid void KeyDetailsDialog::exportPrivateKey() { + // Show a information box with explanation about private key int ret = QMessageBox::information(this, tr("Exporting private Key"), tr("You are about to export your private key.\n" "This is NOT your public key, so don't give it away.\n" - "Make sure you keep it save."), + "Make sure you keep it save." + "Do you really want to export your private key?"), QMessageBox::Cancel | QMessageBox::Ok); + // export key, if ok was clicked if (ret == QMessageBox::Ok) { QByteArray *keyArray = new QByteArray(); mCtx->exportSecretKey(*keyid, keyArray); @@ -196,6 +199,7 @@ void KeyDetailsDialog::exportPrivateKey() QString fileName = QFileDialog::getSaveFileName(this, tr("Export Key To File"), fileString, tr("Key Files") + " (*.asc *.txt);;All Files (*)"); QFile file(fileName); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + QMessageBox::critical(0,tr("Export error"),tr("Couldn't open %1 for writing").arg(fileName)); return; QTextStream stream(&file); stream << *keyArray; |