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

This commit is contained in:
Jean-Francois Dockes 2015-07-20 19:17:53 +02:00
parent e59bf51445
commit 208619697a
6 changed files with 67 additions and 23 deletions

View File

@ -2455,37 +2455,36 @@ MimeType=*/*
one: use PRE tags with line wrapping.</para> one: use PRE tags with line wrapping.</para>
</listitem> </listitem>
<listitem><para><guilabel>Use desktop preferences to choose <listitem><para><guilabel>Choose editor
document editor</guilabel>: if this is checked, the applicationsr</guilabel>: this opens a dialog which allows you
<command>xdg-open</command> utility will be used to open files to select the application to be used to open each MIME
when you click the <guilabel>Open</guilabel> link in the result type. The default is nornally to use the
list, instead of the application defined in <command>xdg-open</command> utility, but you can override it.</para>
<filename>mimeview</filename>. <command>xdg-open</command> will
in term use your desktop preferences to choose an appropriate
application.</para>
</listitem> </listitem>
<listitem><para><guilabel>Exceptions</guilabel>: when using the <listitem><para><guilabel>Exceptions</guilabel>: even wen
desktop preferences for opening documents, these are MIME types <command>xdg-open</command> is used by default for opening
that will still be opened according to &RCL; preferences. This documents, you can set exceptions for MIME types that will
is useful for passing parameters like page numbers or search still be opened according to &RCL; preferences. This is useful
strings to applications that support them for passing parameters like page numbers or search strings to
applications that support them
(e.g. <application>evince</application>). This cannot be done (e.g. <application>evince</application>). This cannot be done
with <command>xdg-open</command> which only supports passing with <command>xdg-open</command> which only supports passing
one parameter.</para> one parameter.</para>
</listitem> </listitem>
<listitem><para><guilabel>Choose editor applications</guilabel> <listitem><para><guilabel>Document filter choice
this will let you choose the command started by the style</guilabel>: this will let you choose if the document
<guilabel>Open</guilabel> links inside the result list, for categories are displayed as a list or a set of buttons, or a
specific document types.</para> menu.</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> </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 <listitem><para><guilabel>Auto-start simple search on white
space entry</guilabel>: if this is checked, a search will be space entry</guilabel>: if this is checked, a search will be
executed each time you enter a space in the simple search input executed each time you enter a space in the simple search input

View File

@ -85,6 +85,7 @@ void rwSettings(bool writing)
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0); SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0);
SETTING_RW(prefs.toolArea, "/Recoll/geometry/toolArea", Int, 0); SETTING_RW(prefs.toolArea, "/Recoll/geometry/toolArea", Int, 0);
SETTING_RW(prefs.resArea, "/Recoll/geometry/resArea", 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.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Int, 3);
SETTING_RW(prefs.startWithAdvSearchOpen, SETTING_RW(prefs.startWithAdvSearchOpen,
"/Recoll/prefs/startWithAdvSearchOpen", Bool, false); "/Recoll/prefs/startWithAdvSearchOpen", Bool, false);

View File

@ -74,6 +74,8 @@ class PrefsPack {
int pvheight; int pvheight;
int toolArea; // Area for "tools" toolbar int toolArea; // Area for "tools" toolbar
int resArea; // Area for "results" toolbar int resArea; // Area for "results" toolbar
bool ssearchTypSav; // Remember last search mode (else always
// start with same)
int ssearchTyp; int ssearchTyp;
// Use single app (default: xdg-open), instead of per-mime settings // Use single app (default: xdg-open), instead of per-mime settings
bool useDesktopOpen; bool useDesktopOpen;

View File

@ -619,7 +619,10 @@ void RclMain::fileExit()
prefs.resArea = toolBarArea(m_resTB); prefs.resArea = toolBarArea(m_resTB);
restable->saveColState(); restable->saveColState();
prefs.ssearchTyp = sSearch->searchTypCMB->currentIndex(); if (prefs.ssearchTypSav) {
prefs.ssearchTyp = sSearch->searchTypCMB->currentIndex();
}
if (asearchform) if (asearchform)
delete asearchform; delete asearchform;

View File

@ -227,6 +227,23 @@
</item> </item>
</layout> </layout>
</item> </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> <item>
<widget class="QCheckBox" name="ssNoCompleteCB"> <widget class="QCheckBox" name="ssNoCompleteCB">
<property name="text"> <property name="text">

View File

@ -59,6 +59,13 @@ void UIPrefsDialog::init()
{ {
m_viewAction = 0; 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(viewActionPB, SIGNAL(clicked()), this, SLOT(showViewAction()));
connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog())); connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont())); connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
@ -103,6 +110,12 @@ void UIPrefsDialog::setFromPrefs()
collapseDupsCB->setChecked(prefs.collapseDuplicates); collapseDupsCB->setChecked(prefs.collapseDuplicates);
maxHLTSB->setValue(prefs.maxhltextmbs); maxHLTSB->setValue(prefs.maxhltextmbs);
if (prefs.ssearchTypSav) {
ssearchTypCMB->setCurrentIndex(4);
} else {
ssearchTypCMB->setCurrentIndex(prefs.ssearchTyp);
}
switch (prefs.filterCtlStyle) { switch (prefs.filterCtlStyle) {
case PrefsPack::FCS_MN: case PrefsPack::FCS_MN:
filterMN_RB->setChecked(1); filterMN_RB->setChecked(1);
@ -241,6 +254,15 @@ void UIPrefsDialog::accept()
prefs.ssearchNoComplete = ssNoCompleteCB->isChecked(); prefs.ssearchNoComplete = ssNoCompleteCB->isChecked();
prefs.ssearchAsYouType = ssAutoAllCB->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()) { if (filterMN_RB->isChecked()) {
prefs.filterCtlStyle = PrefsPack::FCS_MN; prefs.filterCtlStyle = PrefsPack::FCS_MN;
} else if (filterCMB_RB->isChecked()) { } else if (filterCMB_RB->isChecked()) {