summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-06-30 22:54:28 +0200
committerMontel Laurent <[email protected]>2016-06-30 22:54:40 +0200
commit25b4c921255f782141b2073ffe1cebc1d541635e (patch)
tree9fd207d375c406dbe1ab7a578d07e7b2f21981e2
parentf6c01bf3b6bdb5a203530140d7c41d9350dc5876 (diff)
Add new check
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt5
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt8
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp53
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h36
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp48
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h1
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp2
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp2
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp9
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h1
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.cpp12
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.h1
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.cpp (renamed from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp)0
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.h (renamed from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h)0
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.cpp (renamed from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.cpp)0
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.h (renamed from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.h)0
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.cpp66
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h37
18 files changed, 271 insertions, 10 deletions
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt b/kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt
index a037bb3..2880ecf 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt
+++ b/kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt
@@ -2,8 +2,9 @@ set(kmail_checkbeforesendeditorplugin_SRCS
checkbeforesendplugin.cpp
checkbeforesendinterface.cpp
checkbeforesendconfigurewidget.cpp
- checkduplicateemailsdialog.cpp
- checkduplicateemailsjob.cpp
+ duplicateemails/checkduplicateemailsdialog.cpp
+ duplicateemails/checkduplicateemailsjob.cpp
+ sendattachments/checkattachmentdialog.cpp
)
ecm_qt_declare_logging_category(kmail_checkbeforesendeditorplugin_SRCS HEADER checkbeforesendplugin_debug.h IDENTIFIER KMAIL_EDITOR_checkbeforesend_PLUGIN_LOG CATEGORY_NAME log_kmail_checkbeforesendplugin)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt b/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt
index ceb7136..4125b3c 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt
@@ -12,7 +12,9 @@ macro(add_kmail_checkbeforesend_unittest _source _additional)
endmacro ()
-add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp "../checkduplicateemailsjob.cpp;../checkduplicateemailsdialog.cpp;../checkbeforesendplugin.cpp;../checkbeforesendinterface.cpp;../checkbeforesendconfigurewidget.cpp")
+add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp "../sendattachments/checkattachmentdialog.cpp;../duplicateemails/checkduplicateemailsjob.cpp;../duplicateemails/checkduplicateemailsdialog.cpp;../checkbeforesendplugin.cpp;../checkbeforesendinterface.cpp;../checkbeforesendconfigurewidget.cpp")
add_kmail_checkbeforesend_unittest(checkbeforesendconfigurewidgettest.cpp "../checkbeforesendconfigurewidget.cpp")
-add_kmail_checkbeforesend_unittest(checkduplicateemailsdialogtest.cpp "../checkduplicateemailsdialog.cpp")
-add_kmail_checkbeforesend_unittest(checkduplicateemailsjobtest.cpp "../checkduplicateemailsjob.cpp")
+add_kmail_checkbeforesend_unittest(checkduplicateemailsdialogtest.cpp "../duplicateemails/checkduplicateemailsdialog.cpp")
+add_kmail_checkbeforesend_unittest(checkduplicateemailsjobtest.cpp "../duplicateemails/checkduplicateemailsjob.cpp")
+
+add_kmail_checkbeforesend_unittest(checkattachmentdialogtest.cpp "../sendattachments/checkattachmentdialog.cpp")
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp
new file mode 100644
index 0000000..23815c2
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp
@@ -0,0 +1,53 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ This program 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 2 of the License, or (at your option) any later version.
+
+ This program 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 this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "checkattachmentdialogtest.h"
+#include "../sendattachments/checkattachmentdialog.h"
+#include <QDialogButtonBox>
+#include <QLabel>
+#include <QListWidget>
+#include <QTest>
+
+CheckAttachmentDialogTest::CheckAttachmentDialogTest(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+CheckAttachmentDialogTest::~CheckAttachmentDialogTest()
+{
+
+}
+
+void CheckAttachmentDialogTest::shouldHaveDefaultValue()
+{
+ CheckAttachmentDialog w;
+ QDialogButtonBox *buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
+ QVERIFY(buttonBox);
+
+ QLabel *lab = w.findChild<QLabel *>(QStringLiteral("lab"));
+ QVERIFY(lab);
+ QVERIFY(!lab->text().isEmpty());
+
+ QListWidget *mListWidget = w.findChild<QListWidget *>(QStringLiteral("listwidget"));
+ QVERIFY(mListWidget);
+ QCOMPARE(mListWidget->count(), 0);
+}
+
+QTEST_MAIN(CheckAttachmentDialogTest)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h
new file mode 100644
index 0000000..779d22f
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h
@@ -0,0 +1,36 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ This program 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 2 of the License, or (at your option) any later version.
+
+ This program 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 this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef CHECKATTACHMENTDIALOGTEST_H
+#define CHECKATTACHMENTDIALOGTEST_H
+
+#include <QObject>
+
+class CheckAttachmentDialogTest : public QObject
+{
+ Q_OBJECT
+public:
+ explicit CheckAttachmentDialogTest(QObject *parent = Q_NULLPTR);
+ ~CheckAttachmentDialogTest();
+
+private Q_SLOTS:
+ void shouldHaveDefaultValue();
+};
+
+#endif // CHECKATTACHMENTDIALOGTEST_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp
index 9dedce3..4726d5e 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp
@@ -54,6 +54,54 @@ void CheckBeforeSendConfigureWidgetTest::shouldHaveDefaultValue()
QVERIFY(mCheckDuplicateEmails);
QVERIFY(!mCheckDuplicateEmails->text().isEmpty());
QVERIFY(!mCheckDuplicateEmails->isChecked());
+
+ QCheckBox *mCheckSendAttachments = w.findChild<QCheckBox *>(QStringLiteral("checksendattachment"));
+ QVERIFY(mCheckSendAttachments);
+ QVERIFY(!mCheckSendAttachments->text().isEmpty());
+ QVERIFY(!mCheckSendAttachments->isChecked());
+}
+
+void CheckBeforeSendConfigureWidgetTest::shouldResetValue()
+{
+ CheckBeforeSendConfigureWidget w;
+
+ QCheckBox *mCheckPlainTextMail = w.findChild<QCheckBox *>(QStringLiteral("checkplaintext"));
+ QCheckBox *mCheckMailTransport = w.findChild<QCheckBox *>(QStringLiteral("smtpdefinedinidentity"));
+ QCheckBox *mCheckDuplicateEmails = w.findChild<QCheckBox *>(QStringLiteral("checkduplicatedemails"));
+ QCheckBox *mCheckSendAttachments = w.findChild<QCheckBox *>(QStringLiteral("checksendattachment"));
+
+
+ mCheckMailTransport->setChecked(true);
+ mCheckDuplicateEmails->setChecked(true);
+ mCheckSendAttachments->setChecked(true);
+ mCheckPlainTextMail->setChecked(true);
+
+ QVERIFY(mCheckPlainTextMail->isChecked());
+ QVERIFY(mCheckMailTransport->isChecked());
+ QVERIFY(mCheckDuplicateEmails->isChecked());
+ QVERIFY(mCheckSendAttachments->isChecked());
+
+ mCheckMailTransport->setChecked(false);
+ mCheckDuplicateEmails->setChecked(false);
+ mCheckSendAttachments->setChecked(false);
+ mCheckPlainTextMail->setChecked(false);
+
+ QVERIFY(!mCheckPlainTextMail->isChecked());
+ QVERIFY(!mCheckMailTransport->isChecked());
+ QVERIFY(!mCheckDuplicateEmails->isChecked());
+ QVERIFY(!mCheckSendAttachments->isChecked());
+
+
+ mCheckMailTransport->setChecked(true);
+ mCheckDuplicateEmails->setChecked(true);
+ mCheckSendAttachments->setChecked(true);
+ mCheckPlainTextMail->setChecked(true);
+
+ w.resetSettings();
+ QVERIFY(!mCheckPlainTextMail->isChecked());
+ QVERIFY(!mCheckMailTransport->isChecked());
+ QVERIFY(!mCheckDuplicateEmails->isChecked());
+ QVERIFY(!mCheckSendAttachments->isChecked());
}
QTEST_MAIN(CheckBeforeSendConfigureWidgetTest)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
index 91ad518..3811b1b 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
@@ -31,6 +31,7 @@ public:
private Q_SLOTS:
void shouldHaveDefaultValue();
+ void shouldResetValue();
};
#endif // CHECKBEFORESENDCONFIGUREWIDGETTEST_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp
index 8a563a3..09208ad 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp
@@ -18,7 +18,7 @@
*/
#include "checkduplicateemailsdialogtest.h"
-#include "../checkduplicateemailsdialog.h"
+#include "../duplicateemails/checkduplicateemailsdialog.h"
#include <QDialogButtonBox>
#include <QLabel>
#include <QListWidget>
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp
index 2a4ee6f..a75f8b6 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp
@@ -18,7 +18,7 @@
*/
#include "checkduplicateemailsjobtest.h"
-#include "../checkduplicateemailsjob.h"
+#include "../duplicateemails/checkduplicateemailsjob.h"
#include <QTest>
#include <QStringList>
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp
index 2a7571c..760905c 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp
@@ -45,6 +45,11 @@ CheckBeforeSendConfigureWidget::CheckBeforeSendConfigureWidget(QWidget *parent)
connect(mCheckDuplicateEmails, &QCheckBox::clicked, this, &CheckBeforeSendConfigureWidget::configureChanged);
mainLayout->addWidget(mCheckDuplicateEmails);
+ mCheckSendAttachments = new QCheckBox(i18n("Check send attachment"), this);
+ mCheckSendAttachments->setObjectName(QStringLiteral("checksendattachment"));
+ connect(mCheckSendAttachments, &QCheckBox::clicked, this, &CheckBeforeSendConfigureWidget::configureChanged);
+ mainLayout->addWidget(mCheckSendAttachments);
+
mainLayout->addStretch(1);
}
@@ -59,6 +64,7 @@ void CheckBeforeSendConfigureWidget::loadSettings()
mCheckPlainTextMail->setChecked(grp.readEntry("SendPlainText", false));
mCheckMailTransport->setChecked(grp.readEntry("SmtpDefinedInIdentity", false));
mCheckDuplicateEmails->setChecked(grp.readEntry("CheckDuplicatedEmails", false));
+ mCheckSendAttachments->setChecked(grp.readEntry("CheckSendAttachment", false));
}
void CheckBeforeSendConfigureWidget::saveSettings()
@@ -67,10 +73,13 @@ void CheckBeforeSendConfigureWidget::saveSettings()
grp.writeEntry("SendPlainText", mCheckPlainTextMail->isChecked());
grp.writeEntry("SmtpDefinedInIdentity", mCheckMailTransport->isChecked());
grp.writeEntry("CheckDuplicatedEmails", mCheckDuplicateEmails->isChecked());
+ grp.writeEntry("CheckSendAttachment", mCheckSendAttachments->isChecked());
}
void CheckBeforeSendConfigureWidget::resetSettings()
{
mCheckPlainTextMail->setChecked(false);
mCheckMailTransport->setChecked(false);
+ mCheckSendAttachments->setChecked(false);
+ mCheckDuplicateEmails->setChecked(false);
}
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h
index 5a50308..596162c 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h
@@ -39,6 +39,7 @@ private:
QCheckBox *mCheckPlainTextMail;
QCheckBox *mCheckMailTransport;
QCheckBox *mCheckDuplicateEmails;
+ QCheckBox *mCheckSendAttachments;
};
#endif // CHECKBEFORESENDCONFIGUREWIDGET_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.cpp b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.cpp
index cbb9f02..6a849e2 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.cpp
@@ -18,8 +18,9 @@
*/
#include "checkbeforesendinterface.h"
-#include "checkduplicateemailsjob.h"
-#include "checkduplicateemailsdialog.h"
+#include "duplicateemails/checkduplicateemailsjob.h"
+#include "duplicateemails/checkduplicateemailsdialog.h"
+#include "sendattachments/checkattachmentdialog.h"
#include <KMessageBox>
#include <KConfigGroup>
@@ -35,7 +36,8 @@ CheckBeforeSendInterface::CheckBeforeSendInterface(QObject *parent)
mIdentityManager(Q_NULLPTR),
mSendPlainText(false),
mCheckMailTransport(false),
- mCheckDuplicateEmails(false)
+ mCheckDuplicateEmails(false),
+ mCheckSendAttachments(false)
{
reloadConfig();
}
@@ -90,6 +92,9 @@ bool CheckBeforeSendInterface::exec(const MessageComposer::PluginEditorCheckBefo
}
}
}
+ if (mCheckSendAttachments) {
+ //TODO
+ }
return true;
}
@@ -99,4 +104,5 @@ void CheckBeforeSendInterface::reloadConfig()
mSendPlainText = grp.readEntry("SendPlainText", false);
mCheckMailTransport = grp.readEntry("SmtpDefinedInIdentity", false);
mCheckDuplicateEmails = grp.readEntry("CheckDuplicatedEmails", false);
+ mCheckSendAttachments = grp.readEntry("CheckSendAttachment", false);
}
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.h b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.h
index 1c0229a..73742ee 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.h
@@ -41,6 +41,7 @@ private:
bool mSendPlainText;
bool mCheckMailTransport;
bool mCheckDuplicateEmails;
+ bool mCheckSendAttachments;
};
#endif // CHECKBEFORESENDINTERFACE_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.cpp
index 0a8b09e..0a8b09e 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.cpp
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.h
index e2f5172..e2f5172 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.h
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.cpp b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.cpp
index 2a0ec79..2a0ec79 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.cpp
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.h b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.h
index 2d3b0a7..2d3b0a7 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.h
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.cpp b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.cpp
new file mode 100644
index 0000000..a0223f9
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.cpp
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ This program 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 2 of the License, or (at your option) any later version.
+
+ This program 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 this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#include "checkattachmentdialog.h"
+#include <KLocalizedString>
+#include <QVBoxLayout>
+#include <QDialogButtonBox>
+#include <QLabel>
+#include <KConfigGroup>
+#include <KSharedConfig>
+#include <QListWidget>
+
+CheckAttachmentDialog::CheckAttachmentDialog(QWidget *parent)
+ : QDialog(parent)
+{
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+
+ QLabel *lab = new QLabel(i18n("Do you want to send some attachment?"), this);
+ lab->setObjectName(QStringLiteral("lab"));
+ mainLayout->addWidget(lab);
+
+ mListWidget = new QListWidget(this);
+ mListWidget->setObjectName(QStringLiteral("listwidget"));
+ mainLayout->addWidget(mListWidget);
+
+ QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
+ buttonBox->setObjectName(QStringLiteral("buttonbox"));
+ mainLayout->addWidget(buttonBox);
+ readConfig();
+}
+
+CheckAttachmentDialog::~CheckAttachmentDialog()
+{
+ writeConfig();
+}
+
+
+void CheckAttachmentDialog::writeConfig()
+{
+ KConfigGroup group(KSharedConfig::openConfig(), "CheckAttachmentDialog");
+ group.writeEntry("Size", size());
+}
+
+void CheckAttachmentDialog::readConfig()
+{
+ KConfigGroup group(KSharedConfig::openConfig(), "CheckAttachmentDialog");
+ const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
+ if (sizeDialog.isValid()) {
+ resize(sizeDialog);
+ }
+}
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h
new file mode 100644
index 0000000..9a9a42b
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h
@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ This program 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 2 of the License, or (at your option) any later version.
+
+ This program 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 this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef CHECKATTACHMENTDIALOG_H
+#define CHECKATTACHMENTDIALOG_H
+
+#include <QDialog>
+class QListWidget;
+class CheckAttachmentDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit CheckAttachmentDialog(QWidget *parent = Q_NULLPTR);
+ ~CheckAttachmentDialog();
+private:
+ void writeConfig();
+ void readConfig();
+ QListWidget *mListWidget;
+};
+
+#endif // CHECKATTACHMENTDIALOG_H