make constant lengths for abstracts config params
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.16 2006-09-13 08:13:36 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.17 2006-09-13 13:53:35 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -151,6 +151,10 @@ void rwSettings(bool writing)
|
||||
"/Recoll/prefs/query/buildAbstract", Bool, true);
|
||||
SETTING_RW(prefs.queryReplaceAbstract,
|
||||
"/Recoll/prefs/query/replaceAbstract", Bool, false);
|
||||
SETTING_RW(prefs.syntAbsLen, "/Recoll/prefs/query/syntAbsLen",
|
||||
Num, 250);
|
||||
SETTING_RW(prefs.syntAbsCtx, "/Recoll/prefs/query/syntAbsCtx",
|
||||
Num, 4);
|
||||
|
||||
// Ssearch combobox history list
|
||||
if (writing) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef _GUIUTILS_H_INCLUDED_
|
||||
#define _GUIUTILS_H_INCLUDED_
|
||||
/*
|
||||
* @(#$Id: guiutils.h,v 1.8 2006-09-13 08:13:36 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* @(#$Id: guiutils.h,v 1.9 2006-09-13 13:53:35 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* jean-francois.dockes@wanadoo.fr
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -78,6 +78,9 @@ class PrefsPack {
|
||||
// Ignored file types in adv search (startup default)
|
||||
QStringList asearchIgnFilTyps;
|
||||
|
||||
int syntAbsLen;
|
||||
int syntAbsCtx;
|
||||
|
||||
PrefsPack() :
|
||||
showicons(true),
|
||||
respagesize(8),
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.48 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.49 2006-09-13 13:53:35 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -103,6 +103,7 @@ bool maybeOpenDb(string &reason, bool force)
|
||||
dbdir + " wait for indexing to complete?";
|
||||
return false;
|
||||
}
|
||||
rcldb->setAbstractParams(-1, prefs.syntAbsLen, prefs.syntAbsCtx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.31 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.32 2006-09-13 13:53:35 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -131,12 +131,6 @@ void RclMain::init()
|
||||
|
||||
nextPageAction->setIconSet(createIconSet("nextpage.png"));
|
||||
prevPageAction->setIconSet(createIconSet("prevpage.png"));
|
||||
|
||||
|
||||
if (prefs.startWithAdvSearchOpen)
|
||||
showAdvSearchDialog();
|
||||
if (prefs.startWithSortToolOpen)
|
||||
showSortDialog();
|
||||
}
|
||||
|
||||
// We also want to get rid of the advanced search form and previews
|
||||
@@ -667,7 +661,6 @@ void RclMain::docExpand(int docnum)
|
||||
// We need to insert item here, its not auto-done like when the user types
|
||||
// CR
|
||||
sSearch->queryText->setEditText(text);
|
||||
sSearch->queryText->insertItem(text, 0);
|
||||
sSearch->setAnyTermMode();
|
||||
sSearch->startSimpleSearch();
|
||||
}
|
||||
|
||||
+14
-5
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.4 2006-09-12 10:11:36 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.5 2006-09-13 13:53:35 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -89,12 +89,20 @@ void SSearch::startSimpleSearch()
|
||||
// the listbox list, The qt listbox doesn't do lru correctly (if
|
||||
// already in the list the new entry would remain at it's place,
|
||||
// not jump at the top as it should
|
||||
LOGDEB3(("Querytext list count %d\n", queryText->count()));
|
||||
// Have to save current text, this will change while we clean up the list
|
||||
QString txt = queryText->currentText();
|
||||
bool changed;
|
||||
do {
|
||||
changed = false;
|
||||
for (int index = 0; index < queryText->count(); index++) {
|
||||
LOGDEB3(("Querytext[%d] = [%s]\n", index,
|
||||
(const char *)(queryText->text(index).utf8())));
|
||||
if (queryText->text(index).length() == 0 ||
|
||||
queryText->text(index) == queryText->currentText()) {
|
||||
QString::compare(queryText->text(index), txt) == 0) {
|
||||
LOGDEB3(("Querytext removing at %d [%s] [%s]\n", index,
|
||||
(const char *)(queryText->text(index).utf8()),
|
||||
(const char *)(txt.utf8())));
|
||||
queryText->removeItem(index);
|
||||
changed = true;
|
||||
break;
|
||||
@@ -102,13 +110,14 @@ void SSearch::startSimpleSearch()
|
||||
}
|
||||
} while (changed);
|
||||
// The combobox is set for no insertion, insert here:
|
||||
queryText->insertItem(queryText->currentText(), 0);
|
||||
queryText->insertItem(txt, 0);
|
||||
queryText->setCurrentItem(0);
|
||||
|
||||
// Save the current state of the listbox list to file
|
||||
prefs.ssearchHistory.clear();
|
||||
for (int index = 0; index < queryText->count(); index++)
|
||||
for (int index = 0; index < queryText->count(); index++) {
|
||||
prefs.ssearchHistory.push_back(queryText->text(index).utf8());
|
||||
|
||||
}
|
||||
emit startSearch(sdata);
|
||||
}
|
||||
|
||||
|
||||
+95
-8
@@ -47,7 +47,7 @@
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout5</cstring>
|
||||
<cstring>layout1</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@@ -92,7 +92,7 @@
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel3</cstring>
|
||||
<cstring>textLabel4</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Result list font</string>
|
||||
@@ -181,7 +181,6 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>initStartAdvCB</cstring>
|
||||
@@ -204,9 +203,6 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
|
||||
|
||||
</vbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
@@ -276,6 +272,97 @@ May be slow for big documents.</string>
|
||||
<string>Do we synthetize an abstract even if the document seemed to have one?</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout16</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel2</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>2</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Synthetic abstract size (characters)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox">
|
||||
<property name="name">
|
||||
<cstring>syntlenSB</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="minValue">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="maxValue">
|
||||
<number>999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>250</number>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout17</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel3</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Synthetic abstract context words</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox">
|
||||
<property name="name">
|
||||
<cstring>syntctxSB</cstring>
|
||||
</property>
|
||||
<property name="maxValue">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="minValue">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer2</cstring>
|
||||
@@ -310,7 +397,7 @@ May be slow for big documents.</string>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout12</cstring>
|
||||
<cstring>layout15</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@@ -479,7 +566,7 @@ May be slow for big documents.</string>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel3</cstring>
|
||||
<cstring>textLabel5</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Active databases</string>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.3 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.4 2006-09-13 13:53:35 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -54,6 +54,8 @@ void UIPrefsDialog::init()
|
||||
// Show icons checkbox
|
||||
useIconsCB->setChecked(prefs.showicons);
|
||||
autoSearchCB->setChecked(prefs.autoSearchOnWS);
|
||||
syntlenSB->setValue(prefs.syntAbsLen);
|
||||
syntctxSB->setValue(prefs.syntAbsCtx);
|
||||
|
||||
initStartAdvCB->setChecked(prefs.startWithAdvSearchOpen);
|
||||
initStartSortCB->setChecked(prefs.startWithSortToolOpen);
|
||||
@@ -156,6 +158,9 @@ void UIPrefsDialog::accept()
|
||||
prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked();
|
||||
prefs.startWithSortToolOpen = initStartSortCB->isChecked();
|
||||
|
||||
prefs.syntAbsLen = syntlenSB->value();
|
||||
prefs.syntAbsCtx = syntctxSB->value();
|
||||
|
||||
prefs.activeExtraDbs.clear();
|
||||
for (unsigned int i = 0; i < actDbsLB->count(); i++) {
|
||||
QListBoxItem *item = actDbsLB->item(i);
|
||||
|
||||
Reference in New Issue
Block a user