merged 1.6 maint branch modifs up to MERGED_TO_TRUNK_20061130
This commit is contained in:
+27
-23
@@ -19,6 +19,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout18</cstring>
|
||||
@@ -43,23 +46,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer1</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel2</cstring>
|
||||
@@ -79,7 +68,7 @@
|
||||
<enum>Plain</enum>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>7</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Search for <br>documents<br>satisfying:</string>
|
||||
@@ -113,8 +102,8 @@
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16</height>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
@@ -166,6 +155,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="Line">
|
||||
<property name="name">
|
||||
<cstring>clauseline</cstring>
|
||||
@@ -229,6 +221,9 @@
|
||||
<property name="text">
|
||||
<string>Save as default</string>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -237,7 +232,7 @@
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout12</cstring>
|
||||
<cstring>filTypHB</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@@ -251,6 +246,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel2_2</cstring>
|
||||
@@ -269,7 +267,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>80</height>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
@@ -286,6 +284,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>delAFiltypPB</cstring>
|
||||
@@ -352,6 +353,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel3</cstring>
|
||||
@@ -370,7 +374,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>80</height>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.12 2006-11-17 15:26:40 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.13 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -49,7 +49,7 @@ using std::string;
|
||||
|
||||
extern RclConfig *rclconfig;
|
||||
|
||||
static const int initclausetypes[] = {1, 3, 0, 0, 2, 5};
|
||||
static const int initclausetypes[] = {1, 3, 0, 2, 5};
|
||||
static const unsigned int iclausescnt = sizeof(initclausetypes) / sizeof(int);
|
||||
|
||||
void AdvSearch::init()
|
||||
@@ -176,6 +176,10 @@ void AdvSearch::addClause()
|
||||
{
|
||||
addClause(0);
|
||||
}
|
||||
|
||||
#define HORADJ 50
|
||||
#define VERTADJ 30
|
||||
|
||||
void AdvSearch::addClause(int tp)
|
||||
{
|
||||
SearchClauseW *w = new SearchClauseW(this);
|
||||
@@ -192,7 +196,7 @@ void AdvSearch::addClause(int tp)
|
||||
}
|
||||
// Have to adjust the size else we lose the bottom buttons! Why?
|
||||
QSize sz = AdvSearchBaseLayout->sizeHint();
|
||||
resize(QSize(sz.width()+40, sz.height()+80));
|
||||
resize(QSize(sz.width()+HORADJ, sz.height()+VERTADJ));
|
||||
}
|
||||
|
||||
void AdvSearch::delClause()
|
||||
@@ -207,14 +211,14 @@ void AdvSearch::delClause()
|
||||
delClausePB->setEnabled(false);
|
||||
}
|
||||
QSize sz = AdvSearchBaseLayout->sizeHint();
|
||||
resize(QSize(sz.width()+40, sz.height()+80));
|
||||
resize(QSize(sz.width()+HORADJ, sz.height()+VERTADJ));
|
||||
}
|
||||
|
||||
void AdvSearch::polish()
|
||||
{
|
||||
QSize sz = AdvSearchBaseLayout->sizeHint();
|
||||
resize(QSize(sz.width()+40, sz.height()+80));
|
||||
AdvSearchBase::polish();
|
||||
QSize sz = sizeHint();
|
||||
resize(QSize(sz.width()+HORADJ+10, sz.height()+VERTADJ-20));
|
||||
}
|
||||
|
||||
// Move selected file types from the ignored to the searched box
|
||||
@@ -255,6 +259,7 @@ void AdvSearch::restrictFtCB_toggled(bool on)
|
||||
delAFiltypPB->setEnabled(on);
|
||||
addAFiltypPB->setEnabled(on);
|
||||
noFiltypsLB->setEnabled(on);
|
||||
saveFileTypesPB->setEnabled(on);
|
||||
}
|
||||
|
||||
using namespace Rcl;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.25 2006-11-21 08:47:51 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.26 2006-11-30 13:38:44 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -149,8 +149,10 @@ void rwSettings(bool writing)
|
||||
QSettings settings;
|
||||
settings.setPath("Recoll.org", "Recoll", QSettings::User);
|
||||
#endif
|
||||
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Num, 500);
|
||||
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Num, 400);
|
||||
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Num, 0);
|
||||
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Num, 0);
|
||||
SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Num, 0);
|
||||
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Num, 0);
|
||||
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Num, 0);
|
||||
SETTING_RW(prefs.htmlBrowser, "/Recoll/prefs/htmlBrowser", , "");
|
||||
SETTING_RW(prefs.startWithAdvSearchOpen,
|
||||
@@ -159,7 +161,7 @@ void rwSettings(bool writing)
|
||||
"/Recoll/prefs/startWithSortToolOpen", Bool, false);
|
||||
|
||||
QString advSearchClauses;
|
||||
QString ascdflt = QString::fromAscii("1 3 0 0 2 5 ");
|
||||
QString ascdflt;
|
||||
if (writing) {
|
||||
for (vector<int>::iterator it = prefs.advSearchClauses.begin();
|
||||
it != prefs.advSearchClauses.end(); it++) {
|
||||
@@ -185,9 +187,9 @@ void rwSettings(bool writing)
|
||||
"/Recoll/prefs/ssearchAutoPhrase", Bool, false);
|
||||
SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);
|
||||
SETTING_RW(prefs.reslistfontfamily, "/Recoll/prefs/reslist/fontFamily", ,
|
||||
"");
|
||||
"Helvetica");
|
||||
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Num,
|
||||
0);
|
||||
10);
|
||||
QString rlfDflt =
|
||||
QString::fromAscii("%R %S %L <b>%T</b><br>"
|
||||
"%M %D <i>%U</i><br>"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef _GUIUTILS_H_INCLUDED_
|
||||
#define _GUIUTILS_H_INCLUDED_
|
||||
/*
|
||||
* @(#$Id: guiutils.h,v 1.17 2006-11-21 08:47:51 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* @(#$Id: guiutils.h,v 1.18 2006-11-30 13:38:44 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* jean-francois.dockes@wanadoo.fr
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -71,6 +71,8 @@ class PrefsPack {
|
||||
QString queryStemLang;
|
||||
int mainwidth;
|
||||
int mainheight;
|
||||
int pvwidth; // Preview window geom
|
||||
int pvheight;
|
||||
int ssearchTyp;
|
||||
QString htmlBrowser;
|
||||
bool queryBuildAbstract;
|
||||
|
||||
@@ -223,6 +223,10 @@ Click Cancel if you want to edit the configuration file before indexation starts
|
||||
<source>Cancel</source>
|
||||
<translation>Annuler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation>Fermer l'onglet</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PreviewBase</name>
|
||||
|
||||
@@ -224,6 +224,10 @@ Click Cancel if you want to edit the configuration file before indexation starts
|
||||
<source>Cancel</source>
|
||||
<translation>Отмена</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PreviewBase</name>
|
||||
|
||||
@@ -221,6 +221,10 @@ Click Cancel if you want to edit the configuration file before indexation starts
|
||||
<source>Loading preview text into editor</source>
|
||||
<translation>Завантажую текст перегляду в редактор</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PreviewBase</name>
|
||||
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 883 B |
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
+5
-4
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.52 2006-10-11 14:16:26 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.53 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -270,10 +270,11 @@ int main(int argc, char **argv)
|
||||
RclMain w;
|
||||
mainWindow = &w;
|
||||
#endif
|
||||
QSize s(prefs.mainwidth, prefs.mainheight);
|
||||
mainWindow->resize(s);
|
||||
// fprintf(stderr, "Main win created\n");
|
||||
|
||||
if (prefs.mainwidth > 100) {
|
||||
QSize s(prefs.mainwidth, prefs.mainheight);
|
||||
mainWindow->resize(s);
|
||||
}
|
||||
|
||||
mainWindow->sSearch->searchTypCMB->setCurrentItem(prefs.ssearchTyp);
|
||||
dbdir = rclconfig->getDbDir();
|
||||
|
||||
+49
-27
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.17 2006-11-18 12:56:16 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.18 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -62,6 +62,8 @@ class myTextSplitCB : public TextSplitCB {
|
||||
// Out: first query term found in text
|
||||
string firstTerm;
|
||||
int firstTermOcc;
|
||||
int m_firstTermPos;
|
||||
int m_firstTermBPos;
|
||||
|
||||
// Out: begin and end byte positions of query terms/groups in text
|
||||
vector<pair<int, int> > tboffs;
|
||||
@@ -96,6 +98,7 @@ class myTextSplitCB : public TextSplitCB {
|
||||
if (firstTerm.empty()) {
|
||||
firstTerm = term;
|
||||
m_firstTermPos = pos;
|
||||
m_firstTermBPos = bts;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +120,6 @@ private:
|
||||
virtual bool matchGroup(const vector<string>& terms, int dist);
|
||||
|
||||
int m_wcount;
|
||||
int m_firstTermPos;
|
||||
|
||||
// In: user query terms
|
||||
set<string> m_terms;
|
||||
@@ -239,6 +241,20 @@ bool myTextSplitCB::matchGroup(const vector<string>& terms, int window)
|
||||
|
||||
LOGDEB0(("myTextSplitCB::matchGroup: MATCH [%d,%d]\n", sta, sto));
|
||||
|
||||
// Translate the position window into a byte offset window
|
||||
int bs = 0;
|
||||
map<int, pair<int, int> >::iterator i1 = m_gpostobytes.find(sta);
|
||||
map<int, pair<int, int> >::iterator i2 = m_gpostobytes.find(sto);
|
||||
if (i1 != m_gpostobytes.end() && i2 != m_gpostobytes.end()) {
|
||||
LOGDEB1(("myTextSplitCB::matchGroup: pushing %d %d\n",
|
||||
i1->second.first, i2->second.second));
|
||||
tboffs.push_back(pair<int, int>(i1->second.first, i2->second.second));
|
||||
bs = i1->second.first;
|
||||
} else {
|
||||
LOGDEB(("myTextSplitCB::matchGroup: no bpos found for %d or %d\n",
|
||||
sta, sto));
|
||||
}
|
||||
|
||||
if (firstTerm.empty() || m_firstTermPos > sta) {
|
||||
// firsTerm is used to try an position the preview window over
|
||||
// the match. As it's difficult to divine byte/word positions
|
||||
@@ -252,31 +268,24 @@ bool myTextSplitCB::matchGroup(const vector<string>& terms, int window)
|
||||
firstTerm = it->second;
|
||||
LOGDEB(("myTextSplitCB:: best group term %s, firstTermOcc %d\n",
|
||||
firstTerm.c_str(), firstTermOcc));
|
||||
}
|
||||
|
||||
// Translate the position window into a byte offset window
|
||||
map<int, pair<int, int> >::iterator i1 = m_gpostobytes.find(sta);
|
||||
map<int, pair<int, int> >::iterator i2 = m_gpostobytes.find(sto);
|
||||
if (i1 != m_gpostobytes.end() && i2 != m_gpostobytes.end()) {
|
||||
LOGDEB1(("myTextSplitCB::matchGroup: pushing %d %d\n",
|
||||
i1->second.first, i2->second.second));
|
||||
tboffs.push_back(pair<int, int>(i1->second.first, i2->second.second));
|
||||
} else {
|
||||
LOGDEB(("myTextSplitCB::matchGroup: no bpos found for %d or %d\n",
|
||||
sta, sto));
|
||||
m_firstTermPos = sta;
|
||||
m_firstTermBPos = bs;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Sort integer pairs by their first value */
|
||||
/** Sort integer pairs by increasing first value and decreasing width */
|
||||
class PairIntCmpFirst {
|
||||
public:
|
||||
bool operator()(pair<int,int> a, pair<int, int>b) {
|
||||
return a.first < b.first;
|
||||
if (a.first != b.first)
|
||||
return a.first < b.first;
|
||||
return a.second > b.second;
|
||||
}
|
||||
};
|
||||
|
||||
// Do the phrase match thing, then merge the highlight lists
|
||||
bool myTextSplitCB::matchGroups()
|
||||
{
|
||||
vector<vector<string> >::const_iterator vit = m_groups.begin();
|
||||
@@ -285,10 +294,18 @@ bool myTextSplitCB::matchGroups()
|
||||
matchGroup(*vit, *sit + (*vit).size());
|
||||
}
|
||||
|
||||
// Sort by start and end offsets. The merging of overlapping entries
|
||||
// will be handled during output.
|
||||
std::sort(tboffs.begin(), tboffs.end(), PairIntCmpFirst());
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *firstTermAnchorName = "FIRSTTERM";
|
||||
|
||||
#ifdef QT_SCROLL_TO_ANCHOR_BUG
|
||||
const char *firstTermBeacon = "\xe2\xa0\x91\xe2\x96\x9f\x20\x01\x9a";
|
||||
#endif
|
||||
|
||||
// Fix result text for display inside the gui text window.
|
||||
//
|
||||
// To compute the term character positions in the output text, we used
|
||||
@@ -300,9 +317,7 @@ bool myTextSplitCB::matchGroups()
|
||||
// editor's find() function to position on it
|
||||
bool plaintorich(const string& in, string& out,
|
||||
RefCntr<Rcl::SearchData> sdata,
|
||||
string *firstTerm,
|
||||
int *firstTermOcc,
|
||||
bool noHeader)
|
||||
bool noHeader, bool fft)
|
||||
{
|
||||
Chrono chron;
|
||||
out.erase();
|
||||
@@ -338,11 +353,6 @@ bool plaintorich(const string& in, string& out,
|
||||
|
||||
cb.matchGroups();
|
||||
|
||||
if (firstTerm)
|
||||
*firstTerm = cb.firstTerm;
|
||||
if (firstTermOcc)
|
||||
*firstTermOcc = cb.firstTermOcc;
|
||||
|
||||
// Rich text output
|
||||
if (noHeader)
|
||||
out = "";
|
||||
@@ -376,12 +386,24 @@ bool plaintorich(const string& in, string& out,
|
||||
// If we still have terms positions, check (byte) position
|
||||
if (tPosIt != tboffsend) {
|
||||
int ibyteidx = chariter.getBpos();
|
||||
|
||||
if (fft && ibyteidx == cb.m_firstTermBPos) {
|
||||
out += string("<a name=\"") + firstTermAnchorName + "\"> "
|
||||
#ifdef QT_SCROLL_TO_ANCHOR_BUG
|
||||
+ "<font color=\"white\"> " + firstTermBeacon + " </font> "
|
||||
#endif
|
||||
+ "</a>";
|
||||
}
|
||||
|
||||
if (ibyteidx == tPosIt->first) {
|
||||
out += "<termtag>";
|
||||
} else if (ibyteidx == tPosIt->second) {
|
||||
if (tPosIt != cb.tboffs.end())
|
||||
tPosIt++;
|
||||
// Output end tag, then skip all highlight areas that
|
||||
// would overlap this one
|
||||
out += "</termtag>";
|
||||
int crend = tPosIt->second;
|
||||
while (tPosIt != cb.tboffs.end() && tPosIt->first < crend)
|
||||
tPosIt++;
|
||||
}
|
||||
}
|
||||
switch(*chariter) {
|
||||
@@ -414,7 +436,7 @@ bool plaintorich(const string& in, string& out,
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
FILE *fp = fopen("/tmp/debugplaintorich", "w");
|
||||
FILE *fp = fopen("/tmp/debugplaintorich", "a");
|
||||
fprintf(fp, "%s\n", out.c_str());
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
+12
-3
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
#ifndef _PLAINTORICH_H_INCLUDED_
|
||||
#define _PLAINTORICH_H_INCLUDED_
|
||||
/* @(#$Id: plaintorich.h,v 1.10 2006-11-18 12:31:16 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: plaintorich.h,v 1.11 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -38,7 +38,16 @@
|
||||
*/
|
||||
extern bool plaintorich(const string &in, string &out,
|
||||
RefCntr<Rcl::SearchData> sdata,
|
||||
string* firstTerm, int *frsttocc,
|
||||
bool noHeader = false);
|
||||
bool noHeader = false,
|
||||
bool fft = false);
|
||||
|
||||
extern const char *firstTermAnchorName;
|
||||
|
||||
#define QT_SCROLL_TO_ANCHOR_BUG
|
||||
#ifdef QT_SCROLL_TO_ANCHOR_BUG
|
||||
// For some reason, can't get scrollToAnchor() to work. We use a string made
|
||||
// of a few rare utf8 chars as a beacon for the match area.
|
||||
extern const char *firstTermBeacon;
|
||||
#endif
|
||||
|
||||
#endif /* _PLAINTORICH_H_INCLUDED_ */
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>751</width>
|
||||
<height>727</height>
|
||||
<width>640</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -20,12 +20,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Preview</string>
|
||||
</property>
|
||||
@@ -33,6 +27,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
@@ -56,6 +53,9 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QTextEdit">
|
||||
<property name="name">
|
||||
<cstring>pvEdit</cstring>
|
||||
|
||||
+34
-21
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.7 2006-11-18 12:31:16 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.8 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -58,6 +58,18 @@ using std::pair;
|
||||
|
||||
void Preview::init()
|
||||
{
|
||||
#if 0
|
||||
// Couldn't get a small button really in the corner. stays on the left of
|
||||
// the button area and looks ugly
|
||||
QPixmap px = QPixmap::fromMimeSource("cancel.png");
|
||||
QPushButton * bt = new QPushButton(px, "", this);
|
||||
bt->setFixedSize(px.size());
|
||||
#else
|
||||
QPushButton * bt = new QPushButton(tr("Close Tab"), this);
|
||||
#endif
|
||||
|
||||
pvTab->setCornerWidget(bt);
|
||||
|
||||
// signals and slots connections
|
||||
connect(searchTextLine, SIGNAL(textChanged(const QString&)),
|
||||
this, SLOT(searchTextLine_textChanged(const QString&)));
|
||||
@@ -66,12 +78,16 @@ void Preview::init()
|
||||
connect(clearPB, SIGNAL(clicked()), searchTextLine, SLOT(clear()));
|
||||
connect(pvTab, SIGNAL(currentChanged(QWidget *)),
|
||||
this, SLOT(currentChanged(QWidget *)));
|
||||
connect(bt, SIGNAL(clicked()), this, SLOT(closeCurrentTab()));
|
||||
|
||||
searchTextLine->installEventFilter(this);
|
||||
dynSearchActive = false;
|
||||
canBeep = true;
|
||||
tabData.push_back(TabData(pvTab->currentPage()));
|
||||
currentW = 0;
|
||||
if (prefs.pvwidth > 100) {
|
||||
resize(prefs.pvwidth, prefs.pvheight);
|
||||
}
|
||||
}
|
||||
|
||||
void Preview::destroy()
|
||||
@@ -80,6 +96,8 @@ void Preview::destroy()
|
||||
|
||||
void Preview::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
prefs.pvwidth = width();
|
||||
prefs.pvheight = height();
|
||||
emit previewExposed(m_searchId, -1);
|
||||
emit previewClosed((QWidget *)this);
|
||||
QWidget::closeEvent(e);
|
||||
@@ -450,15 +468,11 @@ class LoadThread : public QThread {
|
||||
class ToRichThread : public QThread {
|
||||
string ∈
|
||||
RefCntr<Rcl::SearchData> m_searchData;
|
||||
string& firstTerm;
|
||||
int& firstTermOcc;
|
||||
QString &out;
|
||||
int loglevel;
|
||||
public:
|
||||
ToRichThread(string &i, RefCntr<Rcl::SearchData> searchData,
|
||||
string& ft, int& fto, QString &o)
|
||||
: in(i), m_searchData(searchData), firstTerm(ft), firstTermOcc(fto),
|
||||
out(o)
|
||||
ToRichThread(string &i, RefCntr<Rcl::SearchData> searchData, QString &o)
|
||||
: in(i), m_searchData(searchData), out(o)
|
||||
{
|
||||
loglevel = DebugLog::getdbl()->getlevel();
|
||||
}
|
||||
@@ -467,7 +481,7 @@ class ToRichThread : public QThread {
|
||||
DebugLog::getdbl()->setloglevel(loglevel);
|
||||
string rich;
|
||||
try {
|
||||
plaintorich(in, rich, m_searchData, &firstTerm, &firstTermOcc);
|
||||
plaintorich(in, rich, m_searchData, false, true);
|
||||
} catch (CancelExcept) {
|
||||
}
|
||||
out = QString::fromUtf8(rich.c_str(), rich.length());
|
||||
@@ -548,12 +562,9 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc,
|
||||
// Create preview text: highlight search terms (if not too big):
|
||||
QString richTxt;
|
||||
bool highlightTerms = fdoc.text.length() < 1000 *1024;
|
||||
string firstTerm;
|
||||
int firstTermOcc;
|
||||
if (highlightTerms) {
|
||||
progress.setLabelText(tr("Creating preview text"));
|
||||
ToRichThread rthr(fdoc.text, m_searchData, firstTerm, firstTermOcc,
|
||||
richTxt);
|
||||
ToRichThread rthr(fdoc.text, m_searchData, richTxt);
|
||||
rthr.start();
|
||||
|
||||
for (;;prog++) {
|
||||
@@ -618,6 +629,7 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc,
|
||||
editor->setCursorPosition(0,0);
|
||||
editor->ensureCursorVisible();
|
||||
}
|
||||
|
||||
if (progress.wasCanceled()) {
|
||||
cancel = true;
|
||||
editor->append("<b>Cancelled !</b>");
|
||||
@@ -630,15 +642,16 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc,
|
||||
canBeep = true;
|
||||
doSearch(searchTextLine->text(), true, false);
|
||||
} else {
|
||||
if (!firstTerm.empty()) {
|
||||
bool wasC = matchCheck->isChecked();
|
||||
matchCheck->setChecked(false);
|
||||
for (int i = 0; i < firstTermOcc; i++) {
|
||||
doSearch(QString::fromUtf8(firstTerm.c_str()), i,
|
||||
false, true);
|
||||
}
|
||||
matchCheck->setChecked(wasC);
|
||||
}
|
||||
QString aname = QString::fromUtf8(firstTermAnchorName);
|
||||
LOGDEB2(("Calling scrolltoanchor [%s]\n", (const char *)aname.utf8()));
|
||||
editor->scrollToAnchor(aname);
|
||||
#ifdef QT_SCROLL_TO_ANCHOR_BUG
|
||||
bool wasC = matchCheck->isChecked();
|
||||
matchCheck->setChecked(false);
|
||||
doSearch(QString::fromUtf8(firstTermBeacon), 0, false, false);
|
||||
editor->del();
|
||||
matchCheck->setChecked(wasC);
|
||||
#endif
|
||||
}
|
||||
emit(previewExposed(m_searchId, docnum));
|
||||
return true;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>681</width>
|
||||
<height>244</height>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -20,12 +20,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>25</width>
|
||||
<height>244</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Recoll</string>
|
||||
</property>
|
||||
@@ -33,6 +27,12 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
|
||||
@@ -68,5 +68,8 @@ UNAME = $$system(uname -s)
|
||||
contains( UNAME, [lL]inux ) {
|
||||
LIBS -= -liconv
|
||||
}
|
||||
contains( UNAME, SunOS ) {
|
||||
LIBS += -ldl
|
||||
}
|
||||
|
||||
TRANSLATIONS = i18n/recoll_fr.ts i18n/recoll_ru.ts i18n/recoll_uk.ts
|
||||
|
||||
+12
-6
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.12 2006-11-18 12:31:16 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.13 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
@@ -352,7 +352,8 @@ void ResList::resultPageNext()
|
||||
|
||||
// Result number
|
||||
char numbuf[20];
|
||||
sprintf(numbuf, "%.2d", m_winfirst+1+i);
|
||||
int docnumforlinks = m_winfirst+1+i;
|
||||
sprintf(numbuf, "%d", docnumforlinks);
|
||||
|
||||
// Document date: either doc or file modification time
|
||||
char datebuf[100];
|
||||
@@ -361,7 +362,11 @@ void ResList::resultPageNext()
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atol(doc.fmtime.c_str()) : atol(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
#ifndef sun
|
||||
strftime(datebuf, 99, " %Y-%m-%d %H:%M:%S %z", tm);
|
||||
#else
|
||||
strftime(datebuf, 99, " %Y-%m-%d %H:%M:%S %Z", tm);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Size information. We print both doc and file if they differ a lot
|
||||
@@ -381,18 +386,18 @@ void ResList::resultPageNext()
|
||||
|
||||
// Abstract
|
||||
string abst;
|
||||
plaintorich(doc.abstract, abst, m_searchData, 0, 0, true);
|
||||
plaintorich(doc.abstract, abst, m_searchData, true);
|
||||
|
||||
// Links;
|
||||
string linksbuf;
|
||||
char vlbuf[100];
|
||||
if (canIntern(doc.mimetype, rclconfig)) {
|
||||
sprintf(vlbuf, "\"P%d\"", m_winfirst+i);
|
||||
sprintf(vlbuf, "\"P%d\"", docnumforlinks);
|
||||
linksbuf += string("<a href=") + vlbuf + ">" + "Preview" + "</a>"
|
||||
+ " ";
|
||||
}
|
||||
if (!rclconfig->getMimeViewerDef(doc.mimetype).empty()) {
|
||||
sprintf(vlbuf, "E%d", m_winfirst+i);
|
||||
sprintf(vlbuf, "E%d", docnumforlinks);
|
||||
linksbuf += string("<a href=") + vlbuf + ">" + "Edit" + "</a>";
|
||||
}
|
||||
|
||||
@@ -432,6 +437,7 @@ void ResList::resultPageNext()
|
||||
QString str = QString::fromUtf8(result.c_str(), result.length());
|
||||
append(str);
|
||||
setCursorPosition(0,0);
|
||||
ensureCursorVisible();
|
||||
|
||||
m_pageParaToReldocnums[paragraphs()-1] = i;
|
||||
m_curDocs.push_back(doc);
|
||||
@@ -535,7 +541,7 @@ void ResList::doubleClicked(int, int)
|
||||
void ResList::linkWasClicked(const QString &s, int clkmod)
|
||||
{
|
||||
LOGDEB(("ResList::linkClicked: [%s]\n", s.ascii()));
|
||||
int i = atoi(s.ascii()+1);
|
||||
int i = atoi(s.ascii()+1) -1;
|
||||
int what = s.ascii()[0];
|
||||
switch (what) {
|
||||
case 'H':
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: searchclause_w.cpp,v 1.2 2006-11-14 17:41:12 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: searchclause_w.cpp,v 1.3 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -40,7 +40,7 @@ SearchClauseW::SearchClauseW(QWidget* parent, const char* name, WFlags fl)
|
||||
setName("SearchClauseW");
|
||||
searchClauseLayout = new QVBoxLayout(this);
|
||||
|
||||
hLayout = new QHBoxLayout(0, 0, 6, "hLayout");
|
||||
hLayout = new QHBoxLayout(0, 0, 3, "hLayout");
|
||||
|
||||
sTpCMB = new QComboBox(FALSE, this, "sTpCMB");
|
||||
hLayout->addWidget(sTpCMB);
|
||||
@@ -56,8 +56,7 @@ SearchClauseW::SearchClauseW(QWidget* parent, const char* name, WFlags fl)
|
||||
resize(QSize(0, 0).expandedTo(minimumSizeHint()));
|
||||
clearWState(WState_Polished);
|
||||
|
||||
connect(sTpCMB, SIGNAL(activated(int)),
|
||||
this, SLOT(tpChange(int)));
|
||||
connect(sTpCMB, SIGNAL(activated(int)), this, SLOT(tpChange(int)));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -115,7 +114,6 @@ SearchClauseW::getClause()
|
||||
(const char *)wordsLE->text().utf8(),
|
||||
proxSlackSB->value());
|
||||
case 4:
|
||||
fprintf(stderr, "NEAR\n");
|
||||
return new SearchDataClauseDist(SCLT_NEAR,
|
||||
(const char *)wordsLE->text().utf8(),
|
||||
proxSlackSB->value());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: spell_w.cpp,v 1.6 2006-11-21 08:47:51 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: spell_w.cpp,v 1.7 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -48,7 +48,10 @@ void SpellW::init()
|
||||
/*1*/expTypeCMB->insertItem(tr("Regexp"));
|
||||
/*2*/expTypeCMB->insertItem(tr("Stem expansion"));
|
||||
#ifdef RCL_USE_ASPELL
|
||||
/*3*/expTypeCMB->insertItem(tr("Spelling/Phonetic"));
|
||||
bool noaspell = false;
|
||||
rclconfig->getConfParam("noaspell", &noaspell);
|
||||
if (!noaspell)
|
||||
/*3*/expTypeCMB->insertItem(tr("Spelling/Phonetic"));
|
||||
#endif
|
||||
|
||||
int typ = prefs.termMatchType;
|
||||
|
||||
+13
-18
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.11 2006-11-13 08:58:47 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.12 2006-11-30 13:38:44 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -69,34 +69,29 @@ void SSearch::searchTextChanged( const QString & text )
|
||||
|
||||
void SSearch::startSimpleSearch()
|
||||
{
|
||||
LOGDEB(("SSearch::startSimpleSearch\n"));
|
||||
|
||||
if (queryText->currentText().length() == 0)
|
||||
return;
|
||||
RefCntr<Rcl::SearchData> sdata(new Rcl::SearchData(Rcl::SCLT_AND));
|
||||
QCString u8 = queryText->currentText().utf8();
|
||||
string u8 = (const char *)queryText->currentText().utf8();
|
||||
|
||||
LOGDEB(("SSearch::startSimpleSearch: [%s]\n", u8.c_str()));
|
||||
|
||||
switch (searchTypCMB->currentItem()) {
|
||||
case 0:
|
||||
default:
|
||||
{
|
||||
QString comp = queryText->currentText();
|
||||
// If this is an or and we're set for autophrase and there are
|
||||
// no quotes in the query, add a phrase search
|
||||
if (prefs.ssearchAutoPhrase && comp.find('"', 0) == -1) {
|
||||
comp += QString::fromAscii(" \"") + comp +
|
||||
QString::fromAscii("\"");
|
||||
u8 = comp.utf8();
|
||||
}
|
||||
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_OR,
|
||||
(const char *)u8));
|
||||
// If this is an or and we're set for autophrase and there are
|
||||
// no quotes in the query, add a phrase search
|
||||
if (prefs.ssearchAutoPhrase &&
|
||||
u8.find_first_of("\"") == string::npos) {
|
||||
u8 += string(" \"") + u8 + "\"";
|
||||
}
|
||||
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_OR, u8));
|
||||
break;
|
||||
case 1:
|
||||
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND,
|
||||
(const char *)u8));
|
||||
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND, u8));
|
||||
break;
|
||||
case 2:
|
||||
sdata->addClause(new Rcl::SearchDataClauseFilename((const char *)u8));
|
||||
sdata->addClause(new Rcl::SearchDataClauseFilename(u8));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout2</cstring>
|
||||
|
||||
Reference in New Issue
Block a user