diff --git a/kcm_hotkeys/kcm_hotkeys.cpp b/kcm_hotkeys/kcm_hotkeys.cpp --- a/kcm_hotkeys/kcm_hotkeys.cpp +++ b/kcm_hotkeys/kcm_hotkeys.cpp @@ -327,18 +327,30 @@ // 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; }