Commit 7cd42f68 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve confirmbeforedeleting dialog

parent b1441ca6
...@@ -30,7 +30,7 @@ ConfirmBeforeDeletingDialog::ConfirmBeforeDeletingDialog(QWidget *parent) ...@@ -30,7 +30,7 @@ ConfirmBeforeDeletingDialog::ConfirmBeforeDeletingDialog(QWidget *parent)
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setObjectName(QStringLiteral("buttonBox"));
mainLayout->addWidget(buttonBox); mainLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfirmBeforeDeletingDialog::accept); connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfirmBeforeDeletingDialog::slotSave);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfirmBeforeDeletingDialog::reject); connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfirmBeforeDeletingDialog::reject);
readConfig(); readConfig();
} }
...@@ -40,6 +40,12 @@ ConfirmBeforeDeletingDialog::~ConfirmBeforeDeletingDialog() ...@@ -40,6 +40,12 @@ ConfirmBeforeDeletingDialog::~ConfirmBeforeDeletingDialog()
writeConfig(); writeConfig();
} }
void ConfirmBeforeDeletingDialog::slotSave()
{
// TODO
accept();
}
void ConfirmBeforeDeletingDialog::writeConfig() void ConfirmBeforeDeletingDialog::writeConfig()
{ {
KConfigGroup group(KSharedConfig::openStateConfig(), myConfirmBeforeDeletingConfigGroupName); KConfigGroup group(KSharedConfig::openStateConfig(), myConfirmBeforeDeletingConfigGroupName);
......
...@@ -16,6 +16,7 @@ public: ...@@ -16,6 +16,7 @@ public:
~ConfirmBeforeDeletingDialog() override; ~ConfirmBeforeDeletingDialog() override;
private: private:
void slotSave();
void writeConfig(); void writeConfig();
void readConfig(); void readConfig();
ConfirmBeforeDeletingWidget *const mConfirmBeforeDeletingWidget; ConfirmBeforeDeletingWidget *const mConfirmBeforeDeletingWidget;
......
...@@ -68,7 +68,7 @@ void ConfirmBeforeDeletingManager::saveRules() ...@@ -68,7 +68,7 @@ void ConfirmBeforeDeletingManager::saveRules()
const QString groupName = defaultGroupName() + QStringLiteral(" #%1").arg(i); const QString groupName = defaultGroupName() + QStringLiteral(" #%1").arg(i);
KConfigGroup group = config->group(groupName); KConfigGroup group = config->group(groupName);
const ConfirmBeforeDeletingRule &rule = mRules.at(i); const ConfirmBeforeDeletingRule &rule = mRules.at(i);
rule.save(group); // TODO rule.save(group);
} }
} }
......
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