summaryrefslogtreecommitdiffstats
path: root/src/modules/tip/libkvitip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/tip/libkvitip.cpp')
-rw-r--r--src/modules/tip/libkvitip.cpp68
1 files changed, 32 insertions, 36 deletions
diff --git a/src/modules/tip/libkvitip.cpp b/src/modules/tip/libkvitip.cpp
index ac23d914..9fa3cc76 100644
--- a/src/modules/tip/libkvitip.cpp
+++ b/src/modules/tip/libkvitip.cpp
@@ -31,21 +31,21 @@
#include "kvi_options.h"
#include "kvi_fileutils.h"
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#ifdef COMPILE_USE_QT4
-#include <q3simplerichtext.h>
-#include <QDesktopWidget>
-#include <QCloseEvent>
+#include <tq3simplerichtext.h>
+#include <TQDesktopWidget>
+#include <TQCloseEvent>
#define KviTalSimpleRichText Q3SimpleRichText
#else
-#include <qsimplerichtext.h>
-#define KviTalSimpleRichText QSimpleRichText
+#include <tqsimplerichtext.h>
+#define KviTalSimpleRichText TQSimpleRichText
#endif
-#include <qfont.h>
-#include <qtextcodec.h>
-#include <qpainter.h>
+#include <tqfont.h>
+#include <tqtextcodec.h>
+#include <tqpainter.h>
KviTipWindow * g_pTipWindow = 0;
@@ -58,18 +58,18 @@ KviTipWindow * g_pTipWindow = 0;
#define KVI_TIP_WINDOW_SPACING 2
-KviTipFrame::KviTipFrame(QWidget * par)
-: QFrame(par)
+KviTipFrame::KviTipFrame(TQWidget * par)
+: TQFrame(par)
{
KviStr buffer;
g_pApp->findImage(buffer,"kvi_tip.png");
- m_pTipPixmap = new QPixmap(buffer.ptr());
+ m_pTipPixmap = new TQPixmap(TQString(buffer.ptr()));
#ifdef COMPILE_USE_QT4
- setBackgroundMode(Qt::NoBackground);
+ setBackgroundMode(TQt::NoBackground);
#else
- setBackgroundMode(QWidget::NoBackground);
+ setBackgroundMode(TQWidget::NoBackground);
#endif
- setFrameStyle(QFrame::Sunken | QFrame::WinPanel);
+ setFrameStyle(TQFrame::Sunken | TQFrame::WinPanel);
}
KviTipFrame::~KviTipFrame()
@@ -77,7 +77,7 @@ KviTipFrame::~KviTipFrame()
delete m_pTipPixmap;
}
-void KviTipFrame::setText(const QString &text)
+void KviTipFrame::setText(const TQString &text)
{
m_szText = "<center><font color=\"#FFFFFF\">";
m_szText += text;
@@ -85,29 +85,25 @@ void KviTipFrame::setText(const QString &text)
update();
}
-void KviTipFrame::drawContents(QPainter *p)
+void KviTipFrame::drawContents(TQPainter *p)
{
- p->fillRect(contentsRect(),QColor(0,0,0));
+ p->fillRect(contentsRect(),TQColor(0,0,0));
p->drawPixmap(5,(height() - m_pTipPixmap->height()) / 2,*m_pTipPixmap);
- QFont f = QFont();
- f.setStyleHint(QFont::SansSerif);
+ TQFont f = TQFont();
+ f.setStyleHint(TQFont::SansSerif);
f.setPointSize(12);
KviTalSimpleRichText doc(m_szText,f);
doc.setWidth(width() - 80);
- QRegion reg(0,0,1000,20000);
+ TQRegion reg(0,0,1000,20000);
-#if QT_VERSION >= 300
- doc.draw(p,70,10,reg,colorGroup());
-#else
- doc.draw(p,70,10,reg,palette());
-#endif
+ doc.draw(p,70,10,reg,tqcolorGroup());
}
KviTipWindow::KviTipWindow()
-: QWidget(0,"kvirc_tip_window" /*,WStyle_Customize | WStyle_Title | WStyle_DialogBorder | WStyle_StaysOnTop*/ )
+: TQWidget(0,"kvirc_tip_window" /*,WStyle_Customize | WStyle_Title | WStyle_DialogBorder | WStyle_StaysOnTop*/ )
{
m_pConfig = 0;
@@ -119,23 +115,23 @@ KviTipWindow::KviTipWindow()
KVI_TIP_WINDOW_WIDTH - KVI_TIP_WINDOW_DOUBLE_BORDER,
KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_DOUBLE_BORDER + KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_SPACING));
- QPushButton * pb = new QPushButton(">>",this);
+ TQPushButton * pb = new TQPushButton(">>",this);
pb->setGeometry(
KVI_TIP_WINDOW_WIDTH - ((KVI_TIP_WINDOW_BUTTON_WIDTH * 2)+ KVI_TIP_WINDOW_BORDER + KVI_TIP_WINDOW_SPACING),
KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER),
KVI_TIP_WINDOW_BUTTON_WIDTH,
KVI_TIP_WINDOW_BUTTON_HEIGHT
);
- connect(pb,SIGNAL(clicked()),this,SLOT(nextTip()));
+ connect(pb,TQT_SIGNAL(clicked()),this,TQT_SLOT(nextTip()));
- pb = new QPushButton(__tr2qs("Close"),this);
+ pb = new TQPushButton(__tr2qs("Close"),this);
pb->setGeometry(
KVI_TIP_WINDOW_WIDTH - (KVI_TIP_WINDOW_BUTTON_WIDTH + KVI_TIP_WINDOW_BORDER),
KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER),
KVI_TIP_WINDOW_BUTTON_WIDTH,
KVI_TIP_WINDOW_BUTTON_HEIGHT
);
- connect(pb,SIGNAL(clicked()),this,SLOT(close()));
+ connect(pb,TQT_SIGNAL(clicked()),this,TQT_SLOT(close()));
pb->setDefault(true);
m_pShowAtStartupCheck = new KviStyledCheckBox(__tr2qs("Show at startup"),this);
@@ -217,7 +213,7 @@ void KviTipWindow::nextTip()
KviStr tmp(KviStr::Format,"%u",uNextTip);
- QString szTip = m_pConfig->readEntry(tmp.ptr(),__tr2qs("<b>Can't find any tip... :(</b>"));
+ TQString szTip = m_pConfig->readEntry(tmp.ptr(),__tr2qs("<b>Can't find any tip... :(</b>"));
//debug("REDECODED=%s",szTip.utf8().data());
@@ -228,15 +224,15 @@ void KviTipWindow::nextTip()
m_pTipFrame->setText(szTip);
}
-void KviTipWindow::showEvent(QShowEvent *e)
+void KviTipWindow::showEvent(TQShowEvent *e)
{
resize(KVI_TIP_WINDOW_WIDTH,KVI_TIP_WINDOW_HEIGHT);
move((g_pApp->desktop()->width() - KVI_TIP_WINDOW_WIDTH) / 2,
(g_pApp->desktop()->height() - KVI_TIP_WINDOW_HEIGHT) / 2);
- QWidget::showEvent(e);
+ TQWidget::showEvent(e);
}
-void KviTipWindow::closeEvent(QCloseEvent *e)
+void KviTipWindow::closeEvent(TQCloseEvent *e)
{
e->ignore();
delete this;
@@ -267,7 +263,7 @@ void KviTipWindow::closeEvent(QCloseEvent *e)
static bool tip_kvs_cmd_open(KviKvsModuleCommandCall * c)
{
- QString szTipfilename;
+ TQString szTipfilename;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szTipfilename)
KVSM_PARAMETERS_END(c)