Commit ac133254 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Make Apply/Discard settings prompt consistent with rest of settings

When switching between shortcut categories with pending changes, a user would only be given the opportunity
to discard them or cancel out and save manually.
This makes it consistent with what System Settings usually offers, a Discard, Apply, and Cancel option

Differential Revision: https://phabricator.kde.org/D12928
parent 1f87ba0e
......@@ -327,18 +327,30 @@ bool KCMHotkeysPrivate::maybeShowWidget(const QModelIndex &nextIndex)
// If the current widget is changed, ask user if switch is ok
if (current && (currentIndex != nextIndex) && current->isChanged())
{
int choice = KMessageBox::warningContinueCancel(
q,
i18n("The current action has unsaved changes. If you continue these changes will be lost."),
i18n("Save changes") );
if (choice != KMessageBox::Continue)
{
const int choice = KMessageBox::warningYesNoCancel(
q,
i18n("The current action has unsaved changes.\n"
"Do you want to apply the changes or discard them?"),
i18n("Save changes"),
KStandardGuiItem::apply(),
KStandardGuiItem::discard(),
KStandardGuiItem::cancel()
);
switch (choice) {
case KMessageBox::Yes:
applyCurrentItem();
save();
return true;
case KMessageBox::No:
return true;
case KMessageBox::Cancel:
return false;
default:
Q_UNREACHABLE();
return false;
}
// Apply the changes from the current item
//applyCurrentItem();
//save();
}
}
return true;
}
......
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