From a3cba1ba9996400acc43d133f8941fef84dd323f Mon Sep 17 00:00:00 2001 From: ubbo Date: Tue, 1 May 2012 11:26:57 +0000 Subject: add gui elements for sign&verify of files, remove not used fileEncryptAndDecrypt actions from mainwindow git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@905 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- fileencryptiondialog.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'fileencryptiondialog.cpp') diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp index ded8335..3a49005 100755 --- a/fileencryptiondialog.cpp +++ b/fileencryptiondialog.cpp @@ -27,11 +27,16 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k { mAction = action; mCtx = ctx; - if(mAction == Decrypt) { + if (mAction == Decrypt) { setWindowTitle(tr("Decrypt File")); } else if (mAction == Encrypt) { setWindowTitle(tr("Encrypt File")); resize(500, 300); + } else if (mAction == Sign) { + setWindowTitle(tr("Sign File")); + resize(500, 300); + } else if (mAction == Verify) { + setWindowTitle(tr("Verify File")); } else { setWindowTitle(tr("Encrypt / Decrypt File")); resize(500, 200); @@ -89,7 +94,7 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k actionGroupBox->setLayout(hbox1); QVBoxLayout *vbox2 = new QVBoxLayout(); - if(action == Both) { + if(action == EncryptAndDecrypt) { vbox2->addWidget(actionGroupBox); } vbox2->addWidget(groupBox1); @@ -98,7 +103,7 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k vbox2->addStretch(0); setLayout(vbox2); - if(action == Encrypt) { + if(action == Encrypt || action == Sign) { showKeyList(); } @@ -118,7 +123,7 @@ void FileEncryptionDialog::selectInputFile() // try to find a matching output-filename, if not yet done if (infileName > 0 && outputFileEdit->text().size() == 0) { - if (mAction == Encrypt || (mAction == Both && radioEnc->isChecked())) { + if (mAction == Encrypt || (mAction == EncryptAndDecrypt && radioEnc->isChecked())) { outputFileEdit->setText(infileName + ".asc"); } else { if (infileName.endsWith(".asc", Qt::CaseInsensitive)) { @@ -156,11 +161,11 @@ void FileEncryptionDialog::executeAction() QByteArray inBuffer = infile.readAll(); QByteArray *outBuffer = new QByteArray(); infile.close(); - if ( mAction == Encrypt || (mAction == Both && radioEnc->isChecked())) { + if ( mAction == Encrypt || (mAction == EncryptAndDecrypt && radioEnc->isChecked())) { if (! mCtx->encrypt(mKeyList->getChecked(), inBuffer, outBuffer)) return; } - if (mAction == Decrypt || (mAction == Both && radioDec->isChecked())) { + if (mAction == Decrypt || (mAction == EncryptAndDecrypt && radioDec->isChecked())) { if (! mCtx->decrypt(inBuffer, outBuffer)) return; } -- cgit v1.2.3