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

Fix Bug 411137 - Esc key closes the editor without saving

FIXED-IN: 5.12.1
BUG: 411137
parent c6a76682
......@@ -827,6 +827,20 @@ void IncidenceDialog::slotButtonClicked(QAbstractButton *button)
}
}
void IncidenceDialog::reject()
{
Q_D(IncidenceDialog);
if (d->isDirty()
&& KMessageBox::questionYesNo(
this,
i18nc("@info", "Do you really want to cancel?"),
i18nc("@title:window", "KOrganizer Confirmation")) == KMessageBox::Yes) {
QDialog::reject(); // Discard current changes
} else if (!d->isDirty()) {
QDialog::reject(); // No pending changes, just close the dialog.
}
}
void IncidenceDialog::closeEvent(QCloseEvent *event)
{
Q_D(IncidenceDialog);
......
......@@ -94,6 +94,7 @@ protected:
protected Q_SLOTS:
void slotButtonClicked(QAbstractButton *button);
void handleSelectedCollectionChange(const Akonadi::Collection &collection);
void reject() override;
private:
IncidenceDialogPrivate *const d_ptr;
......
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