summaryrefslogtreecommitdiffstats
path: root/bibletime/frontend/searchdialog/csearchdialogpages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bibletime/frontend/searchdialog/csearchdialogpages.cpp')
-rw-r--r--bibletime/frontend/searchdialog/csearchdialogpages.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/bibletime/frontend/searchdialog/csearchdialogpages.cpp b/bibletime/frontend/searchdialog/csearchdialogpages.cpp
index 473dc91..53853ed 100644
--- a/bibletime/frontend/searchdialog/csearchdialogpages.cpp
+++ b/bibletime/frontend/searchdialog/csearchdialogpages.cpp
@@ -28,11 +28,11 @@
#include "util/ctoolclass.h"
//Qt includes
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qregexp.h>
-#include <qeventloop.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+#include <tqregexp.h>
+#include <tqeventloop.h>
//KDE includes
#include <klocale.h>
@@ -60,12 +60,12 @@ void StrongsResultClass::initStrongsResults(void) {
CDisplayRendering render;
ListCSwordModuleInfo modules;
CTextRendering::KeyTreeItem::Settings settings;
- QString rText, lText, key;
+ TQString rText, lText, key;
bool found;
int sIndex;
int count;
int index;
- QString text;
+ TQString text;
modules.append(srModule);
sword::ListKey& result = srModule->searchResult();
@@ -87,7 +87,7 @@ KApplication::kApplication()->processEvents( 1 ); //1 ms only
progress->progressBar()->setProgress( int( (index*100) / count ) );
KApplication::kApplication()->processEvents( 1 ); //1 ms only
- key = QString::fromUtf8(result.GetElement(index)->getText());
+ key = TQString::fromUtf8(result.GetElement(index)->getText());
text = render.renderSingleKey(key, modules, settings);
sIndex = 0;
while ((rText = getStrongsNumberText(text, &sIndex)) != "")
@@ -113,10 +113,10 @@ KApplication::kApplication()->processEvents( 1 ); //1 ms only
//qHeapSort(srList);
}
-QString StrongsResultClass::getStrongsNumberText(const QString& verseContent, int *startIndex) {
+TQString StrongsResultClass::getStrongsNumberText(const TQString& verseContent, int *startIndex) {
// get the strongs text
int idx1, idx2, index;
- QString sNumber, strongsText;
+ TQString sNumber, strongsText;
//const bool cs = CSwordModuleSearch::caseSensitive;
const bool cs = false;
@@ -150,14 +150,14 @@ QString StrongsResultClass::getStrongsNumberText(const QString& verseContent, in
index += 6; // 6 is the length of "lemma="
}
}
- return QString::null;
+ return TQString::null;
}
/********************************************
********** CSearchDialogResultPage *********
********************************************/
-CSearchResultPage::CSearchResultPage(QWidget *parent, const char *name ) :
+CSearchResultPage::CSearchResultPage(TQWidget *parent, const char *name ) :
SearchResultsForm(parent, name) {
initView();
initConnections();
@@ -167,14 +167,14 @@ CSearchResultPage::~CSearchResultPage() {}
/** Initializes the view of this widget. */
void CSearchResultPage::initView() {
- QVBoxLayout* frameLayout = new QVBoxLayout(m_displayFrame, 0, 6, "frameLayout");
+ TQVBoxLayout* frameLayout = new TQVBoxLayout(m_displayFrame, 0, 6, "frameLayout");
m_previewDisplay = CDisplay::createReadInstance(0, m_displayFrame);
frameLayout->addWidget(m_previewDisplay->view());
}
/** Sets the modules which contain the result of each. */
void CSearchResultPage::setSearchResult(ListCSwordModuleInfo modules) {
- const QString searchedText = CSearchDialog::getSearchDialog()->searchText();
+ const TQString searchedText = CSearchDialog::getSearchDialog()->searchText();
reset(); //clear current modules
m_modules = modules;
@@ -198,7 +198,7 @@ void CSearchResultPage::setSearchResult(ListCSwordModuleInfo modules) {
void CSearchResultPage::reset() {
m_moduleListBox->clear();
m_resultListBox->clear();
- m_previewDisplay->setText(QString::null);
+ m_previewDisplay->setText(TQString::null);
m_analyseButton->setEnabled(false);
// m_modules.setAutoDelete(false); //make sure we don't delete modules accidentally
m_modules.clear();
@@ -206,15 +206,15 @@ void CSearchResultPage::reset() {
/** Update the preview of the selected key. */
-void CSearchResultPage::updatePreview(const QString& key) {
+void CSearchResultPage::updatePreview(const TQString& key) {
using namespace Rendering;
CSwordModuleInfo* module = m_moduleListBox->activeModule();
if ( module ) {
- const QString searchedText = CSearchDialog::getSearchDialog()->searchText();
+ const TQString searchedText = CSearchDialog::getSearchDialog()->searchText();
//const int searchFlags = CSearchDialog::getSearchDialog()->searchFlags();
- QString text;
+ TQString text;
CDisplayRendering render;
ListCSwordModuleInfo modules;
@@ -242,13 +242,13 @@ void CSearchResultPage::updatePreview(const QString& key) {
vk.Verse(0);
}
- const QString startKey = vk.key();
+ const TQString startKey = vk.key();
vk.key(key);
vk.next(CSwordVerseKey::UseVerse);
vk.next(CSwordVerseKey::UseVerse);
- const QString endKey = vk.key();
+ const TQString endKey = vk.key();
settings.keyRenderingFace = CTextRendering::KeyTreeItem::Settings::CompleteShort;
text = render.renderKeyRange(startKey, endKey, modules, key, settings);
@@ -268,10 +268,10 @@ void CSearchResultPage::updatePreview(const QString& key) {
}
vk.Verse(0);
}
- const QString startKey = vk.key();
+ const TQString startKey = vk.key();
vk.key(key);
- const QString endKey = vk.key();
+ const TQString endKey = vk.key();
settings.keyRenderingFace = CTextRendering::KeyTreeItem::Settings::NoKey;
text = render.renderKeyRange(startKey, endKey, modules, key, settings);
@@ -285,9 +285,9 @@ void CSearchResultPage::updatePreview(const QString& key) {
}
}
-QStringList CSearchResultPage::QueryParser(const QString& queryString) {
- QString token;
- QStringList tokenList;
+TQStringList CSearchResultPage::QueryParser(const TQString& queryString) {
+ TQString token;
+ TQStringList tokenList;
int cnt, pos;
token = "";
@@ -384,7 +384,7 @@ QStringList CSearchResultPage::QueryParser(const QString& queryString) {
tokenList.append(token);
cnt = 0;
- QStringList::iterator it;
+ TQStringList::iterator it;
for ( it = tokenList.begin(); it != tokenList.end(); it++ ) {
//-----------------------------------------------------------
// remove all the NOT(!) tokens - these do not need to be
@@ -425,8 +425,8 @@ QStringList CSearchResultPage::QueryParser(const QString& queryString) {
return(tokenList);
}
-const QString CSearchResultPage::highlightSearchedText(const QString& content, const QString& searchedText/*, const int searchFlags*/) {
- QString ret = content;
+const TQString CSearchResultPage::highlightSearchedText(const TQString& content, const TQString& searchedText/*, const int searchFlags*/) {
+ TQString ret = content;
//const bool cs = (searchFlags & CSwordModuleSearch::caseSensitive);
const bool cs = false;
@@ -436,12 +436,12 @@ const QString CSearchResultPage::highlightSearchedText(const QString& content, c
int matchLen = 0;
int length = searchedText.length();
- const QString rep1("<span style=\"background-color:#FFFF66;\">");
- const QString rep2("</span>");
+ const TQString rep1("<span style=\"background-color:#FFFF66;\">");
+ const TQString rep2("</span>");
const unsigned int repLength = rep1.length() + rep1.length();
int sstIndex; // strong search text index for finding "strong:"
bool inQuote;
- QString newSearchText;
+ TQString newSearchText;
newSearchText = searchedText;
//---------------------------------------------------------------------
@@ -451,8 +451,8 @@ const QString CSearchResultPage::highlightSearchedText(const QString& content, c
sstIndex = 0;
while ((sstIndex = newSearchText.find("strong:", sstIndex)) != -1) {
int idx1, idx2, sTokenIndex, sTokenIndex2;
- QString sNumber, lemmaText;
- const QString rep3("style=\"background-color:#FFFF66;\" ");
+ TQString sNumber, lemmaText;
+ const TQString rep3("style=\"background-color:#FFFF66;\" ");
const unsigned int rep3Length = rep3.length();
int strongIndex = index;
//--------------------------------------------------
@@ -517,19 +517,19 @@ const QString CSearchResultPage::highlightSearchedText(const QString& content, c
// since I could not figure out the lucene query parser, I
// made a simple parser.
//===========================================================
- QStringList words = QueryParser(newSearchText);
+ TQStringList words = QueryParser(newSearchText);
for ( int wi = 0; (unsigned int)wi < words.count(); ++wi ) { //search for every word in the list
- QRegExp findExp;
- QString word = words[ wi ];
+ TQRegExp findExp;
+ TQString word = words[ wi ];
if (word.contains("*")) {
length = word.length() - 1;
word.replace('*', "\\S*"); //match within a word
- findExp = QRegExp(word);
+ findExp = TQRegExp(word);
findExp.setMinimal(TRUE);
}
else {
length = word.length();
- findExp = QRegExp("\\b" + word + "\\b");
+ findExp = TQRegExp("\\b" + word + "\\b");
}
// index = 0; //for every word start at the beginning
@@ -553,16 +553,16 @@ const QString CSearchResultPage::highlightSearchedText(const QString& content, c
/** Initializes the signal slot conections of the child widgets, */
void CSearchResultPage::initConnections() {
- connect(m_resultListBox, SIGNAL(keySelected(const QString&)),
- this, SLOT(updatePreview(const QString&)));
- connect(m_moduleListBox, SIGNAL(moduleSelected(CSwordModuleInfo*)),
- m_resultListBox, SLOT(setupTree(CSwordModuleInfo*)));
- connect(m_moduleListBox, SIGNAL(moduleChanged()),
- m_previewDisplay->connectionsProxy(), SLOT(clear()));
- connect(m_analyseButton, SIGNAL(clicked()), SLOT(showAnalysis()));
+ connect(m_resultListBox, TQT_SIGNAL(keySelected(const TQString&)),
+ this, TQT_SLOT(updatePreview(const TQString&)));
+ connect(m_moduleListBox, TQT_SIGNAL(moduleSelected(CSwordModuleInfo*)),
+ m_resultListBox, TQT_SLOT(setupTree(CSwordModuleInfo*)));
+ connect(m_moduleListBox, TQT_SIGNAL(moduleChanged()),
+ m_previewDisplay->connectionsProxy(), TQT_SLOT(clear()));
+ connect(m_analyseButton, TQT_SIGNAL(clicked()), TQT_SLOT(showAnalysis()));
// connect the strongs list
- connect(m_moduleListBox, SIGNAL(strongsSelected(CSwordModuleInfo*, QStringList*)),
- m_resultListBox, SLOT(setupStrongsTree(CSwordModuleInfo*, QStringList*)));
+ connect(m_moduleListBox, TQT_SIGNAL(strongsSelected(CSwordModuleInfo*, TQStringList*)),
+ m_resultListBox, TQT_SLOT(setupStrongsTree(CSwordModuleInfo*, TQStringList*)));
}
/** Shows a dialog with the search analysis of the current search. */
@@ -577,7 +577,7 @@ void CSearchResultPage::showAnalysis() {
namespace Options {
-CSearchOptionsPage::CSearchOptionsPage(QWidget *parent, const char *name ) :
+CSearchOptionsPage::CSearchOptionsPage(TQWidget *parent, const char *name ) :
SearchOptionsForm(parent,name) {
initView();
readSettings();
@@ -588,12 +588,12 @@ CSearchOptionsPage::~CSearchOptionsPage() {
}
/** Returns the search text set in this page. */
-const QString CSearchOptionsPage::searchText() {
+const TQString CSearchOptionsPage::searchText() {
return m_searchTextCombo->currentText();
}
/** Sets the search text used in the page. */
-void CSearchOptionsPage::setSearchText(const QString& text) {
+void CSearchOptionsPage::setSearchText(const TQString& text) {
bool found = false;
int i = 0;
for (i = 0; !found && i < m_searchTextCombo->count(); ++i) {
@@ -616,30 +616,30 @@ void CSearchOptionsPage::setSearchText(const QString& text) {
/** Initializes this page. */
void CSearchOptionsPage::initView() {
- connect( m_searchTextCombo, SIGNAL(activated( const QString& )),
- m_searchTextCombo, SLOT( addToHistory( const QString& ))
+ connect( m_searchTextCombo, TQT_SIGNAL(activated( const TQString& )),
+ m_searchTextCombo, TQT_SLOT( addToHistory( const TQString& ))
);
- connect( m_searchTextCombo, SIGNAL(returnPressed ( const QString& )),
- m_searchTextCombo, SLOT(addToHistory(const QString&))
+ connect( m_searchTextCombo, TQT_SIGNAL(returnPressed ( const TQString& )),
+ m_searchTextCombo, TQT_SLOT(addToHistory(const TQString&))
);
- QToolTip::add(m_searchTextCombo, CResMgr::searchdialog::options::searchedText::tooltip);
+ TQToolTip::add(m_searchTextCombo, CResMgr::searchdialog::options::searchedText::tooltip);
m_syntaxButton->setIconSet(SmallIconSet("contexthelp"));
- connect( m_syntaxButton, SIGNAL(clicked()), this, SLOT(syntaxHelp()));
+ connect( m_syntaxButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(syntaxHelp()));
m_chooseModulesButton->setIconSet(SmallIconSet("wizard"));
- connect(m_chooseModulesButton, SIGNAL(clicked()),
- this, SLOT(chooseModules()));
- QToolTip::add
+ connect(m_chooseModulesButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(chooseModules()));
+ TQToolTip::add
(m_chooseModulesButton, CResMgr::searchdialog::options::moduleChooserButton::tooltip);
- QToolTip::add
+ TQToolTip::add
(m_rangeChooserCombo, CResMgr::searchdialog::options::chooseScope::tooltip);
refreshRanges();
m_chooseRangeButton->setIconSet(SmallIconSet("configure"));
- connect(m_chooseRangeButton, SIGNAL(clicked()),
- this, SLOT(setupRanges()));
+ connect(m_chooseRangeButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(setupRanges()));
//set the initial focus
m_searchTextCombo->setFocus();
@@ -647,7 +647,7 @@ void CSearchOptionsPage::initView() {
/** Sets the modules used by the search. */
void CSearchOptionsPage::setModules( ListCSwordModuleInfo modules ) {
- QString t = i18n("Searching in: ");
+ TQString t = i18n("Searching in: ");
m_modules.clear(); //remove old modules
ListCSwordModuleInfo::iterator end_it = modules.end();
@@ -662,7 +662,7 @@ void CSearchOptionsPage::setModules( ListCSwordModuleInfo modules ) {
m_modules.append( *it );
t.append( (*it)->name() );
if (*it != modules.last()) {
- t += QString::fromLatin1(", "); // so that it will become a readable list (WLC, LXX, GerLut...)
+ t += TQString::fromLatin1(", "); // so that it will become a readable list (WLC, LXX, GerLut...)
}
}
};
@@ -673,8 +673,8 @@ void CSearchOptionsPage::setModules( ListCSwordModuleInfo modules ) {
/** Opens the modules chooser dialog. */
void CSearchOptionsPage::chooseModules() {
CModuleChooserDialog* dlg = new CModuleChooserDialog(this, modules());
- connect(dlg, SIGNAL(modulesChanged(ListCSwordModuleInfo)),
- this, SLOT(setModules(ListCSwordModuleInfo)));
+ connect(dlg, TQT_SIGNAL(modulesChanged(ListCSwordModuleInfo)),
+ this, TQT_SLOT(setModules(ListCSwordModuleInfo)));
dlg->exec();
}
@@ -719,7 +719,7 @@ void CSearchOptionsPage::setupRanges() {
/** No descriptions */
void CSearchOptionsPage::syntaxHelp() {
- QString syntax = i18n (
+ TQString syntax = i18n (
"<p>Enter search terms separated by spaces. By default the search "
"function will return results that match any of the search terms (OR). "
"To search for all the terms separate the terms by AND.</p>") + i18n(
@@ -764,7 +764,7 @@ sword::ListKey CSearchOptionsPage::searchScope() {
if (m_rangeChooserCombo->currentItem() > 0) { //is not "no scope"
CBTConfig::StringMap map = CBTConfig::get(CBTConfig::searchScopes);
- QString scope = map[ m_rangeChooserCombo->currentText() ];
+ TQString scope = map[ m_rangeChooserCombo->currentText() ];
if (!scope.isEmpty()) {
return sword::VerseKey().ParseVerseList( (const char*)scope.utf8(), "Genesis 1:1", true);
}