diff options
Diffstat (limited to 'include/ui')
33 files changed, 0 insertions, 2934 deletions
diff --git a/include/ui/FileEncryptionDialog.h b/include/ui/FileEncryptionDialog.h deleted file mode 100755 index be9ddd22..00000000 --- a/include/ui/FileEncryptionDialog.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * 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 __FILEENCRYPTIONDIALOG_H__ -#define __FILEENCRYPTIONDIALOG_H__ - -#include "gpg/GpgContext.h" -#include "ui/widgets/KeyList.h" -#include "VerifyDetailsDialog.h" - - -/** - * @brief - * - * @class FileEncryptionDialog fileencryptiondialog.h "fileencryptiondialog.h" - */ -class FileEncryptionDialog : public QDialog { -Q_OBJECT - -public: - - enum DialogAction { - Encrypt, - Decrypt, - Sign, - Verify - }; - - /** - * @brief - * - * @fn FileEncryptionDialog - * @param ctx - * @param keyList - * @param parent - */ - FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList keyList, DialogAction action, QWidget *parent = nullptr); - -public slots: - - /** - * @details - * - * @fn selectInputFile - */ - void slotSelectInputFile(); - - /** - * @brief - * - * @fn selectOutputFile - */ - void slotSelectOutputFile(); - - /** - * @brief - * - * @fn selectSignFile - */ - void slotSelectSignFile(); - - /** - * @brief - * - * @fn executeAction - */ - void slotExecuteAction(); - - /** - * @brief - * - * @fn hideKeyList - */ - void slotHideKeyList(); - - /** - * @brief - * - * @fn showKeyList - */ - void slotShowKeyList(); - -private: - QLineEdit *outputFileEdit; - QLineEdit *inputFileEdit; - QLineEdit *signFileEdit; - DialogAction mAction; - QLabel *statusLabel; -protected: - GpgME::GpgContext *mCtx; - KeyList *mKeyList; - -}; - -#endif // __FILEENCRYPTIONDIALOG_H__ diff --git a/include/ui/FindWidget.h b/include/ui/FindWidget.h deleted file mode 100644 index 1142b649..00000000 --- a/include/ui/FindWidget.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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 FINDWIDGET_H -#define FINDWIDGET_H - -#include "ui/widgets/EditorPage.h" - -/** - * @brief Class for handling the find widget shown at buttom of a textedit-page - */ -class FindWidget : public QWidget { -Q_OBJECT - -public: - /** - * @brief - * - * @param parent The parent widget - */ - explicit FindWidget(QWidget *parent, QTextEdit *edit); - -private: - void keyPressEvent(QKeyEvent *e) override; - - /** - * @details Set background of findEdit to red, if no match is found (Documents textcursor position equals -1), - * otherwise set it to white. - */ - void setBackground(); - - QTextEdit *mTextpage; /** Textedit associated to the notification */ - QLineEdit *findEdit; /** Label holding the text shown in infoBoard */ - -private slots: - - void slotFindNext(); - - void slotFindPrevious(); - - void slotFind(); - - void slotClose(); -}; - -#endif // FINDWIDGET_H diff --git a/include/ui/KeyImportDetailDialog.h b/include/ui/KeyImportDetailDialog.h deleted file mode 100644 index 216cdcd0..00000000 --- a/include/ui/KeyImportDetailDialog.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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 __KEYIMPORTDETAILSDIALOG_H__ -#define __KEYIMPORTDETAILSDIALOG_H__ - -#include "gpg/GpgContext.h" - -class KeyImportDetailDialog : public QDialog -{ - Q_OBJECT - -public: - KeyImportDetailDialog(GpgME::GpgContext *ctx, GpgImportInformation result, bool automatic, QWidget *parent = 0); - -private: - void createGeneralInfoBox(); - void createKeysTable(); - void createButtonBox(); - static QString getStatusString(int keyStatus); - - QTableWidget *keysTable{}; - GpgME::GpgContext *mCtx; - QGroupBox *generalInfoBox{}; - QGroupBox *keyInfoBox{}; - QDialogButtonBox *buttonBox{}; - GpgImportInformation mResult; -}; - -#endif // __KEYIMPORTDETAILSDIALOG_H__ diff --git a/include/ui/KeyMgmt.h b/include/ui/KeyMgmt.h deleted file mode 100755 index fa352149..00000000 --- a/include/ui/KeyMgmt.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * 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 __KEYMGMT_H__ -#define __KEYMGMT_H__ - -#include "ui/widgets/KeyList.h" -#include "ui/keypair_details/KeyDetailsDialog.h" -#include "KeyImportDetailDialog.h" -#include "KeyServerImportDialog.h" -#include "ui/keygen/KeygenDialog.h" - - -class KeyMgmt : public QMainWindow { -Q_OBJECT - -public: - explicit KeyMgmt(GpgME::GpgContext *ctx, QWidget *parent = nullptr); - - QAction *importKeyFromClipboardAct{}; - QAction *importKeyFromFileAct{}; - QAction *importKeyFromKeyServerAct{}; - - QAction *generateKeyPairAct{}; - QAction *generateSubKeyAct{}; - -public slots: - - void slotGenerateSubKey(); - - void slotImportKeyFromFile(); - - void slotImportKeyFromClipboard(); - - void slotImportKeyFromKeyServer(); - - void slotImportKeys(QByteArray inBuffer); - - void slotExportKeyToFile(); - - void slotExportKeyToClipboard(); - - void slotDeleteSelectedKeys(); - - void slotDeleteCheckedKeys(); - - void slotGenerateKeyDialog(); - - void slotShowKeyDetails(); - -signals: - - void signalStatusBarChanged(QString); - -private: - void createMenus(); - - void createActions(); - - void createToolBars(); - - void deleteKeysWithWarning(QStringList *uidList); - - QString appPath; - QSettings settings; - - KeyList *mKeyList; - GpgME::GpgContext *mCtx; - QMenu *fileMenu{}; - QMenu *keyMenu{}; - QMenu *generateKeyMenu{}; - QMenu *importKeyMenu{}; - QAction *openKeyFileAct{}; - QAction *exportKeyToFileAct{}; - QAction *exportKeyToClipboardAct{}; - QAction *deleteCheckedKeysAct{}; - QAction *deleteSelectedKeysAct{}; - QAction *generateKeyDialogAct{}; - QAction *closeAct{}; - QAction *showKeyDetailsAct{}; - KeyServerImportDialog *importDialog{}; - -protected: - void closeEvent(QCloseEvent *event) override; -}; - -#endif // __KEYMGMT_H__ diff --git a/include/ui/KeyServerImportDialog.h b/include/ui/KeyServerImportDialog.h deleted file mode 100644 index 6fd45fc5..00000000 --- a/include/ui/KeyServerImportDialog.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * 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 __KEYSERVERIMPORTDIALOG_H__ -#define __KEYSERVERIMPORTDIALOG_H__ - -#include "gpg/GpgContext.h" -#include "KeyImportDetailDialog.h" -#include "ui/widgets/KeyList.h" - - -class KeyServerImportDialog : public QDialog { -Q_OBJECT - -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(); - - void slotSearchFinished(); - - void slotImportFinished(); - - void slotSearch(); - -private: - void createKeysTable(); - - void setMessage(const QString &text, bool error); - - void importKeys(QByteArray inBuffer); - - void setLoading(bool status); - - QPushButton *createButton(const QString &text, const char *member); - - QComboBox *createComboBox(); - - bool mAutomatic; - - QString appPath; - QSettings settings; - - GpgME::GpgContext *mCtx; - KeyList *mKeyList{}; - QLineEdit *searchLineEdit{}; - QComboBox *keyServerComboBox{}; - QProgressBar *waitingBar; - QLabel *searchLabel{}; - QLabel *keyServerLabel{}; - QLabel *message{}; - QLabel *icon{}; - QPushButton *closeButton{}; - QPushButton *importButton{}; - QPushButton *searchButton{}; - QTableWidget *keysTable{}; - QNetworkAccessManager *qnam{}; - -}; - -#endif // __KEYSERVERIMPORTDIALOG_H__ diff --git a/include/ui/KeyUploadDialog.h b/include/ui/KeyUploadDialog.h deleted file mode 100644 index b41ced6b..00000000 --- a/include/ui/KeyUploadDialog.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * 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); - -public slots: - - void slotUpload(); - -private slots: - - void uploadKeyToServer(QByteArray &keys); - - void slotUploadFinished(); - -private: - - GpgME::GpgContext *mCtx; - const QVector<GpgKey> &mKeys; - QString appPath; - QSettings settings; - QByteArray mKeyData; - -}; - - -#endif //GPGFRONTEND_KEYUPLOADWIDGET_H diff --git a/include/ui/QuitDialog.h b/include/ui/QuitDialog.h deleted file mode 100755 index 19af7534..00000000 --- a/include/ui/QuitDialog.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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 __QUITDIALOG_H__ -#define __QUITDIALOG_H__ - -#include <GpgFrontend.h> - -class QuitDialog : public QDialog { -Q_OBJECT - -public: - QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs); - - [[nodiscard]] bool isDiscarded() const; - - QList<int> getTabIdsToSave(); - -private slots: - - void slotMyDiscard(); - -private: - bool discarded; - QTableWidget *mFileList; -}; - -#endif // __QUITDIALOG_H__ diff --git a/include/ui/SendMailDialog.h b/include/ui/SendMailDialog.h deleted file mode 100644 index e01802d3..00000000 --- a/include/ui/SendMailDialog.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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_SENDMAILDIALOG_H -#define GPGFRONTEND_SENDMAILDIALOG_H - -#include "GpgFrontend.h" - -class SendMailDialog : public QDialog { -Q_OBJECT -public: - explicit SendMailDialog(QString text, QWidget *parent = nullptr); - -private slots: - - void slotConfirm(); - -private: - - QString appPath; - QSettings settings; - - QLineEdit *senderEdit; - QTextEdit *recipientEdit; - QLineEdit *subjectEdit; - QPushButton *confirmButton; - - QLabel *errorLabel; - QString mText; - - QString smtpAddress = settings.value("sendMail/smtpAddress", QString()).toString(); - QString username = settings.value("sendMail/username", QString()).toString(); - QString password = settings.value("sendMail/password", QString()).toString(); - QString defaultSender = settings.value("sendMail/defaultSender", QString()).toString(); - QString connectionTypeSettings = settings.value("sendMail/connectionType", QString()).toString(); - int port = settings.value("sendMail/port", QString()).toInt(); - - QRegularExpression re_email{ - R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"}; - - bool check_email_address(const QString &str); -}; - - -#endif //GPGFRONTEND_SENDMAILDIALOG_H diff --git a/include/ui/SettingsDialog.h b/include/ui/SettingsDialog.h deleted file mode 100755 index 72f80917..00000000 --- a/include/ui/SettingsDialog.h +++ /dev/null @@ -1,263 +0,0 @@ -/** - * 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 __SETTINGSDIALOG_H__ -#define __SETTINGSDIALOG_H__ - -#include "ui/widgets/KeyList.h" - -class GeneralTab : public QWidget { -Q_OBJECT - -public: - explicit GeneralTab(GpgME::GpgContext *ctx, QWidget *parent = nullptr); - - void setSettings(); - - void applySettings(); - -private: - - QString appPath; - QSettings settings; - - QComboBox *serverSelectBox; - QCheckBox *saveCheckedKeysCheckBox; - QCheckBox *importConfirmationCheckBox; - QComboBox *langSelectBox; - QComboBox *ownKeySelectBox; - QPushButton *getServiceTokenButton; - QLabel *serviceTokenLabel; - QHash<QString, QString> lang; - QHash<QString, QString> keyIds; - QVector<QString> keyIdsList; - QString serviceToken; - KeyList *mKeyList; - GpgME::GpgContext *mCtx; - -private slots: - - void slotOwnKeyIdChanged(); - - void slotLanguageChanged(); - - void slotGetServiceToken(); - -signals: - - void signalRestartNeeded(bool needed); - -}; - -class SendMailTab : public QWidget { -Q_OBJECT - -public: - explicit SendMailTab(QWidget *parent = nullptr); - - void setSettings(); - - void applySettings(); - -private slots: - - void slotCheckConnection(); - - void slotCheckBoxSetEnableDisable(int state); - -private: - - QString appPath; - QSettings settings; - - QCheckBox *enableCheckBox; - - QLineEdit *smtpAddress; - QLineEdit *username; - QLineEdit *password; - QSpinBox *portSpin; - QComboBox *connectionTypeComboBox; - QLineEdit *defaultSender; - - QPushButton *checkConnectionButton; - -signals: - - void signalRestartNeeded(bool needed); - -}; - -class AppearanceTab : public QWidget { -Q_OBJECT - -public: - //void setSettings(); - explicit AppearanceTab(QWidget *parent = nullptr); - - void setSettings(); - - void applySettings(); - -private: - - QString appPath; - QSettings settings; - - QButtonGroup *iconStyleGroup; - QRadioButton *iconSizeSmall; - QRadioButton *iconSizeMedium; - QRadioButton *iconSizeLarge; - QButtonGroup *iconSizeGroup; - QRadioButton *iconTextButton; - QRadioButton *iconIconsButton; - QRadioButton *iconAllButton; - QSpinBox *infoBoardFontSizeSpin; - QCheckBox *windowSizeCheckBox; - -signals: - - void signalRestartNeeded(bool needed); - -}; - -class KeyserverTab : public QWidget { -Q_OBJECT - -public: - explicit KeyserverTab(QWidget *parent = nullptr); - - void setSettings(); - - void applySettings(); - -private: - - QString appPath; - QSettings settings; - QComboBox *comboBox; - QLineEdit *newKeyServerEdit; - QTableWidget *keyServerTable; - QStringList keyServerStrList; - -private slots: - - void addKeyServer(); - - void refreshTable(); - -signals: - - void signalRestartNeeded(bool needed); - -}; - -class AdvancedTab : public QWidget { -Q_OBJECT - -public: - explicit AdvancedTab(QWidget *parent = nullptr); - - void setSettings(); - - void applySettings(); - -private: - - QString appPath; - QSettings settings; - - QCheckBox *steganoCheckBox; - QCheckBox *autoPubkeyExchangeCheckBox; - -signals: - - void signalRestartNeeded(bool needed); - -}; - -class GpgPathsTab : public QWidget { -Q_OBJECT -public: - explicit GpgPathsTab(QWidget *parent = nullptr); - - void applySettings(); - -private: - static QString getRelativePath(const QString &dir1, const QString &dir2); - - QString appPath; - QSettings settings; - - QString defKeydbPath; /** The default keydb path used by gpg4usb */ - QString accKeydbPath; /** The currently used keydb path */ - QLabel *keydbLabel; - - void setSettings(); - -private slots: - - QString chooseKeydbDir(); - - void setKeydbPathToDefault(); - -}; - -class SettingsDialog : public QDialog { -Q_OBJECT - -public: - explicit SettingsDialog(GpgME::GpgContext *ctx, QWidget *parent = nullptr); - - GeneralTab *generalTab; - SendMailTab *sendMailTab; - AppearanceTab *appearanceTab; - KeyserverTab *keyserverTab; - AdvancedTab *advancedTab; - GpgPathsTab *gpgPathsTab; - - static QHash<QString, QString> listLanguages(); - -public slots: - - void slotAccept(); - -signals: - - void signalRestartNeeded(bool needed); - -private: - QTabWidget *tabWidget; - QDialogButtonBox *buttonBox; - GpgME::GpgContext *mCtx; /** The current gpg context */ - bool restartNeeded{}; - - bool getRestartNeeded() const; - -private slots: - - void slotSetRestartNeeded(bool needed); - -}; - -#endif // __SETTINGSDIALOG_H__ diff --git a/include/ui/ShowCopyDialog.h b/include/ui/ShowCopyDialog.h deleted file mode 100644 index 45b06e2d..00000000 --- a/include/ui/ShowCopyDialog.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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_ZH_CN_TS_SHOWCOPYDIALOG_H -#define GPGFRONTEND_ZH_CN_TS_SHOWCOPYDIALOG_H - -#include "GpgFrontend.h" - -class ShowCopyDialog : public QDialog { -Q_OBJECT -public: - explicit ShowCopyDialog(const QString &text, const QString &info = "", QWidget *parent = nullptr); - -private slots: - - void slotCopyText(); - -private: - QLabel *infoLabel; - QTextEdit *textEdit; - QPushButton *copyButton; -}; - - -#endif //GPGFRONTEND_ZH_CN_TS_SHOWCOPYDIALOG_H diff --git a/include/ui/VerifyDetailsDialog.h b/include/ui/VerifyDetailsDialog.h deleted file mode 100644 index ece2f1e7..00000000 --- a/include/ui/VerifyDetailsDialog.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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 __VERIFYDETAILSDIALOG_H__ -#define __VERIFYDETAILSDIALOG_H__ - -#include "ui/widgets/EditorPage.h" -#include "ui/widgets/VerifyKeyDetailBox.h" - -class VerifyDetailsDialog : public QDialog { -Q_OBJECT -public: - explicit VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext *ctx, KeyList *keyList, gpg_error_t error, - gpgme_verify_result_t result); - -private slots: - - void slotRefresh(); - -private: - GpgME::GpgContext *mCtx; - KeyList *mKeyList; - QHBoxLayout *mainLayout; - QWidget *mVbox{}; - QByteArray *mInputData{}; /** Data to be verified */ - QByteArray *mInputSignature{}; /** Data to be verified */ - QDialogButtonBox *buttonBox{}; - gpgme_signature_t sign; - gpgme_error_t error; -}; - -#endif // __VERIFYDETAILSDIALOG_H__ diff --git a/include/ui/WaitingDialog.h b/include/ui/WaitingDialog.h deleted file mode 100644 index df781073..00000000 --- a/include/ui/WaitingDialog.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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. - * - */ - -#include "GpgFrontend.h" - -class WaitingDialog : public QDialog { -Q_OBJECT -public: - - WaitingDialog(const QString &title, QWidget *parent); - -public slots: - -private slots: - -private: - - -}; diff --git a/include/ui/Wizard.h b/include/ui/Wizard.h deleted file mode 100644 index 79c7e321..00000000 --- a/include/ui/Wizard.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 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 WIZARD_H -#define WIZARD_H - -#include "ui/keygen/KeygenDialog.h" -#include "ui/KeyMgmt.h" -#include "gpg/GpgConstants.h" -#include "SettingsDialog.h" - -class Wizard : public QWizard { -Q_OBJECT - Q_ENUMS(WizardPages) - -public: - enum WizardPages { - Page_Intro, Page_Choose, Page_ImportFromGpg4usb, Page_ImportFromGnupg, Page_GenKey, - Page_Conclusion - }; - - Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent = nullptr); - -private: - GpgME::GpgContext *mCtx; - KeyMgmt *mKeyMgmt; - QString appPath; - QSettings settings; - -private slots: - - void slotWizardAccepted(); - -signals: - - void signalOpenHelp(QString page); -}; - -class IntroPage : public QWizardPage { -Q_OBJECT - -public: - explicit IntroPage(QWidget *parent = nullptr); - - QHash<QString, QString> languages; - - [[nodiscard]] int nextId() const override; - -private: - QString appPath; - QSettings settings; - -private slots: - - void slotLangChange(const QString& lang); -}; - -class ChoosePage : public QWizardPage { -Q_OBJECT - -public: - explicit ChoosePage(QWidget *parent = nullptr); - -private slots: - - void slotJumpPage(const QString &page); - -private: - [[nodiscard]] int nextId() const override; - - int nextPage; -}; - -class KeyGenPage : public QWizardPage { -Q_OBJECT - -public: - explicit KeyGenPage(GpgME::GpgContext *ctx, QWidget *parent = nullptr); - - [[nodiscard]] int nextId() const override; - -private slots: - - void slotGenerateKeyDialog(); - -private: - GpgME::GpgContext *mCtx; -}; - -class ConclusionPage : public QWizardPage { -Q_OBJECT - -public: - explicit ConclusionPage(QWidget *parent = nullptr); - - [[nodiscard]] int nextId() const override; - -private: - QCheckBox *dontShowWizardCheckBox; - QCheckBox *openHelpCheckBox; -}; - -#endif diff --git a/include/ui/help/AboutDialog.h b/include/ui/help/AboutDialog.h deleted file mode 100644 index dee2c018..00000000 --- a/include/ui/help/AboutDialog.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * 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 __ABOUTDIALOG_H__ -#define __ABOUTDIALOG_H__ - -#include <GpgFrontend.h> - -#include "gpg/GpgContext.h" - -/** - * @brief Class containing the main tab of about dialog - * - */ -class InfoTab : public QWidget { -Q_OBJECT - -public: - explicit InfoTab(QWidget *parent = nullptr); -}; - -/** - * @brief Class containing the translator tab of about dialog - * - */ -class TranslatorsTab : public QWidget { -Q_OBJECT - -public: - explicit TranslatorsTab(QWidget *parent = nullptr); -}; - -/** - * @brief Class containing the main tab of about dialog - * - */ -class UpdateTab : public QWidget { -Q_OBJECT - - QLabel *currentVersionLabel; - - QLabel *latestVersionLabel; - - QLabel *upgradeLabel; - - QProgressBar *pb; - - QString currentVersion; - -public: - explicit UpdateTab(QWidget *parent = nullptr); - - void getLatestVersion(); - -private slots: - void processReplyDataFromUpdateServer(const QByteArray& data);; - -signals: - void replyFromUpdateServer(QByteArray data); -}; - -/** - * @brief Class for handling the about dialog - * - */ -class AboutDialog : public QDialog { -Q_OBJECT - -public: - explicit AboutDialog(int defaultIndex, QWidget *parent); - - -protected: - void showEvent(QShowEvent *ev) override; - -private: - UpdateTab *updateTab; -}; - -#endif // __ABOUTDIALOG_H__ - diff --git a/include/ui/help/VersionCheckThread.h b/include/ui/help/VersionCheckThread.h deleted file mode 100644 index 7ee90077..00000000 --- a/include/ui/help/VersionCheckThread.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * 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_VERSIONCHECKTHREAD_H -#define GPGFRONTEND_VERSIONCHECKTHREAD_H - -#include "GpgFrontend.h" - -class VersionCheckThread : public QThread { -Q_OBJECT - -public: - - VersionCheckThread(QNetworkReply *networkReply); - -signals: - - void upgradeVersion(const QString ¤tVersion, const QString &latestVersion); - -protected: - - void run() override; - -private: - - QNetworkReply* mNetworkReply; - -}; - - -#endif //GPGFRONTEND_VERSIONCHECKTHREAD_H diff --git a/include/ui/keygen/KeygenDialog.h b/include/ui/keygen/KeygenDialog.h deleted file mode 100644 index 4a37590a..00000000 --- a/include/ui/keygen/KeygenDialog.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * 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]><[email protected]> starting on May 12, 2021. - * - */ - -#ifndef __KEYGENDIALOG_H__ -#define __KEYGENDIALOG_H__ - -#include "gpg/GpgContext.h" - -class KeyGenDialog : public QDialog { -Q_OBJECT - - -public: - - /** - * @details Constructor of this class - * - * @param ctx The current GpgME context - * @param key The key to show details of - * @param parent The parent of this widget - */ - explicit KeyGenDialog(GpgME::GpgContext *ctx, QWidget *parent = nullptr); - -private: - - QGroupBox *create_key_usage_group_box(); - - QGroupBox *create_basic_info_group_box(); - - QRegularExpression re_email{ - R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"}; - - GpgME::GpgContext *mCtx; /** The current gpg context */ - QStringList errorMessages; /** List of errors occuring when checking entries of lineedits */ - GenKeyInfo genKeyInfo{}; - - QDialogButtonBox *buttonBox; /** Box for standardbuttons */ - QLabel *errorLabel{}; /** Label containing error message */ - QLineEdit *nameEdit{}; /** Lineedit for the keys name */ - QLineEdit *emailEdit{}; /** Lineedit for the keys email */ - QLineEdit *commentEdit{}; /** Lineedit for the keys comment */ - QSpinBox *keySizeSpinBox{}; /** Spinbox for the keys size (in bit) */ - QComboBox *keyTypeComboBox{}; /** Combobox for Keytpe */ - QDateTimeEdit *dateEdit{}; /** Dateedit for expiration date */ - QCheckBox *expireCheckBox{}; /** Checkbox, if key should expire */ - QCheckBox *noPassPhraseCheckBox{}; - - QGroupBox *keyUsageGroupBox{}; /** Group of Widgets detecting the usage of the Key **/ - -// ENCR, SIGN, CERT, AUTH - std::vector<QCheckBox *> keyUsageCheckBoxes; - - void generateKeyDialog(); - - /** - * @details Refresh widgets state by GenKeyInfo - */ - void refresh_widgets_state(); - - void set_signal_slot(); - - bool check_email_address(const QString &str); - -private slots: - - /** - * @details when expirebox was checked/unchecked, enable/disable the expiration date box - */ - void slotExpireBoxChanged(); - - /** - * @details check all lineedits for false entries. Show error, when there is one, otherwise generate the key - */ - void slotKeyGenAccept(); - - void slotEncryptionBoxChanged(int state); - - void slotSigningBoxChanged(int state); - - void slotCertificationBoxChanged(int state); - - void slotAuthenticationBoxChanged(int state); - - void slotActivatedKeyType(int index); - -}; - -#endif // __KEYGENDIALOG_H__ diff --git a/include/ui/keygen/SubkeyGenerateDialog.h b/include/ui/keygen/SubkeyGenerateDialog.h deleted file mode 100644 index a1cfcf55..00000000 --- a/include/ui/keygen/SubkeyGenerateDialog.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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]><[email protected]> starting on May 12, 2021. - * - */ - -#ifndef GPGFRONTEND_SUBKEYGENERATEDIALOG_H -#define GPGFRONTEND_SUBKEYGENERATEDIALOG_H - -#include "gpg/GpgContext.h" - -class SubkeyGenerateDialog : public QDialog { -Q_OBJECT - -public: - - explicit SubkeyGenerateDialog(GpgME::GpgContext *ctx, const GpgKey &key, QWidget *parent = nullptr); - -private: - - GpgME::GpgContext *mCtx; /** The current gpg context */ - const GpgKey &mKey; - - GenKeyInfo genKeyInfo{}; - - QGroupBox *keyUsageGroupBox{}; - QDialogButtonBox *buttonBox; /** Box for standardbuttons */ - QLabel *errorLabel{}; /** Label containing error message */ - QSpinBox *keySizeSpinBox{}; /** Spinbox for the keys size (in bit) */ - QComboBox *keyTypeComboBox{}; /** Combobox for Keytpe */ - QDateTimeEdit *dateEdit{}; /** Dateedit for expiration date */ - QCheckBox *expireCheckBox{}; /** Checkbox, if key should expire */ - - // ENCR, SIGN, CERT, AUTH - std::vector<QCheckBox *> keyUsageCheckBoxes; - - QGroupBox *create_key_usage_group_box(); - - QGroupBox *create_basic_info_group_box(); - - void set_signal_slot(); - - /** - * @details Refresh widgets state by GenKeyInfo - */ - void refresh_widgets_state(); - -private slots: - - /** - * @details when expirebox was checked/unchecked, enable/disable the expiration date box - */ - void slotExpireBoxChanged(); - - /** - * @details check all lineedits for false entries. Show error, when there is one, otherwise generate the key - */ - void slotKeyGenAccept(); - - void slotEncryptionBoxChanged(int state); - - void slotSigningBoxChanged(int state); - - void slotCertificationBoxChanged(int state); - - void slotAuthenticationBoxChanged(int state); - - void slotActivatedKeyType(int index); - -}; - - -#endif //GPGFRONTEND_SUBKEYGENERATEDIALOG_H diff --git a/include/ui/keypair_details/EditSubKeyDialog.h b/include/ui/keypair_details/EditSubKeyDialog.h deleted file mode 100644 index 6577d382..00000000 --- a/include/ui/keypair_details/EditSubKeyDialog.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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_EDITSUBKEY_H -#define GPGFRONTEND_EDITSUBKEY_H - - -class EditSubKeyDialog { - -}; - - -#endif //GPGFRONTEND_EDITSUBKEY_H diff --git a/include/ui/keypair_details/KeyDetailsDialog.h b/include/ui/keypair_details/KeyDetailsDialog.h deleted file mode 100644 index 94fb1223..00000000 --- a/include/ui/keypair_details/KeyDetailsDialog.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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 __KEYDETAILSDIALOG_H__ -#define __KEYDETAILSDIALOG_H__ - -#include "gpg/GpgContext.h" -#include "KeyPairDetailTab.h" -#include "KeyPairUIDTab.h" -#include "KeyPairSubkeyTab.h" - -class KeyDetailsDialog : public QDialog { -Q_OBJECT - -public: - - KeyDetailsDialog(GpgME::GpgContext *ctx, const GpgKey& key, QWidget *parent = nullptr); - -private: - - QTabWidget *tabWidget{}; - -}; - -#endif // __KEYDETAILSDIALOG_H__ diff --git a/include/ui/keypair_details/KeyNewUIDDialog.h b/include/ui/keypair_details/KeyNewUIDDialog.h deleted file mode 100644 index fd8be03b..00000000 --- a/include/ui/keypair_details/KeyNewUIDDialog.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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]><[email protected]> starting on May 12, 2021. - * - */ - -#ifndef GPGFRONTEND_KEYNEWUIDDIALOG_H -#define GPGFRONTEND_KEYNEWUIDDIALOG_H - -#include "GpgFrontend.h" - -#include "gpg/GpgContext.h" - -class KeyNewUIDDialog : public QDialog { -Q_OBJECT - -public: - - KeyNewUIDDialog(GpgME::GpgContext *ctx, const GpgKey &key ,QWidget *parent = nullptr); - - -private slots: - - void slotCreateNewUID(); - -private: - - GpgME::GpgContext *mCtx; - const GpgKey &mKey; - - QLineEdit *name{}; - QLineEdit *email{}; - QLineEdit *comment{}; - - QPushButton *createButton{}; - - QStringList errorMessages; - QLabel *errorLabel{}; - - QRegularExpression re_email{ - R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"}; - - bool check_email_address(const QString &str); - -}; - - -#endif //GPGFRONTEND_KEYNEWUIDDIALOG_H diff --git a/include/ui/keypair_details/KeyPairDetailTab.h b/include/ui/keypair_details/KeyPairDetailTab.h deleted file mode 100644 index bb364718..00000000 --- a/include/ui/keypair_details/KeyPairDetailTab.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * 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]><[email protected]> starting on May 12, 2021. - * - */ - -#ifndef GPGFRONTEND_KEYPAIRDETAILTAB_H -#define GPGFRONTEND_KEYPAIRDETAILTAB_H - -#include "GpgFrontend.h" -#include "gpg/GpgContext.h" - -#include "ui/KeyUploadDialog.h" -#include "ui/KeyServerImportDialog.h" -#include "KeySetExpireDateDialog.h" - -class KeyPairDetailTab : public QWidget { -Q_OBJECT - - /** - * @details Return QString with a space inserted at every fourth character - * - * @param fingerprint The fingerprint to be beautified - */ - static QString beautifyFingerprint(QString fingerprint); - - void createKeyServerOperaMenu(); - -private slots: - - /** - * @details Export the key to a file, which is choosen in a file dialog - */ - void slotExportPrivateKey(); - - /** - * @details Copy the fingerprint to clipboard - */ - void slotCopyFingerprint(); - - void slotModifyEditDatetime(); - - void slotRefreshKeyInfo(); - - void slotUploadKeyToServer(); - - void slotUpdateKeyToServer(); - - void slotGenRevokeCert(); - -private: - - QString *keyid; /** The id of the key the details should be shown for */ - - GpgME::GpgContext *mCtx; /** The current gpg-context */ - const GpgKey &mKey; - - QGroupBox *ownerBox; /** Groupbox containing owner information */ - QGroupBox *keyBox; /** Groupbox containing key information */ - QGroupBox *fingerprintBox; /** Groupbox containing fingerprint information */ - QGroupBox *additionalUidBox; /** Groupbox containing information about additional uids */ - - QLabel *nameVarLabel; /** Label containng the keys name */ - QLabel *emailVarLabel; /** Label containng the keys email */ - QLabel *commentVarLabel; /** Label containng the keys commment */ - QLabel *keySizeVarLabel; /** Label containng the keys keysize */ - QLabel *expireVarLabel; /** Label containng the keys expiration date */ - QLabel *createdVarLabel; /** Label containng the keys creation date */ - QLabel *algorithmVarLabel; /** Label containng the keys algorithm */ - QLabel *keyidVarLabel; /** Label containng the keys keyid */ - QLabel *fingerPrintVarLabel; /** Label containng the keys fingerprint */ - QLabel *usageVarLabel; - QLabel *actualUsageVarLabel; - QLabel *masterKeyExistVarLabel; - - QMenu *keyServerOperaMenu; - -public: - explicit KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, QWidget *parent = nullptr); -}; - - -#endif //GPGFRONTEND_KEYPAIRDETAILTAB_H diff --git a/include/ui/keypair_details/KeyPairSubkeyTab.h b/include/ui/keypair_details/KeyPairSubkeyTab.h deleted file mode 100644 index 41bb0648..00000000 --- a/include/ui/keypair_details/KeyPairSubkeyTab.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * 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_KEYPAIRSUBKEYTAB_H -#define GPGFRONTEND_KEYPAIRSUBKEYTAB_H - -#include "GpgFrontend.h" - -#include "gpg/GpgContext.h" -#include "ui/keygen/SubkeyGenerateDialog.h" -#include "KeySetExpireDateDialog.h" - -class KeyPairSubkeyTab : public QWidget { -Q_OBJECT - -public: - - KeyPairSubkeyTab(GpgME::GpgContext *ctx, const GpgKey &key, QWidget *parent); - -private: - - void createSubkeyList(); - - void createSubkeyOperaMenu(); - - const GpgSubKey *getSelectedSubkey(); - - GpgME::GpgContext *mCtx; - const GpgKey &mKey; - QTableWidget *subkeyList; - QVector<const GpgSubKey *> buffered_subkeys; - - QGroupBox *listBox; - QGroupBox *detailBox; - - QMenu *subkeyOperaMenu; - - - QLabel *keySizeVarLabel; /** Label containng the keys keysize */ - QLabel *expireVarLabel; /** Label containng the keys expiration date */ - QLabel *createdVarLabel; /** Label containng the keys creation date */ - QLabel *algorithmVarLabel; /** Label containng the keys algorithm */ - QLabel *keyidVarLabel; /** Label containng the keys keyid */ - QLabel *fingerPrintVarLabel; /** Label containng the keys fingerprint */ - QLabel *usageVarLabel; - QLabel *masterKeyExistVarLabel; - - -private slots: - - void slotAddSubkey(); - - void slotRefreshSubkeyList(); - - void slotRefreshSubkeyDetail(); - - void slotEditSubkey(); - - void slotRevokeSubkey(); - -protected: - - void contextMenuEvent(QContextMenuEvent *event) override; - - -}; - - -#endif //GPGFRONTEND_KEYPAIRSUBKEYTAB_H diff --git a/include/ui/keypair_details/KeyPairUIDTab.h b/include/ui/keypair_details/KeyPairUIDTab.h deleted file mode 100644 index 6042ec29..00000000 --- a/include/ui/keypair_details/KeyPairUIDTab.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * 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_KEYPAIRUIDTAB_H -#define GPGFRONTEND_KEYPAIRUIDTAB_H - -#include "GpgFrontend.h" -#include "gpg/GpgContext.h" - -#include "KeyUIDSignDialog.h" -#include "KeyNewUIDDialog.h" - -class KeyPairUIDTab : public QWidget { -Q_OBJECT - -public: - - KeyPairUIDTab(GpgME::GpgContext *ctx, const GpgKey &key, QWidget *parent); - -private: - - void createUIDList(); - - void createSignList(); - - void createManageUIDMenu(); - - void createUIDPopupMenu(); - - void createSignPopupMenu(); - - void getUIDChecked(QVector<GpgUID> &uids); - - bool getUIDSelected(GpgUID &uid); - - bool getSignSelected(GpgKeySignature &signature); - - GpgME::GpgContext *mCtx; - const GpgKey &mKey; - QTableWidget *uidList{}; - QTableWidget *sigList{}; - QMenu *manageSelectedUIDMenu; - QMenu *uidPopupMenu; - QMenu *signPopupMenu; - QVector<const GpgUID *> buffered_uids; - QVector<const GpgKeySignature *> buffered_signatures; - -private slots: - - void slotRefreshUIDList(); - - void slotRefreshSigList(); - - void slotAddSign(); - - void slotAddSignSingle(); - - void slotAddUID(); - - void slotDelUID(); - - void slotDelUIDSingle(); - - void slotSetPrimaryUID(); - - void slotDelSign(); - - static void slotAddUIDResult(int result); - -protected: - - void contextMenuEvent(QContextMenuEvent *event) override; - -}; - - -#endif //GPGFRONTEND_KEYPAIRUIDTAB_H diff --git a/include/ui/keypair_details/KeySetExpireDateDialog.h b/include/ui/keypair_details/KeySetExpireDateDialog.h deleted file mode 100644 index 118bc5ed..00000000 --- a/include/ui/keypair_details/KeySetExpireDateDialog.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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_KEYSETEXPIREDATEDIALOG_H -#define GPGFRONTEND_KEYSETEXPIREDATEDIALOG_H - -#include "GpgFrontend.h" -#include "gpg/GpgContext.h" -#include "gpg/GpgKey.h" -#include "gpg/GpgSubKey.h" - -class KeySetExpireDateDialog : public QDialog { -Q_OBJECT -public: - explicit KeySetExpireDateDialog(GpgME::GpgContext *ctx, const GpgKey &key, const GpgSubKey *subkey, QWidget *parent = nullptr); - -private: - GpgME::GpgContext *mCtx; - const GpgKey &mKey; - const GpgSubKey *mSubkey; - - QDateTimeEdit *dateTimeEdit{}; - QPushButton *confirmButton{}; - QCheckBox *nonExpiredCheck{}; - -private slots: - void slotConfirm(); - void slotNonExpiredChecked(int state); -}; - - -#endif //GPGFRONTEND_KEYSETEXPIREDATEDIALOG_H diff --git a/include/ui/keypair_details/KeyUIDSignDialog.h b/include/ui/keypair_details/KeyUIDSignDialog.h deleted file mode 100644 index 88549e95..00000000 --- a/include/ui/keypair_details/KeyUIDSignDialog.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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]><[email protected]> starting on May 12, 2021. - * - */ - -#ifndef GPGFRONTEND_KEYUIDSIGNDIALOG_H -#define GPGFRONTEND_KEYUIDSIGNDIALOG_H - -#include "GpgFrontend.h" - -#include "gpg/GpgContext.h" -#include "ui/widgets/KeyList.h" - -class KeyUIDSignDialog : public QDialog { - Q_OBJECT - -public: - - explicit KeyUIDSignDialog(GpgME::GpgContext *ctx, const GpgKey &key, const QVector<GpgUID> &uid, QWidget *parent = nullptr); - -private: - - GpgME::GpgContext *mCtx; - - KeyList *mKeyList; - - QPushButton *signKeyButton; - - QDateTimeEdit *expiresEdit; - - QCheckBox *nonExpireCheck; - - const QVector<GpgUID> mUids; - - const GpgKey &mKey; - - -private slots: - - void slotSignKey(bool clicked); - -}; - - -#endif //GPGFRONTEND_KEYUIDSIGNDIALOG_H diff --git a/include/ui/widgets/EditorPage.h b/include/ui/widgets/EditorPage.h deleted file mode 100644 index 720f60c3..00000000 --- a/include/ui/widgets/EditorPage.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * 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 __EDITORPAGE_H__ -#define __EDITORPAGE_H__ - -#include <GpgFrontend.h> - -#include "gpg/GpgConstants.h" - - -QT_BEGIN_NAMESPACE -class QVBoxLayout; - -class QHBoxLayout; - -class QString; - -class QLabel; - -QT_END_NAMESPACE - -/** - * @brief Class for handling a single tab of the tabwidget - * - */ -class EditorPage : public QWidget { -Q_OBJECT -public: - /** - * @details Add layout and add plaintextedit - * - * @param filePath Path of the file handled in this tab - * @param parent Pointer to the parent widget - */ - explicit EditorPage(QString filePath = "", QWidget *parent = nullptr); - - /** - * @details Get the filepath of the currently activated tab. - */ - const QString &getFilePath() const; - - /** - * @details Set filepath of currently activated tab. - * - * @param filePath The path to be set - */ - void setFilePath(const QString &filePath); - - /** - * @details Return pointer tp the textedit of the currently activated tab. - */ - QTextEdit *getTextPage(); - - /** - * @details Show additional widget at buttom of currently active tab - * - * @param widget The widget to be added - * @param className The name to handle the added widget - */ - void showNotificationWidget(QWidget *widget, const char *className); - - /** - * @details Hide all widgets with the given className - * - * @param className The classname of the widgets to hide - */ - void closeNoteByClass(const char *className); - - - const QString uuid = QUuid::createUuid().toString(); - -private: - QTextEdit *textPage; /** The textedit of the tab */ - QVBoxLayout *mainLayout; /** The layout for the tab */ - QString fullFilePath; /** The path to the file handled in the tab */ - bool signMarked{}; /** true, if the signed header is marked, false if not */ - -private slots: - - /** - * @details Format the gpg header in another font-style - */ - void slotFormatGpgHeader(); -}; - -#endif // __EDITORPAGE_H__ diff --git a/include/ui/widgets/FilePage.h b/include/ui/widgets/FilePage.h deleted file mode 100644 index 45d638fa..00000000 --- a/include/ui/widgets/FilePage.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * 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_FILEPAGE_H -#define GPGFRONTEND_FILEPAGE_H - -#include "GpgFrontend.h" - -class FilePage : public QWidget { -Q_OBJECT -public: - - explicit FilePage(QWidget* parent = nullptr); - - [[nodiscard]] QString getSelected() const; - - void createPopupMenu(); - -signals: - void pathChanged(const QString &path); - -private slots: - - void fileTreeViewItemClicked(const QModelIndex &index); - void fileTreeViewItemDoubleClicked(const QModelIndex &index); - - void slotUpLevel(); - void slotGoPath(); - - void slotOpenItem(); - void slotDeleteItem(); - void slotEncryptItem(); - void slotDecryptItem(); - void slotSignItem(); - void slotVerifyItem(); - - void onCustomContextMenu(const QPoint &point); - -protected: - - void keyPressEvent(QKeyEvent *event) override; - - -private: - - QFileSystemModel *dirModel; - QTreeView *dirTreeView; - QLineEdit *pathEdit; - QString mPath; - QString selectedPath; - - QPushButton *upLevelButton; - QPushButton *goPathButton; - QPushButton *refreshButton; - - QMenu *popUpMenu{}; - QAction *encryptItemAct{}; - QAction *decryptItemAct{}; - QAction *signItemAct{}; - QAction *verifyItemAct{}; - - QWidget *firstParent; - -}; - - -#endif //GPGFRONTEND_FILEPAGE_H diff --git a/include/ui/widgets/HelpPage.h b/include/ui/widgets/HelpPage.h deleted file mode 100644 index 0b5e4ca3..00000000 --- a/include/ui/widgets/HelpPage.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * helppage.h - * - * Copyright 2008 gpg4usb-team <[email protected]> - * - * This file is part of gpg4usb. - * - * Gpg4usb 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. - * - * Gpg4usb 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 gpg4usb. If not, see <http://www.gnu.org/licenses/> - */ - -#ifndef HELPPAGE_H -#define HELPPAGE_H - -#include <GpgFrontend.h> - -class HelpPage : public QWidget { -Q_OBJECT -public: - explicit HelpPage(const QString& path, QWidget *parent = nullptr); - - QTextBrowser *getBrowser(); - -signals: - -public slots: - - void slotOpenUrl(const QUrl& url); - -private: - QTextBrowser *browser; /** The textbrowser of the tab */ - QUrl localizedHelp(const QUrl& path); - -}; - -#endif // HELPPAGE_H diff --git a/include/ui/widgets/InfoBoardWidget.h b/include/ui/widgets/InfoBoardWidget.h deleted file mode 100644 index 334ef55a..00000000 --- a/include/ui/widgets/InfoBoardWidget.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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 __VERIFYNOTIFICATION_H__ -#define __VERIFYNOTIFICATION_H__ - -#include "EditorPage.h" -#include "FilePage.h" -#include "ui/VerifyDetailsDialog.h" -#include "gpg/result_analyse/VerifyResultAnalyse.h" - -/** - * @details Enumeration for the status of Verifylabel - */ -typedef enum { - INFO_ERROR_OK = 0, - INFO_ERROR_WARN = 1, - INFO_ERROR_CRITICAL = 2, - INFO_ERROR_NEUTRAL = 3, -} InfoBoardStatus; - -/** - * @brief Class for handling the verifylabel shown at buttom of a textedit-page - */ -class InfoBoardWidget : public QWidget { -Q_OBJECT -public: - /** - * @brief - * - * @param ctx The GPGme-Context - * @param parent The parent widget - */ - explicit InfoBoardWidget(QWidget *parent, GpgME::GpgContext *ctx, KeyList *keyList); - - - void associateTextEdit(QTextEdit *edit); - - void associateFileTreeView(FilePage *treeView); - - void associateTabWidget(QTabWidget *tab); - - void addOptionalAction(const QString& name, const std::function<void()>& action); - - void resetOptionActionsMenu(); - - - - /** - * @details Set the text and background-color of verify notification. - * - * @param text The text to be set. - * @param verifyLabelStatus The status of label to set the specified color. - */ - void setInfoBoard(const QString& text, InfoBoardStatus verifyLabelStatus); - - - QStringList *keysNotInList; /** List with keys, which are in signature but not in keylist */ - - -public slots: - - /** - * @details Import the keys contained in keysNotInList from keyserver - * - */ - void slotImportFromKeyserver(); - - void slotReset(); - - /** - * @details Refresh the contents of dialog. - */ - void slotRefresh(const QString &text, InfoBoardStatus status); - -private: - - QString appPath; - QSettings settings; - - QMenu *detailMenu; /** Menu for te Button in verfiyNotification */ - QAction *importFromKeyserverAct; /** Action for importing keys from keyserver which are notin keylist */ - QTextEdit *infoBoard; - GpgME::GpgContext *mCtx; /** GpgME Context */ - KeyList *mKeyList; /** Table holding the keys */ - - QTextEdit *mTextPage{ nullptr }; /** TextEdit associated to the notification */ - FilePage *mFileTreeView{nullptr }; /** TreeView associated to the notification */ - QTabWidget *mTabWidget{ nullptr }; /** TreeView associated to the notification */ - - QHBoxLayout *actionButtonLayout; - - void deleteWidgetsInLayout(QLayout* layout, int start_index = 0); - - -}; - -#endif // __VERIFYNOTIFICATION_H__
\ No newline at end of file diff --git a/include/ui/widgets/KeyList.h b/include/ui/widgets/KeyList.h deleted file mode 100644 index 231255b6..00000000 --- a/include/ui/widgets/KeyList.h +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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 __KEYLIST_H__ -#define __KEYLIST_H__ - -#include "gpg/GpgContext.h" -#include "ui/KeyImportDetailDialog.h" - - -struct KeyListRow { - - using KeyType = unsigned int; - - static const KeyType SECRET_OR_PUBLIC_KEY = 0; - static const KeyType ONLY_SECRET_KEY = 1; - -}; - -struct KeyListColumn { - - using InfoType = unsigned int; - - static constexpr InfoType ALL = ~0; - static constexpr InfoType TYPE = 1 << 0; - static constexpr InfoType NAME = 1 << 1; - static constexpr InfoType EmailAddress = 1 << 2; - static constexpr InfoType Usage = 1 << 3; - static constexpr InfoType Validity = 1 << 4; - static constexpr InfoType FingerPrint = 1 << 5; - -}; - - -class KeyList : public QWidget { -Q_OBJECT - -public: - - explicit KeyList(GpgME::GpgContext *ctx, - KeyListRow::KeyType selectType = KeyListRow::SECRET_OR_PUBLIC_KEY, - KeyListColumn::InfoType infoType = KeyListColumn::ALL, - QWidget *parent = nullptr); - - void setExcludeKeys(std::initializer_list<QString> key_ids); - - void setFilter(std::function<bool(const GpgKey&)> filter); - - void setDoubleClickedAction(std::function<void(const GpgKey&, QWidget *)> action); - - void setColumnWidth(int row, int size); - - void addMenuAction(QAction *act); - - void addSeparator(); - - QStringList *getChecked(); - - void getCheckedKeys(QVector<GpgKey> &keys); - - QStringList *getPrivateChecked(); - - void getPrivateCheckedKeys(QVector<GpgKey> &keys); - - QStringList *getAllPrivateKeys(); - - void setChecked(QStringList *keyIds); - - QStringList *getSelected(); - - GpgKey getSelectedKey(); - - [[maybe_unused]] static void markKeys(QStringList *keyIds); - - [[maybe_unused]] bool containsPrivateKeys(); - -public slots: - - void slotRefresh(); - -private: - - void importKeys(QByteArray inBuffer); - - QString appPath; - QSettings settings; - - GpgME::GpgContext *mCtx; - QTableWidget *mKeyList; - QMenu *popupMenu; - QNetworkAccessManager *qnam{}; - QVector<GpgKey> buffered_keys; - KeyListRow::KeyType mSelectType; - KeyListColumn::InfoType mInfoType; - QVector<QString> excluded_key_ids; - - std::function<bool(const GpgKey &)> mFilter = nullptr; - std::function<void(const GpgKey &, QWidget *)> mAction = nullptr; - - -private slots: - - void slotDoubleClicked(const QModelIndex &index); - -protected: - - void contextMenuEvent(QContextMenuEvent *event) override; - - void dragEnterEvent(QDragEnterEvent *event) override; - - void dropEvent(QDropEvent *event) override; -}; - -#endif // __KEYLIST_H__ diff --git a/include/ui/widgets/SignersPicker.h b/include/ui/widgets/SignersPicker.h deleted file mode 100644 index afa95a05..00000000 --- a/include/ui/widgets/SignersPicker.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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_ZH_CN_TS_SIGNERSPIRCKER_H -#define GPGFRONTEND_ZH_CN_TS_SIGNERSPIRCKER_H - -#include "GpgFrontend.h" -#include "gpg/GpgContext.h" - -#include "ui/widgets/KeyList.h" - -class SignersPicker : public QDialog { -Q_OBJECT - -public: - - explicit SignersPicker(GpgME::GpgContext *ctx, QWidget *parent = nullptr); - - void getCheckedSigners(QVector<GpgKey> &keys); - -private: - GpgME::GpgContext *mCtx; - KeyList *mKeyList; -}; - - -#endif //GPGFRONTEND_ZH_CN_TS_SIGNERSPIRCKER_H diff --git a/include/ui/widgets/TextEdit.h b/include/ui/widgets/TextEdit.h deleted file mode 100644 index 92bf4dfa..00000000 --- a/include/ui/widgets/TextEdit.h +++ /dev/null @@ -1,298 +0,0 @@ -/** - * 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 __TEXTEDIT_H__ -#define __TEXTEDIT_H__ - -#include "ui/widgets/EditorPage.h" -#include "ui/widgets/HelpPage.h" -#include "ui/widgets/FilePage.h" -#include "ui/QuitDialog.h" - - -/** - * @brief TextEdit class - */ -class TextEdit : public QWidget { -Q_OBJECT -public: - /** - * @brief - */ - TextEdit(QWidget *parent); - - /** - * @details Load the content of file into the current textpage - * - * @param fileName QString containing the filename to load - * @return nothing - */ - void loadFile(const QString &fileName); - - - /** - * @details Checks if there are unsaved documents in any tab, - * which may need to be saved. Call this function before - * closing the programme or all tabs. - * @return \li false, if the close event should be aborted. - * \li true, otherwise - */ - bool maybeSaveAnyTab(); - - [[nodiscard]] int tabCount() const; - - /** - * @details textpage of the currently activated tab - * @return \li reference to QTextEdit if tab has one - * \li 0 otherwise (e.g. if helppage) - */ - [[nodiscard]] QTextEdit *curTextPage() const; - - [[nodiscard]] FilePage * curFilePage() const; - - /** - * @details List of currently unsaved tabs. - * @returns QHash<int, QString> Hash of tabindexes and title of unsaved tabs. - */ - [[nodiscard]] QHash<int, QString> unsavedDocuments() const; - - QTabWidget *tabWidget; /** Widget containing the tabs of the editor */ - -public slots: - - /** - * @details Return pointer to the currently activated text edit tab page. - * - */ - [[nodiscard]] EditorPage *slotCurPageTextEdit() const; - - /** - * @details Return pointer to the currently activated file treeview tab page. - * - */ - [[nodiscard]] FilePage *slotCurPageFileTreeView() const; - - /** - * @details Insert a ">" at the begining of every line of current textedit. - */ - void slotQuote() const; - - /** - * @details replace the text of currently active textedit with given text. - * @param text to fill on. - */ - void slotFillTextEditWithText(const QString& text) const; - - /** - * @details Saves the content of the current tab, if it has a filepath - * otherwise it calls saveAs for the current tab - */ - void slotSave(); - - /** - * @details Opens a savefiledialog and calls saveFile with the choosen filename. - * - * @return Return the return value of the savefile method - */ - bool slotSaveAs(); - - /** - * @details Show an OpenFileDoalog and open the file in a new tab. - * Shows an error dialog, if the open fails. - * Set the focus to the tab of the opened file. - */ - void slotOpen(); - - /** - * @details Open a print-dialog for the current tab - */ - void slotPrint(); - - /** - * @details Adds a new tab with the title "untitled"+countpage+".txt" - * Sets the focus to the new tab. Increase Tab-Count by one - */ - void slotNewTab(); - - /** - * @details Adds a new tab with opening file by path - */ - void slotOpenFile(QString &path); - - /** - * @details Adds a new tab with the given title and opens given html file. - * Increase Tab-Count by one - * @param title title for the tab - * @param path path for html file to show - */ - void slotNewHelpTab(const QString& title, const QString& path) const; - - /** - * New File Tab to do file operation - */ - void slotNewFileTab() const; - - /** - * @details put a * in front of current tabs title, if current textedit is modified - */ - void slotShowModified() const; - - /** - * @details close the current tab and decrease TabWidget->count by \a 1 - * - */ - void slotCloseTab(); - - /** - * @details Switch to the next tab. - * - */ - void slotSwitchTabUp() const; - - /** - * @details Switch to the previous tab. - * - */ - void slotSwitchTabDown() const; - - /** - * @details Insert text in target Text Edit - */ - void slotInsertTargetTextPage(const QString &pagePtr, const QString &text); - - void slotReadTargetTextPageStart(const QString &pageStr); - - void slotReadTargetTextPageDone(const QString &pagePtr); - -signals: - - void readTargetTextPageStart(const QString &pagePtr); - - void insertTargetTextPage(const QString &pagePtr, const QString &text); - - void readTargetTextPageDone(const QString &pagePtr); - -private: - /** - * @details return just a filename stripped of a whole path - * - * @param a filename path - * @return QString containing the filename - */ - static QString strippedName(const QString &fullFileName); - - /** - * @brief - * - * @param askToSave - */ - bool maybeSaveCurrentTab(bool askToSave); - - /**************************************************************************************** - * Name: countPage - * Description: int cotaining the number of added tabs - */ - int countPage; /* TODO */ - - QHash<const QString, QWidget *> pagesHashMap; - -private slots: - - void slotFilePagePathChanged(const QString& path); - - /** - * @details Remove the tab with given index - * - * @param index Tab-number to remove - */ - void removeTab(int index); - - /** - * @details Cut selected text in current textpage. - */ - void slotCut() const; - - /** - * @details Copy selected text of current textpage to clipboard. - */ - void slotCopy() const; - - /** - * @details Paste text from clipboard to current textpage. - */ - void slotPaste() const; - - /** - * @details Undo last change in current textpage. - * - */ - void slotUndo() const; - /**************************************************************************************** - * Name: redo - * Description: redo last change in current textpage - * Parameters: none - * Return Values: none - * Change on members: none - */ - /** - * @brief - * - */ - void slotRedo() const; - - void slotZoomIn() const; - - void slotZoomOut() const; - /**************************************************************************************** - * Name: selectAll - * Description: select all in current textpage - * Parameters: none - * Return Values: none - * Change on members: none - */ - /** - * @brief - * - */ - void slotSelectAll() const; - -protected: - - /**************************************************************************************** - * Name: saveFile - * Description: Saves the content of currentTab to the file filename - * Parameters: QString filename contains the full path of the file to save - * Return Values: true, if the file was saved succesfully - * false, if parameter filename is empty or the saving failed - * Change on members: sets isModified of the current tab to false - */ - /** - * @brief - * - * @param fileName - */ - bool saveFile(const QString &fileName); -}; - -#endif // __TEXTEDIT_H__ diff --git a/include/ui/widgets/VerifyKeyDetailBox.h b/include/ui/widgets/VerifyKeyDetailBox.h deleted file mode 100644 index 66f01a8e..00000000 --- a/include/ui/widgets/VerifyKeyDetailBox.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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 __VERIFYKEYDETAILBOX_H__ -#define __VERIFYKEYDETAILBOX_H__ - -#include "ui/widgets/KeyList.h" -#include "ui/KeyServerImportDialog.h" - -class VerifyKeyDetailBox : public QGroupBox { -Q_OBJECT -public: - explicit VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext *ctx, KeyList *mKeyList, - gpgme_signature_t signature); - -private slots: - - void slotImportFormKeyserver(); - -private: - GpgME::GpgContext *mCtx; - KeyList *mKeyList; - - static QString beautifyFingerprint(QString fingerprint); - - QGridLayout *createKeyInfoGrid(gpgme_signature_t &signature); - - QString fpr; -}; - -#endif // __VERIFYKEYDETAILBOX_H__ - |