summaryrefslogtreecommitdiffstats
path: root/kicker-applets/ktimemon/timemon.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kicker-applets/ktimemon/timemon.cc
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz
tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/ktimemon/timemon.cc')
-rw-r--r--kicker-applets/ktimemon/timemon.cc58
1 files changed, 29 insertions, 29 deletions
diff --git a/kicker-applets/ktimemon/timemon.cc b/kicker-applets/ktimemon/timemon.cc
index 84b0e79..75164f4 100644
--- a/kicker-applets/ktimemon/timemon.cc
+++ b/kicker-applets/ktimemon/timemon.cc
@@ -13,9 +13,9 @@
#include <config.h>
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qtooltip.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
+#include <tqtooltip.h>
#include <kconfig.h>
#include <kglobal.h>
@@ -35,7 +35,7 @@
extern "C"
{
- KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile)
+ KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("ktimemon");
KTimeMon *mon = new KTimeMon(configFile, KPanelApplet::Normal,
@@ -85,7 +85,7 @@ void KTimeMon::preferences()
// Repaint the object; get the current sample and paint the bar graphs
// correspondingly. Use a pixmap to minimise flicker.
-void KTimeMon::paintEvent(QPaintEvent *)
+void KTimeMon::paintEvent(TQPaintEvent *)
{
int w, h, x, y, b, r;
@@ -103,10 +103,10 @@ void KTimeMon::paintEvent(QPaintEvent *)
else
s.fill(h);
- QPixmap pixmap(width(), height());
+ TQPixmap pixmap(width(), height());
pixmap.fill(this, 0, 0);
- QPainter painter(&pixmap);
+ TQPainter painter(&pixmap);
b = r / 3; // bar width
r -= b;
@@ -152,7 +152,7 @@ void KTimeMon::paintEvent(QPaintEvent *)
// -----------------------------------------------------------------------------
// Draw part of a bar, depending on the bar orientation.
-void KTimeMon::paintRect(int x, int y, int w, int h, QColor c, QPainter *p)
+void KTimeMon::paintRect(int x, int y, int w, int h, TQColor c, TQPainter *p)
{
if (vertical)
p->fillRect(x, y, w, h, c);
@@ -161,7 +161,7 @@ void KTimeMon::paintRect(int x, int y, int w, int h, QColor c, QPainter *p)
}
// Show a tool-tip with some status information.
-void KTimeMon::maybeTip(const QPoint& p)
+void KTimeMon::maybeTip(const TQPoint& p)
{
if (sample == 0) return; // no associated sample...
if(!rect().contains(p)) return;
@@ -170,7 +170,7 @@ void KTimeMon::maybeTip(const QPoint& p)
int idle = 100 - s.kernel - s.user - s.nice;
if ( idle < 0 )
idle = 0;
- QString str = i18n("cpu: %1% idle\nmem: %2 MB %3% free\nswap: %4 MB %5% free")
+ TQString str = i18n("cpu: %1% idle\nmem: %2 MB %3% free\nswap: %4 MB %5% free")
.arg(idle)
.arg(KGlobal::locale()->formatNumber(s.used/100.*s.mtotal, 0))
.arg(100-s.used)
@@ -184,9 +184,9 @@ void KTimeMon::maybeTip(const QPoint& p)
// Initialise the member variables, read the configuration data base,
// set up the widget, and start the timer.
-KTimeMon::KTimeMon(const QString& configFile, Type type, int actions,
- QWidget *parent, const char *name)
- : KPanelApplet(configFile, type, actions, parent, name, WRepaintNoErase), QToolTip(this),
+KTimeMon::KTimeMon(const TQString& configFile, Type type, int actions,
+ TQWidget *parent, const char *name)
+ : KPanelApplet(configFile, type, actions, parent, name, WRepaintNoErase), TQToolTip(this),
configDialog(0), bgProcess(0),
kernelColour("red1"), userColour("blue"),
niceColour("yellow"), iowaitColour("darkgreen"),
@@ -207,12 +207,12 @@ KTimeMon::KTimeMon(const QString& configFile, Type type, int actions,
swapScale = conf->readUnsignedNumEntry("SwapScale", 5);
ctxScale = conf->readUnsignedNumEntry("ContextScale", 300);
for (int i = 0; i < MAX_MOUSE_ACTIONS; i++) {
- QString n;
+ TQString n;
n.setNum(i);
mouseAction[i] = (MouseAction)
- conf->readUnsignedNumEntry(QString("MouseAction")+n, mouseAction[i]);
- mouseActionCommand[i] = conf->readPathEntry(QString("MouseActionCommand")+n);
+ conf->readUnsignedNumEntry(TQString("MouseAction")+n, mouseAction[i]);
+ mouseActionCommand[i] = conf->readPathEntry(TQString("MouseActionCommand")+n);
}
conf->setGroup("Interface");
@@ -229,13 +229,13 @@ KTimeMon::KTimeMon(const QString& configFile, Type type, int actions,
vertical = conf->readBoolEntry("Vertical", true);
- timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(timeout()));
+ timer = new TQTimer(this);
+ connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout()));
timer->start(interval);
sample = new KSample(this, autoScale, pageScale, swapScale, ctxScale);
- QString aboutmsg = i18n("KTimeMon for KDE\n"
+ TQString aboutmsg = i18n("KTimeMon for KDE\n"
"Maintained by Dirk A. Mueller <dmuell@gmx.net>\n"
"Written by M. Maierhofer (m.maierhofer@tees.ac.uk)\n"
"Based on timemon by H. Maierhofer");
@@ -249,8 +249,8 @@ KTimeMon::KTimeMon(const QString& configFile, Type type, int actions,
menu->insertSeparator();
menu->insertItem(SmallIcon( "help" ), i18n("Help"), hmenu->menu(), 1);
- menu->connectItem(2, this, SLOT(configure()));
- menu->connectItem(4, this, SLOT(orientation()));
+ menu->connectItem(2, this, TQT_SLOT(configure()));
+ menu->connectItem(4, this, TQT_SLOT(orientation()));
menu->setCheckable(true);
@@ -328,11 +328,11 @@ void KTimeMon::writeConfiguration()
conf->writeEntry("ContextScale", ctxScale);
conf->writeEntry("WidgetSize", size());
for (int i = 0; i < MAX_MOUSE_ACTIONS; i++) {
- QString n;
+ TQString n;
n.setNum(i);
- conf->writeEntry(QString("MouseAction")+n, (unsigned)mouseAction[i]);
- conf->writePathEntry(QString("MouseActionCommand")+n, mouseActionCommand[i]);
+ conf->writeEntry(TQString("MouseAction")+n, (unsigned)mouseAction[i]);
+ conf->writePathEntry(TQString("MouseActionCommand")+n, mouseActionCommand[i]);
}
conf->sync();
}
@@ -380,7 +380,7 @@ void KTimeMon::orientation()
}
// Pop up the menu when the appropriate button has been pressed.
-void KTimeMon::mousePressEvent(QMouseEvent *event)
+void KTimeMon::mousePressEvent(TQMouseEvent *event)
{
if (event == 0) return;
@@ -413,8 +413,8 @@ void KTimeMon::runCommand(int index)
bgProcess = new KShellProcess;
*bgProcess << mouseActionCommand[index];
- connect(bgProcess, SIGNAL(receivedStderr(KProcess *, char *, int)),
- this, SLOT(commandStderr(KProcess *, char *, int)));
+ connect(bgProcess, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)),
+ this, TQT_SLOT(commandStderr(KProcess *, char *, int)));
bgProcess->start(KProcess::DontCare, KProcess::Stderr);
}
@@ -423,10 +423,10 @@ void KTimeMon::runCommand(int index)
void KTimeMon::commandStderr(KProcess * /*proc*/, char *buffer, int /*length*/)
{
- QString msgbuf;
+ TQString msgbuf;
msgbuf = i18n("Got diagnostic output from child command:\n\n");
- msgbuf += QString::fromLocal8Bit(buffer);
+ msgbuf += TQString::fromLocal8Bit(buffer);
KMessageBox::information(this, msgbuf);
}