aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mainwindow.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 6f9efc2..8c7e5cf 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -774,7 +774,12 @@ void MainWindow::encrypt()
QStringList *uidList = mKeyList->getChecked();
- QByteArray *tmp = new QByteArray();
+ if (uidList->count() == 0) {
+ QMessageBox::critical(0, tr("No Key Selected"), tr("No Key Selected"));
+ return;
+ }
+
+ //QByteArray *tmp = new QByteArray();
/*if (mCtx->encrypt(uidList, edit->curTextPage()->toPlainText().toUtf8(), tmp)) {
QString *tmp2 = new QString(*tmp);
edit->fillTextEditWithText(*tmp2);
@@ -783,6 +788,9 @@ void MainWindow::encrypt()
QStringList options;
KGpgEncrypt::EncryptOptions opts = KGpgEncrypt::DefaultEncryption;
+ opts |= KGpgEncrypt::AllowUntrustedEncryption;
+ opts |= KGpgEncrypt::AsciiArmored;
+
KGpgEncrypt *encr = new KGpgEncrypt(this, *uidList, edit->curTextPage()->toPlainText(), opts, options);
encr->start();
connect(encr, SIGNAL(done(int)), SLOT(slotEncryptDone(int)));