diff options
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/AttachmentTableModel.h | 57 | ||||
-rwxr-xr-x | include/ui/QuitDialog.h | 33 | ||||
-rw-r--r-- | include/ui/SendMailDialog.h | 66 | ||||
-rwxr-xr-x | include/ui/SettingsDialog.h | 26 | ||||
-rw-r--r-- | include/ui/WaitingDialog.h | 2 | ||||
-rw-r--r-- | include/ui/help/AboutDialog.h (renamed from include/ui/AboutDialog.h) | 25 | ||||
-rw-r--r-- | include/ui/help/VersionCheckThread.h | 32 | ||||
-rw-r--r-- | include/ui/keypair_details/KeyPairDetailTab.h | 10 | ||||
-rw-r--r-- | include/ui/widgets/Attachments.h | 59 | ||||
-rw-r--r-- | include/ui/widgets/FilePage.h | 5 | ||||
-rw-r--r-- | include/ui/widgets/InfoBoardWidget.h | 4 | ||||
-rw-r--r-- | include/ui/widgets/KeyList.h | 2 |
12 files changed, 178 insertions, 143 deletions
diff --git a/include/ui/AttachmentTableModel.h b/include/ui/AttachmentTableModel.h deleted file mode 100644 index 9bc22cea..00000000 --- a/include/ui/AttachmentTableModel.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 __ATTACHMENTTABLEMODEL_H__ -#define __ATTACHMENTTABLEMODEL_H__ - -#include "Mime.h" - -class AttachmentTableModel : public QAbstractTableModel { -Q_OBJECT - -public: - explicit AttachmentTableModel(QObject *parent = nullptr); - - explicit AttachmentTableModel(QList<MimePart> mimeparts, QObject *parent = nullptr); - - int rowCount(const QModelIndex &parent) const override; - - int columnCount(const QModelIndex &parent) const override; - - [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override; - - [[nodiscard]] QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - - void add(const MimePart& mp); - - MimePart getSelectedMimePart(QModelIndex index); - - MimePart getMimePart(int index); - //QList<MimePart> getSelectedMimeParts(QModelIndexList indexes); - -private: - QList<MimePart> listOfMimeparts; -}; - -#endif // __ATTACHMENTTABLEMODEL_H__ diff --git a/include/ui/QuitDialog.h b/include/ui/QuitDialog.h index 8d69cfd2..19af7534 100755 --- a/include/ui/QuitDialog.h +++ b/include/ui/QuitDialog.h @@ -1,22 +1,25 @@ -/* - * keymgmt.h +/** + * This file is part of GPGFrontend. * - * Copyright 2008 gpg4usb-team <[email protected]> + * 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. * - * This file is part of gpg4usb. + * 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. * - * 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. + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <https://www.gnu.org/licenses/>. * - * 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. + * 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. * - * You should have received a copy of the GNU General Public License - * along with gpg4usb. If not, see <http://www.gnu.org/licenses/> */ #ifndef __QUITDIALOG_H__ @@ -30,7 +33,7 @@ Q_OBJECT public: QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs); - bool isDiscarded() const; + [[nodiscard]] bool isDiscarded() const; QList<int> getTabIdsToSave(); diff --git a/include/ui/SendMailDialog.h b/include/ui/SendMailDialog.h new file mode 100644 index 00000000..e01802d3 --- /dev/null +++ b/include/ui/SendMailDialog.h @@ -0,0 +1,66 @@ +/** + * 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 index f1a2863c..133a8ec7 100755 --- a/include/ui/SettingsDialog.h +++ b/include/ui/SettingsDialog.h @@ -66,24 +66,37 @@ signals: }; -class MimeTab : public QWidget { +class SendMailTab : public QWidget { Q_OBJECT public: - explicit MimeTab(QWidget *parent = nullptr); + explicit SendMailTab(QWidget *parent = nullptr); void setSettings(); void applySettings(); +private slots: + + void slotCheckConnection(); + + void slotCheckBoxSetEnableDisable(int state); + private: QString appPath; QSettings settings; - QCheckBox *mimeParseCheckBox; - QCheckBox *mimeQPCheckBox; - QCheckBox *mimeOpenAttachmentCheckBox; + QCheckBox *enableCheckBox; + + QLineEdit *smtpAddress; + QLineEdit *username; + QLineEdit *password; + QSpinBox *portSpin; + QComboBox *connectionTypeComboBox; + QLineEdit *defaultSender; + + QPushButton *checkConnectionButton; signals: @@ -115,6 +128,7 @@ private: QRadioButton *iconTextButton; QRadioButton *iconIconsButton; QRadioButton *iconAllButton; + QSpinBox *infoBoardFontSizeSpin; QCheckBox *windowSizeCheckBox; signals: @@ -208,7 +222,7 @@ public: explicit SettingsDialog(GpgME::GpgContext *ctx, QWidget *parent = nullptr); GeneralTab *generalTab; - MimeTab *mimeTab; + SendMailTab *sendMailTab; AppearanceTab *appearanceTab; KeyserverTab *keyserverTab; AdvancedTab *advancedTab; diff --git a/include/ui/WaitingDialog.h b/include/ui/WaitingDialog.h index 64c77ad9..df781073 100644 --- a/include/ui/WaitingDialog.h +++ b/include/ui/WaitingDialog.h @@ -28,7 +28,7 @@ class WaitingDialog : public QDialog { Q_OBJECT public: - WaitingDialog(QWidget *parent = nullptr); + WaitingDialog(const QString &title, QWidget *parent); public slots: diff --git a/include/ui/AboutDialog.h b/include/ui/help/AboutDialog.h index b7d54544..74391b5a 100644 --- a/include/ui/AboutDialog.h +++ b/include/ui/help/AboutDialog.h @@ -52,6 +52,29 @@ public: }; /** + * @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(); +}; + +/** * @brief Class for handling the about dialog * */ @@ -59,7 +82,7 @@ class AboutDialog : public QDialog { Q_OBJECT public: - explicit AboutDialog(QWidget *parent = nullptr); + explicit AboutDialog(int defaultIndex, QWidget *parent); }; #endif // __ABOUTDIALOG_H__ diff --git a/include/ui/help/VersionCheckThread.h b/include/ui/help/VersionCheckThread.h new file mode 100644 index 00000000..10c9da87 --- /dev/null +++ b/include/ui/help/VersionCheckThread.h @@ -0,0 +1,32 @@ +// +// Created by Administrator on 2021/7/12. +// + +#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/keypair_details/KeyPairDetailTab.h b/include/ui/keypair_details/KeyPairDetailTab.h index 6d041f97..bb364718 100644 --- a/include/ui/keypair_details/KeyPairDetailTab.h +++ b/include/ui/keypair_details/KeyPairDetailTab.h @@ -36,10 +36,10 @@ class KeyPairDetailTab : public QWidget { Q_OBJECT /** - * @details Return QString with a space inserted at every fourth character - * - * @param fingerprint The fingerprint to be beautified - */ + * @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(); @@ -64,6 +64,8 @@ private slots: void slotUpdateKeyToServer(); + void slotGenRevokeCert(); + private: QString *keyid; /** The id of the key the details should be shown for */ diff --git a/include/ui/widgets/Attachments.h b/include/ui/widgets/Attachments.h deleted file mode 100644 index 00433028..00000000 --- a/include/ui/widgets/Attachments.h +++ /dev/null @@ -1,59 +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 __ATTACHMENTS_H__ -#define __ATTACHMENTS_H__ - -#include "ui/AttachmentTableModel.h" - -class Attachments : public QWidget { -Q_OBJECT - -public slots: - - void slotSaveFile(); - - void slotOpenFile(); - -public: - explicit Attachments(QWidget *parent = nullptr); - - void addMimePart(MimePart *mp); - -private: - void createActions(); - - void saveByteArrayToFile(QByteArray outBuffer, QString filename); - - QAction *saveFileAct{}; - QAction *openFileAct{}; - AttachmentTableModel *table; - QTableView *tableView; - QSettings settings; - -protected: - void contextMenuEvent(QContextMenuEvent *event) override; -}; - -#endif // __ATTACHMENTS_H__ diff --git a/include/ui/widgets/FilePage.h b/include/ui/widgets/FilePage.h index 3d2c8e72..45d638fa 100644 --- a/include/ui/widgets/FilePage.h +++ b/include/ui/widgets/FilePage.h @@ -57,6 +57,10 @@ private slots: void onCustomContextMenu(const QPoint &point); +protected: + + void keyPressEvent(QKeyEvent *event) override; + private: @@ -64,6 +68,7 @@ private: QTreeView *dirTreeView; QLineEdit *pathEdit; QString mPath; + QString selectedPath; QPushButton *upLevelButton; QPushButton *goPathButton; diff --git a/include/ui/widgets/InfoBoardWidget.h b/include/ui/widgets/InfoBoardWidget.h index f487b72c..2e5f9034 100644 --- a/include/ui/widgets/InfoBoardWidget.h +++ b/include/ui/widgets/InfoBoardWidget.h @@ -95,6 +95,10 @@ public slots: 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; diff --git a/include/ui/widgets/KeyList.h b/include/ui/widgets/KeyList.h index 413d0969..231255b6 100644 --- a/include/ui/widgets/KeyList.h +++ b/include/ui/widgets/KeyList.h @@ -73,6 +73,8 @@ public: void addMenuAction(QAction *act); + void addSeparator(); + QStringList *getChecked(); void getCheckedKeys(QVector<GpgKey> &keys); |