From 7a0416b3741f9b8b1f7ee4f9d5a926cd99bcb58f Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 28 Apr 2018 11:19:26 +0200 Subject: [PATCH] Rework OK/Apply/Cancel UI of prefs dialog Instead of "Save" (permanently) and "Apply" (temporarily), OK and Apply now always save permanently, unless the new checkbox "Apply to current session only" is checked. Addresses: #10016 (cherry picked from commit c7bdb3b342823d3144f3c73e125e274aa40c77e2) --- src/frontends/qt4/GuiPrefs.cpp | 8 +-- src/frontends/qt4/ui/PrefsUi.ui | 103 ++++++++++++++++++++------------ status.23x | 2 + 3 files changed, 71 insertions(+), 42 deletions(-) diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index dc04ec5c3d..8e4dbcde6a 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -3440,7 +3440,7 @@ GuiPreferences::GuiPreferences(GuiView & lv) QDialog::setModal(false); - connect(savePB, SIGNAL(clicked()), this, SLOT(slotOK())); + connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore())); @@ -3485,7 +3485,7 @@ GuiPreferences::GuiPreferences(GuiView & lv) #endif bc().setPolicy(ButtonPolicy::PreferencesPolicy); - bc().setOK(savePB); + bc().setOK(okPB); bc().setApply(applyPB); bc().setCancel(closePB); bc().setRestore(restorePB); @@ -3596,8 +3596,8 @@ void GuiPreferences::dispatchParams() update_previews_ = false; } - // The Save button has been pressed - if (isClosing()) + // Save permanently + if (!tempSaveCB->isChecked()) dispatch(FuncRequest(LFUN_PREFERENCES_SAVE)); } diff --git a/src/frontends/qt4/ui/PrefsUi.ui b/src/frontends/qt4/ui/PrefsUi.ui index 5da08dba44..ffdd011b60 100644 --- a/src/frontends/qt4/ui/PrefsUi.ui +++ b/src/frontends/qt4/ui/PrefsUi.ui @@ -1,62 +1,79 @@ - + + PrefsUi - - + + 0 0 - 433 + 650 352 - - - 1 - 1 + + 0 0 - + - + true - - + + 11 - + + 11 + + + 11 + + + 11 + + 6 - - - + + + + 6 + + 0 - - 6 + + 0 + + + 0 + + + 0 - - + + &Restore - + false - + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 @@ -65,39 +82,49 @@ - - - &Save + + + If this is checked, pressing OK or Apply will save the changes only for the current LyX session, not permanently. + + + A&pply to current session only + + + + + + + &OK - + false - - + + &Apply - + false - - + + &Close - + false - - + + @@ -112,12 +139,12 @@ prefsPS restorePB - savePB + okPB applyPB closePB - qt_i18n.h + qt_i18n.h diff --git a/status.23x b/status.23x index 3091f06bd1..79eec6488e 100644 --- a/status.23x +++ b/status.23x @@ -50,6 +50,8 @@ What's new - Improve layout of the character dialog (bugs 2752, 3804, 3884, and 4836). +- Rework OK/Apply/Cancel behavior of preferences dialog (bug 10016). + - Disambiguate dialog message (bug 11242). - Unify capitalzation in dialog (bug 11237). -- 2.39.5