From 7af9cc1007b006f01dd2eca335f54d9304e53c71 Mon Sep 17 00:00:00 2001 From: ubbo Date: Fri, 3 Aug 2012 20:38:30 +0000 Subject: encryption works git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2-mac@933 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- mainwindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mainwindow.cpp') 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))); -- cgit v1.2.3