GUI code: added some marker comment to ease semi-automate adding a pref variable

This commit is contained in:
Jean-Francois Dockes 2022-03-09 20:43:40 +01:00
parent f201f5ee1b
commit 53b8b7e237
4 changed files with 50 additions and 48 deletions

View File

@ -289,6 +289,8 @@ void rwSettings(bool writing)
SETTING_RW(prefs.showTrayIcon, "/Recoll/prefs/showTrayIcon", Bool, false);
SETTING_RW(prefs.closeToTray, "/Recoll/prefs/closeToTray", Bool, false);
SETTING_RW(prefs.trayMessages, "/Recoll/prefs/trayMessages", Bool, false);
/*INSERTHERE*/
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show.
SETTING_RW(prefs.showTempFileWarning, "Recoll/prefs/showTempFileWarning", Int, -1);

View File

@ -161,6 +161,7 @@ public:
bool showTrayIcon{false};
bool closeToTray{false};
bool trayMessages{false};
/*INSERTHERE*/
// See widgets/qxtconfirmationmessage.
// Values -1/positive. -1 will trigger the dialog.

View File

@ -1572,8 +1572,6 @@ May be slow for big documents.</string>
<attribute name="title">
<string>Misc</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="anchorTamilHackCB">
@ -1599,8 +1597,6 @@ May be slow for big documents.</string>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
@ -1665,7 +1661,7 @@ May be slow for big documents.</string>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>

View File

@ -163,6 +163,7 @@ void UIPrefsDialog::setFromPrefs()
trayMessagesCB->setEnabled(showTrayIconCB->checkState());
closeToTrayCB->setChecked(prefs.closeToTray);
trayMessagesCB->setChecked(prefs.trayMessages);
/*INSERTHERE_LOAD*/
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show.
showTempFileWarningCB->setChecked(prefs.showTempFileWarning == -1);
@ -438,6 +439,8 @@ void UIPrefsDialog::accept()
m_mainWindow->enableTrayIcon(prefs.showTrayIcon);
prefs.closeToTray = closeToTrayCB->isChecked();
prefs.trayMessages = trayMessagesCB->isChecked();
/*INSERTHERE_ACCEPT*/
// -1 is the qxtconf... predefined value to show the dialog
prefs.showTempFileWarning = showTempFileWarningCB->isChecked() ? -1 : 1;
settings.setValue("anchorSpcHack", anchorTamilHackCB->isChecked());