aboutsummaryrefslogtreecommitdiffstats
path: root/include/ui
diff options
context:
space:
mode:
Diffstat (limited to 'include/ui')
-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
4 files changed, 80 insertions, 18 deletions
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;