summaryrefslogtreecommitdiffstats
path: root/src/modules/editor/scripteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/editor/scripteditor.cpp')
-rw-r--r--src/modules/editor/scripteditor.cpp546
1 files changed, 273 insertions, 273 deletions
diff --git a/src/modules/editor/scripteditor.cpp b/src/modules/editor/scripteditor.cpp
index 06023a7c..cc9ca7c2 100644
--- a/src/modules/editor/scripteditor.cpp
+++ b/src/modules/editor/scripteditor.cpp
@@ -25,21 +25,21 @@
#include "scripteditor.h"
-#include <qlayout.h>
-#include <qtoolbutton.h>
+#include <tqlayout.h>
+#include <tqtoolbutton.h>
#include <kvi_tal_groupbox.h>
#include "kvi_tal_popupmenu.h"
#include "kvi_tal_scrollview.h"
-#include <qmessagebox.h>
-#include <qtimer.h>
+#include <tqmessagebox.h>
+#include <tqtimer.h>
#ifdef COMPILE_USE_QT4
- //#define QSyntaxHighlighter Q3SyntaxHighlighter
+ //#define TQSyntaxHighlighter Q3SyntaxHighlighter
#else
- #include <qobjectlist.h>
+ #include <tqobjectlist.h>
#endif
-#include <qcursor.h>
-#include <qfont.h>
-#include <qrect.h>
+#include <tqcursor.h>
+#include <tqfont.h>
+#include <tqrect.h>
#include "kvi_fileutils.h"
#include "kvi_locale.h"
@@ -55,36 +55,36 @@
#include "kvi_iconmanager.h"
#include "kvi_kvs_kernel.h"
-#include <qlayout.h>
+#include <tqlayout.h>
extern KviPointerList<KviScriptEditorImplementation> * g_pScriptEditorWindowList;
extern KviModule * g_pEditorModulePointer;
-static QColor g_clrBackground(255,255,255);
-static QColor g_clrNormalText(0,0,0);
-static QColor g_clrBracket(255,0,0);
-static QColor g_clrComment(0,120,0);
-static QColor g_clrFunction(0,17,255);
-static QColor g_clrKeyword(85,85,255);
-static QColor g_clrVariable(255,0,0);
-static QColor g_clrPunctuation(180,180,0);
-static QColor g_clrFind(0,0,0);
+static TQColor g_clrBackground(255,255,255);
+static TQColor g_clrNormalText(0,0,0);
+static TQColor g_clrBracket(255,0,0);
+static TQColor g_clrComment(0,120,0);
+static TQColor g_clrFunction(0,17,255);
+static TQColor g_clrKeyword(85,85,255);
+static TQColor g_clrVariable(255,0,0);
+static TQColor g_clrPunctuation(180,180,0);
+static TQColor g_clrFind(0,0,0);
-static QFont g_fntNormal("Courier New",8);
+static TQFont g_fntNormal("Courier New",8);
-KviCompletionBox::KviCompletionBox(QWidget * parent = 0)
-: KviTalListBox(parent)
+KviCompletionBox::KviCompletionBox(TQWidget * tqparent = 0)
+: KviTalListBox(tqparent)
{
- setPaletteForegroundColor(QColor(0,0,0));
- setPaletteBackgroundColor(QColor(255,255,255));
+ setPaletteForegroundColor(TQColor(0,0,0));
+ setPaletteBackgroundColor(TQColor(255,255,255));
#ifdef COMPILE_USE_QT4
setHScrollBarMode(KviTalListBox::AlwaysOff);
#else
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(TQScrollView::AlwaysOff);
#endif
- QFont listfont=font();
+ TQFont listfont=font();
listfont.setPointSize(8);
setFont(listfont);
setVariableWidth(false);
@@ -93,25 +93,25 @@ KviCompletionBox::KviCompletionBox(QWidget * parent = 0)
hide();
}
-void KviCompletionBox::updateContents(QString buffer)
+void KviCompletionBox::updateContents(TQString buffer)
{
buffer=buffer.stripWhiteSpace();
- KviPointerList<QString> list;
+ KviPointerList<TQString> list;
clear();
- QString szModule;
- QChar* pCur = (QChar *)buffer.ucs2();
+ TQString szModule;
+ TQChar* pCur = (TQChar *)buffer.ucs2();
- int pos=buffer.find('.');
+ int pos=buffer.tqfind('.');
if(pos>0)
{
szModule=buffer.left(pos);
- if(szModule[0].unicode()=='$')
+ if(szModule[0].tqunicode()=='$')
szModule.remove(0,1);
}
- if(pCur->unicode() == '$')
+ if(pCur->tqunicode() == '$')
{
buffer.remove(0,1);
if(!buffer.isEmpty())
@@ -120,7 +120,7 @@ void KviCompletionBox::updateContents(QString buffer)
KviKvsKernel::instance()->completeFunction(buffer,&list);
else
debug("we need a module completion!");
- for ( QString* szCurrent = list.first(); szCurrent; szCurrent = list.next() )
+ for ( TQString* szCurrent = list.first(); szCurrent; szCurrent = list.next() )
{
szCurrent->prepend('$');
//szCurrent->append('(');
@@ -134,7 +134,7 @@ void KviCompletionBox::updateContents(QString buffer)
KviKvsKernel::instance()->completeCommand(buffer,&list);
else
debug("we need a module completion!");
- for ( QString* szCurrent = list.first(); szCurrent; szCurrent = list.next() )
+ for ( TQString* szCurrent = list.first(); szCurrent; szCurrent = list.next() )
{
szCurrent->append(' ');
insertItem(*szCurrent);
@@ -143,16 +143,16 @@ void KviCompletionBox::updateContents(QString buffer)
// debug("%s %s %i %i",__FILE__,__FUNCTION__,__LINE__,count());
}
-void KviCompletionBox::keyPressEvent(QKeyEvent * e)
+void KviCompletionBox::keyPressEvent(TQKeyEvent * e)
{
// debug("%s %s %i %x",__FILE__,__FUNCTION__,__LINE__,e->key());
switch(e->key())
{
- case Qt::Key_Escape:
+ case TQt::Key_Escape:
hide();
setFocus();
break;
- case Qt::Key_Return:
+ case TQt::Key_Return:
break;
default:
if(!e->text().isEmpty())
@@ -164,13 +164,13 @@ void KviCompletionBox::keyPressEvent(QKeyEvent * e)
KviTalListBox::keyPressEvent(e);
}
-KviScriptEditorWidgetColorOptions::KviScriptEditorWidgetColorOptions(QWidget * pParent)
-: QDialog(pParent)
+KviScriptEditorWidgetColorOptions::KviScriptEditorWidgetColorOptions(TQWidget * pParent)
+: TQDialog(pParent)
{
m_pSelectorInterfaceList = new KviPointerList<KviSelectorInterface>;
m_pSelectorInterfaceList->setAutoDelete(false);
setCaption(__tr2qs_ctx("Preferences","editor"));
- QGridLayout * g = new QGridLayout(this,3,3,4,4);
+ TQGridLayout * g = new TQGridLayout(this,3,3,4,4);
KviFontSelector * f = new KviFontSelector(this,__tr2qs_ctx("Font:","editor"),&g_fntNormal,true);
g->addMultiCellWidget(f,0,0,0,2);
@@ -187,13 +187,13 @@ KviScriptEditorWidgetColorOptions::KviScriptEditorWidgetColorOptions(QWidget * p
s = addColorSelector(gbox,__tr2qs_ctx("Punctuation:","editor"),&g_clrPunctuation,true);
s = addColorSelector(gbox,__tr2qs_ctx("Find:","editor"),&g_clrFind,true);
- QPushButton * b = new QPushButton(__tr2qs_ctx("&OK","editor"),this);
+ TQPushButton * b = new TQPushButton(__tr2qs_ctx("&OK","editor"),this);
b->setDefault(true);
- connect(b,SIGNAL(clicked()),this,SLOT(okClicked()));
+ connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(okClicked()));
g->addWidget(b,2,1);
- b = new QPushButton(__tr2qs_ctx("Cancel","editor"),this);
- connect(b,SIGNAL(clicked()),this,SLOT(reject()));
+ b = new TQPushButton(__tr2qs_ctx("Cancel","editor"),this);
+ connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(reject()));
g->addWidget(b,2,2);
@@ -206,7 +206,7 @@ KviScriptEditorWidgetColorOptions::~KviScriptEditorWidgetColorOptions()
delete m_pSelectorInterfaceList;
}
-KviColorSelector * KviScriptEditorWidgetColorOptions::addColorSelector(QWidget * pParent,const QString & txt,QColor * pOption,bool bEnabled)
+KviColorSelector * KviScriptEditorWidgetColorOptions::addColorSelector(TQWidget * pParent,const TQString & txt,TQColor * pOption,bool bEnabled)
{
KviColorSelector * s = new KviColorSelector(pParent,txt,pOption,bEnabled);
m_pSelectorInterfaceList->append(s);
@@ -224,7 +224,7 @@ void KviScriptEditorWidgetColorOptions::okClicked()
}
-KviScriptEditorWidget::KviScriptEditorWidget(QWidget * pParent)
+KviScriptEditorWidget::KviScriptEditorWidget(TQWidget * pParent)
: KviTalTextEdit(pParent)
{
setWordWrap(KviTalTextEdit::NoWrap);
@@ -233,7 +233,7 @@ KviScriptEditorWidget::KviScriptEditorWidget(QWidget * pParent)
updateOptions();
m_szFind="";
completelistbox=new KviCompletionBox(this);
- connect (completelistbox,SIGNAL(selected(const QString &)),this,SLOT(slotComplete(const QString &)));
+ connect (completelistbox,TQT_SIGNAL(selected(const TQString &)),this,TQT_SLOT(slotComplete(const TQString &)));
}
KviScriptEditorWidget::~KviScriptEditorWidget()
@@ -242,18 +242,18 @@ KviScriptEditorWidget::~KviScriptEditorWidget()
}
#ifdef COMPILE_USE_QT4
-Q3PopupMenu * KviScriptEditorWidget::createPopupMenu( const QPoint& pos )
+Q3PopupMenu * KviScriptEditorWidget::createPopupMenu( const TQPoint& pos )
#else
-QPopupMenu * KviScriptEditorWidget::createPopupMenu( const QPoint& pos )
+TQPopupMenu * KviScriptEditorWidget::createPopupMenu( const TQPoint& pos )
#endif
{
#ifdef COMPILE_USE_QT4
Q3PopupMenu *pop=KviTalTextEdit::createPopupMenu(pos);
#else
- QPopupMenu *pop=KviTalTextEdit::createPopupMenu(pos);
+ TQPopupMenu *pop=KviTalTextEdit::createPopupMenu(pos);
#endif
- pop->insertItem(__tr2qs("Context sensitive help"),this,SLOT(slotHelp()),Qt::CTRL+Qt::Key_H);
- pop->insertItem(__tr2qs("&Replace"),this,SLOT(slotReplace()),Qt::CTRL+Qt::Key_R);
+ pop->insertItem(__tr2qs("Context sensitive help"),this,TQT_SLOT(slotHelp()),TQt::CTRL+TQt::Key_H);
+ pop->insertItem(__tr2qs("&Replace"),this,TQT_SLOT(slotReplace()),TQt::CTRL+TQt::Key_R);
return pop;
}
@@ -265,10 +265,10 @@ void KviScriptEditorWidget::slotFind()
void KviScriptEditorWidget::slotReplace()
{
- KviScriptEditorReplaceDialog *dialog=new KviScriptEditorReplaceDialog(this,tr("Find & Repalce"));
- connect (dialog,SIGNAL(replaceAll(const QString &,const QString &)),m_pParent,SLOT(slotReplaceAll(const QString &,const QString &)));
- connect (dialog,SIGNAL(initFind()),m_pParent,SLOT(slotInitFind()));
- connect (dialog,SIGNAL(nextFind(const QString &)),m_pParent,SLOT(slotNextFind(const QString &)));
+ KviScriptEditorReplaceDialog *dialog=new KviScriptEditorReplaceDialog(this,tqtr("Find & Repalce"));
+ connect (dialog,TQT_SIGNAL(replaceAll(const TQString &,const TQString &)),m_pParent,TQT_SLOT(slotReplaceAll(const TQString &,const TQString &)));
+ connect (dialog,TQT_SIGNAL(initFind()),m_pParent,TQT_SLOT(slotInitFind()));
+ connect (dialog,TQT_SIGNAL(nextFind(const TQString &)),m_pParent,TQT_SLOT(slotNextFind(const TQString &)));
if(dialog->exec()){};
}
@@ -280,16 +280,16 @@ void KviScriptEditorWidget::slotHelp()
void KviScriptEditorWidget::updateOptions()
{
- setPaper(QBrush(g_clrBackground));
+ setPaper(TQBrush(g_clrBackground));
setFont(g_fntNormal);
setColor(g_clrNormalText);
- QPalette p = palette();
- p.setColor(QColorGroup::Text,g_clrNormalText);
+ TQPalette p = palette();
+ p.setColor(TQColorGroup::Text,g_clrNormalText);
setPalette(p);
#ifdef COMPILE_USE_QT4
- setTextFormat(Qt::PlainText);
+ setTextFormat(TQt::PlainText);
#else
setTextFormat(KviTalTextEdit::PlainText);
#endif
@@ -301,37 +301,37 @@ void KviScriptEditorWidget::updateOptions()
((KviScriptEditorImplementation*)m_pParent)->getFindlineedit()->setPaletteForegroundColor(g_clrFind);
}
-void KviScriptEditorWidget::keyPressEvent(QKeyEvent * e)
+void KviScriptEditorWidget::keyPressEvent(TQKeyEvent * e)
{
- if(e->state() == Qt::ControlButton)
+ if(e->state() == TQt::ControlButton)
{
switch(e->key())
{
- case Qt::Key_B:
+ case TQt::Key_B:
insert("$b");
return;
- case Qt::Key_K:
+ case TQt::Key_K:
insert("$k");
return;
- case Qt::Key_O:
+ case TQt::Key_O:
insert("$o");
return;
- case Qt::Key_U:
+ case TQt::Key_U:
insert("$u");
return;
- case Qt::Key_Enter:
- case Qt::Key_Return:
- case Qt::Key_Backspace:
- case Qt::Key_PageUp:
- e->ignore(); // allow the parent to process it
+ case TQt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Backspace:
+ case TQt::Key_PageUp:
+ e->ignore(); // allow the tqparent to process it
return;
break;
}
}
- if(e->state() == Qt::ShiftButton)
+ if(e->state() == TQt::ShiftButton)
{
- if (e->key() == Qt::Key_Insert)
+ if (e->key() == TQt::Key_Insert)
{
completition();
return;
@@ -339,20 +339,20 @@ void KviScriptEditorWidget::keyPressEvent(QKeyEvent * e)
}
switch(e->key())
{
- case Qt::Key_Period:
- case Qt::Key_Left:
- case Qt::Key_Right:
+ case TQt::Key_Period:
+ case TQt::Key_Left:
+ case TQt::Key_Right:
if(!completelistbox->isVisible()) completition(0);
break;
- case Qt::Key_Up:
- case Qt::Key_Escape:
- case Qt::Key_PageUp:
- case Qt::Key_PageDown:
- case Qt::Key_End:
- case Qt::Key_Home:
+ case TQt::Key_Up:
+ case TQt::Key_Escape:
+ case TQt::Key_PageUp:
+ case TQt::Key_PageDown:
+ case TQt::Key_End:
+ case TQt::Key_Home:
if(completelistbox->isVisible()) completelistbox->hide();
break;
- case Qt::Key_Down:
+ case TQt::Key_Down:
if(completelistbox->isVisible())
{
completelistbox->setFocus();
@@ -360,22 +360,22 @@ void KviScriptEditorWidget::keyPressEvent(QKeyEvent * e)
return;
}
break;
- case Qt::Key_Return:
+ case TQt::Key_Return:
KviTalTextEdit::keyPressEvent(e);
int para,pos;
getCursorPosition(&para,&pos);
if(para > 0)
{
- QString szPrev=text(para-1);
+ TQString szPrev=text(para-1);
if(!szPrev.isEmpty())
{
- if(szPrev.at(szPrev.length() - 1).unicode() == ' ')
+ if(szPrev.tqat(szPrev.length() - 1).tqunicode() == ' ')
szPrev.remove(szPrev.length() - 1,1);
- QString szCur;
- const QChar * pCur = (const QChar *)szPrev.ucs2();
+ TQString szCur;
+ const TQChar * pCur = (const TQChar *)szPrev.ucs2();
if(pCur)
{
- while(pCur->unicode() && pCur->isSpace())
+ while(pCur->tqunicode() && pCur->isSpace())
{
szCur.append(*pCur);
pCur++;
@@ -397,19 +397,19 @@ void KviScriptEditorWidget::keyPressEvent(QKeyEvent * e)
completition(0);
}
-void KviScriptEditorWidget::contentsMousePressEvent(QMouseEvent *e)
+void KviScriptEditorWidget::contentsMousePressEvent(TQMouseEvent *e)
{
completelistbox->hide();
if (e->button() == Qt::RightButton)
{
// bool bIsFirstWordInLine;
- QString buffer;
+ TQString buffer;
int para = paragraphAt(e->pos());
int index=charAt(e->pos(),&para);
buffer=this->text(para);
getWordOnCursor(buffer,index);
- QString tmp=buffer;
- KviPointerList<QString> l;
+ TQString tmp=buffer;
+ KviPointerList<TQString> l;
if (tmp.left(1) == "$")
{
tmp.remove(0,1);
@@ -432,7 +432,7 @@ void KviScriptEditorWidget::contentsMousePressEvent(QMouseEvent *e)
bool KviScriptEditorWidget::contextSensitiveHelp() const
{
- QString buffer;
+ TQString buffer;
int para,index;
getCursorPosition(&para,&index);
buffer=text(para);
@@ -440,8 +440,8 @@ bool KviScriptEditorWidget::contextSensitiveHelp() const
getWordOnCursor(buffer,index);
/*
- QString tmp=buffer;
- KviPointerList<QString> * l;
+ TQString tmp=buffer;
+ KviPointerList<TQString> * l;
if(tmp.left(1) == "$")
{
tmp.remove(0,1);
@@ -453,9 +453,9 @@ bool KviScriptEditorWidget::contextSensitiveHelp() const
bool bOk = false;
if(l)
{
- for(QString * s = l->first();s;s = l->next())
+ for(TQString * s = l->first();s;s = l->next())
{
- if(KviQString::equalCI(*s,buffer))
+ if(KviTQString::equalCI(*s,buffer))
{
l->last();
bOk = true;
@@ -466,8 +466,8 @@ bool KviScriptEditorWidget::contextSensitiveHelp() const
if(!bOk)return false;
*/
- QString parse;
- KviQString::sprintf(parse,"timer -s (help,0){ help -s %Q; }",&buffer);
+ TQString parse;
+ KviTQString::sprintf(parse,"timer -s (help,0){ help -s %Q; }",&buffer);
debug ("parsing %s",parse.latin1());
KviKvsScript::run(parse,(KviWindow*)g_pApp->activeConsole());
@@ -475,14 +475,14 @@ bool KviScriptEditorWidget::contextSensitiveHelp() const
}
-void KviScriptEditorWidget::getWordOnCursor(QString &buffer,int index) const
+void KviScriptEditorWidget::getWordOnCursor(TQString &buffer,int index) const
{
- QRegExp re("[ \t=,\\(\\)\"}{\\[\\]\r\n+-*><;@!]");
+ TQRegExp re("[ \t=,\\(\\)\"}{\\[\\]\r\n+-*><;@!]");
//debug("BUFFER IS %s",buffer.utf8().data());
- int start = buffer.findRev(re,index);
- int end = buffer.find(re,index);
+ int start = buffer.tqfindRev(re,index);
+ int end = buffer.tqfind(re,index);
- QString tmp;
+ TQString tmp;
if(start!=end)
{
if(start<0)start=0;
@@ -497,8 +497,8 @@ void KviScriptEditorWidget::getWordOnCursor(QString &buffer,int index) const
void KviScriptEditorWidget::completition(bool bCanComplete)
{
int line,index;
- QString buffer;
- QString word;
+ TQString buffer;
+ TQString word;
getCursorPosition(&line,&index);
buffer=this->text(line);
bool bIsFirstWordInLine;
@@ -524,15 +524,15 @@ void KviScriptEditorWidget::completition(bool bCanComplete)
}
}
-void KviScriptEditorWidget::getWordBeforeCursor(QString &buffer,int index,bool *bIsFirstWordInLine)
+void KviScriptEditorWidget::getWordBeforeCursor(TQString &buffer,int index,bool *bIsFirstWordInLine)
{
- QString tmp = buffer.left(index);
+ TQString tmp = buffer.left(index);
buffer=tmp;
- int idx = buffer.findRev(' ');
- int idx1 = buffer.findRev("=");
- int idx2 = buffer.findRev(',');
- int idx3 = buffer.findRev('(');
- int idx4 = buffer.findRev('"');
+ int idx = buffer.tqfindRev(' ');
+ int idx1 = buffer.tqfindRev("=");
+ int idx2 = buffer.tqfindRev(',');
+ int idx3 = buffer.tqfindRev('(');
+ int idx4 = buffer.tqfindRev('"');
if(idx1 > idx) idx= idx1;
if(idx2 > idx)idx = idx2;
if(idx3 > idx)idx = idx3;
@@ -547,19 +547,19 @@ void KviScriptEditorWidget::getWordBeforeCursor(QString &buffer,int index,bool *
}
-void KviScriptEditorWidget::slotComplete(const QString &str)
+void KviScriptEditorWidget::slotComplete(const TQString &str)
{
- QString complete=str;
+ TQString complete=str;
int line,index;
getCursorPosition(&line,&index);
- QString buffer;
+ TQString buffer;
buffer=this->text(line);
bool bIsFirstWordInLine;
getWordBeforeCursor(buffer,index,&bIsFirstWordInLine);
int len=buffer.length();
-// if (buffer[1].unicode() == '$') len --;
+// if (buffer[1].tqunicode() == '$') len --;
complete.remove(0,len-1);
- if (buffer[1].unicode() == '$') complete.append("(");
+ if (buffer[1].tqunicode() == '$') complete.append("(");
else complete.append(" ");
insert (complete);
completelistbox->hide();
@@ -567,7 +567,7 @@ void KviScriptEditorWidget::slotComplete(const QString &str)
}
KviScriptSyntaxHighlighter::KviScriptSyntaxHighlighter(KviScriptEditorWidget * pWidget)
-: QSyntaxHighlighter(pWidget)
+: TQSyntaxHighlighter(pWidget)
{
}
@@ -579,11 +579,11 @@ KviScriptSyntaxHighlighter::~KviScriptSyntaxHighlighter()
#define IN_LINE 2
#define IN_STRING 4
-int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endStateOfLastPara)
+int KviScriptSyntaxHighlighter::highlightParagraph(const TQString &text,int endStateOfLastPara)
{
- const QChar * pBuf = (const QChar *)text.ucs2();
- const QChar * c = pBuf;
+ const TQChar * pBuf = (const TQChar *)text.ucs2();
+ const TQChar * c = pBuf;
if(!c)return endStateOfLastPara;
if(endStateOfLastPara < 0)endStateOfLastPara = 0;
@@ -592,22 +592,22 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
bool bInComment = endStateOfLastPara & IN_COMMENT;
bool bInString = endStateOfLastPara & IN_STRING;
- const QChar * pBegin;
+ const TQChar * pBegin;
- while(c->unicode())
+ while(c->tqunicode())
{
if(bInComment)
{
pBegin = c;
- while(c->unicode() && (c->unicode() != '*'))c++;
- if(!c->unicode())
+ while(c->tqunicode() && (c->tqunicode() != '*'))c++;
+ if(!c->tqunicode())
{
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrComment);
return IN_COMMENT;
}
c++;
- if(c->unicode() == '/')
+ if(c->tqunicode() == '/')
{
// end of the comment!
c++;
@@ -620,14 +620,14 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
if(c->isSpace())
{
- while(c->unicode() && c->isSpace())c++;
- if(!c->unicode())continue;
+ while(c->tqunicode() && c->isSpace())c++;
+ if(!c->tqunicode())continue;
}
pBegin = c;
// this does not break the bNewCommand flag
- if((c->unicode() == '{') || (c->unicode() == '}'))
+ if((c->tqunicode() == '{') || (c->tqunicode() == '}'))
{
c++;
setFormat(pBegin - pBuf,1,g_fntNormal,g_clrBracket);
@@ -639,12 +639,12 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
{
bNewCommand = false;
- if(c->unicode() == '#')
+ if(c->tqunicode() == '#')
{
if(c > pBuf)
{
- const QChar * prev = c - 1;
- if((prev->unicode() == ']') || (prev->unicode() == '}'))
+ const TQChar * prev = c - 1;
+ if((prev->tqunicode() == ']') || (prev->tqunicode() == '}'))
{
// array or hash count
c++;
@@ -653,19 +653,19 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
}
}
// comment until the end of the line
- while(c->unicode())c++;
+ while(c->tqunicode())c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrComment);
continue;
}
- if(c->unicode() == '/')
+ if(c->tqunicode() == '/')
{
c++;
- if(c->unicode() == '/')
+ if(c->tqunicode() == '/')
{
- while(c->unicode())c++;
+ while(c->tqunicode())c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrComment);
continue;
- } else if(c->unicode() == '*')
+ } else if(c->tqunicode() == '*')
{
c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrComment);
@@ -674,40 +674,40 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
}
c--;
}
- if(c->unicode() && (c->isLetterOrNumber() || (c->unicode() == '_')))
+ if(c->tqunicode() && (c->isLetterOrNumber() || (c->tqunicode() == '_')))
{
c++;
- while(c->unicode() && (c->isLetterOrNumber() || (c->unicode() == '.') || (c->unicode() == '_') || (c->unicode() == ':')))c++;
+ while(c->tqunicode() && (c->isLetterOrNumber() || (c->tqunicode() == '.') || (c->tqunicode() == '_') || (c->tqunicode() == ':')))c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrKeyword);
// special processing for callbacks and magic commands
- if(pBegin->unicode() == 'e')
+ if(pBegin->tqunicode() == 'e')
{
if(c - pBegin == 4)
{
// might be "else"
- QString tmp(pBegin,4);
+ TQString tmp(pBegin,4);
if(tmp.lower() == "else")bNewCommand = true;
continue;
}
}
else
- if(pBegin->unicode() == 'f')
+ if(pBegin->tqunicode() == 'f')
{
if(c - pBegin == 8)
{
// might be "function"
- QString tmp(pBegin,8);
+ TQString tmp(pBegin,8);
if(tmp.lower() == "function")bNewCommand = true;
continue;
}
}
- if(pBegin->unicode() == 'i')
+ if(pBegin->tqunicode() == 'i')
{
if(c - pBegin == 8)
{
// might be "internal"
- QString tmp(pBegin,8);
+ TQString tmp(pBegin,8);
if(tmp.lower() == "internal")bNewCommand = true;
continue;
}
@@ -717,28 +717,28 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
continue;
}
}
- if(c->unicode() == '$')
+ if(c->tqunicode() == '$')
{
c++;
- if(c->unicode() == '$')
+ if(c->tqunicode() == '$')
{
c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrKeyword);
} else {
- while(c->unicode() && (c->isLetterOrNumber() || (c->unicode() == '.') || (c->unicode() == '_') || (c->unicode() == ':')))c++;
+ while(c->tqunicode() && (c->isLetterOrNumber() || (c->tqunicode() == '.') || (c->tqunicode() == '_') || (c->tqunicode() == ':')))c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrFunction);
}
continue;
}
- if(c->unicode() == '-')
+ if(c->tqunicode() == '-')
{
- QChar * pTmp =(QChar *) c;
+ TQChar * pTmp =(TQChar *) c;
c++;
- if(c->unicode() == '-') c++;
+ if(c->tqunicode() == '-') c++;
if(c->isLetter())
{
- while(c->unicode() && (c->isLetterOrNumber() || (c->unicode() == '_')))c++;
+ while(c->tqunicode() && (c->isLetterOrNumber() || (c->tqunicode() == '_')))c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrKeyword);
continue;
} else {
@@ -746,52 +746,52 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
}
}
- if(c->unicode() == '%')
+ if(c->tqunicode() == '%')
{
c++;
- if(c->unicode() && (c->isLetterOrNumber() || (c->unicode() == ':') || (c->unicode() == '_')))
+ if(c->tqunicode() && (c->isLetterOrNumber() || (c->tqunicode() == ':') || (c->tqunicode() == '_')))
{
- while(c->unicode() && (c->isLetterOrNumber() || (c->unicode() == ':') || (c->unicode() == '_')))c++;
+ while(c->tqunicode() && (c->isLetterOrNumber() || (c->tqunicode() == ':') || (c->tqunicode() == '_')))c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrVariable);
continue;
}
c--;
}
- if(!c->unicode())continue;
+ if(!c->tqunicode())continue;
- if(c->isLetterOrNumber() || c->unicode() == '_')
+ if(c->isLetterOrNumber() || c->tqunicode() == '_')
{
c++;
- while(c->unicode() && c->isLetterOrNumber() || (c->unicode() == '_'))c++;
+ while(c->tqunicode() && c->isLetterOrNumber() || (c->tqunicode() == '_'))c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrNormalText);
continue;
}
- if(c->unicode() == '\\')
+ if(c->tqunicode() == '\\')
{
c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrPunctuation);
// the next char is to be interpreted as normal text
pBegin = c;
- if(c->unicode() && (c->unicode() != '\n'))
+ if(c->tqunicode() && (c->tqunicode() != '\n'))
{
c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrNormalText);
continue;
}
- // this is never returned since Qt sux in string processing
+ // this is never returned since TQt sux in string processing
// it sets the newlines to spaces and we have no secure way to undestand that this was the end of a line
return IN_LINE;
}
- if(c->unicode() == '"')
+ if(c->tqunicode() == '"')
{
bInString = !bInString;
c++;
setFormat(pBegin - pBuf,c - pBegin,g_fntNormal,g_clrPunctuation);
continue;
- } else if(c->unicode() == ';')
+ } else if(c->tqunicode() == ';')
{
if(!bInString) bNewCommand = true; // the next will be a new command
}
@@ -806,13 +806,13 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
}
bool i=TRUE;
- QString szFind=((KviScriptEditorWidget *)textEdit())->m_szFind;
+ TQString szFind=((KviScriptEditorWidget *)textEdit())->m_szFind;
if (!szFind.isEmpty())
{
int index=0;
while (i)
{
- index=text.find(szFind,index,false);
+ index=text.tqfind(szFind,index,false);
if (index != -1)
{
setFormat(index,szFind.length(),g_clrFind);
@@ -838,17 +838,17 @@ int KviScriptSyntaxHighlighter::highlightParagraph(const QString &text,int endSt
//==30299== or possible Valgrind bug. This message is only shown 3 times.
-KviScriptEditorImplementation::KviScriptEditorImplementation(QWidget * par)
+KviScriptEditorImplementation::KviScriptEditorImplementation(TQWidget * par)
:KviScriptEditor(par)
{
if(g_pScriptEditorWindowList->isEmpty())loadOptions();
g_pScriptEditorWindowList->append(this);
- m_lastCursorPos=QPoint(0,0);
- QGridLayout * g = new QGridLayout(this,2,3,0,0);
+ m_lastCursorPos=TQPoint(0,0);
+ TQGridLayout * g = new TQGridLayout(this,2,3,0,0);
- m_pFindLineedit = new QLineEdit(" ",this);
+ m_pFindLineedit = new TQLineEdit(" ",this);
#ifndef COMPILE_USE_QT4
- m_pFindLineedit->setFrameStyle(QFrame::Sunken | QFrame::Panel);
+ m_pFindLineedit->setFrameStyle(TQFrame::Sunken | TQFrame::Panel);
#endif
m_pFindLineedit->setText("");
m_pFindLineedit->setPaletteForegroundColor(g_clrFind);
@@ -858,39 +858,39 @@ KviScriptEditorImplementation::KviScriptEditorImplementation(QWidget * par)
g->setRowStretch(0,1);
#ifdef COMPILE_USE_QT4
- QToolButton * b = new QToolButton(Qt::DownArrow,this,"dsa2");
+ TQToolButton * b = new TQToolButton(TQt::DownArrow,this,"dsa2");
#else
- QToolButton * b = new QToolButton(DownArrow,this);
+ TQToolButton * b = new TQToolButton(DownArrow,this);
#endif
b->setMinimumWidth(24);
g->addWidget(b,1,0);
KviTalPopupMenu * pop = new KviTalPopupMenu(b);
- pop->insertItem(__tr2qs_ctx("&Open...","editor"),this,SLOT(loadFromFile()));
- pop->insertItem(__tr2qs_ctx("&Save As...","editor"),this,SLOT(saveToFile()));
+ pop->insertItem(__tr2qs_ctx("&Open...","editor"),this,TQT_SLOT(loadFromFile()));
+ pop->insertItem(__tr2qs_ctx("&Save As...","editor"),this,TQT_SLOT(saveToFile()));
pop->insertSeparator();
- pop->insertItem(__tr2qs_ctx("&Configure Editor...","editor"),this,SLOT(configureColors()));
+ pop->insertItem(__tr2qs_ctx("&Configure Editor...","editor"),this,TQT_SLOT(configureColors()));
b->setPopup(pop);
b->setPopupDelay(1);
g->setColStretch(1,1);
g->setColStretch(2,10);
g->addWidget(m_pFindLineedit,1,2);
- QLabel *lab= new QLabel("find",this);
+ TQLabel *lab= new TQLabel("tqfind",this);
lab->setText(tr("Find"));
g->addWidget(lab,1,1);
- m_pRowColLabel = new QLabel("0",this);
- m_pRowColLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
+ m_pRowColLabel = new TQLabel("0",this);
+ m_pRowColLabel->setFrameStyle(TQFrame::Sunken | TQFrame::Panel);
m_pRowColLabel->setMinimumWidth(80);
g->addWidget(m_pRowColLabel,1,3);
- connect(m_pFindLineedit,SIGNAL(returnPressed()),m_pEditor,SLOT(slotFind()));
- connect(m_pFindLineedit,SIGNAL(returnPressed()),this,SLOT(slotFind()));
- connect(m_pEditor,SIGNAL(keyPressed()),this,SLOT(updateRowColLabel()));
- connect(m_pEditor,SIGNAL(textChanged()),this,SLOT(updateRowColLabel()));
- connect(m_pEditor,SIGNAL(selectionChanged()),this,SLOT(updateRowColLabel()));
- m_lastCursorPos = QPoint(-1,-1);
+ connect(m_pFindLineedit,TQT_SIGNAL(returnPressed()),m_pEditor,TQT_SLOT(slotFind()));
+ connect(m_pFindLineedit,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(slotFind()));
+ connect(m_pEditor,TQT_SIGNAL(keyPressed()),this,TQT_SLOT(updateRowColLabel()));
+ connect(m_pEditor,TQT_SIGNAL(textChanged()),this,TQT_SLOT(updateRowColLabel()));
+ connect(m_pEditor,TQT_SIGNAL(selectionChanged()),this,TQT_SLOT(updateRowColLabel()));
+ m_lastCursorPos = TQPoint(-1,-1);
}
KviScriptEditorImplementation::~KviScriptEditorImplementation()
@@ -901,22 +901,22 @@ KviScriptEditorImplementation::~KviScriptEditorImplementation()
void KviScriptEditorImplementation::loadOptions()
{
- QString tmp;
+ TQString tmp;
g_pEditorModulePointer->getDefaultConfigFileName(tmp);
KviConfig cfg(tmp,KviConfig::Read);
- g_clrBackground = cfg.readColorEntry("Background",QColor(0,0,0));;
- g_clrNormalText = cfg.readColorEntry("NormalText",QColor(100,255,0));
- g_clrBracket = cfg.readColorEntry("Bracket",QColor(255,0,0));
- g_clrComment = cfg.readColorEntry("Comment",QColor(0,120,0));
- g_clrFunction = cfg.readColorEntry("Function",QColor(255,255,0));
- g_clrKeyword = cfg.readColorEntry("Keyword",QColor(120,120,150));
- g_clrVariable = cfg.readColorEntry("Variable",QColor(200,200,200));
- g_clrPunctuation = cfg.readColorEntry("Punctuation",QColor(180,180,0));
- g_clrFind = cfg.readColorEntry("Find",QColor(255,0,0));
-
- g_fntNormal = cfg.readFontEntry("Font",QFont("Fixed",12));
+ g_clrBackground = cfg.readColorEntry("Background",TQColor(0,0,0));;
+ g_clrNormalText = cfg.readColorEntry("NormalText",TQColor(100,255,0));
+ g_clrBracket = cfg.readColorEntry("Bracket",TQColor(255,0,0));
+ g_clrComment = cfg.readColorEntry("Comment",TQColor(0,120,0));
+ g_clrFunction = cfg.readColorEntry("Function",TQColor(255,255,0));
+ g_clrKeyword = cfg.readColorEntry("Keyword",TQColor(120,120,150));
+ g_clrVariable = cfg.readColorEntry("Variable",TQColor(200,200,200));
+ g_clrPunctuation = cfg.readColorEntry("Punctuation",TQColor(180,180,0));
+ g_clrFind = cfg.readColorEntry("Find",TQColor(255,0,0));
+
+ g_fntNormal = cfg.readFontEntry("Font",TQFont("Fixed",12));
}
bool KviScriptEditorImplementation::isModified()
@@ -926,25 +926,25 @@ bool KviScriptEditorImplementation::isModified()
void KviScriptEditorImplementation::slotFind()
{
- emit find(m_pFindLineedit->text());
+ emit tqfind(m_pFindLineedit->text());
}
-void KviScriptEditorImplementation::slotNextFind(const QString &text)
+void KviScriptEditorImplementation::slotNextFind(const TQString &text)
{
-// emit nextFind(const QString &text);
+// emit nextFind(const TQString &text);
}void KviScriptEditorImplementation::slotInitFind()
{
emit initFind();
}
-void KviScriptEditorImplementation::slotReplaceAll(const QString &txt,const QString &txt1)
+void KviScriptEditorImplementation::slotReplaceAll(const TQString &txt,const TQString &txt1)
{
emit replaceAll(txt,txt1);
}
void KviScriptEditorImplementation::saveOptions()
{
- QString tmp;
+ TQString tmp;
g_pEditorModulePointer->getDefaultConfigFileName(tmp);
KviConfig cfg(tmp,KviConfig::Write);
@@ -968,7 +968,7 @@ void KviScriptEditorImplementation::setFocus()
-void KviScriptEditorImplementation::focusInEvent(QFocusEvent *)
+void KviScriptEditorImplementation::focusInEvent(TQFocusEvent *)
{
m_pEditor->setFocus();
}
@@ -976,38 +976,38 @@ void KviScriptEditorImplementation::focusInEvent(QFocusEvent *)
void KviScriptEditorImplementation::setEnabled(bool bEnabled)
{
- QWidget::setEnabled(bEnabled);
+ TQWidget::setEnabled(bEnabled);
m_pEditor->setEnabled(bEnabled);
m_pRowColLabel->setEnabled(bEnabled);
}
void KviScriptEditorImplementation::saveToFile()
{
- QString fName;
+ TQString fName;
if(KviFileDialog::askForSaveFileName(fName,
__tr2qs_ctx("Choose a Filename - KVIrc","editor"),
- QString::null,
- QString::null,false,true,true))
+ TQString(),
+ TQString(),false,true,true))
{
- QString buffer = m_pEditor->text();
+ TQString buffer = m_pEditor->text();
//if(tmp.isEmpty())tmp = "";
//KviStr buffer = tmp.utf8().data();
if(!KviFileUtils::writeFile(fName,buffer))
{
- QString tmp;
- QMessageBox::warning(this,
+ TQString tmp;
+ TQMessageBox::warning(this,
__tr2qs_ctx("Save Failed - KVIrc","editor"),
- KviQString::sprintf(tmp,__tr2qs_ctx("Can't open the file %s for writing.","editor"),&fName));
+ KviTQString::sprintf(tmp,__tr2qs_ctx("Can't open the file %s for writing.","editor"),&fName));
}
}
}
-void KviScriptEditorImplementation::setText(const KviQCString &txt)
+void KviScriptEditorImplementation::setText(const KviTQCString &txt)
{
m_pEditor->setText(txt.data());
#ifdef COMPILE_USE_QT4
- m_pEditor->setTextFormat(Qt::PlainText);
+ m_pEditor->setTextFormat(TQt::PlainText);
#else
m_pEditor->setTextFormat(KviTalTextEdit::PlainText);
#endif
@@ -1016,19 +1016,19 @@ void KviScriptEditorImplementation::setText(const KviQCString &txt)
updateRowColLabel();
}
-void KviScriptEditorImplementation::getText(KviQCString &txt)
+void KviScriptEditorImplementation::getText(KviTQCString &txt)
{
txt = m_pEditor->text();
}
-QLineEdit * KviScriptEditorImplementation::getFindlineedit()
+TQLineEdit * KviScriptEditorImplementation::getFindlineedit()
{
return m_pFindLineedit;
}
-void KviScriptEditorImplementation::setText(const QString &txt)
+void KviScriptEditorImplementation::setText(const TQString &txt)
{
m_pEditor->setText(txt);
#ifdef COMPILE_USE_QT4
- m_pEditor->setTextFormat(Qt::PlainText);
+ m_pEditor->setTextFormat(TQt::PlainText);
#else
m_pEditor->setTextFormat(KviTalTextEdit::PlainText);
#endif
@@ -1037,11 +1037,11 @@ void KviScriptEditorImplementation::setText(const QString &txt)
updateRowColLabel();
}
-void KviScriptEditorImplementation::getText(QString &txt)
+void KviScriptEditorImplementation::getText(TQString &txt)
{
txt = m_pEditor->text();
}
-void KviScriptEditorImplementation::setFindText(const QString &txt)
+void KviScriptEditorImplementation::setFindText(const TQString &txt)
{
m_pFindLineedit->setText(txt);
m_pEditor->slotFind();
@@ -1061,24 +1061,24 @@ void KviScriptEditorImplementation::updateRowColLabel()
m_pEditor->getCursorPosition(&iRow,&iCol);
if(iRow != m_lastCursorPos.x() || iCol != m_lastCursorPos.y())
{
- m_lastCursorPos = QPoint(iRow,iCol);
- QString tmp;
- KviQString::sprintf(tmp,__tr2qs_ctx("Row: %d Col: %d","editor"),iRow,iCol);
+ m_lastCursorPos = TQPoint(iRow,iCol);
+ TQString tmp;
+ KviTQString::sprintf(tmp,__tr2qs_ctx("Row: %d Col: %d","editor"),iRow,iCol);
m_pRowColLabel->setText(tmp);
}
}
-QPoint KviScriptEditorImplementation::getCursor()
+TQPoint KviScriptEditorImplementation::getCursor()
{
return m_lastCursorPos;
}
-void KviScriptEditorImplementation::setCursorPosition(QPoint pos)
+void KviScriptEditorImplementation::setCursorPosition(TQPoint pos)
{
m_pEditor->setCursorPosition(pos.x(),pos.y());
m_pEditor->setFocus();
m_pEditor->ensureCursorVisible();
- QString tmp;
- KviQString::sprintf(tmp,__tr2qs_ctx("Row: %d Col: %d","editor"),pos.x(),pos.y());
+ TQString tmp;
+ KviTQString::sprintf(tmp,__tr2qs_ctx("Row: %d Col: %d","editor"),pos.x(),pos.y());
m_pRowColLabel->setText(tmp);
m_lastCursorPos=pos;
@@ -1086,23 +1086,23 @@ void KviScriptEditorImplementation::setCursorPosition(QPoint pos)
void KviScriptEditorImplementation::loadFromFile()
{
- QString fName;
+ TQString fName;
if(KviFileDialog::askForOpenFileName(fName,
__tr2qs_ctx("Load Script File - KVIrc","editor"),
- QString::null,
- QString::null,false,true))
+ TQString(),
+ TQString(),false,true))
{
- QString buffer;
+ TQString buffer;
if(KviFileUtils::loadFile(fName,buffer))
{
m_pEditor->setText(buffer);
m_pEditor->moveCursor(KviTalTextEdit::MoveEnd,false);
updateRowColLabel();
} else {
- QString tmp;
- QMessageBox::warning(this,
+ TQString tmp;
+ TQMessageBox::warning(this,
__tr2qs_ctx("Open Failed - KVIrc","editor"),
- KviQString::sprintf(tmp,__tr2qs_ctx("Can't open the file %s for reading.","editor"),&fName));
+ KviTQString::sprintf(tmp,__tr2qs_ctx("Can't open the file %s for reading.","editor"),&fName));
}
}
}
@@ -1110,87 +1110,87 @@ void KviScriptEditorImplementation::loadFromFile()
void KviScriptEditorImplementation::configureColors()
{
KviScriptEditorWidgetColorOptions dlg(this);
- if(dlg.exec() == QDialog::Accepted)
+ if(dlg.exec() == TQDialog::Accepted)
{
m_pEditor->updateOptions();
saveOptions();
}
}
-KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog( QWidget* parent, const char* name)
- : QDialog( parent)
+KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog( TQWidget* tqparent, const char* name)
+ : TQDialog( tqparent)
{
- m_pParent=parent;
+ m_pParent=tqparent;
emit initFind();
- setPaletteForegroundColor( QColor( 0, 0, 0 ) );
- setPaletteBackgroundColor( QColor( 236, 233, 216 ) );
- QGridLayout *layout = new QGridLayout( this, 1, 1, 11, 6, "replace layout");
+ setPaletteForegroundColor( TQColor( 0, 0, 0 ) );
+ setPaletteBackgroundColor( TQColor( 236, 233, 216 ) );
+ TQGridLayout *tqlayout = new TQGridLayout( this, 1, 1, 11, 6, "replace tqlayout");
- m_pFindlineedit = new QLineEdit( this, "findlineedit" );
+ m_pFindlineedit = new TQLineEdit( this, "findlineedit" );
#ifndef COMPILE_USE_QT4
- m_pFindlineedit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, m_pFindlineedit->sizePolicy().hasHeightForWidth() ) );
- m_pFindlineedit->setFrameShape( QLineEdit::LineEditPanel );
- m_pFindlineedit->setFrameShadow( QLineEdit::Sunken );
+ m_pFindlineedit->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, m_pFindlineedit->sizePolicy().hasHeightForWidth() ) );
+ m_pFindlineedit->setFrameShape( TQLineEdit::LineEditPanel );
+ m_pFindlineedit->setFrameShadow( TQLineEdit::Sunken );
#endif
- layout->addMultiCellWidget( m_pFindlineedit, 2, 2, 1, 2 );
+ tqlayout->addMultiCellWidget( m_pFindlineedit, 2, 2, 1, 2 );
- m_pReplacelineedit = new QLineEdit( this, "replacelineedit" );
+ m_pReplacelineedit = new TQLineEdit( this, "replacelineedit" );
#ifndef COMPILE_USE_QT4
- m_pReplacelineedit->setFrameShape( QLineEdit::LineEditPanel );
- m_pReplacelineedit->setFrameShadow( QLineEdit::Sunken );
+ m_pReplacelineedit->setFrameShape( TQLineEdit::LineEditPanel );
+ m_pReplacelineedit->setFrameShadow( TQLineEdit::Sunken );
#endif
- layout->addMultiCellWidget( m_pReplacelineedit, 3, 3, 1, 2 );
+ tqlayout->addMultiCellWidget( m_pReplacelineedit, 3, 3, 1, 2 );
m_pFindlineedit->setFocus();
- QLabel *findlabel = new QLabel( this, "findlabel" );
+ TQLabel *findlabel = new TQLabel( this, "findlabel" );
findlabel->setText(tr("Word to Find"));
#ifndef COMPILE_USE_QT4
findlabel->setAutoResize(true);
#endif
- layout->addWidget( findlabel, 2, 0 );
+ tqlayout->addWidget( findlabel, 2, 0 );
- QLabel *replacelabel = new QLabel( this, "replacelabel" );
+ TQLabel *replacelabel = new TQLabel( this, "replacelabel" );
replacelabel->setText(tr("Replace with"));
#ifndef COMPILE_USE_QT4
replacelabel->setAutoResize(true);
#endif
- layout->addWidget( replacelabel, 3, 0 );
+ tqlayout->addWidget( replacelabel, 3, 0 );
- QPushButton *cancelbutton = new QPushButton( this, "cancelButton" );
+ TQPushButton *cancelbutton = new TQPushButton( this, "cancelButton" );
cancelbutton->setText(tr("&Cancel"));
- layout->addWidget( cancelbutton, 5, 2 );
+ tqlayout->addWidget( cancelbutton, 5, 2 );
- replacebutton = new QPushButton( this, "replacebutton" );
+ replacebutton = new TQPushButton( this, "replacebutton" );
replacebutton->setText(tr("&Replace"));
replacebutton->setEnabled( FALSE );
- layout->addWidget( replacebutton, 5, 0 );
+ tqlayout->addWidget( replacebutton, 5, 0 );
checkReplaceAll = new KviStyledCheckBox( this, "replaceAll" );
checkReplaceAll->setText(tr("&Replace in all Aliases"));
- layout->addWidget( checkReplaceAll, 4, 0 );
+ tqlayout->addWidget( checkReplaceAll, 4, 0 );
- findNext = new QPushButton(this, "findNext(WIP)" );
+ findNext = new TQPushButton(this, "findNext(WIP)" );
findNext->setText(tr("&Findnext"));
- layout->addWidget( findNext, 2, 3 );
+ tqlayout->addWidget( findNext, 2, 3 );
findNext->setEnabled(false);
- replace = new QPushButton(this, "replace" );
- replace->setText(tr("&Replace(WIP)"));
- layout->addWidget( replace, 3, 3 );
- replace->setEnabled(false);
+ tqreplace = new TQPushButton(this, "tqreplace" );
+ tqreplace->setText(tr("&Replace(WIP)"));
+ tqlayout->addWidget( tqreplace, 3, 3 );
+ tqreplace->setEnabled(false);
#ifndef COMPILE_USE_QT4
clearWState( WState_Polished );
setTabOrder(m_pFindlineedit,m_pReplacelineedit);
#endif
// signals and slots connections
- connect( replacebutton, SIGNAL( clicked() ), this, SLOT( slotReplace() ) );
- connect( findNext, SIGNAL( clicked() ),this,SLOT( slotNextFind()));
- connect( cancelbutton, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( m_pFindlineedit, SIGNAL( textChanged(const QString &)), this, SLOT( textChanged(const QString &)));
+ connect( replacebutton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotReplace() ) );
+ connect( findNext, TQT_SIGNAL( clicked() ),this,TQT_SLOT( slotNextFind()));
+ connect( cancelbutton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
+ connect( m_pFindlineedit, TQT_SIGNAL( textChanged(const TQString &)), this, TQT_SLOT( textChanged(const TQString &)));
}
@@ -1199,7 +1199,7 @@ KviScriptEditorReplaceDialog::~KviScriptEditorReplaceDialog()
{
}
-void KviScriptEditorReplaceDialog::textChanged(const QString &txt)
+void KviScriptEditorReplaceDialog::textChanged(const TQString &txt)
{
if (!txt.isEmpty()) replacebutton->setEnabled(TRUE);
else replacebutton->setEnabled(FALSE);
@@ -1207,9 +1207,9 @@ void KviScriptEditorReplaceDialog::textChanged(const QString &txt)
}
void KviScriptEditorReplaceDialog::slotReplace()
{
- QString txt=((KviScriptEditorWidget *)m_pParent)->text();
+ TQString txt=((KviScriptEditorWidget *)m_pParent)->text();
if (checkReplaceAll->isChecked()) emit replaceAll(m_pFindlineedit->text(),m_pReplacelineedit->text());
- txt.replace(m_pFindlineedit->text(),m_pReplacelineedit->text(),false);
+ txt.tqreplace(m_pFindlineedit->text(),m_pReplacelineedit->text(),false);
((KviScriptEditorWidget *)m_pParent)->setText(txt);
((KviScriptEditorWidget *)m_pParent)->setModified(true);
m_pFindlineedit->setText("");