summaryrefslogtreecommitdiffstats
path: root/kcpuload/kcpuload/statpopup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kcpuload/kcpuload/statpopup.cpp')
-rw-r--r--kcpuload/kcpuload/statpopup.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/kcpuload/kcpuload/statpopup.cpp b/kcpuload/kcpuload/statpopup.cpp
index f6e7b4d..7740444 100644
--- a/kcpuload/kcpuload/statpopup.cpp
+++ b/kcpuload/kcpuload/statpopup.cpp
@@ -16,8 +16,8 @@
#include "statdock.h"
#include "statpopup.h"
-#include <qpainter.h>
-#include <qtimer.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <kcolordialog.h>
#include <kconfig.h>
@@ -34,7 +34,7 @@
#define TEXT_EXPANSION_HORIZONTAL 10
#define TEXT_EXPANSION_VERTICAL 3
-const QColor StatPopup::colorBorder(0, 0, 0);
+const TQColor StatPopup::colorBorder(0, 0, 0);
StatPopup::Reading::Reading() :
dock(0),
@@ -54,14 +54,14 @@ void StatPopup::Reading::Init(int which, StatPopup* popup)
color = popup->defaultDockColor(which);
color = popup->config->readColorEntry(colorid, &color);
- actColor = new KAction(i18n("Color (%1)...").arg(popup->dockName(which)),
- "color", 0, popup, SLOT(selectColor()), popup->coll, colorid);
+ actColor = new KAction(i18n("Color (%1)...").tqarg(popup->dockName(which)),
+ "color", 0, TQT_TQOBJECT(popup), TQT_SLOT(selectColor()), popup->coll, colorid);
}
-StatPopup::StatPopup(bool useSupportSplit, QWidget *parent, const char *name) :
- QWidget(parent, name, Qt::WStyle_Customize | Qt::WStyle_NoBorder |
- Qt::WStyle_StaysOnTop | Qt::WDestructiveClose | Qt::WType_TopLevel),
+StatPopup::StatPopup(bool useSupportSplit, TQWidget *tqparent, const char *name) :
+ TQWidget(tqparent, name, TQt::WStyle_Customize | TQt::WStyle_NoBorder |
+ TQt::WStyle_StaysOnTop | TQt::WDestructiveClose | TQt::WType_TopLevel),
supportSplit(useSupportSplit) {
// Window management.
KWin::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
@@ -83,8 +83,8 @@ StatPopup::StatPopup(bool useSupportSplit, QWidget *parent, const char *name) :
coll = new KActionCollection(this);
// Set up a timer for our periodic updates.
- timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(takeReading()));
+ timer = new TQTimer(this);
+ connect(timer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(takeReading()));
}
StatPopup::~StatPopup() {
@@ -292,20 +292,20 @@ void StatPopup::setGrid(bool set) {
void StatPopup::selectColor() {
// which color?
int whichDock;
- if (sscanf(sender()->name(), "Color%d", &whichDock) != 1)
+ if (sscanf(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name(), "Color%d", &whichDock) != 1)
return;
if (whichDock < 0 || whichDock >= r.size())
return;
if (r[whichDock].dock) {
- QColor ans;
+ TQColor ans;
if (KColorDialog::getColor(ans, r[whichDock].color, firstDock()) ==
- QDialog::Accepted) {
+ TQDialog::Accepted) {
r[whichDock].color = ans;
r[whichDock].dock->setColor(ans);
config->setGroup("General Options");
- QString n;
+ TQString n;
n.sprintf("Color%d", whichDock);
config->writeEntry(n, ans);
config->sync();
@@ -334,57 +334,57 @@ void StatPopup::setupActions() {
bVal = config->readBoolEntry("Active", true);
actActive = new KToggleAction(i18n("&Active"), 0, coll, "active");
actActive->setChecked(bVal);
- connect(actActive, SIGNAL(toggled(bool)), this, SLOT(setActive(bool)));
+ connect(actActive, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(setActive(bool)));
actClearHistory = new KAction(i18n("&Clear"), "editdelete", 0,
- this, SLOT(clearHistory()), coll, "clear");
+ TQT_TQOBJECT(this), TQT_SLOT(clearHistory()), coll, "clear");
speed = config->readNumEntry("Speed", DEFAULT_SPEED);
actSpeed = new KAction(i18n("&Speed..."), "speedarrow", 0,
- this, SLOT(selectSpeed()), coll, "speed");
+ TQT_TQOBJECT(this), TQT_SLOT(selectSpeed()), coll, "speed");
if (supportSplit) {
bVal = config->readBoolEntry("Split", true);
actSplit = new IconToggleAction(i18n("Sp&lit Graph"), "split",
i18n("Graph Sp&litting Enabled"), "spliton", 0, coll, "split");
actSplit->setChecked(bVal);
- connect(actSplit, SIGNAL(toggled(bool)), this, SLOT(setSplit(bool)));
+ connect(actSplit, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(setSplit(bool)));
}
fillStyle = config->readNumEntry("StyleID", StatDock::fillShaded);
actFillLines = new IconToggleAction(i18n("&Lines"), "lines", "lineson", 0,
- this, SLOT(setFillLines()), coll, "filllines");
+ TQT_TQOBJECT(this), TQT_SLOT(setFillLines()), coll, "filllines");
actFillLines->setChecked(fillStyle == StatDock::fillLines);
actFillBars = new IconToggleAction(i18n("&Bars"), "bars", "barson", 0,
- this, SLOT(setFillBars()), coll, "fillbars");
+ TQT_TQOBJECT(this), TQT_SLOT(setFillBars()), coll, "fillbars");
actFillBars->setChecked(fillStyle == StatDock::fillBars);
actFillShaded = new IconToggleAction(i18n("&Shaded"), "shaded", "shadedon",
- 0, this, SLOT(setFillShaded()), coll, "fillshaded");
+ 0, TQT_TQOBJECT(this), TQT_SLOT(setFillShaded()), coll, "fillshaded");
actFillShaded->setChecked(fillStyle == StatDock::fillShaded);
bVal = config->readBoolEntry("Soft", false);
actSoft = new IconToggleAction(i18n("So&ft Curves"), "soft",
i18n("So&ft Curves Enabled"), "softon", 0, coll, "soft");
actSoft->setChecked(bVal);
- connect(actSoft, SIGNAL(toggled(bool)), this, SLOT(setSoft(bool)));
+ connect(actSoft, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(setSoft(bool)));
bVal = config->readBoolEntry("Labelled", true);
actLabelled= new IconToggleAction(i18n("Show &Labels"), "labels",
i18n("&Labels Enabled"), "labelson", 0, coll, "labelled");
actLabelled->setChecked(bVal);
- connect(actLabelled, SIGNAL(toggled(bool)), this, SLOT(setLabelled(bool)));
+ connect(actLabelled, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(setLabelled(bool)));
bVal = config->readBoolEntry("Grid", true);
actGrid = new IconToggleAction(i18n("Show &Grid"), "grid",
i18n("&Grid Enabled"), "gridon", 0, coll, "grid");
actGrid->setChecked(bVal);
- connect(actGrid, SIGNAL(toggled(bool)), this, SLOT(setGrid(bool)));
+ connect(actGrid, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(setGrid(bool)));
setupCustomActions();
}
-void StatPopup::paintEvent(QPaintEvent*) {
- QPainter p(this);
+void StatPopup::paintEvent(TQPaintEvent*) {
+ TQPainter p(this);
// Draw the border.
p.setPen(colorBorder);
@@ -399,12 +399,12 @@ void StatPopup::paintEvent(QPaintEvent*) {
// Draw the text.
p.setFont(font());
- p.setPen(colorGroup().foreground());
+ p.setPen(tqcolorGroup().foreground());
p.drawText(rect(), AlignHCenter | AlignVCenter, fullReading);
}
-void StatPopup::mousePressEvent(QMouseEvent* e) {
- if(e->button() == RightButton) {
+void StatPopup::mousePressEvent(TQMouseEvent* e) {
+ if(e->button() == Qt::RightButton) {
// Hide the pop-up.
hide();
} else {
@@ -412,38 +412,38 @@ void StatPopup::mousePressEvent(QMouseEvent* e) {
isDragged = true;
relX = e->x();
relY = e->y();
- repaint();
+ tqrepaint();
}
}
-void StatPopup::mouseMoveEvent(QMouseEvent* e) {
+void StatPopup::mouseMoveEvent(TQMouseEvent* e) {
// In the middle of a drag operation.
move(e->globalX() - relX, e->globalY() - relY);
}
-void StatPopup::mouseReleaseEvent(QMouseEvent* e) {
+void StatPopup::mouseReleaseEvent(TQMouseEvent* e) {
// The end of a drag operation.
move(e->globalX() - relX, e->globalY() - relY);
isDragged = false;
- repaint();
+ tqrepaint();
}
-void StatPopup::closeEvent(QCloseEvent* e) {
+void StatPopup::closeEvent(TQCloseEvent* e) {
// We're about to close. Save the current state for the last time.
savePopupState();
closing = true;
- QWidget::closeEvent(e);
+ TQWidget::closeEvent(e);
}
-void StatPopup::hideEvent(QHideEvent* e) {
+void StatPopup::hideEvent(TQHideEvent* e) {
// We're about to hide. Save the current state if we're not
// closing altogether.
if (! closing)
savePopupState();
- QWidget::hideEvent(e);
+ TQWidget::hideEvent(e);
}
-void StatPopup::showEvent(QShowEvent* e) {
+void StatPopup::showEvent(TQShowEvent* e) {
// Make sure we're up-to-date and properly resized.
if (isActive())
takeReading();
@@ -453,7 +453,7 @@ void StatPopup::showEvent(QShowEvent* e) {
// Window management - fix so a taskbar button doesn't appear
KWin::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
- QWidget::showEvent(e);
+ TQWidget::showEvent(e);
}
void StatPopup::takeReading() {
@@ -469,17 +469,17 @@ void StatPopup::takeReading() {
if (resizeRequested)
resizeToText();
- repaint();
+ tqrepaint();
}
}
void StatPopup::resizeToText() {
resizeRequested = false;
- QSize size = fontMetrics().size(0, fullReading);
+ TQSize size = fontMetrics().size(0, fullReading);
resize(size.width() + 2 * TEXT_EXPANSION_HORIZONTAL,
size.height() + 2 * TEXT_EXPANSION_VERTICAL);
- repaint();
+ tqrepaint();
}
#include "statpopup.moc"