From bbf565c18eb8de4be6bb3e98ddaf93b3be7b7f76 Mon Sep 17 00:00:00 2001 From: dockes Date: Thu, 29 Jan 2009 10:08:56 +0000 Subject: [PATCH] have ssearch install the lang help section when needed --- src/qtgui/main.cpp | 1 + src/qtgui/ssearch_w.cpp | 13 ++++++++++++- src/qtgui/ssearch_w.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/qtgui/main.cpp b/src/qtgui/main.cpp index 96bda342..24155024 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -319,6 +319,7 @@ int main(int argc, char **argv) } mainWindow->sSearch->searchTypCMB->setCurrentItem(prefs.ssearchTyp); + mainWindow->sSearch->searchTypeChanged(prefs.ssearchTyp); string dbdir = rclconfig->getDbDir(); if (dbdir.empty()) { // Note: this will have to be replaced by a call to a diff --git a/src/qtgui/ssearch_w.cpp b/src/qtgui/ssearch_w.cpp index 032dfef2..24081d15 100644 --- a/src/qtgui/ssearch_w.cpp +++ b/src/qtgui/ssearch_w.cpp @@ -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 "textsplit.h" #include "wasatorcl.h" +#include "rclhelp.h" void SSearch::init() { @@ -53,6 +54,7 @@ void SSearch::init() connect(clearqPB, SIGNAL(clicked()), queryText->lineEdit(), SLOT(clear())); connect(searchPB, SIGNAL(clicked()), this, SLOT(startSimpleSearch())); + connect(searchTypCMB, SIGNAL(activated(int)), this, SLOT(searchTypeChanged(int))); #if QT_VERSION >= 0x040000 queryText->installEventFilter(this); @@ -62,7 +64,7 @@ void SSearch::init() m_escape = false; } -void SSearch::searchTextChanged( const QString & text ) +void SSearch::searchTextChanged(const QString& text) { if (text.isEmpty()) { 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() { if (queryText->currentText().length() == 0) diff --git a/src/qtgui/ssearch_w.h b/src/qtgui/ssearch_w.h index 8bae91ef..2598caa7 100644 --- a/src/qtgui/ssearch_w.h +++ b/src/qtgui/ssearch_w.h @@ -64,6 +64,7 @@ public: public slots: virtual void searchTextChanged(const QString & text); + virtual void searchTypeChanged(int); virtual void setSearchString(const QString& text); virtual void startSimpleSearch();