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
+1
View File
@@ -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);
+2
View File
@@ -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;
+4 -1
View File
@@ -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;
+17
View File
@@ -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">
+22
View File
@@ -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()) {