Commit 20861969 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Allow starting with fixed simple search mode instead of last remembered value

parent e59bf514
......@@ -2455,37 +2455,36 @@ MimeType=*/*
one: use PRE tags with line wrapping.</para>
</listitem>
<listitem><para><guilabel>Use desktop preferences to choose
document editor</guilabel>: if this is checked, the
<command>xdg-open</command> utility will be used to open files
when you click the <guilabel>Open</guilabel> link in the result
list, instead of the application defined in
<filename>mimeview</filename>. <command>xdg-open</command> will
in term use your desktop preferences to choose an appropriate
application.</para>
<listitem><para><guilabel>Choose editor
applicationsr</guilabel>: this opens a dialog which allows you
to select the application to be used to open each MIME
type. The default is nornally to use the
<command>xdg-open</command> utility, but you can override it.</para>
</listitem>
<listitem><para><guilabel>Exceptions</guilabel>: when using the
desktop preferences for opening documents, these are MIME types
that will still be opened according to &RCL; preferences. This
is useful for passing parameters like page numbers or search
strings to applications that support them
<listitem><para><guilabel>Exceptions</guilabel>: even wen
<command>xdg-open</command> is used by default for opening
documents, you can set exceptions for MIME types that will
still be opened according to &RCL; preferences. This is useful
for passing parameters like page numbers or search strings to
applications that support them
(e.g. <application>evince</application>). This cannot be done
with <command>xdg-open</command> which only supports passing
one parameter.</para>
</listitem>
<listitem><para><guilabel>Choose editor applications</guilabel>
this will let you choose the command started by the
<guilabel>Open</guilabel> links inside the result list, for
specific document types.</para>
</listitem>
<listitem><para><guilabel>Display category filter as
toolbar...</guilabel> this will let you choose if the document
categories are displayed as a list or a set of buttons.</para>
<listitem><para><guilabel>Document filter choice
style</guilabel>: this will let you choose if the document
categories are displayed as a list or a set of buttons, or a
menu.</para>
</listitem>
<listitem><para><guilabel>Start with simple search
mode</guilabel>: this lets you choose the value of the simple
search type on program startup. Either a fixed value
(e.g. <literal>Query Language</literal>, or the value in use
when the program last exited.</para></listitem>
<listitem><para><guilabel>Auto-start simple search on white
space entry</guilabel>: if this is checked, a search will be
executed each time you enter a space in the simple search input
......
......@@ -85,6 +85,7 @@ void rwSettings(bool writing)
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0);
SETTING_RW(prefs.toolArea, "/Recoll/geometry/toolArea", Int, 0);
SETTING_RW(prefs.resArea, "/Recoll/geometry/resArea", Int, 0);
SETTING_RW(prefs.ssearchTypSav, "/Recoll/prefs/ssearchTypSav", Bool, 0);
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Int, 3);
SETTING_RW(prefs.startWithAdvSearchOpen,
"/Recoll/prefs/startWithAdvSearchOpen", Bool, false);
......
......@@ -74,6 +74,8 @@ class PrefsPack {
int pvheight;
int toolArea; // Area for "tools" toolbar
int resArea; // Area for "results" toolbar
bool ssearchTypSav; // Remember last search mode (else always
// start with same)
int ssearchTyp;
// Use single app (default: xdg-open), instead of per-mime settings
bool useDesktopOpen;
......
......@@ -619,7 +619,10 @@ void RclMain::fileExit()
prefs.resArea = toolBarArea(m_resTB);
restable->saveColState();
prefs.ssearchTyp = sSearch->searchTypCMB->currentIndex();
if (prefs.ssearchTypSav) {
prefs.ssearchTyp = sSearch->searchTypCMB->currentIndex();
}
if (asearchform)
delete asearchform;
......
......@@ -227,6 +227,23 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabelSST">
<property name="text">
<string>Start with simple search mode</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="ssearchTypCMB"/>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="ssNoCompleteCB">
<property name="text">
......
......@@ -59,6 +59,13 @@ void UIPrefsDialog::init()
{
m_viewAction = 0;
// See enum above and keep in order !
ssearchTypCMB->addItem(tr("Any term"));
ssearchTypCMB->addItem(tr("All terms"));
ssearchTypCMB->addItem(tr("File name"));
ssearchTypCMB->addItem(tr("Query language"));
ssearchTypCMB->addItem(tr("Value from previous program exit"));
connect(viewActionPB, SIGNAL(clicked()), this, SLOT(showViewAction()));
connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
......@@ -103,6 +110,12 @@ void UIPrefsDialog::setFromPrefs()
collapseDupsCB->setChecked(prefs.collapseDuplicates);
maxHLTSB->setValue(prefs.maxhltextmbs);
if (prefs.ssearchTypSav) {
ssearchTypCMB->setCurrentIndex(4);
} else {
ssearchTypCMB->setCurrentIndex(prefs.ssearchTyp);
}
switch (prefs.filterCtlStyle) {
case PrefsPack::FCS_MN:
filterMN_RB->setChecked(1);
......@@ -241,6 +254,15 @@ void UIPrefsDialog::accept()
prefs.ssearchNoComplete = ssNoCompleteCB->isChecked();
prefs.ssearchAsYouType = ssAutoAllCB->isChecked();
if (ssearchTypCMB->currentIndex() == 4) {
prefs.ssearchTypSav = true;
// prefs.ssearchTyp will be set from the current value when
// exiting the program
} else {
prefs.ssearchTypSav = false;
prefs.ssearchTyp = ssearchTypCMB->currentIndex();
}
if (filterMN_RB->isChecked()) {
prefs.filterCtlStyle = PrefsPack::FCS_MN;
} else if (filterCMB_RB->isChecked()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment