Skip to content

Commit 9601cb5

Browse files
authored
Merge pull request #13 from saturneric/develop
Version 1.2.1
2 parents 74fc3e7 + 6169797 commit 9601cb5

13 files changed

+1983
-1096
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.16)
22

3-
project(GpgFrontend VERSION 1.1.3 LANGUAGES CXX)
3+
project(GpgFrontend VERSION 1.2.1 LANGUAGES CXX)
44

55
message(STATUS "GPGFrontend Build Configuration Started CMAKE Version ${CMAKE_VERSION}")
66

include/ui/QuitDialog.h

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
/*
2-
* keymgmt.h
1+
/**
2+
* This file is part of GPGFrontend.
33
*
4-
* Copyright 2008 gpg4usb-team <[email protected]>
4+
* GPGFrontend is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
58
*
6-
* This file is part of gpg4usb.
9+
* Foobar is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
713
*
8-
* Gpg4usb is free software: you can redistribute it and/or modify
9-
* it under the terms of the GNU General Public License as published by
10-
* the Free Software Foundation, either version 3 of the License, or
11-
* (at your option) any later version.
14+
* You should have received a copy of the GNU General Public License
15+
* along with Foobar. If not, see <https://www.gnu.org/licenses/>.
1216
*
13-
* Gpg4usb is distributed in the hope that it will be useful,
14-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16-
* GNU General Public License for more details.
17+
* The initial version of the source code is inherited from gpg4usb-team.
18+
* Their source code version also complies with GNU General Public License.
19+
*
20+
* The source code version of this software was modified and released
21+
* by Saturneric<[email protected]> starting on May 12, 2021.
1722
*
18-
* You should have received a copy of the GNU General Public License
19-
* along with gpg4usb. If not, see <http://www.gnu.org/licenses/>
2023
*/
2124

2225
#ifndef __QUITDIALOG_H__
@@ -30,7 +33,7 @@ Q_OBJECT
3033
public:
3134
QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs);
3235

33-
bool isDiscarded() const;
36+
[[nodiscard]] bool isDiscarded() const;
3437

3538
QList<int> getTabIdsToSave();
3639

include/ui/SendMailDialog.h

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* This file is part of GPGFrontend.
3+
*
4+
* GPGFrontend is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* Foobar is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with Foobar. If not, see <https://www.gnu.org/licenses/>.
16+
*
17+
* The initial version of the source code is inherited from gpg4usb-team.
18+
* Their source code version also complies with GNU General Public License.
19+
*
20+
* The source code version of this software was modified and released
21+
* by Saturneric<[email protected]> starting on May 12, 2021.
22+
*
23+
*/
24+
25+
#ifndef GPGFRONTEND_SENDMAILDIALOG_H
26+
#define GPGFRONTEND_SENDMAILDIALOG_H
27+
28+
#include "GpgFrontend.h"
29+
30+
class SendMailDialog : public QDialog {
31+
Q_OBJECT
32+
public:
33+
explicit SendMailDialog(QString text, QWidget *parent = nullptr);
34+
35+
private slots:
36+
37+
void slotConfirm();
38+
39+
private:
40+
41+
QString appPath;
42+
QSettings settings;
43+
44+
QLineEdit *senderEdit;
45+
QTextEdit *recipientEdit;
46+
QLineEdit *subjectEdit;
47+
QPushButton *confirmButton;
48+
49+
QLabel *errorLabel;
50+
QString mText;
51+
52+
QString smtpAddress = settings.value("sendMail/smtpAddress", QString()).toString();
53+
QString username = settings.value("sendMail/username", QString()).toString();
54+
QString password = settings.value("sendMail/password", QString()).toString();
55+
QString defaultSender = settings.value("sendMail/defaultSender", QString()).toString();
56+
QString connectionTypeSettings = settings.value("sendMail/connectionType", QString()).toString();
57+
int port = settings.value("sendMail/port", QString()).toInt();
58+
59+
QRegularExpression re_email{
60+
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])+)\]))"};
61+
62+
bool check_email_address(const QString &str);
63+
};
64+
65+
66+
#endif //GPGFRONTEND_SENDMAILDIALOG_H

include/ui/SettingsDialog.h

+19-6
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,37 @@ private slots:
6666

6767
};
6868

69-
class MimeTab : public QWidget {
69+
class SendMailTab : public QWidget {
7070
Q_OBJECT
7171

7272
public:
73-
explicit MimeTab(QWidget *parent = nullptr);
73+
explicit SendMailTab(QWidget *parent = nullptr);
7474

7575
void setSettings();
7676

7777
void applySettings();
7878

79+
private slots:
80+
81+
void slotCheckConnection();
82+
83+
void slotCheckBoxSetEnableDisable(int state);
84+
7985
private:
8086

8187
QString appPath;
8288
QSettings settings;
8389

84-
QCheckBox *mimeParseCheckBox;
85-
QCheckBox *mimeQPCheckBox;
86-
QCheckBox *mimeOpenAttachmentCheckBox;
90+
QCheckBox *enableCheckBox;
91+
92+
QLineEdit *smtpAddress;
93+
QLineEdit *username;
94+
QLineEdit *password;
95+
QSpinBox *portSpin;
96+
QComboBox *connectionTypeComboBox;
97+
QLineEdit *defaultSender;
98+
99+
QPushButton *checkConnectionButton;
87100

88101
signals:
89102

@@ -209,7 +222,7 @@ Q_OBJECT
209222
explicit SettingsDialog(GpgME::GpgContext *ctx, QWidget *parent = nullptr);
210223

211224
GeneralTab *generalTab;
212-
MimeTab *mimeTab;
225+
SendMailTab *sendMailTab;
213226
AppearanceTab *appearanceTab;
214227
KeyserverTab *keyserverTab;
215228
AdvancedTab *advancedTab;

0 commit comments

Comments
 (0)