summaryrefslogtreecommitdiffstats
path: root/src/kvirc/ui/kvi_input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvirc/ui/kvi_input.cpp')
-rw-r--r--src/kvirc/ui/kvi_input.cpp760
1 files changed, 378 insertions, 382 deletions
diff --git a/src/kvirc/ui/kvi_input.cpp b/src/kvirc/ui/kvi_input.cpp
index c0fbbd9e..28ac74f2 100644
--- a/src/kvirc/ui/kvi_input.cpp
+++ b/src/kvirc/ui/kvi_input.cpp
@@ -55,39 +55,35 @@
#include "kvi_texticonmanager.h"
#include "kvi_draganddrop.h"
-#include <qlabel.h>
+#include <tqlabel.h>
#include <ctype.h>
#include <stdlib.h>
-#include <qfiledialog.h>
+#include <tqfiledialog.h>
#include "kvi_tal_popupmenu.h"
-#include <qpainter.h>
-#include <qclipboard.h>
-#include <qstringlist.h>
+#include <tqpainter.h>
+#include <tqclipboard.h>
+#include <tqstringlist.h>
#include "kvi_pointerlist.h"
-#include <qapplication.h>
-#include <qclipboard.h>
-#include <qmessagebox.h>
+#include <tqapplication.h>
+#include <tqclipboard.h>
+#include <tqmessagebox.h>
#include "kvi_tal_hbox.h"
-#include <qlayout.h>
-#include <qstyle.h>
-#include <qevent.h>
+#include <tqlayout.h>
+#include <tqstyle.h>
+#include <tqevent.h>
#ifndef ACCEL_KEY
-#define ACCEL_KEY(k) "\t" + QString(QKeySequence( Qt::CTRL | Qt::Key_ ## k ))
+#define ACCEL_KEY(k) "\t" + TQString(TQKeySequence( TQt::CTRL | TQt::Key_ ## k ))
#endif
// FIXME: #warning "This hack is temporary...later remove it"
-#if QT_VERSION >= 300
- #ifndef QT_CLEAN_NAMESPACE
- #define QT_CLEAN_NAMESPACE
- #include <qcursor.h>
- #undef QT_CLEAN_NAMESPACE
- #else
- #include <qcursor.h>
- #endif
+#ifndef TQT_CLEAN_NAMESPACE
+ #define TQT_CLEAN_NAMESPACE
+ #include <tqcursor.h>
+ #undef TQT_CLEAN_NAMESPACE
#else
- #include <qcursor.h>
+ #include <tqcursor.h>
#endif
@@ -98,11 +94,11 @@ extern KviTextIconWindow * g_pTextIconWindow;
extern KviHistoryWindow * g_pHistoryWindow;
extern KviTalPopupMenu * g_pInputPopup;
-static QFontMetrics * g_pLastFontMetrics = 0;
+static TQFontMetrics * g_pLastFontMetrics = 0;
#ifdef COMPILE_PSEUDO_TRANSPARENCY
- extern QPixmap * g_pShadedChildGlobalDesktopBackground;
+ extern TQPixmap * g_pShadedChildGlobalDesktopBackground;
#endif
@@ -115,7 +111,7 @@ extern KviInputHistory * g_pInputHistory;
KviInputHistory::KviInputHistory()
{
- m_pStringList = new KviPointerList<QString>;
+ m_pStringList = new KviPointerList<TQString>;
m_pStringList->setAutoDelete(true);
}
@@ -124,7 +120,7 @@ KviInputHistory::~KviInputHistory()
delete m_pStringList;
}
-void KviInputHistory::add(QString * s)
+void KviInputHistory::add(TQString * s)
{
m_pStringList->insert(0,s);
if(m_pStringList->count() > KVI_INPUT_MAX_GLOBAL_HISTORY_ENTRIES)m_pStringList->removeLast();
@@ -143,8 +139,8 @@ void KviInputHistory::load(const char * filename)
for(int i=0;i<cnt;i++)
{
tmp.sprintf("S%d",i);
- QString entry = c.readQStringEntry(tmp.ptr(),"");
- if(!entry.isEmpty())add(new QString(entry));
+ TQString entry = c.readTQStringEntry(tmp.ptr(),"");
+ if(!entry.isEmpty())add(new TQString(entry));
}
}
@@ -158,7 +154,7 @@ void KviInputHistory::save(const char * filename)
KviStr tmp;
int idx = 0;
- for(QString * s = m_pStringList->first();s;s = m_pStringList->next())
+ for(TQString * s = m_pStringList->first();s;s = m_pStringList->next())
{
if(!s->isEmpty())
{
@@ -175,8 +171,8 @@ static int g_iInputFontCharWidth[256];
static bool g_bInputFontMetricsDirty = true;
-KviInputEditor::KviInputEditor(QWidget * par,KviWindow *wnd,KviUserListView * view)
-:QFrame(par,"input")
+KviInputEditor::KviInputEditor(TQWidget * par,KviWindow *wnd,KviUserListView * view)
+:TQFrame(par,"input")
{
m_pIconMenu = 0;
m_pInputParent = par;
@@ -201,7 +197,7 @@ KviInputEditor::KviInputEditor(QWidget * par,KviWindow *wnd,KviUserListView * vi
m_bUpdatesEnabled = true;
m_pKviWindow = wnd;
m_pUserListView = view;
- m_pHistory = new KviPointerList<QString>;
+ m_pHistory = new KviPointerList<TQString>;
m_pHistory->setAutoDelete(true);
m_bReadOnly = FALSE;
@@ -209,20 +205,20 @@ KviInputEditor::KviInputEditor(QWidget * par,KviWindow *wnd,KviUserListView * vi
#ifdef COMPILE_USE_QT4
setAutoFillBackground(false);
- setFocusPolicy(Qt::StrongFocus);
+ setFocusPolicy(TTQ_StrongFocus);
#else
- setBackgroundMode(Qt::NoBackground);
- setFocusPolicy(QWidget::StrongFocus);
+ setBackgroundMode(TQt::NoBackground);
+ setFocusPolicy(TQ_StrongFocus);
#endif
setAcceptDrops(true);
setFrameStyle( LineEditPanel );
setFrameShadow( Plain );
m_pIconMenu = new KviTalPopupMenu();
- connect(m_pIconMenu,SIGNAL(activated(int)),this,SLOT(iconPopupActivated(int)));
+ connect(m_pIconMenu,TQT_SIGNAL(activated(int)),this,TQT_SLOT(iconPopupActivated(int)));
#ifdef COMPILE_USE_QT4
- setCursor(Qt::IBeamCursor);
+ setCursor(TQt::IBeamCursor);
#else
setCursor(IbeamCursor);
#endif
@@ -238,19 +234,19 @@ KviInputEditor::~KviInputEditor()
killDragTimer();
}
-void KviInputEditor::recalcFontMetrics(QFontMetrics * pFm)
+void KviInputEditor::recalcFontMetrics(TQFontMetrics * pFm)
{
- QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
+ TQFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
unsigned short i;
for(i=1;i<32;i++)
{
- QChar c = getSubstituteChar(i);
+ TQChar c = getSubstituteChar(i);
g_iInputFontCharWidth[i] = fm.width(c);
- if(c != QChar(i))g_iInputFontCharWidth[i] += 4;
+ if(c != TQChar(i))g_iInputFontCharWidth[i] += 4;
}
for(i=32;i<256;i++)
{
- g_iInputFontCharWidth[i] = fm.width(QChar(i));
+ g_iInputFontCharWidth[i] = fm.width(TQChar(i));
}
g_bInputFontMetricsDirty = false;
}
@@ -261,7 +257,7 @@ void KviInputEditor::applyOptions()
update();
}
-void KviInputEditor::dragEnterEvent(QDragEnterEvent *e)
+void KviInputEditor::dragEnterEvent(TQDragEnterEvent *e)
{
if(KviUriDrag::canDecode(e))
{
@@ -273,23 +269,23 @@ void KviInputEditor::dragEnterEvent(QDragEnterEvent *e)
} else e->accept(false);
}
-void KviInputEditor::dropEvent(QDropEvent *e)
+void KviInputEditor::dropEvent(TQDropEvent *e)
{
- QStringList list;
+ TQStringList list;
if(KviUriDrag::decodeLocalFiles(e,list))
{
//debug("Local files decoded");
if(!list.isEmpty())
{
//debug("List not empty");
- QStringList::ConstIterator it = list.begin(); //kewl ! :)
+ TQStringList::ConstIterator it = list.begin(); //kewl ! :)
for( ; it != list.end(); ++it )
{
- QString tmp = *it; //wow :)
+ TQString tmp = *it; //wow :)
#ifndef COMPILE_ON_WINDOWS
if(tmp.length() > 0)
{
- if(tmp[0] != QChar('/'))tmp.prepend("/"); //HACK HACK HACK for Qt bug (?!?)
+ if(tmp[0] != TQChar('/'))tmp.prepend("/"); //HACK HACK HACK for TQt bug (?!?)
}
#endif
tmp.prepend("/PARSE \"");
@@ -303,27 +299,27 @@ void KviInputEditor::dropEvent(QDropEvent *e)
int KviInputEditor::heightHint() const
{
- return sizeHint().height();
+ return tqsizeHint().height();
}
-QSize KviInputEditor::sizeHint() const
+TQSize KviInputEditor::tqsizeHint() const
{
//grabbed from qlineedit.cpp
constPolish();
- QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
- int h = QMAX(fm.lineSpacing(), 14) + 2*2; /* innerMargin */
+ TQFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
+ int h = TQMAX(fm.lineSpacing(), 14) + 2*2; /* innerMargin */
int w = fm.width( 'x' ) * 17; // "some"
int m = frameWidth() * 2;
#ifdef COMPILE_USE_QT4
- QStyleOption opt;
+ TQStyleOption opt;
opt.initFrom(this);
- return (style()->sizeFromContents(QStyle::CT_LineEdit,&opt,
- QSize( w + m, h + m ).
- expandedTo(QApplication::globalStrut()),this));
+ return (style()->sizeFromContents(TQStyle::CT_LineEdit,&opt,
+ TQSize( w + m, h + m ).
+ expandedTo(TQApplication::globalStrut()),this));
#else
- return (style().sizeFromContents(QStyle::CT_LineEdit, this,
- QSize( w + m, h + m ).
- expandedTo(QApplication::globalStrut())));
+ return (tqstyle().tqsizeFromContents(TQStyle::CT_LineEdit, this,
+ TQSize( w + m, h + m ).
+ expandedTo(TQApplication::globalStrut())));
#endif
}
@@ -331,35 +327,35 @@ QSize KviInputEditor::sizeHint() const
#define KVI_INPUT_DEF_FORE 101
#ifdef COMPILE_USE_QT4
-void KviInputEditor::paintEvent(QPaintEvent *e)
+void KviInputEditor::paintEvent(TQPaintEvent *e)
{
- QPainter p(this);
+ TQPainter p(this);
SET_ANTI_ALIASING(p);
drawFrame(&p);
drawContents(&p);
}
#endif
-void KviInputEditor::drawContents(QPainter *p)
+void KviInputEditor::drawContents(TQPainter *p)
{
if(!isVisible())return;
- QRect rect = contentsRect();
+ TQRect rect = contentsRect();
int widgetWidth = rect.width();
int widgetHeight = rect.height();
KviDoubleBuffer doublebuffer(widgetWidth,widgetHeight);
- QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap();
+ TQPixmap * pDoubleBufferPixmap = doublebuffer.pixmap();
- QPainter pa(pDoubleBufferPixmap);
+ TQPainter pa(pDoubleBufferPixmap);
SET_ANTI_ALIASING(pa);
pa.setFont(KVI_OPTION_FONT(KviOption_fontInput));
- QFontMetrics fm(pa.fontMetrics());
+ TQFontMetrics fm(pa.fontMetrics());
if(!g_pLastFontMetrics)
- g_pLastFontMetrics = new QFontMetrics(pa.fontMetrics());
+ g_pLastFontMetrics = new TQFontMetrics(pa.fontMetrics());
if(g_bInputFontMetricsDirty)
recalcFontMetrics(&fm);
@@ -368,11 +364,11 @@ void KviInputEditor::drawContents(QPainter *p)
#ifdef COMPILE_PSEUDO_TRANSPARENCY
if(g_pShadedChildGlobalDesktopBackground)
{
- QPoint pnt = mapToGlobal(rect.topLeft());
+ TQPoint pnt = mapToGlobal(rect.topLeft());
pa.drawTiledPixmap(0,0,widgetWidth,widgetHeight,*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y());
} else {
#endif
- QPixmap *pix=KVI_OPTION_PIXMAP(KviOption_pixmapInputBackground).pixmap();
+ TQPixmap *pix=KVI_OPTION_PIXMAP(KviOption_pixmapInputBackground).pixmap();
pa.fillRect(0,0,widgetWidth,widgetHeight,KVI_OPTION_COLOR(KviOption_colorInputBackground));
if(pix)
@@ -415,9 +411,9 @@ void KviInputEditor::drawContents(QPainter *p)
int xLeft = xPositionFromCharIndex(fm,iSelStart,TRUE);
int xRight = xPositionFromCharIndex(fm,m_iSelectionEnd + 1,TRUE);
-// pa.setRasterOp(Qt::NotROP);
+// pa.setRasterOp(TQt::NotROP);
pa.fillRect(xLeft,frameWidth(),xRight - xLeft,widgetWidth,KVI_OPTION_COLOR(KviOption_colorInputSelectionBackground));
-// pa.setRasterOp(Qt::CopyROP);
+// pa.setRasterOp(TQt::CopyROP);
}
// When m_bIMComposing is true, the text between m_iIMStart and m_iIMStart+m_iIMLength should be highlighted to show that this is the active
@@ -433,9 +429,9 @@ void KviInputEditor::drawContents(QPainter *p)
if(iIMSelectionStart < m_iFirstVisibleChar) iIMSelectionStart = m_iFirstVisibleChar;
int xIMSelectionLeft = xPositionFromCharIndex(fm,iIMSelectionStart,TRUE);
int xIMSelectionRight = xPositionFromCharIndex(fm,iIMSelectionStart + m_iIMSelectionLength,TRUE);
-// pa.setRasterOp(Qt::NotROP);
+// pa.setRasterOp(TQt::NotROP);
pa.fillRect(xIMSelectionLeft,0,xIMSelectionRight - xIMSelectionLeft, widgetWidth,KVI_OPTION_COLOR(KviOption_colorInputSelectionBackground));
-// pa.setRasterOp(Qt::CopyROP);
+// pa.setRasterOp(TQt::CopyROP);
// highlight the IM selection
int iIMStart = m_iIMStart;
@@ -458,7 +454,7 @@ void KviInputEditor::drawContents(QPainter *p)
{
pa.setPen(KVI_OPTION_COLOR(KviOption_colorInputControl));
- QString s = getSubstituteChar(m_szTextBuffer[charIdx].unicode());
+ TQString s = getSubstituteChar(m_szTextBuffer[charIdx].tqunicode());
// the block width is 4 pixels more than the actual character
@@ -525,11 +521,11 @@ void KviInputEditor::drawContents(QPainter *p)
while(m_iBlockLen < m_iCursorPosition)
{
- QChar c = m_szTextBuffer.at(m_iBlockLen);
+ TQChar c = m_szTextBuffer.at(m_iBlockLen);
#ifdef COMPILE_USE_QT4
- m_iLastCursorXPosition+= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);
+ m_iLastCursorXPosition+= c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);
#else
- m_iLastCursorXPosition+= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c);
+ m_iLastCursorXPosition+= (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c);
#endif
m_iBlockLen++;
}
@@ -552,12 +548,12 @@ void KviInputEditor::drawContents(QPainter *p)
#endif
}
-void KviInputEditor::drawTextBlock(QPainter * pa,QFontMetrics & fm,int curXPos,int textBaseline,int charIdx,int len,bool bSelected)
+void KviInputEditor::drawTextBlock(TQPainter * pa,TQFontMetrics & fm,int curXPos,int textBaseline,int charIdx,int len,bool bSelected)
{
- QString tmp = m_szTextBuffer.mid(charIdx,len);
+ TQString tmp = m_szTextBuffer.mid(charIdx,len);
m_iBlockWidth = fm.width(tmp);
- QRect rect = contentsRect();
+ TQRect rect = contentsRect();
int widgetHeight = rect.height();
if(m_iCurFore == KVI_INPUT_DEF_FORE)
@@ -592,66 +588,66 @@ void KviInputEditor::drawTextBlock(QPainter * pa,QFontMetrics & fm,int curXPos,i
}
-QChar KviInputEditor::getSubstituteChar(unsigned short control_code)
+TQChar KviInputEditor::getSubstituteChar(unsigned short control_code)
{
switch(control_code)
{
case KVI_TEXT_COLOR:
- return QChar('K');
+ return TQChar('K');
break;
case KVI_TEXT_BOLD:
- return QChar('B');
+ return TQChar('B');
break;
case KVI_TEXT_RESET:
- return QChar('O');
+ return TQChar('O');
break;
case KVI_TEXT_REVERSE:
- return QChar('R');
+ return TQChar('R');
break;
case KVI_TEXT_UNDERLINE:
- return QChar('U');
+ return TQChar('U');
break;
case KVI_TEXT_CRYPTESCAPE:
- return QChar('P');
+ return TQChar('P');
break;
case KVI_TEXT_ICON:
- return QChar('I');
+ return TQChar('I');
break;
default:
- return QChar(control_code);
+ return TQChar(control_code);
break;
}
}
-void KviInputEditor::extractNextBlock(int idx,QFontMetrics & fm,int curXPos,int maxXPos)
+void KviInputEditor::extractNextBlock(int idx,TQFontMetrics & fm,int curXPos,int maxXPos)
{
m_iBlockLen = 0;
m_iBlockWidth = 0;
- QChar c = m_szTextBuffer[idx];
+ TQChar c = m_szTextBuffer[idx];
- if((c.unicode() > 32) ||
- ((c != QChar(KVI_TEXT_COLOR)) &&
- (c != QChar(KVI_TEXT_BOLD)) && (c != QChar(KVI_TEXT_UNDERLINE)) &&
- (c != QChar(KVI_TEXT_RESET)) && (c != QChar(KVI_TEXT_REVERSE)) &&
- (c != QChar(KVI_TEXT_CRYPTESCAPE)) && (c != QChar(KVI_TEXT_ICON))))
+ if((c.tqunicode() > 32) ||
+ ((c != TQChar(KVI_TEXT_COLOR)) &&
+ (c != TQChar(KVI_TEXT_BOLD)) && (c != TQChar(KVI_TEXT_UNDERLINE)) &&
+ (c != TQChar(KVI_TEXT_RESET)) && (c != TQChar(KVI_TEXT_REVERSE)) &&
+ (c != TQChar(KVI_TEXT_CRYPTESCAPE)) && (c != TQChar(KVI_TEXT_ICON))))
{
m_bControlBlock = false;
//Not a control code...run..
while((idx < ((int)(m_szTextBuffer.length()))) && (curXPos < maxXPos))
{
c = m_szTextBuffer[idx];
- if((c.unicode() > 32) ||
- ((c != QChar(KVI_TEXT_COLOR)) && (c != QChar(KVI_TEXT_BOLD)) &&
- (c != QChar(KVI_TEXT_UNDERLINE)) && (c != QChar(KVI_TEXT_RESET)) &&
- (c != QChar(KVI_TEXT_REVERSE)) && (c != QChar(KVI_TEXT_CRYPTESCAPE)) &&
- (c != QChar(KVI_TEXT_ICON))))
+ if((c.tqunicode() > 32) ||
+ ((c != TQChar(KVI_TEXT_COLOR)) && (c != TQChar(KVI_TEXT_BOLD)) &&
+ (c != TQChar(KVI_TEXT_UNDERLINE)) && (c != TQChar(KVI_TEXT_RESET)) &&
+ (c != TQChar(KVI_TEXT_REVERSE)) && (c != TQChar(KVI_TEXT_CRYPTESCAPE)) &&
+ (c != TQChar(KVI_TEXT_ICON))))
{
m_iBlockLen++;
#ifdef COMPILE_USE_QT4
- int xxx = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);;
+ int xxx = c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);;
#else
- int xxx = (c.unicode() < 256 ? g_iInputFontCharWidth[c.unicode()] : fm.width(c));
+ int xxx = (c.tqunicode() < 256 ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c));
#endif
m_iBlockWidth +=xxx;
curXPos +=xxx;
@@ -662,9 +658,9 @@ void KviInputEditor::extractNextBlock(int idx,QFontMetrics & fm,int curXPos,int
} else {
m_bControlBlock = true;
m_iBlockLen = 1;
- m_iBlockWidth = g_iInputFontCharWidth[c.unicode()];
+ m_iBlockWidth = g_iInputFontCharWidth[c.tqunicode()];
//Control code
- switch(c.unicode())
+ switch(c.tqunicode())
{
case KVI_TEXT_BOLD:
m_bCurBold = ! m_bCurBold;
@@ -720,7 +716,7 @@ void KviInputEditor::runUpToTheFirstVisibleChar()
register int idx = 0;
while(idx < m_iFirstVisibleChar)
{
- unsigned short c = m_szTextBuffer[idx].unicode();
+ unsigned short c = m_szTextBuffer[idx].tqunicode();
if(c < 32)
{
switch(c)
@@ -769,7 +765,7 @@ void KviInputEditor::runUpToTheFirstVisibleChar()
}
-void KviInputEditor::mousePressEvent(QMouseEvent *e)
+void KviInputEditor::mousePressEvent(TQMouseEvent *e)
{
if(e->button() & Qt::LeftButton)
{
@@ -779,8 +775,8 @@ void KviInputEditor::mousePressEvent(QMouseEvent *e)
if(anchorX > (width()-frameWidth()))m_iFirstVisibleChar++;
m_iSelectionAnchorChar = m_iCursorPosition;
selectOneChar(-1);
- //grabMouse(QCursor(crossCursor));
- repaintWithCursorOn();
+ //grabMouse(TQCursor(crossCursor));
+ tqrepaintWithCursorOn();
killDragTimer();
m_iDragTimer = startTimer(KVI_INPUT_DRAG_TIMEOUT);
@@ -791,17 +787,17 @@ void KviInputEditor::mousePressEvent(QMouseEvent *e)
//Popup menu
g_pInputPopup->clear();
- QString szClip;
+ TQString szClip;
- QClipboard * c = QApplication::clipboard();
+ TQClipboard * c = TQApplication::tqclipboard();
if(c)
{
- szClip = c->text(QClipboard::Clipboard);
+ szClip = c->text(TQClipboard::Clipboard);
#ifdef COMPILE_USE_QT4
- int occ = szClip.count(QChar('\n'));
+ int occ = szClip.count(TQChar('\n'));
#else
- int occ = szClip.contains(QChar('\n'));
+ int occ = szClip.tqcontains(TQChar('\n'));
#endif
if(!szClip.isEmpty())
@@ -811,29 +807,29 @@ void KviInputEditor::mousePressEvent(QMouseEvent *e)
szClip.truncate(60);
szClip.append("...");
}
- szClip.replace(QChar('&'),"&amp;");
- szClip.replace(QChar('<'),"&lt;");
- szClip.replace(QChar('>'),"&gt;");
- szClip.replace(QChar('\n'),"<br>");
+ szClip.tqreplace(TQChar('&'),"&amp;");
+ szClip.tqreplace(TQChar('<'),"&lt;");
+ szClip.tqreplace(TQChar('>'),"&gt;");
+ szClip.tqreplace(TQChar('\n'),"<br>");
- QString label = "<center><b>";
+ TQString label = "<center><b>";
label += __tr2qs("Clipboard");
label += ":</b><br>";
label += szClip;
label += "<br><b>";
- QString num;
+ TQString num;
num.setNum(occ);
label += num;
- label += QChar(' ');
+ label += TQChar(' ');
label += (occ == 1) ? __tr2qs("line break") : __tr2qs("line breaks");
label += "</b></center>";
- QLabel * l = new QLabel(label,g_pInputPopup);
- l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel);
+ TQLabel * l = new TQLabel(label,g_pInputPopup);
+ l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel);
l->setMargin(5);
- // FIXME: This does NOT work under Qt 4.x (they seem to consider it as bad UI design)
+ // FIXME: This does NOT work under TQt 4.x (they seem to consider it as bad UI design)
#ifndef COMPILE_USE_QT4
g_pInputPopup->insertItem(l);
#else
@@ -842,39 +838,39 @@ void KviInputEditor::mousePressEvent(QMouseEvent *e)
}
}
- int id = g_pInputPopup->insertItem(__tr2qs("Cu&t") + ACCEL_KEY(X),this,SLOT(cut()));
+ int id = g_pInputPopup->insertItem(__tr2qs("Cu&t") + ACCEL_KEY(X),this,TQT_SLOT(cut()));
g_pInputPopup->setItemEnabled(id,hasSelection());
- id = g_pInputPopup->insertItem(__tr2qs("&Copy") + ACCEL_KEY(C),this,SLOT(copyToClipboard()));
+ id = g_pInputPopup->insertItem(__tr2qs("&Copy") + ACCEL_KEY(C),this,TQT_SLOT(copyToClipboard()));
g_pInputPopup->setItemEnabled(id,hasSelection());
- id = g_pInputPopup->insertItem(__tr2qs("&Paste") + ACCEL_KEY(V),this,SLOT(pasteClipboardWithConfirmation()));
+ id = g_pInputPopup->insertItem(__tr2qs("&Paste") + ACCEL_KEY(V),this,TQT_SLOT(pasteClipboardWithConfirmation()));
g_pInputPopup->setItemEnabled(id,!szClip.isEmpty() && !m_bReadOnly);
- id = g_pInputPopup->insertItem(__tr2qs("Paste (Slowly)"),this,SLOT(pasteSlow()));
- if ((type == KVI_WINDOW_TYPE_CHANNEL) || (type == KVI_WINDOW_TYPE_QUERY) || (type == KVI_WINDOW_TYPE_DCCCHAT))
+ id = g_pInputPopup->insertItem(__tr2qs("Paste (Slowly)"),this,TQT_SLOT(pasteSlow()));
+ if ((type == KVI_WINDOW_TYPE_CHANNEL) || (type == KVI_WINDOW_TYPE_TQUERY) || (type == KVI_WINDOW_TYPE_DCCCHAT))
g_pInputPopup->setItemEnabled(id,!szClip.isEmpty() && !m_bReadOnly);
else
g_pInputPopup->setItemEnabled(id,false);
- id = g_pInputPopup->insertItem(__tr2qs("Paste &File") + ACCEL_KEY(F),this,SLOT(pasteFile()));
- if ((type != KVI_WINDOW_TYPE_CHANNEL) && (type != KVI_WINDOW_TYPE_QUERY) && (type != KVI_WINDOW_TYPE_DCCCHAT))
+ id = g_pInputPopup->insertItem(__tr2qs("Paste &File") + ACCEL_KEY(F),this,TQT_SLOT(pasteFile()));
+ if ((type != KVI_WINDOW_TYPE_CHANNEL) && (type != KVI_WINDOW_TYPE_TQUERY) && (type != KVI_WINDOW_TYPE_DCCCHAT))
g_pInputPopup->setItemEnabled(id,false);
else
g_pInputPopup->setItemEnabled(id,!m_bReadOnly);
if(m_bSpSlowFlag ==true)
{
- id = g_pInputPopup->insertItem(__tr2qs("Stop Paste"),this,SLOT(stopPasteSlow())); /*G&N 2005*/
+ id = g_pInputPopup->insertItem(__tr2qs("Stop Paste"),this,TQT_SLOT(stopPasteSlow())); /*G&N 2005*/
}
- id = g_pInputPopup->insertItem(__tr2qs("Clear"),this,SLOT(clear()));
+ id = g_pInputPopup->insertItem(__tr2qs("Clear"),this,TQT_SLOT(clear()));
g_pInputPopup->setItemEnabled(id,!m_szTextBuffer.isEmpty() && !m_bReadOnly);
g_pInputPopup->insertSeparator();
- id = g_pInputPopup->insertItem(__tr2qs("Select All"),this,SLOT(selectAll()));
+ id = g_pInputPopup->insertItem(__tr2qs("Select All"),this,TQT_SLOT(selectAll()));
g_pInputPopup->setItemEnabled(id,(!m_szTextBuffer.isEmpty()));
g_pInputPopup->insertSeparator();
m_pIconMenu->clear();
- KviPointerHashTable<QString,KviTextIcon> * d = g_pTextIconManager->textIconDict();
- KviPointerHashTableIterator<QString,KviTextIcon> it(*d);
- QStringList strList;
+ KviPointerHashTable<TQString,KviTextIcon> * d = g_pTextIconManager->textIconDict();
+ KviPointerHashTableIterator<TQString,KviTextIcon> it(*d);
+ TQStringList strList;
while(KviTextIcon * i = it.current())
{
strList.append(it.currentKey());
@@ -882,9 +878,9 @@ void KviInputEditor::mousePressEvent(QMouseEvent *e)
}
strList.sort();
KviTextIcon * icon;
- QPixmap *pix;
+ TQPixmap *pix;
- for(QStringList::Iterator iter = strList.begin(); iter != strList.end(); ++iter)
+ for(TQStringList::Iterator iter = strList.begin(); iter != strList.end(); ++iter)
{
icon=g_pTextIconManager->lookupTextIcon(*iter);
if(icon)
@@ -904,7 +900,7 @@ void KviInputEditor::iconPopupActivated(int id)
{
if(!m_bReadOnly)
{
- QString text = m_pIconMenu->text(id);
+ TQString text = m_pIconMenu->text(id);
if(!text.isEmpty())
{
text.prepend(KVI_TEXT_ICON);
@@ -922,24 +918,24 @@ bool KviInputEditor::hasSelection()
void KviInputEditor::copyToClipboard()
{
if(!hasSelection())return;
- QClipboard * c = QApplication::clipboard();
+ TQClipboard * c = TQApplication::tqclipboard();
if(!c)return;
- QString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
- c->setText(szTxt,QClipboard::Clipboard);
- repaintWithCursorOn();
+ TQString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
+ c->setText(szTxt,TQClipboard::Clipboard);
+ tqrepaintWithCursorOn();
}
void KviInputEditor::copyToSelection(bool bDonNotCopyToClipboard)
{
if(!hasSelection())return;
- QClipboard * c = QApplication::clipboard();
+ TQClipboard * c = TQApplication::tqclipboard();
if(!c)return;
- QString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
+ TQString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
if(c->supportsSelection())
- c->setText(szTxt,QClipboard::Selection);
+ c->setText(szTxt,TQClipboard::Selection);
else if(!bDonNotCopyToClipboard)
- c->setText(szTxt,QClipboard::Clipboard);
- repaintWithCursorOn();
+ c->setText(szTxt,TQClipboard::Clipboard);
+ tqrepaintWithCursorOn();
}
@@ -958,7 +954,7 @@ void KviInputEditor::moveCursorTo(int idx,bool bRepaint)
m_iCursorPosition = idx;
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar = m_iCursorPosition;
}
- if(bRepaint)repaintWithCursorOn();
+ if(bRepaint)tqrepaintWithCursorOn();
}
void KviInputEditor::removeSelected()
@@ -967,49 +963,49 @@ void KviInputEditor::removeSelected()
m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
moveCursorTo(m_iSelectionBegin,false);
selectOneChar(-1);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
void KviInputEditor::cut()
{
if(!hasSelection())return;
- QClipboard * c = QApplication::clipboard();
+ TQClipboard * c = TQApplication::tqclipboard();
if(!c)return;
- c->setText(m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1),QClipboard::Clipboard);
+ c->setText(m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1),TQClipboard::Clipboard);
m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
moveCursorTo(m_iSelectionBegin,false);
selectOneChar(-1);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
-void KviInputEditor::insertText(const QString &text)
+void KviInputEditor::insertText(const TQString &text)
{
- QString szText = text; // crop away constness
+ TQString szText = text; // crop away constness
if(szText.isEmpty())return;
//szText.replaceAll('\t'," "); //Do not paste tabs
- //szText.replace(QRegExp("\t")," "); // do not paste tabs
+ //szText.tqreplace(TQRegExp("\t")," "); // do not paste tabs
m_bUpdatesEnabled = false;
removeSelected();
m_bUpdatesEnabled = true;
- if(szText.find('\n') == -1)
+ if(szText.tqfind('\n') == -1)
{
m_szTextBuffer.insert(m_iCursorPosition,szText);
m_szTextBuffer.truncate(m_iMaxBufferSize);
moveCursorTo(m_iCursorPosition + szText.length());
} else {
//Multiline paste...do not execute commands here
- QString szBlock;
+ TQString szBlock;
while(!szText.isEmpty())
{
- int idx = szText.find('\n');
+ int idx = szText.tqfind('\n');
if(idx != -1)
{
szBlock = szText.left(idx);
- //else szBlock = QChar(KVI_TEXT_RESET);
+ //else szBlock = TQChar(KVI_TEXT_RESET);
szText.remove(0,idx+1);
} else {
szBlock = szText;
@@ -1021,7 +1017,7 @@ void KviInputEditor::insertText(const QString &text)
int pos = 0;
while((pos < ((int)(m_szTextBuffer.length()))) && (m_szTextBuffer[pos] < 33))pos++;
- if((pos < ((int)(m_szTextBuffer.length()))) && (m_szTextBuffer[pos] == QChar('/')))m_szTextBuffer.insert(pos,"\\");
+ if((pos < ((int)(m_szTextBuffer.length()))) && (m_szTextBuffer[pos] == TQChar('/')))m_szTextBuffer.insert(pos,"\\");
returnPressed(idx != -1);
}
@@ -1031,12 +1027,12 @@ void KviInputEditor::insertText(const QString &text)
// Replace (length) characters in the buffer from (start) with (text), returns
// the length of the text inserted (different from text.length() only if the
// buffer was truncated.
-int KviInputEditor::replaceSegment(int start, int length, const QString &text)
+int KviInputEditor::replaceSegment(int start, int length, const TQString &text)
{
m_szTextBuffer.remove(start, length);
m_szTextBuffer.insert(start, text);
m_szTextBuffer.truncate(m_iMaxBufferSize);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
int iInsertedLength = text.length();
int iMaxInsertedLength = m_iMaxBufferSize - start;
@@ -1046,11 +1042,11 @@ int KviInputEditor::replaceSegment(int start, int length, const QString &text)
void KviInputEditor::pasteClipboardWithConfirmation()
{
- QClipboard * c = QApplication::clipboard();
+ TQClipboard * c = TQApplication::tqclipboard();
if(!c)return;
- QString szText = c->text(QClipboard::Clipboard);
+ TQString szText = c->text(TQClipboard::Clipboard);
- if(szText.contains(QChar('\n')) > 0)
+ if(szText.tqcontains(TQChar('\n')) > 0)
{
if(m_pInputParent->inherits("KviInput"))
((KviInput*)(m_pInputParent))->multiLinePaste(szText);
@@ -1061,11 +1057,11 @@ void KviInputEditor::pasteClipboardWithConfirmation()
void KviInputEditor::pasteSelectionWithConfirmation()
{
- QClipboard * c = QApplication::clipboard();
+ TQClipboard * c = TQApplication::tqclipboard();
if(!c)return;
- QString szText = c->text(c->supportsSelection() ? QClipboard::Selection : QClipboard::Clipboard);
+ TQString szText = c->text(c->supportsSelection() ? TQClipboard::Selection : TQClipboard::Clipboard);
- if(szText.contains(QChar('\n')) > 0)
+ if(szText.tqcontains(TQChar('\n')) > 0)
{
if(m_pInputParent->inherits("KviInput"))
((KviInput*)(m_pInputParent))->multiLinePaste(szText);
@@ -1088,10 +1084,10 @@ void KviInputEditor::stopPasteSlow()
void KviInputEditor::pasteFile()
{
- QString stmp = QFileDialog::getOpenFileName("","",this,"Paste File", "Choose a file" );
+ TQString stmp = TQFileDialog::getOpenFileName("","",this,"Paste File", "Choose a file" );
if(stmp!="")
{
- QString stmp1 = "spaste.file " + stmp ;
+ TQString stmp1 = "spaste.file " + stmp ;
KviKvsScript::run(stmp1,g_pActiveWindow);
m_bSpSlowFlag = true;
}
@@ -1114,7 +1110,7 @@ void KviInputEditor::clear()
home();
}
-void KviInputEditor::setText(const QString text)
+void KviInputEditor::setText(const TQString text)
{
m_szTextBuffer = text;
m_szTextBuffer.truncate(m_iMaxBufferSize);
@@ -1122,7 +1118,7 @@ void KviInputEditor::setText(const QString text)
end();
}
-void KviInputEditor::mouseReleaseEvent(QMouseEvent *)
+void KviInputEditor::mouseReleaseEvent(TQMouseEvent *)
{
if(m_iDragTimer)
{
@@ -1143,7 +1139,7 @@ void KviInputEditor::killDragTimer()
}
}
-void KviInputEditor::timerEvent(QTimerEvent *e)
+void KviInputEditor::timerEvent(TQTimerEvent *e)
{
if(e->timerId() == m_iCursorTimer)
{
@@ -1164,7 +1160,7 @@ void KviInputEditor::handleDragSelection()
{
if(m_iSelectionAnchorChar == -1)return;
- QPoint pnt = mapFromGlobal(QCursor::pos());
+ TQPoint pnt = mapFromGlobal(TQCursor::pos());
if(pnt.x() <= 0)
@@ -1195,7 +1191,7 @@ void KviInputEditor::handleDragSelection()
m_iSelectionEnd = m_iSelectionAnchorChar-1;
}
}
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
void KviInputEditor::returnPressed(bool bRepaint)
@@ -1203,9 +1199,9 @@ void KviInputEditor::returnPressed(bool bRepaint)
if (!m_szTextBuffer.isEmpty() /* && (!m_pHistory->current() || m_szTextBuffer.compare(*(m_pHistory->current())))*/)
{
if(m_pInputParent->inherits("KviInput"))
- g_pInputHistory->add(new QString(m_szTextBuffer));
+ g_pInputHistory->add(new TQString(m_szTextBuffer));
- m_pHistory->insert(0,new QString(m_szTextBuffer));
+ m_pHistory->insert(0,new TQString(m_szTextBuffer));
}
__range_valid(KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES > 1); //ABSOLUTELY NEEDED, if not, pHist will be destroyed...
@@ -1213,16 +1209,16 @@ void KviInputEditor::returnPressed(bool bRepaint)
m_iCurHistoryIdx = -1;
- // FIXME: ALL THIS STUFF SHOULD BE CONVERTED TO QString
+ // FIXME: ALL THIS STUFF SHOULD BE CONVERTED TO TQString
/*
if(m_pInputParent->inherits("KviInput"))
{
- QString szBuffer(m_szTextBuffer);
+ TQString szBuffer(m_szTextBuffer);
m_szTextBuffer="";
selectOneChar(-1);
m_iCursorPosition = 0;
m_iFirstVisibleChar = 0;
- if(bRepaint)repaintWithCursorOn();
+ if(bRepaint)tqrepaintWithCursorOn();
KviUserInput::parse(szBuffer,m_pKviWindow);
} else {
*/
@@ -1233,7 +1229,7 @@ void KviInputEditor::returnPressed(bool bRepaint)
*/
}
-void KviInputEditor::focusInEvent(QFocusEvent *)
+void KviInputEditor::focusInEvent(TQFocusEvent *)
{
if(m_iCursorTimer==0)
{
@@ -1243,12 +1239,12 @@ void KviInputEditor::focusInEvent(QFocusEvent *)
}
// XIM handling...
#ifndef COMPILE_USE_QT4
- // THIS SEEMS TO BE GONE IN Qt4.x ? (even if the documentation states that it *should* be there)
+ // THIS SEEMS TO BE GONE IN TQt4.x ? (even if the documentation states that it *should* be there)
setMicroFocusHint(1,1,width() - 2,height() - 2,true,0);
#endif
}
-void KviInputEditor::focusOutEvent(QFocusEvent *)
+void KviInputEditor::focusOutEvent(TQFocusEvent *)
{
if(m_iCursorTimer)killTimer(m_iCursorTimer);
m_iCursorTimer = 0;
@@ -1295,7 +1291,7 @@ void KviInputEditor::internalCursorLeft(bool bShift)
// remember the text before and after the cursor at this point, and put them
// before and after the text inserted by IM in imEndEvent.
// hagabaka
-void KviInputEditor::imStartEvent(QIMEvent *e)
+void KviInputEditor::imStartEvent(TQIMEvent *e)
{
removeSelected();
m_iIMStart = m_iIMSelectionBegin = m_iCursorPosition;
@@ -1306,12 +1302,12 @@ void KviInputEditor::imStartEvent(QIMEvent *e)
// Whenever the IM's preedit changes, update the visuals and internal data. refer to <http://doc.trolltech.com/3.3/qimevent.html> */
// hagabaka
-void KviInputEditor::imComposeEvent(QIMEvent *e)
+void KviInputEditor::imComposeEvent(TQIMEvent *e)
{
// replace the old pre-edit string with e->text()
m_bUpdatesEnabled = false;
#ifdef COMPILE_USE_QT4
- // Qt 4.x ??????????
+ // TQt 4.x ??????????
m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->commitString());
// update selection inside the pre-edit
@@ -1329,20 +1325,20 @@ void KviInputEditor::imComposeEvent(QIMEvent *e)
#endif
- // repaint
+ // tqrepaint
m_bUpdatesEnabled = true;
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
e->accept();
}
// Input method is done; put its resulting text to where the preedit area was
// hagabaka
-void KviInputEditor::imEndEvent(QIMEvent *e)
+void KviInputEditor::imEndEvent(TQIMEvent *e)
{
// replace the preedit area with the IM result text
m_bUpdatesEnabled = false;
#ifdef COMPILE_USE_QT4
- // Qt 4.x ??????????
+ // TQt 4.x ??????????
m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->commitString());
#else
m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->text());
@@ -1351,9 +1347,9 @@ void KviInputEditor::imEndEvent(QIMEvent *e)
// move cursor to after the IM result text
moveCursorTo(m_iIMStart + m_iIMLength);
- // repaint
+ // tqrepaint
m_bUpdatesEnabled = true;
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
// reset data
m_bIMComposing = false;
@@ -1363,7 +1359,7 @@ void KviInputEditor::imEndEvent(QIMEvent *e)
// FIXME According to <http://www.kde.gr.jp/~asaki/how-to-support-input-method.html>, if the XIM
// style used is OverTheTop, code needs to be added in keyPressEvent handler */
// hagabaka
-void KviInputEditor::keyPressEvent(QKeyEvent *e)
+void KviInputEditor::keyPressEvent(TQKeyEvent *e)
{
// disable the keyPress handling when IM is in composition.
if(m_bIMComposing)
@@ -1375,9 +1371,9 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
if(!m_bReadOnly)
{
- if((e->key() == Qt::Key_Tab) || (e->key() == Qt::Key_BackTab))
+ if((e->key() == TQt::Key_Tab) || (e->key() == TQt::Key_BackTab))
{
- completion(e->state() & Qt::ShiftButton);
+ completion(e->state() & TQt::ShiftButton);
return;
} else {
m_bLastCompletionFinished=1;
@@ -1385,17 +1381,17 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
}
- if(e->key() == Qt::Key_Escape)
+ if(e->key() == TQt::Key_Escape)
{
emit escapePressed();
return;
}
- if((e->state() & Qt::AltButton) || (e->state() & Qt::ControlButton))
+ if((e->state() & TQt::AltButton) || (e->state() & TQt::ControlButton))
{
switch(e->key())
{
- case Qt::Key_Backspace:
+ case TQt::Key_Backspace:
if(m_pInputParent->inherits("KviInput"))
{
((KviInput*)(m_pInputParent))->multiLinePaste(m_szTextBuffer);
@@ -1409,50 +1405,50 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
//Make CtrlKey and CommandKey ("Apple") behave equally on MacOSX.
//This way typical X11 and Apple shortcuts can be used simultanously within the input line.
#ifndef Q_OS_MACX
- if(e->state() & Qt::ControlButton)
+ if(e->state() & TQt::ControlButton)
#else
- if((e->state() & Qt::ControlButton) || (e->state() & Qt::MetaButton))
+ if((e->state() & TQt::ControlButton) || (e->state() & TQt::MetaButton))
#endif
{
switch(e->key())
{
- case Qt::Key_Right:
+ case TQt::Key_Right:
if(m_iCursorPosition < ((int)(m_szTextBuffer.length())))
{
// skip whitespace
while(m_iCursorPosition < ((int)(m_szTextBuffer.length())))
{
if(!m_szTextBuffer.at(m_iCursorPosition).isSpace())break;
- internalCursorRight(e->state() & Qt::ShiftButton);
+ internalCursorRight(e->state() & TQt::ShiftButton);
}
// skip nonwhitespace
while(m_iCursorPosition < ((int)(m_szTextBuffer.length())))
{
if(m_szTextBuffer.at(m_iCursorPosition).isSpace())break;
- internalCursorRight(e->state() & Qt::ShiftButton);
+ internalCursorRight(e->state() & TQt::ShiftButton);
}
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
break;
- case Qt::Key_Left:
+ case TQt::Key_Left:
if(m_iCursorPosition > 0)
{
// skip whitespace
while(m_iCursorPosition > 0)
{
if(!m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break;
- internalCursorLeft(e->state() & Qt::ShiftButton);
+ internalCursorLeft(e->state() & TQt::ShiftButton);
}
// skip nonwhitespace
while(m_iCursorPosition > 0)
{
if(m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break;
- internalCursorLeft(e->state() & Qt::ShiftButton);
+ internalCursorLeft(e->state() & TQt::ShiftButton);
}
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
break;
- case Qt::Key_K:
+ case TQt::Key_K:
{
if(!m_bReadOnly)
{
@@ -1461,27 +1457,27 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
if(xPos > 24)xPos-=24;
if(!g_pColorWindow)g_pColorWindow = new KviColorWindow();
if(xPos+g_pColorWindow->width() > width())xPos = width()-(g_pColorWindow->width()+2);
- g_pColorWindow->move(mapToGlobal(QPoint(xPos,-35)));
+ g_pColorWindow->move(mapToGlobal(TQPoint(xPos,-35)));
g_pColorWindow->popup(this);
}
}
break;
- case Qt::Key_B:
+ case TQt::Key_B:
if(!m_bReadOnly) insertChar(KVI_TEXT_BOLD);
break;
- case Qt::Key_O:
+ case TQt::Key_O:
if(!m_bReadOnly) insertChar(KVI_TEXT_RESET);
break;
- case Qt::Key_U:
+ case TQt::Key_U:
if(!m_bReadOnly) insertChar(KVI_TEXT_UNDERLINE);
break;
- case Qt::Key_R:
+ case TQt::Key_R:
if(!m_bReadOnly) insertChar(KVI_TEXT_REVERSE);
break;
- case Qt::Key_P:
+ case TQt::Key_P:
if(!m_bReadOnly) insertChar(KVI_TEXT_CRYPTESCAPE); // DO NOT CRYPT THIS STUFF
break;
- case Qt::Key_I:
+ case TQt::Key_I:
{
if(!m_bReadOnly)
{
@@ -1490,22 +1486,22 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
if(xPos > 24)xPos-=24;
if(!g_pTextIconWindow)g_pTextIconWindow = new KviTextIconWindow();
if(xPos+g_pTextIconWindow->width() > width())xPos = width()-(g_pTextIconWindow->width()+2);
- g_pTextIconWindow->move(mapToGlobal(QPoint(xPos,-KVI_TEXTICON_WIN_HEIGHT)));
+ g_pTextIconWindow->move(mapToGlobal(TQPoint(xPos,-KVI_TEXTICON_WIN_HEIGHT)));
g_pTextIconWindow->popup(this);
}
}
break;
- case Qt::Key_C:
+ case TQt::Key_C:
copyToClipboard();
break;
- case Qt::Key_X:
+ case TQt::Key_X:
if(!m_bReadOnly) cut();
break;
- case Qt::Key_V:
+ case TQt::Key_V:
if(!m_bReadOnly) pasteClipboardWithConfirmation();
break;
- //case Qt::Key_Backspace:
- case Qt::Key_W:
+ //case TQt::Key_Backspace:
+ case TQt::Key_W:
if(m_iCursorPosition > 0 && !m_bReadOnly && !hasSelection())
{
// skip whitespace
@@ -1524,39 +1520,39 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
m_iCursorPosition--;
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--;
}
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
break;
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
if(KVI_OPTION_BOOL(KviOption_boolDisableInputHistory)) break;
if(m_pInputParent->inherits("KviInput"))
((KviInput*)(m_pInputParent))->historyButtonClicked();
break;
- case Qt::Key_F:
+ case TQt::Key_F:
if(m_pKviWindow)
if(m_pKviWindow->view())m_pKviWindow->view()->toggleToolWidget();
break;
- case Qt::Key_A:
+ case TQt::Key_A:
m_iSelectionBegin=0;
m_iSelectionEnd=m_szTextBuffer.length()-1;
m_iCursorPosition=m_szTextBuffer.length();
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
break;
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Enter:
if(m_pInputParent->inherits("KviInput"))
{
- QString szBuffer(m_szTextBuffer);
+ TQString szBuffer(m_szTextBuffer);
m_szTextBuffer="";
selectOneChar(-1);
m_iCursorPosition = 0;
m_iFirstVisibleChar = 0;
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
KviUserInput::parseNonCommand(szBuffer,m_pKviWindow);
if (!szBuffer.isEmpty())
{
- g_pInputHistory->add(new QString(szBuffer));
- m_pHistory->insert(0,new QString(szBuffer));
+ g_pInputHistory->add(new TQString(szBuffer));
+ m_pHistory->insert(0,new TQString(szBuffer));
}
__range_valid(KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES > 1); //ABSOLUTELY NEEDED, if not, pHist will be destroyed...
@@ -1572,10 +1568,10 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
return;
}
- if((e->state() & Qt::AltButton) && (e->state() & Qt::Keypad))
+ if((e->state() & TQt::AltButton) && (e->state() & TQt::Keypad))
{
- // Qt::Key_Meta seems to substitute Qt::Key_Alt on some keyboards
- if((e->key() == Qt::Key_Alt) || (e->key() == Qt::Key_Meta))
+ // TQt::Key_Meta seems to substitute TQt::Key_Alt on some keyboards
+ if((e->key() == TQt::Key_Alt) || (e->key() == TQt::Key_Meta))
{
m_szAltKeyCode = "";
return;
@@ -1592,20 +1588,20 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
return;
}
- if(e->state() & Qt::ShiftButton)
+ if(e->state() & TQt::ShiftButton)
{
switch(e->key())
{
- case Qt::Key_Insert:
+ case TQt::Key_Insert:
if(!m_bReadOnly) pasteClipboardWithConfirmation();
return;
break;
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
if(m_pKviWindow)
if(m_pKviWindow->view())m_pKviWindow->view()->prevLine();
return;
break;
- case Qt::Key_PageDown:
+ case TQt::Key_PageDown:
if(m_pKviWindow)
if(m_pKviWindow->view())m_pKviWindow->view()->nextLine();
return;
@@ -1615,21 +1611,21 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
switch(e->key())
{
- case Qt::Key_Right:
+ case TQt::Key_Right:
if(m_iCursorPosition < ((int)(m_szTextBuffer.length())))
{
- internalCursorRight(e->state() & Qt::ShiftButton);
- repaintWithCursorOn();
+ internalCursorRight(e->state() & TQt::ShiftButton);
+ tqrepaintWithCursorOn();
}
break;
- case Qt::Key_Left:
+ case TQt::Key_Left:
if(m_iCursorPosition > 0)
{
- internalCursorLeft(e->state() & Qt::ShiftButton);
- repaintWithCursorOn();
+ internalCursorLeft(e->state() & TQt::ShiftButton);
+ tqrepaintWithCursorOn();
}
break;
- case Qt::Key_Backspace:
+ case TQt::Key_Backspace:
if(!m_bReadOnly)
{
if(hasSelection() && (m_iSelectionEnd >= m_iCursorPosition-1) && (m_iSelectionBegin <= m_iCursorPosition))
@@ -1644,10 +1640,10 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--;
}
selectOneChar(-1);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
break;
- case Qt::Key_Delete:
+ case TQt::Key_Delete:
if(!m_bReadOnly)
{
if(hasSelection()) removeSelected();
@@ -1655,14 +1651,14 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
{
m_szTextBuffer.remove(m_iCursorPosition,1);
selectOneChar(-1);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
}
break;
- case Qt::Key_Home:
+ case TQt::Key_Home:
if(m_iCursorPosition > 0)
{
- if(e->state() & Qt::ShiftButton)
+ if(e->state() & TQt::ShiftButton)
{
if((m_iSelectionBegin == -1)&&(m_iSelectionEnd == -1))m_iSelectionEnd = m_iCursorPosition - 1;
m_iSelectionBegin = 0;
@@ -1672,8 +1668,8 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
home();
}
break;
- case Qt::Key_End://we should call it even the cursor is at the end for deselecting
- if(e->state() & Qt::ShiftButton)
+ case TQt::Key_End://we should call it even the cursor is at the end for deselecting
+ if(e->state() & TQt::ShiftButton)
{
if((m_iSelectionBegin == -1)&&(m_iSelectionEnd == -1))m_iSelectionBegin = m_iCursorPosition;
m_iSelectionEnd = m_szTextBuffer.length()-1;
@@ -1682,7 +1678,7 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
}
end();
break;
- case Qt::Key_Up:
+ case TQt::Key_Up:
if(!m_bReadOnly)
{
if(m_pHistory->count() > 0)
@@ -1706,7 +1702,7 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
}
}
break;
- case Qt::Key_Down:
+ case TQt::Key_Down:
if(!m_bReadOnly)
{
if(m_pHistory->count() > 0)
@@ -1730,20 +1726,20 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
}
}
break;
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
if(m_pKviWindow)
if(m_pKviWindow->view())m_pKviWindow->view()->prevPage();
break;
- case Qt::Key_PageDown:
+ case TQt::Key_PageDown:
if(m_pKviWindow)
if(m_pKviWindow->view())m_pKviWindow->view()->nextPage();
break;
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Enter:
returnPressed();
break;
- case Qt::Key_Alt:
- case Qt::Key_Meta:
+ case TQt::Key_Alt:
+ case TQt::Key_Meta:
m_szAltKeyCode = "";
break;
default:
@@ -1753,9 +1749,9 @@ void KviInputEditor::keyPressEvent(QKeyEvent *e)
}
}
-void KviInputEditor::keyReleaseEvent(QKeyEvent *e)
+void KviInputEditor::keyReleaseEvent(TQKeyEvent *e)
{
- if((e->key() == Qt::Key_Alt) || (e->key() == Qt::Key_Meta))
+ if((e->key() == TQt::Key_Alt) || (e->key() == TQt::Key_Meta))
{
if(m_szAltKeyCode.hasData())
{
@@ -1764,7 +1760,7 @@ void KviInputEditor::keyReleaseEvent(QKeyEvent *e)
if(bOk && ch != 0)
{
//debug("INSERTING CHAR %d",ch);
- insertChar(QChar(ch));
+ insertChar(TQChar(ch));
e->accept();
}
}
@@ -1773,7 +1769,7 @@ void KviInputEditor::keyReleaseEvent(QKeyEvent *e)
e->ignore();
}
-void KviInputEditor::getWordBeforeCursor(QString &buffer,bool * bIsFirstWordInLine)
+void KviInputEditor::getWordBeforeCursor(TQString &buffer,bool * bIsFirstWordInLine)
{
if(m_szTextBuffer.isEmpty() || m_iCursorPosition <= 0)
{
@@ -1783,10 +1779,10 @@ void KviInputEditor::getWordBeforeCursor(QString &buffer,bool * bIsFirstWordInLi
buffer = m_szTextBuffer.left(m_iCursorPosition);
- int idx = buffer.findRev(' ');
- int idx2 = buffer.findRev(','); // This is for comma separated lists...
- int idx3 = buffer.findRev('(');
- int idx4 = buffer.findRev('"');
+ int idx = buffer.tqfindRev(' ');
+ int idx2 = buffer.tqfindRev(','); // This is for comma separated lists...
+ int idx3 = buffer.tqfindRev('(');
+ int idx4 = buffer.tqfindRev('"');
if(idx2 > idx)idx = idx2;
if(idx3 > idx)idx = idx3;
if(idx4 > idx)idx = idx4;
@@ -1801,8 +1797,8 @@ void KviInputEditor::completion(bool bShift)
// On windows the KVI_PATH_SEPARATOR_CHARacters are breaking everything...
// Well.... :D
- QString word;
- QString match;
+ TQString word;
+ TQString match;
bool bFirstWordInLine;
getWordBeforeCursor(word,&bFirstWordInLine);
@@ -1812,18 +1808,18 @@ void KviInputEditor::completion(bool bShift)
else {
// this is standard nick completion continued
standardNickCompletion(bShift,word,bFirstWordInLine);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
return;
}
}
- KviPointerList<QString> tmp;
+ KviPointerList<TQString> tmp;
tmp.setAutoDelete(true);
bool bIsCommand = false;
bool bIsDir = false;
bool bIsNick = false;
- unsigned short uc = word[0].unicode();
+ unsigned short uc = word[0].tqunicode();
if(uc == '/')
{
@@ -1849,12 +1845,12 @@ void KviInputEditor::completion(bool bShift)
{
if(m_pKviWindow)
{
- if( (word.length()==1) && (m_pKviWindow->windowName()[0].unicode()==uc))
+ if( (word.length()==1) && (m_pKviWindow->windowName()[0].tqunicode()==uc))
{
match=m_pKviWindow->windowName();
match.append(" ");
replaceWordBeforeCursor(word,match,false);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
return;
} else {
if(m_pKviWindow->console())
@@ -1863,7 +1859,7 @@ void KviInputEditor::completion(bool bShift)
}
//FIXME: Complete also on irc:// starting strings, not only irc.?
- } else if(KviQString::equalCIN(word,"irc.",4))
+ } else if(KviTQString::equalCIN(word,"irc.",4))
{
// irc server name
if(m_pKviWindow)
@@ -1879,7 +1875,7 @@ void KviInputEditor::completion(bool bShift)
bIsNick = true;
} else {
standardNickCompletion(bShift,word,bFirstWordInLine);
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
return;
}
}
@@ -1902,8 +1898,8 @@ void KviInputEditor::completion(bool bShift)
}
}
} else {
- QString all;
- QString * s = tmp.first();
+ TQString all;
+ TQString * s = tmp.first();
match = *s;
int wLen = word.length();
for(;s;s = tmp.next())
@@ -1911,12 +1907,12 @@ void KviInputEditor::completion(bool bShift)
if(s->length() < match.length())
match.remove(s->length(),match.length() - s->length());
// All the matches here have length >= word.len()!!!
- const QChar * b1 = KviQString::nullTerminatedArray(*s) + wLen;
- const QChar * b2 = KviQString::nullTerminatedArray(match) + wLen;
- const QChar * c1 = b1;
- const QChar * c2 = b2;
- if(bIsDir)while(c1->unicode() && (c1->unicode() == c2->unicode()))c1++,c2++;
- else while(c1->unicode() && (c1->lower().unicode() == c2->lower().unicode()))c1++,c2++;
+ const TQChar * b1 = KviTQString::nullTerminatedArray(*s) + wLen;
+ const TQChar * b2 = KviTQString::nullTerminatedArray(match) + wLen;
+ const TQChar * c1 = b1;
+ const TQChar * c2 = b2;
+ if(bIsDir)while(c1->tqunicode() && (c1->tqunicode() == c2->tqunicode()))c1++,c2++;
+ else while(c1->tqunicode() && (c1->lower().tqunicode() == c2->lower().tqunicode()))c1++,c2++;
int len = wLen + (c1 - b1);
if(len < ((int)(match.length())))match.remove(len,match.length() - len);
if(!all.isEmpty())all.append(", ");
@@ -1937,10 +1933,10 @@ void KviInputEditor::completion(bool bShift)
replaceWordBeforeCursor(word,match,false);
}
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
-void KviInputEditor::replaceWordBeforeCursor(const QString &word,const QString &replacement,bool bRepaint)
+void KviInputEditor::replaceWordBeforeCursor(const TQString &word,const TQString &replacement,bool bRepaint)
{
selectOneChar(-1);
m_iCursorPosition -= word.length();
@@ -1948,16 +1944,16 @@ void KviInputEditor::replaceWordBeforeCursor(const QString &word,const QString &
m_szTextBuffer.insert(m_iCursorPosition,replacement);
m_szTextBuffer.truncate(m_iMaxBufferSize);
moveCursorTo(m_iCursorPosition + replacement.length());
- if(bRepaint)repaintWithCursorOn();
+ if(bRepaint)tqrepaintWithCursorOn();
}
-void KviInputEditor::standardNickCompletion(bool bAddMask,QString &word,bool bFirstWordInLine)
+void KviInputEditor::standardNickCompletion(bool bAddMask,TQString &word,bool bFirstWordInLine)
{
// FIXME: this could be really simplified...
if(!m_pUserListView)return;
selectOneChar(-1);
- QString buffer;
+ TQString buffer;
if(m_szLastCompletedNick.isEmpty())
{
// New completion session: we NEED sth to complete
@@ -2049,17 +2045,17 @@ void KviInputEditor::end()
moveRightFirstVisibleCharToShowCursor();
m_iCursorPosition++;
}
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
void KviInputEditor::home()
{
m_iFirstVisibleChar = 0;
m_iCursorPosition = 0;
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
-void KviInputEditor::insertChar(QChar c)
+void KviInputEditor::insertChar(TQChar c)
{
if(m_szTextBuffer.length() >= m_iMaxBufferSize)return;
@@ -2077,34 +2073,34 @@ void KviInputEditor::insertChar(QChar c)
m_szTextBuffer.insert(m_iCursorPosition,c);
moveRightFirstVisibleCharToShowCursor();
m_iCursorPosition++;
- repaintWithCursorOn();
+ tqrepaintWithCursorOn();
}
void KviInputEditor::moveRightFirstVisibleCharToShowCursor()
{
// :)
- QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
+ TQFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
- QChar c = m_szTextBuffer.at(m_iCursorPosition);
+ TQChar c = m_szTextBuffer.at(m_iCursorPosition);
#ifdef COMPILE_USE_QT4
- m_iLastCursorXPosition += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);;
+ m_iLastCursorXPosition += c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);;
#else
- m_iLastCursorXPosition += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c);
+ m_iLastCursorXPosition += (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c);
#endif
while(m_iLastCursorXPosition >= contentsRect().width()-2*KVI_INPUT_MARGIN)
{
c = m_szTextBuffer.at(m_iFirstVisibleChar);
#ifdef COMPILE_USE_QT4
- m_iLastCursorXPosition -= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);;
+ m_iLastCursorXPosition -= c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);;
#else
- m_iLastCursorXPosition -= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c);
+ m_iLastCursorXPosition -= (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c);
#endif
m_iFirstVisibleChar++;
}
}
-void KviInputEditor::repaintWithCursorOn()
+void KviInputEditor::tqrepaintWithCursorOn()
{
// :)
if(m_bUpdatesEnabled)
@@ -2126,14 +2122,14 @@ int KviInputEditor::charIndexFromXPosition(int xPos)
int curChar = m_iFirstVisibleChar;
int bufLen = m_szTextBuffer.length();
- QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
+ TQFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput));
while(curChar < bufLen)
{
- QChar c = m_szTextBuffer.at(curChar);
+ TQChar c = m_szTextBuffer.at(curChar);
#ifdef COMPILE_USE_QT4
- int widthCh = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);;
+ int widthCh = c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);;
#else
- int widthCh = (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c);
+ int widthCh = (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c);
#endif
if(xPos < (curXPos+(widthCh/2)))return curChar;
else if(xPos < (curXPos+widthCh))return (curChar+1);
@@ -2145,18 +2141,18 @@ int KviInputEditor::charIndexFromXPosition(int xPos)
return curChar;
}
-int KviInputEditor::xPositionFromCharIndex(QFontMetrics& fm,int chIdx,bool bContentsCoords)
+int KviInputEditor::xPositionFromCharIndex(TQFontMetrics& fm,int chIdx,bool bContentsCoords)
{
// FIXME: this could use fm.width(m_szTextBuffer,chIdx)
int curXPos = bContentsCoords ? KVI_INPUT_MARGIN : frameWidth()+KVI_INPUT_MARGIN;
int curChar = m_iFirstVisibleChar;
while(curChar < chIdx)
{
- QChar c = m_szTextBuffer.at(curChar);
+ TQChar c = m_szTextBuffer.at(curChar);
#ifdef COMPILE_USE_QT4
- curXPos += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);;
+ curXPos += c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);;
#else
- curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c);
+ curXPos += (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c);
#endif
curChar++;
}
@@ -2169,14 +2165,14 @@ int KviInputEditor::xPositionFromCharIndex(int chIdx,bool bContentsCoords)
int curXPos = bContentsCoords ? KVI_INPUT_MARGIN : frameWidth()+KVI_INPUT_MARGIN;
int curChar = m_iFirstVisibleChar;
//debug("%i",g_pLastFontMetrics);
- if(!g_pLastFontMetrics) g_pLastFontMetrics = new QFontMetrics(KVI_OPTION_FONT(KviOption_fontInput));
+ if(!g_pLastFontMetrics) g_pLastFontMetrics = new TQFontMetrics(KVI_OPTION_FONT(KviOption_fontInput));
while(curChar < chIdx)
{
- QChar c = m_szTextBuffer.at(curChar);
+ TQChar c = m_szTextBuffer.at(curChar);
#ifdef COMPILE_USE_QT4
- curXPos += c.unicode() < 32 ? g_pLastFontMetrics->width(getSubstituteChar(c.unicode())) + 3 : g_pLastFontMetrics->width(c);
+ curXPos += c.tqunicode() < 32 ? g_pLastFontMetrics->width(getSubstituteChar(c.tqunicode())) + 3 : g_pLastFontMetrics->width(c);
#else
- curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : g_pLastFontMetrics->width(c);
+ curXPos += (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : g_pLastFontMetrics->width(c);
#endif
curChar++;
}
@@ -2278,7 +2274,7 @@ int KviInputEditor::xPositionFromCharIndex(int chIdx,bool bContentsCoords)
Ctrl+Shift+CursorLeft: Moves the selection one word left<br>
Ctrl+Shift+CursorRight: Moves the selection one word right<br>
Tab: Nickname, function/command, or filename completion (see below)<br>
- Shift+Tab: Hostmask or function/command completion (see below)<br>
+ Shift+Tab: Hosttqmask or function/command completion (see below)<br>
Alt+&lt;numeric_sequence&gt;: Inserts the character by ASCII/Unicode code<br>
<example>
Alt+32: Inserts ASCII/Unicode character 32: ' ' (a space)
@@ -2313,11 +2309,11 @@ int KviInputEditor::xPositionFromCharIndex(int chIdx,bool bContentsCoords)
KviInput::KviInput(KviWindow *par,KviUserListView * view)
-: QWidget(par,"input")
+: TQWidget(par,"input")
{
- QBoxLayout* pLayout=new QHBoxLayout(this);
+ TQBoxLayout* pLayout=new TQHBoxLayout(this);
pLayout->setAutoAdd(true);
- pLayout->setDirection(QBoxLayout::RightToLeft);
+ pLayout->setDirection(TQBoxLayout::RightToLeft);
pLayout->setMargin(0);
pLayout->setSpacing(0);
@@ -2333,51 +2329,51 @@ KviInput::KviInput(KviWindow *par,KviUserListView * view)
if(g_pIconManager->getBigIcon("kvi_horizontal_left.png"))
m_pHideToolsButton->setPixmap(*(g_pIconManager->getBigIcon("kvi_horizontal_left.png")));
- connect(m_pHideToolsButton,SIGNAL(clicked()),this,SLOT(toggleToolButtons()));
+ connect(m_pHideToolsButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleToolButtons()));
m_pButtonContainer=new KviTalHBox(this);
m_pButtonContainer->setSpacing(0);
#ifdef COMPILE_USE_QT4
- m_pButtonContainer->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred));
-// if(m_pButtonContainer->layout())
-// m_pButtonContainer->layout()->setSizeConstraint(QLayout::SetMinimumSize);
+ m_pButtonContainer->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Preferred));
+// if(m_pButtonContainer->tqlayout())
+// m_pButtonContainer->tqlayout()->setSizeConstraint(TQLayout::SetMinimumSize);
#endif
m_pHistoryButton = new KviStyledToolButton(m_pButtonContainer,"historybutton");
m_pHistoryButton->setUsesBigPixmap(false);
//m_pHistoryButton->setUpdatesEnabled(TRUE); ???
- QIconSet is1;
+ TQIconSet is1;
if(!KVI_OPTION_BOOL(KviOption_boolDisableInputHistory))//G&N mar 2005
{
- is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME)),QIconSet::Small);
+ is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME)),TQIconSet::Small);
m_pHistoryButton->setIconSet(is1);
KviTalToolTip::add(m_pHistoryButton,__tr2qs("Show History<br>&lt;Ctrl+PageUp&gt;"));
- connect(m_pHistoryButton,SIGNAL(clicked()),this,SLOT(historyButtonClicked()));
+ connect(m_pHistoryButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(historyButtonClicked()));
}
else
{
- is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITSPLIT)),QIconSet::Small);
+ is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TQUITSPLIT)),TQIconSet::Small);
m_pHistoryButton->setIconSet(is1);
KviTalToolTip::add(m_pHistoryButton,__tr2qs("Input History Disabled"));
}
m_pIconButton = new KviStyledToolButton(m_pButtonContainer,"iconbutton");
m_pIconButton->setUsesBigPixmap(false);
- QIconSet is3;
- is3.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_BIGGRIN)),QIconSet::Small);
+ TQIconSet is3;
+ is3.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_BIGGRIN)),TQIconSet::Small);
m_pIconButton->setIconSet(is3);
KviTalToolTip::add(m_pIconButton,__tr2qs("Show Icons Popup<br>&lt;Ctrl+I&gt;<br>See also /help texticons"));
- connect(m_pIconButton,SIGNAL(clicked()),this,SLOT(iconButtonClicked()));
+ connect(m_pIconButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(iconButtonClicked()));
m_pCommandlineModeButton = new KviStyledToolButton(m_pButtonContainer,"commandlinemodebutton");
m_pCommandlineModeButton->setUsesBigPixmap(false);
m_pCommandlineModeButton->setToggleButton(true);
- QIconSet is0;
- is0.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SAYSMILE)),QIconSet::Small,QIconSet::Normal,QIconSet::On);
- is0.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SAYKVS)),QIconSet::Small,QIconSet::Normal,QIconSet::Off);
+ TQIconSet is0;
+ is0.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SAYSMILE)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::On);
+ is0.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SAYKVS)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::Off);
m_pCommandlineModeButton->setIconSet(is0);
KviTalToolTip::add(m_pCommandlineModeButton,__tr2qs("User friendly commandline mode<br>See also /help commandline"));
if(KVI_OPTION_BOOL(KviOption_boolCommandlineInUserFriendlyModeByDefault))
@@ -2387,22 +2383,22 @@ KviInput::KviInput(KviWindow *par,KviUserListView * view)
m_pMultiEditorButton = new KviStyledToolButton(m_pButtonContainer,"multieditorbutton");
m_pMultiEditorButton->setToggleButton(true);
m_pMultiEditorButton->setUsesBigPixmap(false);
- QIconSet is2;
- is2.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TERMINAL)),QIconSet::Small,QIconSet::Normal,QIconSet::On);
- is2.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TERMINAL)),QIconSet::Small,QIconSet::Normal,QIconSet::Off);
+ TQIconSet is2;
+ is2.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TERMINAL)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::On);
+ is2.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TERMINAL)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::Off);
m_pMultiEditorButton->setIconSet(is2);
- QString szTip = __tr2qs("Multi-line Editor<br>&lt;Alt+Backspace&gt;");
+ TQString szTip = __tr2qs("Multi-line Editor<br>&lt;Alt+Backspace&gt;");
szTip += " - &lt;Ctrl+Backspace&gt;";
KviTalToolTip::add(m_pMultiEditorButton,szTip);
- connect(m_pMultiEditorButton,SIGNAL(toggled(bool)),this,SLOT(multilineEditorButtonToggled(bool)));
+ connect(m_pMultiEditorButton,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(multilineEditorButtonToggled(bool)));
m_pInputEditor = new KviInputEditor(this,par,view);
- connect(m_pInputEditor,SIGNAL(enterPressed()),this,SLOT(inputEditorEnterPressed()));
+ connect(m_pInputEditor,TQT_SIGNAL(enterPressed()),this,TQT_SLOT(inputEditorEnterPressed()));
#ifdef COMPILE_USE_QT4
- m_pInputEditor->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Ignored));
+ m_pInputEditor->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Ignored));
#else
- m_pInputEditor->setSizePolicy(QSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored));
+ m_pInputEditor->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Ignored,TQSizePolicy::Ignored));
#endif
@@ -2434,7 +2430,7 @@ void KviInput::setButtonsHidden(bool bHidden)
if(!m_pHideToolsButton || !m_pButtonContainer) return;
if(bHidden==m_pButtonContainer->isHidden()) return;
m_pButtonContainer->setHidden(bHidden);
- QPixmap* pix= bHidden ?
+ TQPixmap* pix= bHidden ?
g_pIconManager->getBigIcon("kvi_horizontal_right.png") :
g_pIconManager->getBigIcon("kvi_horizontal_left.png");
if(pix)
@@ -2448,36 +2444,36 @@ void KviInput::toggleToolButtons()
void KviInput::inputEditorEnterPressed()
{
- QString szText = m_pInputEditor->text();
- KviUserInput::parse(szText,m_pWindow,QString::null,m_pCommandlineModeButton->isOn());
+ TQString szText = m_pInputEditor->text();
+ KviUserInput::parse(szText,m_pWindow,TQString(),m_pCommandlineModeButton->isOn());
m_pInputEditor->setText("");
}
-void KviInput::keyPressEvent(QKeyEvent *e)
+void KviInput::keyPressEvent(TQKeyEvent *e)
{
//debug("KviInput::keyPressEvent(key:%d,state:%d,text:%s)",e->key(),e->state(),e->text().isEmpty() ? "empty" : e->text().utf8().data());
- if((e->state() & Qt::ControlButton) || (e->state() & Qt::AltButton) || (e->state() & Qt::MetaButton))
+ if((e->state() & TQt::ControlButton) || (e->state() & TQt::AltButton) || (e->state() & TQt::MetaButton))
{
switch(e->key())
{
- case Qt::Key_Backspace:
+ case TQt::Key_Backspace:
//if(m_pMultiLineEditor)
multilineEditorButtonToggled(!m_pMultiLineEditor);
break;
}
}
- if(e->state() & Qt::ControlButton)
+ if(e->state() & TQt::ControlButton)
{
switch(e->key())
{
- case Qt::Key_Enter:
- case Qt::Key_Return:
+ case TQt::Key_Enter:
+ case TQt::Key_Return:
{
if(m_pMultiLineEditor)
{
- QString szText;
+ TQString szText;
m_pMultiLineEditor->getText(szText);
if(szText.isEmpty())return;
if(KVI_OPTION_BOOL(KviOption_boolWarnAboutPastingMultipleLines))
@@ -2489,11 +2485,11 @@ void KviInput::keyPressEvent(QKeyEvent *e)
#ifdef COMPILE_USE_QT4
int nLines = szText.count('\n') + 1;
#else
- int nLines = szText.contains('\n') + 1;
+ int nLines = szText.tqcontains('\n') + 1;
#endif
if(nLines > 15)
{
- int nRet = QMessageBox::question(
+ int nRet = TQMessageBox::question(
this,
__tr2qs("Confirm Multiline Message"),
__tr2qs("You're about to send a message with %1 lines of text.<br><br>" \
@@ -2501,7 +2497,7 @@ void KviInput::keyPressEvent(QKeyEvent *e)
"here to prevent you from accidentally sending<br>" \
"a really large message just because you didn't edit it<br>" \
"properly after pasting text from the clipboard.<br><br>" \
- "Do you want the message to be sent?").arg(nLines),
+ "Do you want the message to be sent?").tqarg(nLines),
__tr2qs("Yes, always"),
__tr2qs("Yes"),
__tr2qs("No"),
@@ -2521,19 +2517,19 @@ void KviInput::keyPressEvent(QKeyEvent *e)
}
}
}
- KviUserInput::parse(szText,m_pWindow,QString::null,m_pCommandlineModeButton->isOn());
+ KviUserInput::parse(szText,m_pWindow,TQString(),m_pCommandlineModeButton->isOn());
m_pMultiLineEditor->setText("");
}
}
break;
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
historyButtonClicked();
break;
}
}
}
-void KviInput::multiLinePaste(const QString &text)
+void KviInput::multiLinePaste(const TQString &text)
{
if(!m_pMultiLineEditor)multilineEditorButtonToggled(true);
m_pMultiLineEditor->setText(text);
@@ -2547,20 +2543,20 @@ void KviInput::multilineEditorButtonToggled(bool bOn)
KviScriptEditor::destroyInstance(m_pMultiLineEditor);
m_pMultiLineEditor = 0;
m_pInputEditor->show();
- m_pWindow->childrenTreeChanged(0);
+ m_pWindow->tqchildrenTreeChanged(0);
m_pInputEditor->setFocus();
m_pMultiEditorButton->setOn(false);
} else {
if(!bOn)return;
m_pMultiLineEditor = KviScriptEditor::createInstance(this);
- QString szText = __tr2qs("<Ctrl+Return>; submits, <Alt+Backspace>; hides this editor");
+ TQString szText = __tr2qs("<Ctrl+Return>; submits, <Alt+Backspace>; hides this editor");
// compatibility entry to avoid breaking translation just before a release... :)
- szText.replace("Alt+Backspace","Ctrl+Backspace");
+ szText.tqreplace("Alt+Backspace","Ctrl+Backspace");
m_pMultiLineEditor->setFindText(szText);
m_pMultiLineEditor->setFindLineeditReadOnly(true);
m_pInputEditor->hide();
m_pMultiLineEditor->show();
- m_pWindow->childrenTreeChanged(m_pMultiLineEditor);
+ m_pWindow->tqchildrenTreeChanged(m_pMultiLineEditor);
m_pMultiLineEditor->setFocus();
m_pMultiEditorButton->setOn(true);
}
@@ -2569,7 +2565,7 @@ void KviInput::multilineEditorButtonToggled(bool bOn)
void KviInput::iconButtonClicked()
{
if(!g_pTextIconWindow)g_pTextIconWindow = new KviTextIconWindow();
- QPoint pnt = m_pIconButton->mapToGlobal(QPoint(m_pIconButton->width(),0));
+ TQPoint pnt = m_pIconButton->mapToGlobal(TQPoint(m_pIconButton->width(),0));
g_pTextIconWindow->move(pnt.x()-g_pTextIconWindow->width(),pnt.y() - g_pTextIconWindow->height());
g_pTextIconWindow->popup(this,true);
}
@@ -2578,7 +2574,7 @@ void KviInput::historyButtonClicked()
{
if(!g_pHistoryWindow)g_pHistoryWindow = new KviHistoryWindow();
- QPoint pnt = mapToGlobal(QPoint(0,0));
+ TQPoint pnt = mapToGlobal(TQPoint(0,0));
g_pHistoryWindow->setGeometry(pnt.x(),pnt.y() - KVI_HISTORY_WIN_HEIGHT,width(),KVI_HISTORY_WIN_HEIGHT);
g_pHistoryWindow->popup(this);
@@ -2586,7 +2582,7 @@ void KviInput::historyButtonClicked()
#define BUTTON_WIDTH 20
-/*void KviInput::resizeEvent(QResizeEvent *e)
+/*void KviInput::resizeEvent(TQResizeEvent *e)
{
//m_pButtonContainer
m_pInputEditor->setGeometry(0,0,m_pButtonContainer->isVisible() ? width() - (BUTTON_WIDTH * 4)-10 : width() - 10,height());
@@ -2595,19 +2591,19 @@ void KviInput::historyButtonClicked()
m_pHideToolsButton->setGeometry(width() - 10,0,10,height());
- QWidget::resizeEvent(e);
+ TQWidget::resizeEvent(e);
}*/
void KviInput::setFocus()
{
- // redirect setFocus() to the right children
+ // redirect setFocus() to the right tqchildren
if(m_pMultiLineEditor)m_pMultiLineEditor->setFocus();
else m_pInputEditor->setFocus();
}
-void KviInput::focusInEvent(QFocusEvent * e)
+void KviInput::focusInEvent(TQFocusEvent * e)
{
- // if we get a focus in event , redirect the focus to the children
+ // if we get a focus in event , redirect the focus to the tqchildren
if(m_pMultiLineEditor)m_pMultiLineEditor->setFocus();
else m_pInputEditor->setFocus();
}
@@ -2618,9 +2614,9 @@ int KviInput::heightHint() const
return m_pMultiLineEditor ? 120 : m_pInputEditor->heightHint();
}
-void KviInput::setText(const QString &text)
+void KviInput::setText(const TQString &text)
{
- // FIXME: Latin1 -> QString ?
+ // FIXME: Latin1 -> TQString ?
if(m_pMultiLineEditor)m_pMultiLineEditor->setText(text);
else m_pInputEditor->setText(text);
}
@@ -2630,7 +2626,7 @@ void KviInput::insertChar(char c)
m_pInputEditor->insertChar(c);
}
-void KviInput::insertText(const QString& text)
+void KviInput::insertText(const TQString& text)
{
m_pInputEditor->insertText(text);
}
@@ -2642,34 +2638,34 @@ void KviInput::applyOptions()
if(KVI_OPTION_BOOL(KviOption_boolDisableInputHistory))//G&N mar 2005
{
- QIconSet is1;
- is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITSPLIT)),QIconSet::Small);
+ TQIconSet is1;
+ is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TQUITSPLIT)),TQIconSet::Small);
m_pHistoryButton->setIconSet(is1);
KviTalToolTip::add(m_pHistoryButton,__tr2qs("Input History Disabled"));
- m_pHistoryButton->disconnect(SIGNAL(clicked()));
+ m_pHistoryButton->disconnect(TQT_SIGNAL(clicked()));
}
if(!KVI_OPTION_BOOL(KviOption_boolDisableInputHistory))
{
- QIconSet is1;
- is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME)),QIconSet::Small);
+ TQIconSet is1;
+ is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME)),TQIconSet::Small);
m_pHistoryButton->setIconSet(is1);
KviTalToolTip::add(m_pHistoryButton,__tr2qs("Show History<br>&lt;Ctrl+PageUp&gt;"));
- connect(m_pHistoryButton,SIGNAL(clicked()),this,SLOT(historyButtonClicked()));
+ connect(m_pHistoryButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(historyButtonClicked()));
}
m_pInputEditor->applyOptions();
}
-void KviInput::setFocusProxy(QWidget *)
+void KviInput::setFocusProxy(TQWidget *)
{
/* do nothing */
}
-//const QString & KviInput::text()
-QString KviInput::text()
+//const TQString & KviInput::text()
+TQString KviInput::text()
{
- QString szText;
+ TQString szText;
if(m_pMultiLineEditor)
m_pMultiLineEditor->getText(szText);
else