From c7bdb3b342823d3144f3c73e125e274aa40c77e2 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 --- src/frontends/qt4/GuiPrefs.cpp | 8 +-- src/frontends/qt4/ui/PrefsUi.ui | 103 ++++++++++++++++++++------------ 2 files changed, 69 insertions(+), 42 deletions(-) diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index d855ffa15d..615c7dabdf 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -3417,7 +3417,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())); @@ -3462,7 +3462,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); @@ -3573,8 +3573,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 -- 2.39.5