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.showTrayIcon, "/Recoll/prefs/showTrayIcon", Bool, false);
SETTING_RW(prefs.closeToTray, "/Recoll/prefs/closeToTray", Bool, false); SETTING_RW(prefs.closeToTray, "/Recoll/prefs/closeToTray", Bool, false);
SETTING_RW(prefs.trayMessages, "/Recoll/prefs/trayMessages", Bool, false); SETTING_RW(prefs.trayMessages, "/Recoll/prefs/trayMessages", Bool, false);
/*INSERTHERE*/
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show. // See qxtconfirmationmessage. Needs to be -1 for the dialog to show.
SETTING_RW(prefs.showTempFileWarning, "Recoll/prefs/showTempFileWarning", Int, -1); SETTING_RW(prefs.showTempFileWarning, "Recoll/prefs/showTempFileWarning", Int, -1);

View File

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

View File

@ -1572,33 +1572,29 @@ May be slow for big documents.</string>
<attribute name="title"> <attribute name="title">
<string>Misc</string> <string>Misc</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <widget class="QCheckBox" name="anchorTamilHackCB">
<item> <property name="toolTip">
<widget class="QCheckBox" name="anchorTamilHackCB"> <string>The bug causes a strange circle characters to be displayed inside highlighted Tamil words. The workaround inserts an additional space character which appears to fix the problem.</string>
<property name="toolTip"> </property>
<string>The bug causes a strange circle characters to be displayed inside highlighted Tamil words. The workaround inserts an additional space character which appears to fix the problem.</string> <property name="text">
</property> <string>Work around Tamil QTBUG-78923 by inserting space before anchor text</string>
<property name="text"> </property>
<string>Work around Tamil QTBUG-78923 by inserting space before anchor text</string> </widget>
</property> </item>
</widget> <item>
</item> <spacer name="verticalSpacer_2">
<item> <property name="orientation">
<spacer name="verticalSpacer_2"> <enum>Qt::Vertical</enum>
<property name="orientation"> </property>
<enum>Qt::Vertical</enum> <property name="sizeHint" stdset="0">
</property> <size>
<property name="sizeHint" stdset="0"> <width>20</width>
<size> <height>40</height>
<width>20</width> </size>
<height>40</height> </property>
</size> </spacer>
</property>
</spacer>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -1665,7 +1661,7 @@ May be slow for big documents.</string>
<resources/> <resources/>
<connections/> <connections/>
<buttongroups> <buttongroups>
<buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_2"/> <buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup"/>
</buttongroups> </buttongroups>
</ui> </ui>

View File

@ -163,6 +163,7 @@ void UIPrefsDialog::setFromPrefs()
trayMessagesCB->setEnabled(showTrayIconCB->checkState()); trayMessagesCB->setEnabled(showTrayIconCB->checkState());
closeToTrayCB->setChecked(prefs.closeToTray); closeToTrayCB->setChecked(prefs.closeToTray);
trayMessagesCB->setChecked(prefs.trayMessages); trayMessagesCB->setChecked(prefs.trayMessages);
/*INSERTHERE_LOAD*/
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show. // See qxtconfirmationmessage. Needs to be -1 for the dialog to show.
showTempFileWarningCB->setChecked(prefs.showTempFileWarning == -1); showTempFileWarningCB->setChecked(prefs.showTempFileWarning == -1);
@ -438,6 +439,8 @@ void UIPrefsDialog::accept()
m_mainWindow->enableTrayIcon(prefs.showTrayIcon); m_mainWindow->enableTrayIcon(prefs.showTrayIcon);
prefs.closeToTray = closeToTrayCB->isChecked(); prefs.closeToTray = closeToTrayCB->isChecked();
prefs.trayMessages = trayMessagesCB->isChecked(); prefs.trayMessages = trayMessagesCB->isChecked();
/*INSERTHERE_ACCEPT*/
// -1 is the qxtconf... predefined value to show the dialog // -1 is the qxtconf... predefined value to show the dialog
prefs.showTempFileWarning = showTempFileWarningCB->isChecked() ? -1 : 1; prefs.showTempFileWarning = showTempFileWarningCB->isChecked() ? -1 : 1;
settings.setValue("anchorSpcHack", anchorTamilHackCB->isChecked()); settings.setValue("anchorSpcHack", anchorTamilHackCB->isChecked());
@ -743,7 +746,7 @@ void UIPrefsDialog::addExtraDbPB_clicked()
} }
} }
LOGDEB("ExtraDbDial: got: [" << (dbdir) << "]\n" ); LOGDEB("ExtraDbDial: got: [" << (dbdir) << "]\n");
bool stripped; bool stripped;
if (!Rcl::Db::testDbDir(dbdir, &stripped)) { if (!Rcl::Db::testDbDir(dbdir, &stripped)) {
QMessageBox::warning(0, "Recoll", tr("The selected directory does not " QMessageBox::warning(0, "Recoll", tr("The selected directory does not "