diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-08-03 20:38:27 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-08-03 20:38:27 +0000 |
commit | a274da36798b7aa7a7cbc9e85ec30748fa66047e (patch) | |
tree | b5f4e5403ecae4a86a28f8e58925c2a2f1e01db0 /kgpg/kgpginterface.cpp | |
parent | reorganize kgpg source tree (diff) | |
download | gpg4usb-a274da36798b7aa7a7cbc9e85ec30748fa66047e.tar.gz gpg4usb-a274da36798b7aa7a7cbc9e85ec30748fa66047e.zip |
start porting encrypt from kgpg, not yet working
git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2-mac@932 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'kgpg/kgpginterface.cpp')
-rw-r--r-- | kgpg/kgpginterface.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/kgpg/kgpginterface.cpp b/kgpg/kgpginterface.cpp index 0c14b33..a907fe3 100644 --- a/kgpg/kgpginterface.cpp +++ b/kgpg/kgpginterface.cpp @@ -35,6 +35,7 @@ #include <QString> #include <QTextStream> #include <QDebug> +#include <QInputDialog> using namespace KgpgCore; @@ -143,28 +144,37 @@ void KgpgInterface::setGpgBoolSetting(const QString &name, const bool enable, co } } -/*int KgpgInterface::sendPassphrase(const QString &text, KProcess *process, QWidget *widget) +int KgpgInterface::sendPassphrase(const QString &text, KProcess *process, QWidget *widget) { QPointer<KProcess> gpgprocess = process; QByteArray passphrase; - int code; + //int code; + bool result; - QPointer<KPasswordDialog> dlg = new KPasswordDialog(widget); + /*QPointer<KPasswordDialog> dlg = new KPasswordDialog(widget); QObject::connect(process, SIGNAL(processExited()), dlg->button(KDialog::Cancel), SLOT(click())); dlg->setPrompt(text); - code = dlg->exec(); + code = dlg->exec(); + if (!dlg.isNull()) passphrase = dlg->password().toUtf8(); delete dlg; if (code != KPasswordDialog::Accepted) return 1; +*/ + + QString password = QInputDialog::getText(QApplication::activeWindow(), QObject::tr("Enter Password"), + text, QLineEdit::Password, + "", &result); + + passphrase = password.toAscii(); if (!gpgprocess.isNull()) gpgprocess->write(passphrase + '\n'); return 0; -}*/ +} /** * @param p the process that reads the GnuPG data |