summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-03-20 13:58:15 +0100
committerLaurent Montel <[email protected]>2018-03-20 13:58:15 +0100
commitb8a0ba16dee0c09da6fad86684a07a1739e0bbd7 (patch)
tree4cdb56e2122871181881e64ac338e66e280be123
parent01df23f2a3e5daa963460f27606d0cc7c085e9d6 (diff)
Use createSelectEmailsWidget here toov18.03.80
-rw-r--r--src/ksieveui/autocreatescripts/sieveactions/sieveactionvacation.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ksieveui/autocreatescripts/sieveactions/sieveactionvacation.cpp b/src/ksieveui/autocreatescripts/sieveactions/sieveactionvacation.cpp
index a99fcdb..b988edb 100644
--- a/src/ksieveui/autocreatescripts/sieveactions/sieveactionvacation.cpp
+++ b/src/ksieveui/autocreatescripts/sieveactions/sieveactionvacation.cpp
@@ -31,6 +31,8 @@
#include "libksieve_debug.h"
#include <QXmlStreamReader>
#include <QGridLayout>
+#include "autocreatescripts/autocreatescriptutil_p.h"
+#include <KSieveUi/AbstractSelectEmailLineEdit>
using namespace KSieveUi;
@@ -76,9 +78,10 @@ QWidget *SieveActionVacation::createParamWidget(QWidget *parent) const
lab = new QLabel(i18n("Additional email:"));
grid->addWidget(lab, 2, 0);
- QLineEdit *addresses = new QLineEdit;
+ AbstractSelectEmailLineEdit *addresses = AutoCreateScriptUtil::createSelectEmailsWidget();
addresses->setObjectName(QStringLiteral("addresses"));
- connect(addresses, &QLineEdit::textChanged, this, &SieveActionVacation::valueChanged);
+ addresses->setMultiSelection(true);
+ connect(addresses, &AbstractSelectEmailLineEdit::valueChanged, this, &SieveActionVacation::valueChanged);
grid->addWidget(addresses, 2, 1);
lab = new QLabel(i18n("Vacation reason:"));
@@ -108,7 +111,7 @@ bool SieveActionVacation::setParamWidgetValue(QXmlStreamReader &element, QWidget
} else if (tagValue == QLatin1String("days")) {
//Nothing wait num tag for it.
} else if (tagValue == QLatin1String("addresses")) {
- QLineEdit *addresses = w->findChild<QLineEdit *>(QStringLiteral("addresses"));
+ AbstractSelectEmailLineEdit *addresses = w->findChild<AbstractSelectEmailLineEdit *>(QStringLiteral("addresses"));
if (element.readNextStartElement()) {
const QStringRef textElementTagName = element.name();
if (textElementTagName == QLatin1String("str")) {
@@ -161,7 +164,7 @@ QString SieveActionVacation::code(QWidget *w) const
const QLineEdit *subject = w->findChild<QLineEdit *>(QStringLiteral("subject"));
const QString subjectStr = subject->text();
- const QLineEdit *addresses = w->findChild<QLineEdit *>(QStringLiteral("addresses"));
+ const AbstractSelectEmailLineEdit *addresses = w->findChild<AbstractSelectEmailLineEdit *>(QStringLiteral("addresses"));
const QString addressesStr = addresses->text();
QString result = QStringLiteral("vacation");
if (!dayStr.isEmpty()) {