Commit 854b2873 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement create rule dialog

parent 2dd01239
Pipeline #68302 passed with stage
in 54 minutes and 35 seconds
......@@ -28,6 +28,7 @@ ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingCreateRuleWidget(QWi
mPatternLineEdit->setObjectName(QStringLiteral("mPatternLineEdit"));
mainLayout->addWidget(mPatternLineEdit);
fillComboBox();
}
ConfirmBeforeDeletingCreateRuleWidget::~ConfirmBeforeDeletingCreateRuleWidget()
......@@ -37,5 +38,15 @@ ConfirmBeforeDeletingCreateRuleWidget::~ConfirmBeforeDeletingCreateRuleWidget()
ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo ConfirmBeforeDeletingCreateRuleWidget::info() const
{
ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo info;
info.pattern = mPatternLineEdit->text();
info.ruleType = mRuleTypeComboBox->currentData().toString();
return info;
}
void ConfirmBeforeDeletingCreateRuleWidget::fillComboBox()
{
mRuleTypeComboBox->addItem(i18n("Body"), QStringLiteral("body"));
mRuleTypeComboBox->addItem(i18n("Subject"), QStringLiteral("subject"));
mRuleTypeComboBox->addItem(i18n("To"), QStringLiteral("to"));
mRuleTypeComboBox->addItem(i18n("Cc"), QStringLiteral("cc"));
}
......@@ -17,12 +17,14 @@ class KMAILCONFIRMBEFOREDELETING_TESTS_EXPORT ConfirmBeforeDeletingCreateRuleWid
public:
struct ConfirmBeforeDeletingInfo {
QString pattern;
QString ruleType;
};
explicit ConfirmBeforeDeletingCreateRuleWidget(QWidget *parent = nullptr);
~ConfirmBeforeDeletingCreateRuleWidget() override;
Q_REQUIRED_RESULT ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo info() const;
private:
void fillComboBox();
QLineEdit *const mPatternLineEdit;
QComboBox *const mRuleTypeComboBox;
};
......@@ -5,15 +5,20 @@
*/
#include "confirmbeforedeletingwidget.h"
#include "confirmbeforedeletingcreateruledialog.h"
#include <QPointer>
#include <QTreeWidget>
#include <QVBoxLayout>
ConfirmBeforeDeletingWidget::ConfirmBeforeDeletingWidget(QWidget *parent)
: QWidget(parent)
, mTreeWidget(new QTreeWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins({});
mainLayout->setObjectName(QStringLiteral("mainlayout"));
// TODO
mainLayout->addWidget(mTreeWidget);
}
ConfirmBeforeDeletingWidget::~ConfirmBeforeDeletingWidget()
......
......@@ -8,11 +8,14 @@
#include "confirmbeforedeleting_private_export.h"
#include <QWidget>
class QTreeWidget;
class KMAILCONFIRMBEFOREDELETING_TESTS_EXPORT ConfirmBeforeDeletingWidget : public QWidget
{
Q_OBJECT
public:
explicit ConfirmBeforeDeletingWidget(QWidget *parent = nullptr);
~ConfirmBeforeDeletingWidget() override;
private:
QTreeWidget *const mTreeWidget;
};
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