summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-06-09 13:40:05 +0200
committerMontel Laurent <[email protected]>2016-06-09 13:40:05 +0200
commit92d22b2b7ea4125c4c0665edb7c47a643bcfc0da (patch)
tree387e0c6b37500624a5c81a53d86be553103322e2
parentc6f24e815e7990d079b9a075cde801d5e943ca26 (diff)
Move widgets
-rw-r--r--kmail/editorsendcheckplugins/confirm-address/autotests/confirmaddressconfiguretabwidgettest.cpp17
-rw-r--r--kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.cpp42
-rw-r--r--kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.h8
3 files changed, 66 insertions, 1 deletions
diff --git a/kmail/editorsendcheckplugins/confirm-address/autotests/confirmaddressconfiguretabwidgettest.cpp b/kmail/editorsendcheckplugins/confirm-address/autotests/confirmaddressconfiguretabwidgettest.cpp
index cbcb840..b6297e4 100644
--- a/kmail/editorsendcheckplugins/confirm-address/autotests/confirmaddressconfiguretabwidgettest.cpp
+++ b/kmail/editorsendcheckplugins/confirm-address/autotests/confirmaddressconfiguretabwidgettest.cpp
@@ -21,7 +21,8 @@
#include "../confirmaddressconfiguretabwidget.h"
#include <QTest>
#include <QVBoxLayout>
-#include <QTabWidget>
+#include <QGroupBox>
+#include <PimCommon/SimpleStringlistEditor>
ConfirmAddressConfigureTabWidgetTest::ConfirmAddressConfigureTabWidgetTest(QObject *parent)
: QObject(parent)
@@ -36,6 +37,20 @@ ConfirmAddressConfigureTabWidgetTest::~ConfirmAddressConfigureTabWidgetTest()
void ConfirmAddressConfigureTabWidgetTest::shouldHaveDefaultValue()
{
+ ConfirmAddressConfigureTabWidget w;
+ QGroupBox *groupBoxDomainName = w.findChild<QGroupBox *>(QStringLiteral("groupboxdomainname"));
+ QVERIFY(groupBoxDomainName);
+ QVBoxLayout *layoutDomainName = w.findChild<QVBoxLayout *>(QStringLiteral("layoutdomainname"));
+ QVERIFY(layoutDomainName);
+ PimCommon::SimpleStringListEditor *mDomainNameListEditor = w.findChild<PimCommon::SimpleStringListEditor *>(QStringLiteral("domainnamelisteditor"));
+ QVERIFY(mDomainNameListEditor);
+
+ QGroupBox *groupBoxWhiteList = w.findChild<QGroupBox *>(QStringLiteral("groupboxwhitelist"));
+ QVERIFY(groupBoxWhiteList);
+ QVBoxLayout *layoutWhiteList = w.findChild<QVBoxLayout *>(QStringLiteral("layoutwhitelist"));
+ QVERIFY(layoutWhiteList);
+ PimCommon::SimpleStringListEditor *mWhiteListEditor = w.findChild<PimCommon::SimpleStringListEditor *>(QStringLiteral("whitelisteditor"));
+ QVERIFY(mWhiteListEditor);
}
QTEST_MAIN(ConfirmAddressConfigureTabWidgetTest)
diff --git a/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.cpp b/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.cpp
index 938e0bc..24c2b04 100644
--- a/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.cpp
+++ b/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.cpp
@@ -19,11 +19,53 @@
#include "confirmaddressconfiguretabwidget.h"
#include <KLocalizedString>
+#include <QGroupBox>
#include <QVBoxLayout>
+#include <PimCommon/SimpleStringlistEditor>
ConfirmAddressConfigureTabWidget::ConfirmAddressConfigureTabWidget(QWidget *parent)
: QWidget(parent)
{
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ mainLayout->setObjectName(QStringLiteral("mainlayout"));
+ mainLayout->setMargin(0);
+
+
+ QGroupBox *groupBoxDomainName = new QGroupBox(i18n("Accepted Domain Name"), this);
+ groupBoxDomainName->setObjectName(QStringLiteral("groupboxdomainname"));
+ mainLayout->addWidget(groupBoxDomainName);
+ QVBoxLayout *layoutDomainName = new QVBoxLayout(groupBoxDomainName);
+ layoutDomainName->setObjectName(QStringLiteral("layoutdomainname"));
+
+ PimCommon::SimpleStringListEditor::ButtonCode buttonCode =
+ static_cast<PimCommon::SimpleStringListEditor::ButtonCode>(PimCommon::SimpleStringListEditor::Add | PimCommon::SimpleStringListEditor::Remove | PimCommon::SimpleStringListEditor::Modify);
+ mDomainNameListEditor =
+ new PimCommon::SimpleStringListEditor(groupBoxDomainName, buttonCode,
+ i18n("A&dd..."), i18n("Re&move"),
+ i18n("Mod&ify..."),
+ i18n("Enter new domain name:"));
+ mDomainNameListEditor->setObjectName(QStringLiteral("domainnamelisteditor"));
+ connect(mDomainNameListEditor, &PimCommon::SimpleStringListEditor::changed,
+ this, &ConfirmAddressConfigureTabWidget::configureChanged);
+ layoutDomainName->addWidget(mDomainNameListEditor);
+
+ QGroupBox *groupBoxWhiteList = new QGroupBox(i18n("White List Address"), this);
+ groupBoxWhiteList->setObjectName(QStringLiteral("groupboxwhitelist"));
+ mainLayout->addWidget(groupBoxWhiteList);
+ QVBoxLayout *layoutWhiteList = new QVBoxLayout(groupBoxWhiteList);
+ layoutWhiteList->setObjectName(QStringLiteral("layoutwhitelist"));
+
+ buttonCode =
+ static_cast<PimCommon::SimpleStringListEditor::ButtonCode>(PimCommon::SimpleStringListEditor::Add | PimCommon::SimpleStringListEditor::Remove | PimCommon::SimpleStringListEditor::Modify);
+ mWhiteListEditor =
+ new PimCommon::SimpleStringListEditor(groupBoxWhiteList, buttonCode,
+ i18n("A&dd..."), i18n("Re&move"),
+ i18n("Mod&ify..."),
+ i18n("Enter new email name:"));
+ mWhiteListEditor->setObjectName(QStringLiteral("whitelisteditor"));
+ layoutWhiteList->addWidget(mWhiteListEditor);
+ connect(mWhiteListEditor, &PimCommon::SimpleStringListEditor::changed,
+ this, &ConfirmAddressConfigureTabWidget::configureChanged);
}
ConfirmAddressConfigureTabWidget::~ConfirmAddressConfigureTabWidget()
diff --git a/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.h b/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.h
index 72f8b42..afbdb72 100644
--- a/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.h
+++ b/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.h
@@ -21,6 +21,10 @@
#define CONFIRMADDRESSCONFIGURETABWIDGET_H
#include <QWidget>
+namespace PimCommon
+{
+class SimpleStringListEditor;
+}
class QTabWidget;
class ConfirmAddressConfigureTabWidget : public QWidget
{
@@ -31,6 +35,10 @@ public:
Q_SIGNALS:
void configureChanged();
+
+private:
+ PimCommon::SimpleStringListEditor *mDomainNameListEditor;
+ PimCommon::SimpleStringListEditor *mWhiteListEditor;
};
#endif // CONFIRMADDRESSCONFIGURETABWIDGET_H