aboutsummaryrefslogtreecommitdiffstats
path: root/fileencryptiondialog.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-06 12:29:39 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-06 12:29:39 +0000
commitac7dfcc91345f9752b9f387e8b1653af41718621 (patch)
treec754321cb21743ac3038ce646ecf344d59d27d31 /fileencryptiondialog.cpp
parentreplace ts files with 0.3.1 version, update to reflect name change from gpgwi... (diff)
downloadgpg4usb-ac7dfcc91345f9752b9f387e8b1653af41718621.tar.gz
gpg4usb-ac7dfcc91345f9752b9f387e8b1653af41718621.zip
file encryption dialog configurable for encrypt / decrypt / both. popup menu for file encrypt or decrypt in toolbar now
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@668 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'fileencryptiondialog.cpp')
-rwxr-xr-xfileencryptiondialog.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp
index d7bd27f..b23d5a1 100755
--- a/fileencryptiondialog.cpp
+++ b/fileencryptiondialog.cpp
@@ -21,12 +21,19 @@
#include "fileencryptiondialog.h"
-FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconPath, QStringList keyList, QWidget *parent)
+FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconPath, QStringList keyList, QWidget *parent, DialogAction action)
: QDialog(parent)
{
mCtx = ctx;
- setWindowTitle(tr("Encrypt / Decrypt File"));
+ if(action == Decrypt) {
+ setWindowTitle(tr(" Decrypt File"));
+ } else if (action == Encrypt) {
+ setWindowTitle(tr("Encrypt File"));
+ } else {
+ setWindowTitle(tr("Encrypt / Decrypt File"));
+ }
+
resize(500, 200);
setModal(true);
@@ -35,7 +42,7 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconP
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QGroupBox *groupBox1 = new QGroupBox(tr("File"));
- QGroupBox *groupBox3 = new QGroupBox(tr("Action"));
+ QGroupBox *actionGroupBox = new QGroupBox(tr("Action"));
/* Setup input & Outputfileselection*/
inputFileEdit = new QLineEdit();
@@ -77,15 +84,22 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconP
hbox1->addWidget(radioEnc);
groupBox1->setLayout(gLayout);
- groupBox3->setLayout(hbox1);
+ actionGroupBox->setLayout(hbox1);
QVBoxLayout *vbox2 = new QVBoxLayout();
- vbox2->addWidget(groupBox3);
+ if(action == Both) {
+ vbox2->addWidget(actionGroupBox);
+ }
vbox2->addWidget(groupBox1);
vbox2->addWidget(mKeyList);
vbox2->addWidget(buttonBox);
vbox2->addStretch(0);
setLayout(vbox2);
+
+ if(action == Encrypt) {
+ showKeyList();
+ }
+
exec();
}