diff options
-rw-r--r-- | gpg4usb.pro | 4 | ||||
-rw-r--r-- | gpgwin.cpp | 10 | ||||
-rw-r--r-- | gpgwin.h | 1 | ||||
-rw-r--r-- | keygenthread.cpp | 28 | ||||
-rw-r--r-- | keygenthread.h | 21 | ||||
-rwxr-xr-x | keymgmt.cpp | 48 | ||||
-rw-r--r-- | release/icons/genkey.jpeg | bin | 3427 -> 0 bytes |
7 files changed, 75 insertions, 37 deletions
diff --git a/gpg4usb.pro b/gpg4usb.pro index 4a64200..c39c91e 100644 --- a/gpg4usb.pro +++ b/gpg4usb.pro @@ -12,8 +12,8 @@ INCLUDEPATH += . ./include CONFIG += release static # Input -HEADERS += context.h gpgwin.h keylist.h attachments.h keymgmt.h fileencryptiondialog.h keygenthread.h -SOURCES += context.cpp gpgwin.cpp main.cpp keylist.cpp attachments.cpp keymgmt.cpp fileencryptiondialog.cpp keygenthread.cpp +HEADERS += context.h gpgwin.h keylist.h keymgmt.h fileencryptiondialog.h keygenthread.h +SOURCES += context.cpp gpgwin.cpp main.cpp keylist.cpp keymgmt.cpp fileencryptiondialog.cpp keygenthread.cpp RC_FILE = gpg4usb.rc # comment out line below for static building LIBS += -lgpgme -lgpg-error @@ -462,9 +462,13 @@ void GpgWin::importKeyFromFile() void GpgWin::openKeyManagement() { - KeyMgmt *window = new KeyMgmt(mCtx, iconPath); - window->resize(800,400); - window->show(); + if(!keyMgmt) { + keyMgmt = new KeyMgmt(mCtx, iconPath); + keyMgmt->resize(800,400); + } + keyMgmt->show(); + keyMgmt->raise(); + keyMgmt->activateWindow(); } void GpgWin::importKeyDialog() { @@ -138,5 +138,6 @@ private: Attachments *mAttachments; GpgME::Context *mCtx; QString iconPath; + KeyMgmt *keyMgmt; }; diff --git a/keygenthread.cpp b/keygenthread.cpp index 9fc6a5a..5dbb194 100644 --- a/keygenthread.cpp +++ b/keygenthread.cpp @@ -1,9 +1,30 @@ +/* + * keygenthread.cpp + * + * Copyright 2008 gpg4usb-team <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + + #include "keygenthread.h" KeyGenThread::KeyGenThread(QString keyGenParams, GpgME::Context *ctx) { - qDebug() << keyGenParams; this->keyGenParams=keyGenParams; this->ctx=ctx; abort=false; @@ -11,10 +32,5 @@ KeyGenThread::KeyGenThread(QString keyGenParams, GpgME::Context *ctx) void KeyGenThread::run() { - qDebug() << keyGenParams; - qDebug("hallo2"); ctx->generateKey(&keyGenParams); - - qDebug("hallo323"); - } diff --git a/keygenthread.h b/keygenthread.h index b9196f5..06dfea1 100644 --- a/keygenthread.h +++ b/keygenthread.h @@ -1,3 +1,24 @@ +/* + * keygenthread.h + * + * Copyright 2008 gpg4usb-team <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + #include <qthread.h> #include <iostream> #include <string> diff --git a/keymgmt.cpp b/keymgmt.cpp index b5c92af..942bd5f 100755 --- a/keymgmt.cpp +++ b/keymgmt.cpp @@ -197,13 +197,13 @@ void KeyMgmt::generateKeyDialog() expireLabel = new QLabel(tr("Never Expire")); pwStrengthLabel = new QLabel(tr("Password: Strength\nWeak -> Strong")); errorLabel = new QLabel(tr("")); - nameEdit = new QLineEdit("hallo",genkeyDialog); + nameEdit = new QLineEdit(genkeyDialog); emailEdit = new QLineEdit(genkeyDialog); commentEdit = new QLineEdit(genkeyDialog); keySizeSpinBox = new QSpinBox(genkeyDialog); keySizeSpinBox->setRange(512,8192); - keySizeSpinBox->setValue(512); + keySizeSpinBox->setValue(1024); keySizeSpinBox->setSingleStep(256); @@ -216,8 +216,8 @@ void KeyMgmt::generateKeyDialog() expireCheckBox = new QCheckBox(genkeyDialog); expireCheckBox->setCheckState(Qt::Checked); - passwordEdit = new QLineEdit("asd",genkeyDialog); - repeatpwEdit = new QLineEdit("asd",genkeyDialog); + passwordEdit = new QLineEdit(genkeyDialog); + repeatpwEdit = new QLineEdit(genkeyDialog); passwordEdit->setEchoMode(QLineEdit::Password); repeatpwEdit->setEchoMode(QLineEdit::Password); @@ -311,37 +311,33 @@ void KeyMgmt::keyGenAccept() "Passphrase: "+passwordEdit->text()+"\n"; } keyGenParams += "</GnupgKeyParms>"; -// mCtx->generateKey(&keyGenParams); KeyGenThread *kg = new KeyGenThread(keyGenParams, mCtx); kg->start(); genkeyDialog->accept(); - QPixmap pix(mIconPath+"genkey.jpeg"); - QSplashScreen splash(this, pix); - splash.releaseMouse(); - splash.show(); - splash.showMessage("Generating Key"); - //QProgressBar* progress = new QProgressBar(splash); -// QProgressDialog *qpd = new QProgressDialog("Generating", "Jau",0,5,this); - // qpd->setWindowModality(Qt::WindowModal); - int value=0; + + QDialog *dialog = new QDialog(this, Qt::CustomizeWindowHint | Qt::WindowTitleHint); + dialog->setModal(true); + dialog->setWindowTitle(tr("Generating Key...")); + + QLabel *waitMessage = new QLabel(tr("Collecting random data for key generation.\n This may take a while.\n To speed up the process use your computer\n (e.g. browse the net, listen to music,...)")); + QProgressBar *pb = new QProgressBar(); + pb->setRange(0,0); + + QVBoxLayout *layout = new QVBoxLayout(dialog); + layout->addWidget(waitMessage); + layout->addWidget(pb); + dialog->setLayout(layout); + + dialog->show(); + while(kg->isRunning()) { - value++; - value=value%32000; - - qDebug() << value << value; - splash.show(); QCoreApplication::processEvents(); - - //qpd->setValue(value); - //sleep(1); } - splash.finish(this); - //qpd->cancel(); - qDebug() << "hallo"; - //genkeyDialog->accept(); + + dialog->close(); } else { /** diff --git a/release/icons/genkey.jpeg b/release/icons/genkey.jpeg Binary files differdeleted file mode 100644 index cc8424b..0000000 --- a/release/icons/genkey.jpeg +++ /dev/null |