gui: replaced checkboxes for all/filename in simple search with droplist

This commit is contained in:
dockes 2006-03-29 17:31:55 +00:00
parent b42df0c260
commit ca8f76726a
5 changed files with 41 additions and 49 deletions

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.3 2006-02-01 14:34:34 dockes Exp $ (C) 2005 Jean-Francois Dockes";
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.4 2006-03-29 17:31:55 dockes Exp $ (C) 2005 Jean-Francois Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -114,7 +114,7 @@ void rwSettings(bool writing)
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Num, 590);
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Num, 810);
SETTING_RW(prefs.ssall, "/Recoll/prefs/simpleSearchAll", Bool, false);
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.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);

View File

@ -17,7 +17,7 @@
#ifndef _GUIUTILS_H_INCLUDED_
#define _GUIUTILS_H_INCLUDED_
/*
* @(#$Id: guiutils.h,v 1.2 2006-01-30 11:15:27 dockes Exp $ (C) 2005 Jean-Francois Dockes
* @(#$Id: guiutils.h,v 1.3 2006-03-29 17:31:55 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,7 +52,7 @@ class PrefsPack {
QString queryStemLang;
int mainwidth;
int mainheight;
bool ssall;
int ssearchTyp;
QString htmlBrowser;
bool queryBuildAbstract;
bool queryReplaceAbstract;
@ -60,7 +60,7 @@ class PrefsPack {
showicons(true),
respagesize(8),
reslistfontsize(10),
ssall(false),
ssearchTyp(0),
queryBuildAbstract(true),
queryReplaceAbstract(false)
{

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: main.cpp,v 1.37 2006-02-02 08:35:18 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: main.cpp,v 1.38 2006-03-29 17:31:55 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -37,7 +37,7 @@ static char rcsid[] = "@(#$Id: main.cpp,v 1.37 2006-02-02 08:35:18 dockes Exp $
#include <qtimer.h>
#include <qmessagebox.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include "rcldb.h"
#ifndef NO_NAMESPACES
@ -103,7 +103,7 @@ static void recollCleanup()
if (mainWindow) {
prefs.mainwidth = mainWindow->width();
prefs.mainheight = mainWindow->height();
prefs.ssall = mainWindow->sSearch->allTermsCB->isChecked();
prefs.ssearchTyp = mainWindow->sSearch->searchTypCMB->currentItem();
}
rwSettings(true);
stop_idxthread();
@ -188,7 +188,7 @@ int main( int argc, char ** argv )
mainWindow->resize(s);
mainWindow->sSearch->allTermsCB->setChecked(prefs.ssall);
mainWindow->sSearch->searchTypCMB->setCurrentItem(prefs.ssearchTyp);
if (rclconfig->getConfParam(string("dbdir"), dbdir) == 0) {
// Note: this will have to be replaced by a call to a

View File

@ -8,20 +8,20 @@
<rect>
<x>0</x>
<y>0</y>
<width>525</width>
<height>48</height>
<width>593</width>
<height>44</height>
</rect>
</property>
<property name="caption">
<string>SSearchBase</string>
</property>
<vbox>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout29</cstring>
<cstring>layout2</cstring>
</property>
<hbox>
<property name="name">
@ -54,42 +54,19 @@
<property name="text">
<string>Search</string>
</property>
<property name="accel">
<string></string>
</property>
<property name="toolTip" stdset="0">
<string>Start query</string>
</property>
</widget>
<widget class="QCheckBox">
<widget class="QComboBox">
<property name="name">
<cstring>allTermsCB</cstring>
</property>
<property name="text">
<string>&amp;All terms</string>
</property>
<property name="accel">
<string>Alt+A</string>
<cstring>searchTypCMB</cstring>
</property>
<property name="toolTip" stdset="0">
<string>Do documents have to contain all terms in query?</string>
</property>
<property name="whatsThis" stdset="0">
<string>If this is set, each returned document will contain all the terms in the query. Else documents will be ordered by relevance, but may not contain all the terms.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>isFNameCB</cstring>
</property>
<property name="text">
<string>&amp;File name</string>
</property>
<property name="accel">
<string>Alt+F</string>
</property>
<property name="toolTip" stdset="0">
<string>Search is on file names only, and may use wildcards.</string>
</property>
<property name="whatsThis" stdset="0">
<string>If this is set, the search will only be performed on file names. Wildcards ? and * can be used and will be matched as in a shell command line.</string>
<string>Choose type of search: any term, all terms, filename with possible wildcards.</string>
</property>
</widget>
<widget class="QLineEdit">
@ -122,7 +99,7 @@
</widget>
</hbox>
</widget>
</vbox>
</hbox>
</widget>
<connections>
<connection>
@ -161,5 +138,8 @@
<slot>searchTextChanged( const QString &amp; text )</slot>
<slot>startSimpleSearch()</slot>
</slots>
<functions>
<function>init()</function>
</functions>
<layoutdefaults spacing="6" margin="0"/>
</UI>

View File

@ -28,6 +28,13 @@
#include "debuglog.h"
void SSearchBase::init()
{
searchTypCMB->insertItem(tr("Any term"));
searchTypCMB->insertItem(tr("All terms"));
searchTypCMB->insertItem(tr("File name"));
}
void SSearchBase::searchTextChanged( const QString & text )
{
if (text.isEmpty()) {
@ -45,13 +52,18 @@ void SSearchBase::startSimpleSearch()
Rcl::AdvSearchData sdata;
QCString u8 = queryText->text().utf8();
if (isFNameCB->isChecked())
sdata.filename = u8;
else if (allTermsCB->isChecked())
sdata.allwords = u8;
else
switch (searchTypCMB->currentItem()) {
case 0:
default:
sdata.orwords = u8;
break;
case 1:
sdata.allwords = u8;
break;
case 2:
sdata.filename = u8;
break;
}
emit startSearch(sdata);
}