GUI: warning when opening temp file: really remember the preference from the dialog

This commit is contained in:
Jean-Francois Dockes 2019-10-20 10:31:40 +02:00
parent c11cac2868
commit a90c4bf698
5 changed files with 9 additions and 0 deletions

View File

@ -306,6 +306,7 @@ 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);
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show.
SETTING_RW(prefs.showTempFileWarning, "Recoll/prefs/showTempFileWarning",
Int, -1);

View File

@ -143,6 +143,7 @@ class PrefsPack {
bool closeToTray{false};
bool trayMessages{false};
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show
int showTempFileWarning;
// Advanced search window clause list state

View File

@ -375,6 +375,11 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
confirm.setSettingsPath("Recoll/prefs");
confirm.setOverrideSettingsKey("showTempFileWarning");
confirm.exec();
// Pita: need to keep the prefs struct in sync, else the value
// will be clobbered on program exit.
QSettings settings("Recoll.org", "recoll");
prefs.showTempFileWarning =
settings.value("Recoll/prefs/showTempFileWarning").toInt();
}
// If we are not called with a page number (which would happen for a call

View File

@ -253,6 +253,7 @@ void SSearch::onCompleterShown()
// nothing was typed. So we disable the completion if a
bool SSearch::eventFilter(QObject *target, QEvent *event)
{
Q_UNUSED(target);
LOGDEB1("SSearch::eventFilter: event\n");
if (event->type() != QEvent::KeyPress) {
return false;

View File

@ -154,6 +154,7 @@ void UIPrefsDialog::setFromPrefs()
closeToTrayCB->setChecked(prefs.closeToTray);
trayMessagesCB->setChecked(prefs.trayMessages);
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show.
showTempFileWarningCB->setChecked(prefs.showTempFileWarning == -1);
anchorTamilHackCB->setChecked(settings.value("anchorSpcHack", 0).toBool());
previewHtmlCB->setChecked(prefs.previewHtml);