Commit bceea2d5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to assign info

parent 5d3f609f
Pipeline #68948 canceled with stage
......@@ -35,3 +35,8 @@ ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo ConfirmBeforeDe
{
return mConfirmBeforeDeletingCreateRuleWidget->info();
}
void ConfirmBeforeDeletingCreateRuleDialog::setInfo(const ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo &info)
{
mConfirmBeforeDeletingCreateRuleWidget->setInfo(info);
}
......@@ -18,6 +18,8 @@ public:
Q_REQUIRED_RESULT ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo info() const;
void setInfo(const ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo &info);
private:
ConfirmBeforeDeletingCreateRuleWidget *const mConfirmBeforeDeletingCreateRuleWidget;
};
......@@ -43,6 +43,12 @@ ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo ConfirmBeforeDe
return info;
}
void ConfirmBeforeDeletingCreateRuleWidget::setInfo(const ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo &info)
{
mPatternLineEdit->setText(info.pattern);
mRuleTypeComboBox->setCurrentIndex(mRuleTypeComboBox->findData(info.ruleType));
}
void ConfirmBeforeDeletingCreateRuleWidget::fillComboBox()
{
mRuleTypeComboBox->addItem(i18n("Body"), QStringLiteral("body"));
......
......@@ -23,6 +23,8 @@ public:
~ConfirmBeforeDeletingCreateRuleWidget() override;
Q_REQUIRED_RESULT ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo info() const;
void setInfo(const ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo &info);
private:
void fillComboBox();
QLineEdit *const mPatternLineEdit;
......
......@@ -73,7 +73,9 @@ void ConfirmBeforeDeletingWidget::slotAddRule()
{
QPointer<ConfirmBeforeDeletingCreateRuleDialog> dlg = new ConfirmBeforeDeletingCreateRuleDialog(this);
if (dlg->exec()) {
// TODO
const ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo info = dlg->info();
// TODO save it.
}
delete dlg;
}
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