diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp index c46dc5ca..2468da5f 100644 --- a/src/qtgui/guiutils.cpp +++ b/src/qtgui/guiutils.cpp @@ -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); diff --git a/src/qtgui/guiutils.h b/src/qtgui/guiutils.h index bdc84d1b..c15d7079 100644 --- a/src/qtgui/guiutils.h +++ b/src/qtgui/guiutils.h @@ -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) { diff --git a/src/qtgui/main.cpp b/src/qtgui/main.cpp index e9e6d0bc..50c1f50b 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -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 #include #include - +#include #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 diff --git a/src/qtgui/ssearchb.ui b/src/qtgui/ssearchb.ui index b7471432..701ab097 100644 --- a/src/qtgui/ssearchb.ui +++ b/src/qtgui/ssearchb.ui @@ -8,20 +8,20 @@ 0 0 - 525 - 48 + 593 + 44 SSearchBase - + unnamed - layout29 + layout2 @@ -54,42 +54,19 @@ Search + + + Start query - + - allTermsCB - - - &All terms - - - Alt+A + searchTypCMB - Do documents have to contain all terms in query? - - - 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. - - - - - isFNameCB - - - &File name - - - Alt+F - - - Search is on file names only, and may use wildcards. - - - 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. + Choose type of search: any term, all terms, filename with possible wildcards. @@ -122,7 +99,7 @@ - + @@ -161,5 +138,8 @@ searchTextChanged( const QString & text ) startSimpleSearch() + + init() + diff --git a/src/qtgui/ssearchb.ui.h b/src/qtgui/ssearchb.ui.h index d0fb216e..00bbf55f 100644 --- a/src/qtgui/ssearchb.ui.h +++ b/src/qtgui/ssearchb.ui.h @@ -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); }