have ssearch install the lang help section when needed

This commit is contained in:
dockes 2009-01-29 10:08:56 +00:00
parent 713eb87472
commit bbf565c18e
3 changed files with 14 additions and 1 deletions

View File

@ -319,6 +319,7 @@ int main(int argc, char **argv)
} }
mainWindow->sSearch->searchTypCMB->setCurrentItem(prefs.ssearchTyp); mainWindow->sSearch->searchTypCMB->setCurrentItem(prefs.ssearchTyp);
mainWindow->sSearch->searchTypeChanged(prefs.ssearchTyp);
string dbdir = rclconfig->getDbDir(); string dbdir = rclconfig->getDbDir();
if (dbdir.empty()) { if (dbdir.empty()) {
// Note: this will have to be replaced by a call to a // Note: this will have to be replaced by a call to a

View File

@ -35,6 +35,7 @@ static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.26 2008-12-05 11:09:31 dockes E
#include "refcntr.h" #include "refcntr.h"
#include "textsplit.h" #include "textsplit.h"
#include "wasatorcl.h" #include "wasatorcl.h"
#include "rclhelp.h"
void SSearch::init() void SSearch::init()
{ {
@ -53,6 +54,7 @@ void SSearch::init()
connect(clearqPB, SIGNAL(clicked()), connect(clearqPB, SIGNAL(clicked()),
queryText->lineEdit(), SLOT(clear())); queryText->lineEdit(), SLOT(clear()));
connect(searchPB, SIGNAL(clicked()), this, SLOT(startSimpleSearch())); connect(searchPB, SIGNAL(clicked()), this, SLOT(startSimpleSearch()));
connect(searchTypCMB, SIGNAL(activated(int)), this, SLOT(searchTypeChanged(int)));
#if QT_VERSION >= 0x040000 #if QT_VERSION >= 0x040000
queryText->installEventFilter(this); queryText->installEventFilter(this);
@ -62,7 +64,7 @@ void SSearch::init()
m_escape = false; m_escape = false;
} }
void SSearch::searchTextChanged( const QString & text ) void SSearch::searchTextChanged(const QString& text)
{ {
if (text.isEmpty()) { if (text.isEmpty()) {
searchPB->setEnabled(false); searchPB->setEnabled(false);
@ -74,6 +76,15 @@ void SSearch::searchTextChanged( const QString & text )
} }
} }
void SSearch::searchTypeChanged(int typ)
{
LOGDEB(("Search type now %d\n", typ));
if (typ == SST_LANG)
HelpClient::installMap(this->name(), "RCL.SEARCH.LANG");
else
HelpClient::installMap(this->name(), "RCL.SEARCH.SIMPLE");
}
void SSearch::startSimpleSearch() void SSearch::startSimpleSearch()
{ {
if (queryText->currentText().length() == 0) if (queryText->currentText().length() == 0)

View File

@ -64,6 +64,7 @@ public:
public slots: public slots:
virtual void searchTextChanged(const QString & text); virtual void searchTextChanged(const QString & text);
virtual void searchTypeChanged(int);
virtual void setSearchString(const QString& text); virtual void setSearchString(const QString& text);
virtual void startSimpleSearch(); virtual void startSimpleSearch();