aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/MainWindow.h5
-rw-r--r--include/gpg/GpgContext.h2
-rw-r--r--include/ui/KeyServerImportDialog.h24
-rw-r--r--include/ui/KeyUploadDialog.h51
-rw-r--r--include/ui/keypair_details/KeyPairDetailTab.h15
-rw-r--r--include/ui/widgets/KeyList.h8
6 files changed, 85 insertions, 20 deletions
diff --git a/include/MainWindow.h b/include/MainWindow.h
index 48d77d25..95a10210 100644
--- a/include/MainWindow.h
+++ b/include/MainWindow.h
@@ -35,6 +35,7 @@
#include "ui/widgets/InfoBoardWidget.h"
#include "ui/FindWidget.h"
#include "ui/Wizard.h"
+#include "ui/KeyUploadDialog.h"
#include "gpg/result_analyse/SignResultAnalyse.h"
#include "gpg/result_analyse/EncryptResultAnalyse.h"
@@ -279,7 +280,7 @@ private:
QToolBar *keyToolBar; /** Toolbar holding key operations */
QToolButton *importButton; /** Toolbutton for import dropdown menu in toolbar */
QToolButton *fileEncButton; /** Toolbutton for file cryption dropdown menu in toolbar */
- QDockWidget *keylistDock; /** Encrypt Dock*/
+ QDockWidget *keyListDock; /** Encrypt Dock*/
QDockWidget *attachmentDock; /** Attachment Dock */
QDockWidget *infoBoardDock;
@@ -308,7 +309,7 @@ private:
QAction *quoteAct; /** Action to quote text */
QAction *cutAct; /** Action to cut text */
QAction *pasteAct; /** Action to paste text */
- QAction *selectallAct; /** Action to select whole text */
+ QAction *selectAllAct; /** Action to select whole text */
QAction *findAct; /** Action to find text */
QAction *undoAct; /** Action to undo last action */
QAction *redoAct; /** Action to redo last action */
diff --git a/include/gpg/GpgContext.h b/include/gpg/GpgContext.h
index eed7afe2..1e5334d1 100644
--- a/include/gpg/GpgContext.h
+++ b/include/gpg/GpgContext.h
@@ -77,6 +77,8 @@ namespace GpgME {
bool exportKeys(QStringList *uidList, QByteArray *outBuffer);
+ bool exportKeys(const QVector<GpgKey> &keys, QByteArray &outBuffer);
+
bool generateKey(GenKeyInfo *params);
bool generateSubkey(const GpgKey &key, GenKeyInfo *params);
diff --git a/include/ui/KeyServerImportDialog.h b/include/ui/KeyServerImportDialog.h
index 0a77aece..6fd45fc5 100644
--- a/include/ui/KeyServerImportDialog.h
+++ b/include/ui/KeyServerImportDialog.h
@@ -37,10 +37,14 @@ public:
KeyServerImportDialog(GpgME::GpgContext *ctx, KeyList *keyList, bool automatic,
QWidget *parent);
+ KeyServerImportDialog(GpgME::GpgContext *ctx, QWidget *parent);
+
void slotImport(const QStringList& keyIds);
void slotImport(const QStringList& keyIds, const QUrl& keyserverUrl);
+ void slotImportKey(const QVector<GpgKey>& keys);
+
private slots:
void slotImport();
@@ -70,17 +74,17 @@ private:
QSettings settings;
GpgME::GpgContext *mCtx;
- KeyList *mKeyList;
- QLineEdit *searchLineEdit;
- QComboBox *keyServerComboBox;
+ KeyList *mKeyList{};
+ QLineEdit *searchLineEdit{};
+ QComboBox *keyServerComboBox{};
QProgressBar *waitingBar;
- QLabel *searchLabel;
- QLabel *keyServerLabel;
- QLabel *message;
- QLabel *icon;
- QPushButton *closeButton;
- QPushButton *importButton;
- QPushButton *searchButton;
+ QLabel *searchLabel{};
+ QLabel *keyServerLabel{};
+ QLabel *message{};
+ QLabel *icon{};
+ QPushButton *closeButton{};
+ QPushButton *importButton{};
+ QPushButton *searchButton{};
QTableWidget *keysTable{};
QNetworkAccessManager *qnam{};
diff --git a/include/ui/KeyUploadDialog.h b/include/ui/KeyUploadDialog.h
new file mode 100644
index 00000000..013c0b72
--- /dev/null
+++ b/include/ui/KeyUploadDialog.h
@@ -0,0 +1,51 @@
+/**
+ * This file is part of GPGFrontend.
+ *
+ * GPGFrontend 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Foobar 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 Foobar. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The initial version of the source code is inherited from gpg4usb-team.
+ * Their source code version also complies with GNU General Public License.
+ *
+ * The source code version of this software was modified and released
+ * by Saturneric<[email protected]> starting on May 12, 2021.
+ *
+ */
+
+#ifndef GPGFRONTEND_KEYUPLOADWIDGET_H
+#define GPGFRONTEND_KEYUPLOADWIDGET_H
+
+#include "GpgFrontend.h"
+#include "gpg/GpgContext.h"
+
+class KeyUploadDialog : public QDialog {
+Q_OBJECT
+public:
+ KeyUploadDialog(GpgME::GpgContext *ctx, const QVector<GpgKey> &keys, QWidget *parent = nullptr);
+
+private slots:
+
+ void uploadKeyToServer(QByteArray &keys);
+
+ void slotUploadFinished();
+
+private:
+
+ QString appPath;
+ QSettings settings;
+ QByteArray mKeyData;
+
+};
+
+
+#endif //GPGFRONTEND_KEYUPLOADWIDGET_H
diff --git a/include/ui/keypair_details/KeyPairDetailTab.h b/include/ui/keypair_details/KeyPairDetailTab.h
index ad0b13f6..6d041f97 100644
--- a/include/ui/keypair_details/KeyPairDetailTab.h
+++ b/include/ui/keypair_details/KeyPairDetailTab.h
@@ -27,10 +27,13 @@
#include "GpgFrontend.h"
#include "gpg/GpgContext.h"
+
+#include "ui/KeyUploadDialog.h"
+#include "ui/KeyServerImportDialog.h"
#include "KeySetExpireDateDialog.h"
class KeyPairDetailTab : public QWidget {
- Q_OBJECT
+Q_OBJECT
/**
* @details Return QString with a space inserted at every fourth character
@@ -39,6 +42,8 @@ class KeyPairDetailTab : public QWidget {
*/
static QString beautifyFingerprint(QString fingerprint);
+ void createKeyServerOperaMenu();
+
private slots:
/**
@@ -55,6 +60,10 @@ private slots:
void slotRefreshKeyInfo();
+ void slotUploadKeyToServer();
+
+ void slotUpdateKeyToServer();
+
private:
QString *keyid; /** The id of the key the details should be shown for */
@@ -80,8 +89,10 @@ private:
QLabel *actualUsageVarLabel;
QLabel *masterKeyExistVarLabel;
+ QMenu *keyServerOperaMenu;
+
public:
- explicit KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey& mKey, QWidget *parent = nullptr);
+ explicit KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, QWidget *parent = nullptr);
};
diff --git a/include/ui/widgets/KeyList.h b/include/ui/widgets/KeyList.h
index fe554495..413d0969 100644
--- a/include/ui/widgets/KeyList.h
+++ b/include/ui/widgets/KeyList.h
@@ -85,9 +85,10 @@ public:
void setChecked(QStringList *keyIds);
- //QStringList *getPrivateChecked();
QStringList *getSelected();
+ GpgKey getSelectedKey();
+
[[maybe_unused]] static void markKeys(QStringList *keyIds);
[[maybe_unused]] bool containsPrivateKeys();
@@ -96,8 +97,6 @@ public slots:
void slotRefresh();
- void uploadKeyToServer(QByteArray *keys);
-
private:
void importKeys(QByteArray inBuffer);
@@ -120,11 +119,8 @@ private:
private slots:
- void uploadFinished();
-
void slotDoubleClicked(const QModelIndex &index);
-
protected:
void contextMenuEvent(QContextMenuEvent *event) override;