new libs Makefile+autoSearchOnWS
This commit is contained in:
@@ -188,7 +188,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
@@ -289,7 +289,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.8 2006-04-07 13:08:08 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.9 2006-04-18 08:53:28 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -126,6 +126,8 @@ void rwSettings(bool writing)
|
||||
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Num, 0);
|
||||
SETTING_RW(prefs.htmlBrowser, "/Recoll/prefs/htmlBrowser", , "");
|
||||
SETTING_RW(prefs.showicons, "/Recoll/prefs/reslist/showicons", Bool, true);
|
||||
SETTING_RW(prefs.autoSearchOnWS, "/Recoll/prefs/reslist/autoSearchOnWS",
|
||||
Bool, false);
|
||||
SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);
|
||||
SETTING_RW(prefs.reslistfontfamily, "/Recoll/prefs/reslist/fontFamily", ,
|
||||
"");
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef _GUIUTILS_H_INCLUDED_
|
||||
#define _GUIUTILS_H_INCLUDED_
|
||||
/*
|
||||
* @(#$Id: guiutils.h,v 1.4 2006-04-05 12:50:42 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* @(#$Id: guiutils.h,v 1.5 2006-04-18 08:53:28 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* jean-francois.dockes@wanadoo.fr
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -52,6 +52,7 @@ extern bool startHelpBrowser(const string& url = "");
|
||||
class PrefsPack {
|
||||
public:
|
||||
bool showicons;
|
||||
bool autoSearchOnWS;
|
||||
int respagesize;
|
||||
QString reslistfontfamily;
|
||||
int reslistfontsize;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.21 2006-04-12 10:41:39 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.22 2006-04-18 08:53:28 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -96,6 +96,8 @@ void RclMain::init()
|
||||
m_history = new RclDHistory(historyfile);
|
||||
connect(sSearch, SIGNAL(startSearch(Rcl::AdvSearchData)),
|
||||
this, SLOT(startAdvSearch(Rcl::AdvSearchData)));
|
||||
connect(sSearch, SIGNAL(clearSearch()),
|
||||
resList, SLOT(resetSearch()));
|
||||
|
||||
nextPageAction->setIconSet(createIconSet("nextpage.png"));
|
||||
prevPageAction->setIconSet(createIconSet("prevpage.png"));
|
||||
|
||||
+14
-12
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: rclreslist.cpp,v 1.10 2006-04-04 10:38:52 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: rclreslist.cpp,v 1.11 2006-04-18 08:53:28 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
@@ -353,10 +353,14 @@ void RclResList::showResultPage()
|
||||
ensureCursorVisible();
|
||||
} else {
|
||||
// Restore first in win parameter that we shouln't have incremented
|
||||
append(tr("<p>"
|
||||
/*"<img align=\"left\" source=\"myimage\">"*/
|
||||
"<b>No results found</b>"
|
||||
"<br>"));
|
||||
QString chunk = "<p><font size=+1><b>";
|
||||
chunk += QString::fromUtf8(m_docsource->title().c_str());
|
||||
chunk += "</b></font><br>";
|
||||
chunk += "<a href=\"H-1\">";
|
||||
chunk += tr("Show query details");
|
||||
chunk += "</a><br>";
|
||||
append(chunk);
|
||||
append(tr("<p><b>No results found</b><br>"));
|
||||
m_winfirst -= prefs.respagesize;
|
||||
if (m_winfirst < 0)
|
||||
m_winfirst = -1;
|
||||
@@ -385,9 +389,7 @@ void RclResList::showResultPage()
|
||||
}
|
||||
}
|
||||
|
||||
// Single click in result list: we don't actually do anything but
|
||||
// start a timer because we want to check first if this might be a
|
||||
// double click
|
||||
// Single click in result list: color active paragraph
|
||||
void RclResList::clicked(int par, int car)
|
||||
{
|
||||
LOGDEB(("RclResList::clicked:wfirst %d par %d char %d\n",
|
||||
@@ -414,10 +416,10 @@ void RclResList::linkWasClicked(const QString &s)
|
||||
emit headerClicked();
|
||||
break;
|
||||
case 'P':
|
||||
emit docClicked(i);
|
||||
emit docPreviewClicked(i);
|
||||
break;
|
||||
case 'E':
|
||||
emit docDoubleClicked(i);
|
||||
emit docEditClicked(i);
|
||||
break;
|
||||
default: break;// ??
|
||||
}
|
||||
@@ -438,11 +440,11 @@ QPopupMenu *RclResList::createPopupMenu(const QPoint& pos)
|
||||
|
||||
void RclResList::menuPreview()
|
||||
{
|
||||
emit docClicked(m_docnum);
|
||||
emit docPreviewClicked(m_docnum);
|
||||
}
|
||||
void RclResList::menuEdit()
|
||||
{
|
||||
emit docDoubleClicked(m_docnum);
|
||||
emit docEditClicked(m_docnum);
|
||||
}
|
||||
void RclResList::menuCopyFN()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef _RCLRESLIST_H_INCLUDED_
|
||||
#define _RCLRESLIST_H_INCLUDED_
|
||||
/* @(#$Id: rclreslist.h,v 1.4 2006-03-29 11:18:14 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||
/* @(#$Id: rclreslist.h,v 1.5 2006-04-18 08:53:28 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||
|
||||
#include <qtextbrowser.h>
|
||||
#include <qpopupmenu.h>
|
||||
@@ -16,12 +16,12 @@ class RclResList : public QTextBrowser
|
||||
RclResList(QWidget* parent = 0, const char* name = 0);
|
||||
virtual ~RclResList();
|
||||
|
||||
virtual void resetSearch() {m_winfirst = -1;}
|
||||
virtual bool getDoc( int, Rcl::Doc & );
|
||||
virtual void setDocSource(DocSequence *);
|
||||
virtual QPopupMenu *createPopupMenu(const QPoint& pos);
|
||||
|
||||
public slots:
|
||||
virtual void resetSearch() {m_winfirst = -1;clear();}
|
||||
virtual void clicked(int, int);
|
||||
virtual void resPageUpOrBack();
|
||||
virtual void resPageDownOrNext();
|
||||
@@ -35,8 +35,8 @@ class RclResList : public QTextBrowser
|
||||
signals:
|
||||
void nextPageAvailable(bool);
|
||||
void prevPageAvailable(bool);
|
||||
void docDoubleClicked(int);
|
||||
void docClicked(int);
|
||||
void docEditClicked(int);
|
||||
void docPreviewClicked(int);
|
||||
void headerClicked();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -378,13 +378,13 @@
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>resList</sender>
|
||||
<signal>docDoubleClicked(int)</signal>
|
||||
<signal>docEditClicked(int)</signal>
|
||||
<receiver>RclMainBase</receiver>
|
||||
<slot>startNativeViewer(int)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>resList</sender>
|
||||
<signal>docClicked(int)</signal>
|
||||
<signal>docPreviewClicked(int)</signal>
|
||||
<receiver>RclMainBase</receiver>
|
||||
<slot>startPreview(int)</slot>
|
||||
</connection>
|
||||
|
||||
@@ -136,6 +136,7 @@
|
||||
</includes>
|
||||
<signals>
|
||||
<signal>startSearch(Rcl::AdvSearchData)</signal>
|
||||
<signal>clearSearch()</signal>
|
||||
</signals>
|
||||
<slots>
|
||||
<slot>searchTextChanged( const QString & text )</slot>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "debuglog.h"
|
||||
#include "guiutils.h"
|
||||
|
||||
void SSearchBase::init()
|
||||
{
|
||||
@@ -40,9 +41,13 @@ void SSearchBase::searchTextChanged( const QString & text )
|
||||
if (text.isEmpty()) {
|
||||
searchPB->setEnabled(false);
|
||||
clearqPB->setEnabled(false);
|
||||
emit clearSearch();
|
||||
} else {
|
||||
searchPB->setEnabled(true);
|
||||
clearqPB->setEnabled(true);
|
||||
string u8 = (const char *)queryText->text().utf8();
|
||||
if (prefs.autoSearchOnWS && !u8.empty() && u8[u8.length()-1] == ' ')
|
||||
startSimpleSearch();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,6 +170,17 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>autoSearchCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto-start simple search on whitespace entry</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
|
||||
@@ -47,6 +47,7 @@ void UIPrefsDialog::init()
|
||||
pageLenSB->setValue(prefs.respagesize);
|
||||
// Show icons checkbox
|
||||
useIconsCB->setChecked(prefs.showicons);
|
||||
autoSearchCB->setChecked(prefs.autoSearchOnWS);
|
||||
// Result list font family and size
|
||||
reslistFontFamily = prefs.reslistfontfamily;
|
||||
reslistFontSize = prefs.reslistfontsize;
|
||||
@@ -123,6 +124,7 @@ void UIPrefsDialog::init()
|
||||
void UIPrefsDialog::accept()
|
||||
{
|
||||
prefs.showicons = useIconsCB->isChecked();
|
||||
prefs.autoSearchOnWS = autoSearchCB->isChecked();
|
||||
prefs.respagesize = pageLenSB->value();
|
||||
|
||||
prefs.reslistfontfamily = reslistFontFamily;
|
||||
|
||||
Reference in New Issue
Block a user