Commit 196b8524 authored by Laurent Montel's avatar Laurent Montel 😁

Assign sieveImapAccountSettings for AbstractMoveImapFolderWidget

parent 6bcfe211
......@@ -121,6 +121,7 @@ QWidget *SieveActionFileInto::createParamWidget(QWidget *parent) const
}
KSieveUi::AbstractMoveImapFolderWidget *edit = AutoCreateScriptUtil::createImapFolderWidget();
edit->setSieveImapAccountSettings(sieveImapAccountSettings());
connect(edit, &KSieveUi::AbstractMoveImapFolderWidget::textChanged, this, &SieveActionFileInto::valueChanged);
lay->addWidget(edit);
edit->setObjectName(QStringLiteral("fileintolineedit"));
......
......@@ -19,6 +19,7 @@
#include "sievecondition.h"
#include "autocreatescripts/sieveeditorgraphicalmodewidget.h"
#include "libksieve_debug.h"
#include <KLocalizedString>
......@@ -38,6 +39,15 @@ SieveCondition::~SieveCondition()
{
}
KSieveUi::SieveImapAccountSettings SieveCondition::sieveImapAccountSettings() const
{
if (mSieveGraphicalModeWidget) {
return mSieveGraphicalModeWidget->sieveImapAccountSettings();
}
qCWarning(LIBKSIEVE_LOG) << "SieveAction::sieveImapAccountSettings Problem during initialize mSieveGraphicalModeWidget ";
return {};
}
QStringList SieveCondition::sieveCapabilities() const
{
if (mSieveGraphicalModeWidget) {
......
......@@ -22,8 +22,10 @@
#include <QObject>
#include <QUrl>
class QXmlStreamReader;
namespace KSieveUi {
class SieveImapAccountSettings;
class SieveEditorGraphicalModeWidget;
class SieveCondition : public QObject
{
......@@ -61,14 +63,15 @@ public:
void tooManyArguments(const QString &tagName, int index, int maxValue, QString &error);
void serverDoesNotSupportFeatures(const QString &feature, QString &error);
QString comment() const;
Q_REQUIRED_RESULT QString comment() const;
void setComment(const QString &comment);
QString generateComment() const;
Q_REQUIRED_RESULT QString generateComment() const;
protected:
QStringList sieveCapabilities() const;
Q_REQUIRED_RESULT KSieveUi::SieveImapAccountSettings sieveImapAccountSettings() const;
Q_REQUIRED_RESULT QStringList sieveCapabilities() const;
SieveEditorGraphicalModeWidget *mSieveGraphicalModeWidget = nullptr;
Q_SIGNALS:
......
......@@ -20,6 +20,7 @@
#include "autocreatescripts/autocreatescriptutil_p.h"
#include "autocreatescripts/commonwidgets/selectmatchtypecombobox.h"
#include "editor/sieveeditorutil.h"
#include "util/sieveimapaccountsettings.h"
#include <KLocalizedString>
#include <QLineEdit>
......@@ -56,6 +57,7 @@ QWidget *SieveConditionMetaData::createParamWidget(QWidget *parent) const
grid->addWidget(lab, 0, 0);
KSieveUi::AbstractMoveImapFolderWidget *mailbox = AutoCreateScriptUtil::createImapFolderWidget();
mailbox->setSieveImapAccountSettings(sieveImapAccountSettings());
connect(mailbox, &KSieveUi::AbstractMoveImapFolderWidget::textChanged, this, &SieveConditionMetaData::valueChanged);
mailbox->setObjectName(QStringLiteral("mailbox"));
......
......@@ -19,6 +19,7 @@
#include "sieveconditionmetadataexists.h"
#include "autocreatescripts/autocreatescriptutil_p.h"
#include "editor/sieveeditorutil.h"
#include "util/sieveimapaccountsettings.h"
#include <KLocalizedString>
#include <QLineEdit>
......@@ -45,6 +46,7 @@ QWidget *SieveConditionMetaDataExists::createParamWidget(QWidget *parent) const
grid->addWidget(lab, 0, 0);
KSieveUi::AbstractMoveImapFolderWidget *mailbox = AutoCreateScriptUtil::createImapFolderWidget();
mailbox->setSieveImapAccountSettings(sieveImapAccountSettings());
connect(mailbox, &KSieveUi::AbstractMoveImapFolderWidget::textChanged, this, &SieveConditionMetaDataExists::valueChanged);
mailbox->setObjectName(QStringLiteral("mailbox"));
grid->addWidget(mailbox, 0, 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment