add allTerms checkbutton, save state in settings
This commit is contained in:
parent
4682f9be9b
commit
315f8cdb33
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.22 2005-12-13 12:42:59 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.23 2005-12-13 17:20:46 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
@ -12,6 +12,7 @@ static char rcsid[] = "@(#$Id: main.cpp,v 1.22 2005-12-13 12:42:59 dockes Exp $
|
||||
#include <qtimer.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qsettings.h>
|
||||
#include <qcheckbox.h>
|
||||
|
||||
|
||||
#include "rcldb.h"
|
||||
@ -76,6 +77,8 @@ void recollCleanup()
|
||||
settings.setPath("Recoll.org", "Recoll");
|
||||
settings.writeEntry( "/Recoll/geometry/width", width);
|
||||
settings.writeEntry("/Recoll/geometry/height", height);
|
||||
settings.writeEntry("/Recoll/prefs/simpleSearchAll",
|
||||
mainWindow->allTermsCB->isChecked());
|
||||
}
|
||||
|
||||
stop_idxthread();
|
||||
@ -114,13 +117,14 @@ int main( int argc, char ** argv )
|
||||
settings.setPath("Recoll.org", "Recoll");
|
||||
int width = settings.readNumEntry( "/Recoll/geometry/width", 590);
|
||||
int height = settings.readNumEntry( "/Recoll/geometry/height", 810);
|
||||
bool ssall = settings.readBoolEntry( "/Recoll/prefs/simpleSearchAll", 0);
|
||||
QSize s(width, height);
|
||||
|
||||
// Create main window and set its size to previous session's
|
||||
RecollMain w;
|
||||
mainWindow = &w;
|
||||
w.resize(s);
|
||||
|
||||
w.allTermsCB->setDown(ssall);
|
||||
string reason;
|
||||
rclconfig = recollinit(recollCleanup, sigcleanup, reason);
|
||||
if (!rclconfig || !rclconfig->ok()) {
|
||||
|
||||
@ -74,6 +74,17 @@
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>allTermsCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&All terms</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+A</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit">
|
||||
<property name="name">
|
||||
<cstring>queryText</cstring>
|
||||
@ -154,21 +165,21 @@
|
||||
<cstring>Toolbar</cstring>
|
||||
</property>
|
||||
<property name="label">
|
||||
<string>Toolbar</string>
|
||||
<string>Search tools</string>
|
||||
</property>
|
||||
<action name="prevPageAction"/>
|
||||
<action name="nextPageAction"/>
|
||||
<action name="toolsAdvanced_SearchAction"/>
|
||||
<action name="toolsSort_parametersAction"/>
|
||||
<action name="toolsDoc_HistoryAction"/>
|
||||
</toolbar>
|
||||
<toolbar dock="2">
|
||||
<property name="name">
|
||||
<cstring>Toolbar1</cstring>
|
||||
</property>
|
||||
<property name="label">
|
||||
<string>Tools</string>
|
||||
<string>Result list</string>
|
||||
</property>
|
||||
<action name="toolsAdvanced_SearchAction"/>
|
||||
<action name="toolsSort_parametersAction"/>
|
||||
<action name="toolsDoc_HistoryAction"/>
|
||||
<action name="prevPageAction"/>
|
||||
<action name="nextPageAction"/>
|
||||
</toolbar>
|
||||
</toolbars>
|
||||
<actions>
|
||||
|
||||
@ -29,6 +29,7 @@ using std::pair;
|
||||
#include <qstatusbar.h>
|
||||
#include <qwindowdefs.h>
|
||||
#include <qapplication.h>
|
||||
#include <qcheckbox.h>
|
||||
|
||||
#include "recoll.h"
|
||||
#include "debuglog.h"
|
||||
@ -389,7 +390,11 @@ void RecollMain::startSimpleSearch()
|
||||
Rcl::AdvSearchData sdata;
|
||||
|
||||
QCString u8 = queryText->text().utf8();
|
||||
sdata.orwords = u8;
|
||||
if (allTermsCB->isChecked())
|
||||
sdata.allwords = u8;
|
||||
else
|
||||
sdata.orwords = u8;
|
||||
|
||||
startAdvSearch(sdata);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user