Add control for toggling preview use of <br> vs <pre> (plainpre). Restore default as true

This commit is contained in:
Jean-Francois Dockes 2011-05-11 08:05:03 +02:00
parent 08a65f5cfc
commit 4a750521b8
3 changed files with 19 additions and 4 deletions

View File

@ -119,11 +119,11 @@ void rwSettings(bool writing)
SETTING_RW(prefs.showResultsAsTable,
"/Recoll/prefs/showResultsAsTable", Bool, false);
SETTING_RW(prefs.maxhltextmbs, "/Recoll/prefs/preview/maxhltextmbs", Int, 3);
// This used to be plainPre in the file, but there is no gui control for
// this and the initial default was wrong (true). So switched to plainPre1
// so that we can start again.
// The default is true because I find it more often useful to keep
// indentation than to fold lines. Mileage may vary.
SETTING_RW(prefs.previewPlainPre,
"/Recoll/prefs/preview/plainPre1", Bool, false);
"/Recoll/prefs/preview/plainPre", Bool, true);
SETTING_RW(prefs.qtermcolor, "/Recoll/prefs/qtermcolor", String, "blue");
if (!writing && prefs.qtermcolor == "")
prefs.qtermcolor = "blue";

View File

@ -274,6 +274,19 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="previewPlainPreCB">
<property name="text">
<string>Use &lt;PRE&gt; tags instead of &lt;BR&gt;to display plain text as html.</string>
</property>
<property name="toolTip">
<string>Lines in PRE text are not folded. Using BR loses indentation.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>

View File

@ -100,6 +100,7 @@ void UIPrefsDialog::setFromPrefs()
keepSortCB->setChecked(prefs.keepSort);
previewHtmlCB->setChecked(prefs.previewHtml);
previewPlainPreCB->setChecked(prefs.previewPlainPre);
// Query terms color
qtermColorLE->setText(prefs.qtermcolor);
@ -203,6 +204,7 @@ void UIPrefsDialog::accept()
prefs.useDesktopOpen = useDesktopOpenCB->isChecked();
prefs.keepSort = keepSortCB->isChecked();
prefs.previewHtml = previewHtmlCB->isChecked();
prefs.previewPlainPre = previewPlainPreCB->isChecked();
prefs.syntAbsLen = syntlenSB->value();
prefs.syntAbsCtx = syntctxSB->value();