|
a/src/qtgui/ssearch_w.cpp |
|
b/src/qtgui/ssearch_w.cpp |
|
... |
|
... |
33 |
#include "searchdata.h"
|
33 |
#include "searchdata.h"
|
34 |
#include "ssearch_w.h"
|
34 |
#include "ssearch_w.h"
|
35 |
#include "refcntr.h"
|
35 |
#include "refcntr.h"
|
36 |
#include "textsplit.h"
|
36 |
#include "textsplit.h"
|
37 |
#include "wasatorcl.h"
|
37 |
#include "wasatorcl.h"
|
|
|
38 |
#include "rclhelp.h"
|
38 |
|
39 |
|
39 |
void SSearch::init()
|
40 |
void SSearch::init()
|
40 |
{
|
41 |
{
|
41 |
// See enum above and keep in order !
|
42 |
// See enum above and keep in order !
|
42 |
searchTypCMB->insertItem(tr("Any term"));
|
43 |
searchTypCMB->insertItem(tr("Any term"));
|
|
... |
|
... |
51 |
connect(queryText->lineEdit(), SIGNAL(textChanged(const QString&)),
|
52 |
connect(queryText->lineEdit(), SIGNAL(textChanged(const QString&)),
|
52 |
this, SLOT(searchTextChanged(const QString&)));
|
53 |
this, SLOT(searchTextChanged(const QString&)));
|
53 |
connect(clearqPB, SIGNAL(clicked()),
|
54 |
connect(clearqPB, SIGNAL(clicked()),
|
54 |
queryText->lineEdit(), SLOT(clear()));
|
55 |
queryText->lineEdit(), SLOT(clear()));
|
55 |
connect(searchPB, SIGNAL(clicked()), this, SLOT(startSimpleSearch()));
|
56 |
connect(searchPB, SIGNAL(clicked()), this, SLOT(startSimpleSearch()));
|
|
|
57 |
connect(searchTypCMB, SIGNAL(activated(int)), this, SLOT(searchTypeChanged(int)));
|
56 |
|
58 |
|
57 |
#if QT_VERSION >= 0x040000
|
59 |
#if QT_VERSION >= 0x040000
|
58 |
queryText->installEventFilter(this);
|
60 |
queryText->installEventFilter(this);
|
59 |
#else
|
61 |
#else
|
60 |
queryText->lineEdit()->installEventFilter(this);
|
62 |
queryText->lineEdit()->installEventFilter(this);
|
61 |
#endif
|
63 |
#endif
|
62 |
m_escape = false;
|
64 |
m_escape = false;
|
63 |
}
|
65 |
}
|
64 |
|
66 |
|
65 |
void SSearch::searchTextChanged( const QString & text )
|
67 |
void SSearch::searchTextChanged(const QString& text)
|
66 |
{
|
68 |
{
|
67 |
if (text.isEmpty()) {
|
69 |
if (text.isEmpty()) {
|
68 |
searchPB->setEnabled(false);
|
70 |
searchPB->setEnabled(false);
|
69 |
clearqPB->setEnabled(false);
|
71 |
clearqPB->setEnabled(false);
|
70 |
emit clearSearch();
|
72 |
emit clearSearch();
|
71 |
} else {
|
73 |
} else {
|
72 |
searchPB->setEnabled(true);
|
74 |
searchPB->setEnabled(true);
|
73 |
clearqPB->setEnabled(true);
|
75 |
clearqPB->setEnabled(true);
|
74 |
}
|
76 |
}
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
void SSearch::searchTypeChanged(int typ)
|
|
|
80 |
{
|
|
|
81 |
LOGDEB(("Search type now %d\n", typ));
|
|
|
82 |
if (typ == SST_LANG)
|
|
|
83 |
HelpClient::installMap(this->name(), "RCL.SEARCH.LANG");
|
|
|
84 |
else
|
|
|
85 |
HelpClient::installMap(this->name(), "RCL.SEARCH.SIMPLE");
|
75 |
}
|
86 |
}
|
76 |
|
87 |
|
77 |
void SSearch::startSimpleSearch()
|
88 |
void SSearch::startSimpleSearch()
|
78 |
{
|
89 |
{
|
79 |
if (queryText->currentText().length() == 0)
|
90 |
if (queryText->currentText().length() == 0)
|