diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2013-02-26 22:22:11 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2013-02-26 22:22:11 +0000 |
commit | eb6e0aa48b3129338ba3c5628eaec5499369130e (patch) | |
tree | f15068246f0c72ba77f8cdf25f53fbe4088cc09b | |
parent | updated windows gpg.exe to 1.4.13 (diff) | |
download | gpg4usb-eb6e0aa48b3129338ba3c5628eaec5499369130e.tar.gz gpg4usb-eb6e0aa48b3129338ba3c5628eaec5499369130e.zip |
upload to keyserver now works
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1019 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | TODO | 8 | ||||
-rw-r--r-- | keylist.cpp | 4 | ||||
-rw-r--r-- | mainwindow.cpp | 36 | ||||
-rw-r--r-- | mainwindow.h | 5 |
4 files changed, 39 insertions, 14 deletions
@@ -4,6 +4,10 @@ Release 0.4 - MacOS build - replace gpgme with kgpg (lots of work and trouble!!!) - Refresh key from keyserver [DONE] +- Update GnuPG binary to 1.4.13 + - for windows [DONE] + - for linux [DONE] + - for macos - add encrypt to self functionality [DONE] - add automatic restart if key changed [DONE] - add find action in textedit [DONE] @@ -14,7 +18,9 @@ Release 0.4 - create revocation file - on key generation - later -- Upload key to keyserver +- Upload key to keyserver [DONE] + - error handling + - show message on successful upload - show message if verify has no valid signature - exclude translators list from about dialog [DONE] - change docu on file de- and encryption diff --git a/keylist.cpp b/keylist.cpp index 4ad30c0..15d1d46 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -278,7 +278,9 @@ void KeyList::importKeys(QByteArray inBuffer) void KeyList::slotUploadKeyToServer(QByteArray *keys) { - QUrl reqUrl("http://localhost:11371/pks/add"); + qDebug() << "slot upload"; + // TODO: Replace url by actual keyserver + QUrl reqUrl("http://gpg4usb.org:11371/pks/add"); qnam = new QNetworkAccessManager(this); QUrl params; diff --git a/mainwindow.cpp b/mainwindow.cpp index 1f91369..d0a11a6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1144,6 +1144,32 @@ void MainWindow::slotAppendSelectedKeysReady(int result) { exp->deleteLater(); } +void MainWindow::slotUploadKeyToServer() +{ + QStringList expopts; + KGpgExport *exp = new KGpgExport(this, *mKeyList->getSelected(), expopts); + connect(exp, SIGNAL(done(int)), SLOT(slotUploadKeyToServerReady(int))); + exp->start(); +} + +void MainWindow::slotUploadKeyToServerReady(int result) +{ + KGpgExport *exp = qobject_cast<KGpgExport *>(sender()); + Q_ASSERT(exp != NULL); + + if (result == KGpgTransaction::TS_OK) { +// QByteArray keyArray = new QByteArray(); + QByteArray keyArray = exp->getOutputData(); + mKeyList->slotUploadKeyToServer(&keyArray); + } else { + //KMessageBox::sorry(this, i18n("Your public key could not be exported\nCheck the key.")); + qDebug() << "Your public key could not be exported\nCheck the key."; + } + + exp->deleteLater(); + +} + void MainWindow::slotCopyMailAddressToClipboard() { if (mKeyList->getSelected()->isEmpty()) { @@ -1219,16 +1245,6 @@ void MainWindow::slotRefreshKeysFromKeyserver() ksid->slotImport(*mKeyList->getSelected()); } -void MainWindow::slotUploadKeyToServer() -{ - QByteArray *keyArray = new QByteArray(); - - // TODO: - //mCtx->exportKeys(mKeyList->getSelected(), keyArray); - - //mKeyList->uploadKeyToServer(keyArray); -} - void MainWindow::slotFileEncrypt() { QStringList *keyList; diff --git a/mainwindow.h b/mainwindow.h index 3257849..40af5c9 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -134,8 +134,9 @@ private slots: /** * @details upload the selected key to the keyserver */ - void slotUploadKeyToServer(); - + void slotUploadKeyToServer(); + void slotUploadKeyToServerReady(int result); + /** * @details start the wizard */ |