diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
commit | cfc42a28c327b96c6a2afee92af3bac1a479eb8a (patch) | |
tree | e3219edf5f827eaa4db3feb509a17846a1a5a752 /kteatime | |
parent | a73fc4d7e66fe0824313aa4e9a650c4cddef6e9f (diff) | |
download | tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.tar.gz tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1157650 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kteatime')
-rw-r--r-- | kteatime/tealist.cpp | 22 | ||||
-rw-r--r-- | kteatime/tealist.h | 14 | ||||
-rw-r--r-- | kteatime/timeedit.cpp | 38 | ||||
-rw-r--r-- | kteatime/timeedit.h | 12 | ||||
-rw-r--r-- | kteatime/toplevel.cpp | 230 | ||||
-rw-r--r-- | kteatime/toplevel.h | 54 |
6 files changed, 185 insertions, 185 deletions
diff --git a/kteatime/tealist.cpp b/kteatime/tealist.cpp index 0f7aa26..ae32339 100644 --- a/kteatime/tealist.cpp +++ b/kteatime/tealist.cpp @@ -7,13 +7,13 @@ ------------------------------------------------------------- */ #include <klocale.h> -#include <qlistview.h> +#include <tqlistview.h> #include "tealist.h" -QString int2time(int time) +TQString int2time(int time) { - QString str; + TQString str; if (time / 60) str.append(i18n("%1 min").arg(time / 60)); if (time % 60) @@ -25,14 +25,14 @@ QString int2time(int time) } -TeaListItem::TeaListItem(QListView * parent) - :QListViewItem(parent) +TeaListItem::TeaListItem(TQListView * parent) + :TQListViewItem(parent) { } -TeaListItem::TeaListItem(QListView * parent, QListViewItem *after) - :QListViewItem(parent, after) +TeaListItem::TeaListItem(TQListView * parent, TQListViewItem *after) + :TQListViewItem(parent, after) { } @@ -43,17 +43,17 @@ TeaListItem::~TeaListItem() void TeaListItem::setTime(int t) { - QListViewItem::setText(1, int2time(t)); + TQListViewItem::setText(1, int2time(t)); tim = t; } -void TeaListItem::setName(const QString &n) +void TeaListItem::setName(const TQString &n) { nam = n; - QListViewItem::setText(0, n); + TQListViewItem::setText(0, n); } -QString TeaListItem::name() +TQString TeaListItem::name() { return nam; } diff --git a/kteatime/tealist.h b/kteatime/tealist.h index 8d025c8..f526f9a 100644 --- a/kteatime/tealist.h +++ b/kteatime/tealist.h @@ -8,7 +8,7 @@ #ifndef TEALIST_H #define TEALIST_H -#include <qstring.h> +#include <tqstring.h> class QListView; class QListViewItem; @@ -18,20 +18,20 @@ class TeaListItem : public QListViewItem { public: - TeaListItem(QListView *parent); - TeaListItem(QListView *parent, QListViewItem *after); + TeaListItem(TQListView *parent); + TeaListItem(TQListView *parent, TQListViewItem *after); ~TeaListItem(); int time(); - QString name(); + TQString name(); void setTime(int v); - void setName(const QString &n); + void setName(const TQString &n); private: int tim; - QString nam; + TQString nam; }; -QString int2time(int t); +TQString int2time(int t); #endif diff --git a/kteatime/timeedit.cpp b/kteatime/timeedit.cpp index c101de0..8cd3d60 100644 --- a/kteatime/timeedit.cpp +++ b/kteatime/timeedit.cpp @@ -7,14 +7,14 @@ ------------------------------------------------------------- */ #include <klocale.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> #include "timeedit.h" #include "timeedit.moc" -WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, QWidget *parent, const char *name) - : QSpinBox(minValue, maxValue, step, parent, name) +WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, TQWidget *parent, const char *name) + : TQSpinBox(minValue, maxValue, step, parent, name) { } @@ -23,7 +23,7 @@ WrappingSpinBox::~WrappingSpinBox() } -/** Overloaded QSpinBox method */ +/** Overloaded TQSpinBox method */ void WrappingSpinBox::stepUp() { bool wrap = false; @@ -31,16 +31,16 @@ void WrappingSpinBox::stepUp() wrap = true; if (wrap) emit wrapUp(); // must wrap first (to avoid double-step-up) - QSpinBox::stepUp(); + TQSpinBox::stepUp(); } -/** Overloaded QSpinBox method */ +/** Overloaded TQSpinBox method */ void WrappingSpinBox::stepDown() { bool wrap = false; if (value() == 0) wrap = true; - QSpinBox::stepDown(); + TQSpinBox::stepDown(); if (wrap) emit wrapDown(); } @@ -49,20 +49,20 @@ void WrappingSpinBox::stepDown() // ------------------------------------------------------------------------- -TimeEdit::TimeEdit(QWidget* parent, const char* name) - : QWidget(parent, name) +TimeEdit::TimeEdit(TQWidget* parent, const char* name) + : TQWidget(parent, name) { - layout = new QHBoxLayout(this); - minuteBox = new QSpinBox(0, 300, 1, this); + layout = new TQHBoxLayout(this); + minuteBox = new TQSpinBox(0, 300, 1, this); // minuteBox->setFixedSize(minuteBox->sizeHint()); - QLabel* min = new QLabel(i18n(" min"), this); + TQLabel* min = new TQLabel(i18n(" min"), this); min->setFixedSize(min->sizeHint()); secondBox = new WrappingSpinBox(0, 59, 1, this); secondBox->setWrapping(true); // secondBox->setFixedSize(secondBox->sizeHint()); - QLabel* sec = new QLabel(i18n(" sec"),this); + TQLabel* sec = new TQLabel(i18n(" sec"),this); sec->setFixedSize(sec->sizeHint()); layout->addWidget(minuteBox); @@ -71,10 +71,10 @@ TimeEdit::TimeEdit(QWidget* parent, const char* name) layout->addWidget(secondBox); layout->addWidget(sec); - connect(minuteBox, SIGNAL(valueChanged(int)), SLOT(spinBoxValueChanged(int)) ); - connect(secondBox, SIGNAL(valueChanged(int)), SLOT(spinBoxValueChanged(int)) ); - connect(secondBox, SIGNAL(wrapUp()), SLOT(wrappedUp())); - connect(secondBox, SIGNAL(wrapDown()), SLOT(wrappedDown())); + connect(minuteBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) ); + connect(secondBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) ); + connect(secondBox, TQT_SIGNAL(wrapUp()), TQT_SLOT(wrappedUp())); + connect(secondBox, TQT_SIGNAL(wrapDown()), TQT_SLOT(wrappedDown())); } TimeEdit::~TimeEdit() @@ -139,7 +139,7 @@ void TimeEdit::spinBoxValueChanged(int) emit valueChanged(value()); } -/** SLOT (overloading QSpinBox): set focus */ +/** TQT_SLOT (overloading TQSpinBox): set focus */ void TimeEdit::setFocus() { minuteBox->setFocus(); diff --git a/kteatime/timeedit.h b/kteatime/timeedit.h index cc03f58..445861e 100644 --- a/kteatime/timeedit.h +++ b/kteatime/timeedit.h @@ -8,8 +8,8 @@ #ifndef TIMEEDIT_H #define TIMEEDIT_H -#include <qspinbox.h> -#include <qwidget.h> +#include <tqspinbox.h> +#include <tqwidget.h> class QBoxLayout; @@ -23,7 +23,7 @@ class WrappingSpinBox : public QSpinBox Q_OBJECT public: - WrappingSpinBox(int minValue, int maxValue, int step = 1, QWidget *parent=0, const char *name=0); + WrappingSpinBox(int minValue, int maxValue, int step = 1, TQWidget *parent=0, const char *name=0); ~WrappingSpinBox(); void stepUp(); @@ -44,7 +44,7 @@ class TimeEdit : public QWidget Q_OBJECT public: - TimeEdit(QWidget* parent = 0, const char* name = 0); + TimeEdit(TQWidget* parent = 0, const char* name = 0); ~TimeEdit(); void setValue(int value); @@ -63,9 +63,9 @@ signals: protected: - QSpinBox *minuteBox; + TQSpinBox *minuteBox; WrappingSpinBox *secondBox; - QBoxLayout* layout; + TQBoxLayout* layout; }; #endif diff --git a/kteatime/toplevel.cpp b/kteatime/toplevel.cpp index 39ca159..df70963 100644 --- a/kteatime/toplevel.cpp +++ b/kteatime/toplevel.cpp @@ -23,20 +23,20 @@ #include <stdlib.h> #include <assert.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qlineedit.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qfile.h> -#include <qcursor.h> -#include <qpushbutton.h> -#include <qgroupbox.h> -#include <qheader.h> -#include <qpixmap.h> -#include <qbitmap.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqlineedit.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqfile.h> +#include <tqcursor.h> +#include <tqpushbutton.h> +#include <tqgroupbox.h> +#include <tqheader.h> +#include <tqpixmap.h> +#include <tqbitmap.h> #include <kconfig.h> #include <khelpmenu.h> @@ -64,7 +64,7 @@ const int TopLevel::DEFAULT_TEA_TIME = 3*60; TopLevel::TopLevel() : KSystemTray() { setBackgroundMode(X11ParentRelative); // what for? - QString n, key; + TQString n, key; unsigned int num; teas.clear(); @@ -76,7 +76,7 @@ TopLevel::TopLevel() : KSystemTray() // assuming this is a new-style config num = config->readNumEntry("Number", 0); teas.resize(num); - QString tempstr; + TQString tempstr; for (unsigned int index=1; index<=num; ++index) { key.sprintf("Tea%d Time", index); tempstr = config->readEntry(key, NULL); @@ -118,24 +118,24 @@ TopLevel::TopLevel() : KSystemTray() startAct = new KAction(i18n("&Start"), "1rightarrow", 0, - this, SLOT(start()), actionCollection(), "start"); + this, TQT_SLOT(start()), actionCollection(), "start"); stopAct = new KAction(i18n("Sto&p"), "cancel", 0, - this, SLOT(stop()), actionCollection(), "stop"); + this, TQT_SLOT(stop()), actionCollection(), "stop"); confAct = new KAction(i18n("&Configure..."), "configure", 0, - this, SLOT(config()), actionCollection(), "configure"); + this, TQT_SLOT(config()), actionCollection(), "configure"); anonAct = new KAction(i18n("&Anonymous..."), 0, 0, - this, SLOT(anonymous()), actionCollection(), "anonymous"); + this, TQT_SLOT(anonymous()), actionCollection(), "anonymous"); // KAction *quitAct = actionCollection()->action("file_quit"); // create app menu (displayed on right-click) - menu = new QPopupMenu(); + menu = new TQPopupMenu(); menu->setCheckable(true); - connect(menu, SIGNAL(activated(int)), this, SLOT(teaSelected(int))); + connect(menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(teaSelected(int))); // this menu will be displayed when no tea is steeping, and left mouse button is clicked - start_menu = new QPopupMenu(); + start_menu = new TQPopupMenu(); start_menu->setCheckable(true); // menu isn't tickable, but this gives some add. spacing - connect(start_menu, SIGNAL(activated(int)), this, SLOT(teaStartSelected(int))); + connect(start_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(teaStartSelected(int))); rebuildTeaMenus(); // populate tops of menus with tea-entries from config @@ -152,13 +152,13 @@ TopLevel::TopLevel() : KSystemTray() menu->insertSeparator(); confAct->plug(menu); menu->insertItem(SmallIcon("help"), i18n("&Help"), helpMnu); - menu->insertItem(SmallIcon("exit"), i18n("Quit"), kapp, SLOT(quit())); + menu->insertItem(SmallIcon("exit"), i18n("Quit"), kapp, TQT_SLOT(quit())); // quitAct->plug(menu); // FIXME: this doesn't seem to work with above definition of quitAct? // (need special 'quit'-method?) // this menu will be displayed when a tea is steeping, and left mouse button is clicked - steeping_menu = new QPopupMenu(); -// steeping_menu->insertItem(SmallIcon("cancel"), i18n("Just &Cancel Current"), this, SLOT(stop())); + steeping_menu = new TQPopupMenu(); +// steeping_menu->insertItem(SmallIcon("cancel"), i18n("Just &Cancel Current"), this, TQT_SLOT(stop())); stopAct->plug(steeping_menu); // FIXME: can provide different text for this incarnation? // start_menu->insertSeparator(); @@ -201,7 +201,7 @@ TopLevel::~TopLevel() // FIXME: must delete more (like all the QWidgets in config-window)? } -void TopLevel::resizeEvent ( QResizeEvent * ) +void TopLevel::resizeEvent ( TQResizeEvent * ) { mugPixmap = loadSizedIcon("mug", width()); teaNotReadyPixmap = loadSizedIcon("tea_not_ready", width()); @@ -211,26 +211,26 @@ void TopLevel::resizeEvent ( QResizeEvent * ) } /** Handle mousePressEvent */ -void TopLevel::mousePressEvent(QMouseEvent *event) +void TopLevel::mousePressEvent(TQMouseEvent *event) { if (event->button() == LeftButton) { if (ready) { stop(); // reset tooltip and stop animation } else { if (running) - steeping_menu->popup(QCursor::pos()); + steeping_menu->popup(TQCursor::pos()); else - start_menu->popup(QCursor::pos()); + start_menu->popup(TQCursor::pos()); } } else if (event->button() == RightButton) - menu->popup(QCursor::pos()); + menu->popup(TQCursor::pos()); // else if (event->button() == MidButton) // currently unused } /** Handle paintEvent (ie. animate icon) */ -void TopLevel::paintEvent(QPaintEvent *) +void TopLevel::paintEvent(TQPaintEvent *) { - QPixmap *pm = &mugPixmap; + TQPixmap *pm = &mugPixmap; if (running) { if (useTrayVis) @@ -239,7 +239,7 @@ void TopLevel::paintEvent(QPaintEvent *) pm = &teaNotReadyPixmap; // generic "steeping" icon } else { // use simple two-frame "animation" - // FIXME: how about using a QMovie instead? (eg. MNG) + // FIXME: how about using a TQMovie instead? (eg. MNG) if (ready) { if (firstFrame) pm = &teaAnim1Pixmap; @@ -249,11 +249,11 @@ void TopLevel::paintEvent(QPaintEvent *) } // overlay pie chart onto tray icon - QPixmap base(*pm); // make copy of base pixmap + TQPixmap base(*pm); // make copy of base pixmap if (useTrayVis && running) { // extend mask - QBitmap mask = *(base.mask()); - QPainter pm(&mask); + TQBitmap mask = *(base.mask()); + TQPainter pm(&mask); pm.setBrush(Qt::color1); // fill with "foreground-colour" pm.setPen(Qt::NoPen); // no border needed/wanted pm.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16); // full circle of small size @@ -262,21 +262,21 @@ void TopLevel::paintEvent(QPaintEvent *) base.setMask(mask); // draw pie chart - QPainter px(&base); - px.setPen(QPen(Qt::black, 0)); // black border - px.setBrush(QColor(192, 0, 0)); // red fill colour for small circle + TQPainter px(&base); + px.setPen(TQPen(Qt::black, 0)); // black border + px.setBrush(TQColor(192, 0, 0)); // red fill colour for small circle px.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16); - px.setBrush(QColor(0, 192, 0)); // green fill colour for pie part + px.setBrush(TQColor(0, 192, 0)); // green fill colour for pie part px.drawPie(0, ((float) width()/(float) 2.44444444444), ((float) width()/(float) 1.69230769231), ((float) width()/(float) 1.69230769231), 90*16, percentDone*16); px.end(); } // FIXME: over-emphasize first and last few percent? (for better visibility) - // FIXME: some optimizations (eg. store pre-drawn QPixmap with small circle) + // FIXME: some optimizations (eg. store pre-drawn TQPixmap with small circle) // (and use drawEllipse() instead of drawPie() for small circle!) // set new tray icon - QPainter p(this); + TQPainter p(this); int x = 1 + (((float) width()/(float) 1.83333333333) - pm->width()/2); int y = 1 + (((float) width()/(float) 1.83333333333) - pm->height()/2); p.drawPixmap(x, y, base); @@ -284,7 +284,7 @@ void TopLevel::paintEvent(QPaintEvent *) } /** Check timer and initiate appropriate action if finished */ -void TopLevel::timerEvent(QTimerEvent *) +void TopLevel::timerEvent(TQTimerEvent *) { if (running) { // a tea is steeping; must count down @@ -302,15 +302,15 @@ void TopLevel::timerEvent(QTimerEvent *) menu->setItemChecked(current_selected, true); } - QString teaMessage = i18n("The %1 is now ready!").arg(current_name); + TQString teaMessage = i18n("The %1 is now ready!").arg(current_name); // invoke action if (useNotify) { KNotifyClient::event(winId(), "tea", teaMessage); } if (useAction && (!action.isEmpty())) { - QString cmd = action; + TQString cmd = action; cmd.replace("%t", current_name); - system(QFile::encodeName(cmd)); + system(TQFile::encodeName(cmd)); } if (usePopup) KPassivePopup::message(i18n("The Tea Cooker"), @@ -329,7 +329,7 @@ void TopLevel::timerEvent(QTimerEvent *) } } // ...and Tooltip - QString min = int2time(seconds); + TQString min = int2time(seconds); setToolTip(i18n("%1 left for %2").arg(min).arg(current_name)); } } else { @@ -342,7 +342,7 @@ void TopLevel::timerEvent(QTimerEvent *) } /** update ToolTip */ -void TopLevel::setToolTip(const QString &text, bool force) +void TopLevel::setToolTip(const TQString &text, bool force) { // don't update if text hasn't changed if (lastTip == text) @@ -352,8 +352,8 @@ void TopLevel::setToolTip(const QString &text, bool force) // FIXME: this isn't too nice: currently mouse must stay outside for >1s for update to occur if (force || !this->hasMouse() || (lastTip == i18n("The Tea Cooker"))) { lastTip = text; - QToolTip::remove(this); - QToolTip::add(this, text); + TQToolTip::remove(this); + TQToolTip::add(this, text); } } @@ -369,9 +369,9 @@ void TopLevel::rebuildTeaMenus() { // now add new tea-entries to top of menus int id = 0; int index = 0; - for (QValueVector<tea_struct>::ConstIterator it=teas.begin(); it != teas.end(); ++it) { + for (TQValueVector<tea_struct>::ConstIterator it=teas.begin(); it != teas.end(); ++it) { // construct string with name and steeping time - QString str = it->name; + TQString str = it->name; str.append(" ("); str.append(int2time(it->time)); str.append(")"); @@ -478,18 +478,18 @@ void TopLevel::anonymous() anondlg = new KDialogBase(KDialogBase::Plain, i18n("Anonymous Tea"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, this, "anonymous", true); - QWidget *page = anondlg->plainPage(); - QBoxLayout *top_box = new QVBoxLayout(page); - QBoxLayout *prop_box = new QHBoxLayout(top_box); - QVBox *propleft = new QVBox(page); + TQWidget *page = anondlg->plainPage(); + TQBoxLayout *top_box = new TQVBoxLayout(page); + TQBoxLayout *prop_box = new TQHBoxLayout(top_box); + TQVBox *propleft = new TQVBox(page); prop_box->addWidget(propleft); - QVBox *propright = new QVBox(page); + TQVBox *propright = new TQVBox(page); prop_box->addWidget(propright); anon_time = new TimeEdit(propright); anon_time->setFixedHeight(anon_time->sizeHint().height()); anon_time->setValue(DEFAULT_TEA_TIME); - QLabel *l = new QLabel(anon_time, i18n("Tea time:"), propleft); + TQLabel *l = new TQLabel(anon_time, i18n("Tea time:"), propleft); l->setFixedSize(l->sizeHint()); top_box->addStretch(); @@ -501,7 +501,7 @@ void TopLevel::anonymous() // (why? - better use LRU, and save that to config) } - if (anondlg->exec() == QDialog::Accepted) { + if (anondlg->exec() == TQDialog::Accepted) { shooting = true; if (!listempty) menu->setItemChecked(current_selected, false); // no item is to be checked @@ -557,7 +557,7 @@ void TopLevel::listBoxItemSelected() { } /* config-slot: name of a tea edited */ -void TopLevel::nameEditTextChanged(const QString& newText) { +void TopLevel::nameEditTextChanged(const TQString& newText) { /* this method also gets called when the last TeaListItem has been deleted * (to clear the name edit widget), so check for empty listbox */ if (listbox->currentItem() != NULL) { @@ -618,7 +618,7 @@ void TopLevel::delButtonClicked() { /* config-slot: "up" button clicked */ void TopLevel::upButtonClicked() { - QListViewItem* item = listbox->currentItem(); + TQListViewItem* item = listbox->currentItem(); if (item && item->itemAbove()) item->itemAbove()->moveItem(item); @@ -628,7 +628,7 @@ void TopLevel::upButtonClicked() { /* config-slot: "down" button clicked */ void TopLevel::downButtonClicked() { - QListViewItem* item = listbox->currentItem(); + TQListViewItem* item = listbox->currentItem(); if (item && item->itemBelow()) item->moveItem(item->itemBelow()); @@ -661,118 +661,118 @@ void TopLevel::config() confdlg = new KDialogBase(KDialogBase::Plain, i18n("Configure Tea Cooker"), KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help, KDialogBase::Ok, this, "config", true); - QWidget *page = confdlg->plainPage(); + TQWidget *page = confdlg->plainPage(); // FIXME: enforce sensible initial/default size of dialog // FIXME: modal is ok, but can avoid always-on-top? - QBoxLayout *top_box = new QVBoxLayout(page, 0, 8); // whole config-stuff - QBoxLayout *box = new QHBoxLayout(top_box); // list + properties + TQBoxLayout *top_box = new TQVBoxLayout(page, 0, 8); // whole config-stuff + TQBoxLayout *box = new TQHBoxLayout(top_box); // list + properties /* left side - tea list and list-modifying buttons */ - QBoxLayout *leftside = new QVBoxLayout(box); - QGroupBox *listgroup = new QGroupBox(2, Vertical, i18n("Tea List"), page); + TQBoxLayout *leftside = new TQVBoxLayout(box); + TQGroupBox *listgroup = new TQGroupBox(2, Vertical, i18n("Tea List"), page); leftside->addWidget(listgroup, 0, 0); - listbox = new QListView(listgroup, "listBox"); + listbox = new TQListView(listgroup, "listBox"); listbox->addColumn(i18n("Name")); listbox->header()->setClickEnabled(false, listbox->header()->count()-1); listbox->addColumn(i18n("Time")); listbox->header()->setClickEnabled(false, listbox->header()->count()-1); listbox->setSorting(-1); - connect(listbox, SIGNAL(selectionChanged()), SLOT(listBoxItemSelected())); + connect(listbox, TQT_SIGNAL(selectionChanged()), TQT_SLOT(listBoxItemSelected())); // now buttons for editing the tea-list - QWidget *listgroup_widget = new QWidget(listgroup); - QBoxLayout *hbox = new QHBoxLayout(listgroup_widget); + TQWidget *listgroup_widget = new TQWidget(listgroup); + TQBoxLayout *hbox = new TQHBoxLayout(listgroup_widget); hbox->setSpacing(4); - btn_new = new QPushButton(QString::null, listgroup_widget); - QToolTip::add(btn_new, i18n("New")); + btn_new = new TQPushButton(TQString::null, listgroup_widget); + TQToolTip::add(btn_new, i18n("New")); btn_new->setPixmap(SmallIcon("filenew")); btn_new->setMinimumSize(btn_new->sizeHint() * 1.2); - connect(btn_new, SIGNAL(clicked()), SLOT(newButtonClicked())); + connect(btn_new, TQT_SIGNAL(clicked()), TQT_SLOT(newButtonClicked())); hbox->addWidget(btn_new); - btn_del = new QPushButton(QString::null, listgroup_widget); - QToolTip::add(btn_del, i18n("Delete")); + btn_del = new TQPushButton(TQString::null, listgroup_widget); + TQToolTip::add(btn_del, i18n("Delete")); btn_del->setIconSet(SmallIconSet("editdelete")); btn_del->setMinimumSize(btn_new->sizeHint() * 1.2); - connect(btn_del, SIGNAL(clicked()), SLOT(delButtonClicked())); + connect(btn_del, TQT_SIGNAL(clicked()), TQT_SLOT(delButtonClicked())); hbox->addWidget(btn_del); - btn_up = new QPushButton(QString::null, listgroup_widget); - QToolTip::add(btn_up, i18n("Up")); + btn_up = new TQPushButton(TQString::null, listgroup_widget); + TQToolTip::add(btn_up, i18n("Up")); btn_up->setIconSet(SmallIconSet("up")); btn_up->setMinimumSize(btn_up->sizeHint() * 1.2); - connect(btn_up, SIGNAL(clicked()), SLOT(upButtonClicked())); + connect(btn_up, TQT_SIGNAL(clicked()), TQT_SLOT(upButtonClicked())); hbox->addWidget(btn_up); - btn_down = new QPushButton(QString::null, listgroup_widget); - QToolTip::add(btn_down, i18n("Down")); + btn_down = new TQPushButton(TQString::null, listgroup_widget); + TQToolTip::add(btn_down, i18n("Down")); btn_down->setIconSet(SmallIconSet("down")); btn_down->setMinimumSize(btn_down->sizeHint() * 1.2); - connect(btn_down, SIGNAL(clicked()), SLOT(downButtonClicked())); + connect(btn_down, TQT_SIGNAL(clicked()), TQT_SLOT(downButtonClicked())); hbox->addWidget(btn_down); hbox->addStretch(10); /* right side - tea properties */ - QBoxLayout *rightside = new QVBoxLayout(box); - editgroup = new QGroupBox(2, Vertical, i18n("Tea Properties"), page); + TQBoxLayout *rightside = new TQVBoxLayout(box); + editgroup = new TQGroupBox(2, Vertical, i18n("Tea Properties"), page); rightside->addWidget(editgroup, 0, 0); - QHBox *propbox = new QHBox(editgroup); + TQHBox *propbox = new TQHBox(editgroup); // FIXME: - must enforce correct vertical alignment of each label-editor pair // (better use one HBox for each label-editor pair?) - QVBox *propleft = new QVBox(propbox); - QVBox *propright = new QVBox(propbox); - nameEdit = new QLineEdit(propright); + TQVBox *propleft = new TQVBox(propbox); + TQVBox *propright = new TQVBox(propbox); + nameEdit = new TQLineEdit(propright); nameEdit->setFixedHeight(nameEdit->sizeHint().height()); - nameEdit->setAlignment(QLineEdit::AlignLeft); - QLabel *l = new QLabel(nameEdit, i18n("Name:"), propleft); + nameEdit->setAlignment(TQLineEdit::AlignLeft); + TQLabel *l = new TQLabel(nameEdit, i18n("Name:"), propleft); l->setFixedSize(l->sizeHint()); - connect(nameEdit, SIGNAL(textChanged(const QString&)), SLOT(nameEditTextChanged(const QString&)) ); + connect(nameEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(nameEditTextChanged(const TQString&)) ); timeEdit = new TimeEdit(propright); timeEdit->setFixedHeight(timeEdit->sizeHint().height()); - l = new QLabel(timeEdit, i18n("Tea time:"), propleft); + l = new TQLabel(timeEdit, i18n("Tea time:"), propleft); l->setFixedSize(l->sizeHint()); - connect(timeEdit, SIGNAL(valueChanged(int)), SLOT(spinBoxValueChanged(int))); + connect(timeEdit, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int))); /* bottom - timeout actions */ - QGroupBox *actiongroup = new QGroupBox(4, Vertical, i18n("Action"), page); + TQGroupBox *actiongroup = new TQGroupBox(4, Vertical, i18n("Action"), page); top_box->addWidget(actiongroup, 0, 0); - QWidget *actionconf_widget = new QWidget(actiongroup); - QBoxLayout *actionconf_hbox = new QHBoxLayout(actionconf_widget); - btn_conf = new QPushButton(i18n("Configure Events..."), actionconf_widget); + TQWidget *actionconf_widget = new TQWidget(actiongroup); + TQBoxLayout *actionconf_hbox = new TQHBoxLayout(actionconf_widget); + btn_conf = new TQPushButton(i18n("Configure Events..."), actionconf_widget); actionconf_hbox->addWidget(btn_conf); - connect(btn_conf, SIGNAL(clicked()), SLOT(confButtonClicked())); + connect(btn_conf, TQT_SIGNAL(clicked()), TQT_SLOT(confButtonClicked())); actionconf_hbox->addStretch(10); - eventEnable = new QCheckBox(i18n("Event"), actiongroup); - popupEnable = new QCheckBox(i18n("Popup"), actiongroup); + eventEnable = new TQCheckBox(i18n("Event"), actiongroup); + popupEnable = new TQCheckBox(i18n("Popup"), actiongroup); eventEnable->setFixedHeight(eventEnable->sizeHint().height()); popupEnable->setFixedHeight(popupEnable->sizeHint().height()); - QHBox *actionbox = new QHBox(actiongroup); - actionEnable = new QCheckBox(actionbox); + TQHBox *actionbox = new TQHBox(actiongroup); + actionEnable = new TQCheckBox(actionbox); // FIXME: add text to this line: -// QLabel *actionLabel = new QLabel(i18n("Execute: "), actiongroup); - actionEdit = new QLineEdit(actionbox); +// TQLabel *actionLabel = new TQLabel(i18n("Execute: "), actiongroup); + actionEdit = new TQLineEdit(actionbox); actionEdit->setFixedHeight(actionEdit->sizeHint().height()); - QToolTip::add(actionEdit, i18n("Enter command here; '%t' will be replaced with name of steeping tea")); - connect(actionEnable, SIGNAL(toggled(bool)), SLOT(actionEnableToggled(bool))); + TQToolTip::add(actionEdit, i18n("Enter command here; '%t' will be replaced with name of steeping tea")); + connect(actionEnable, TQT_SIGNAL(toggled(bool)), TQT_SLOT(actionEnableToggled(bool))); rightside->addStretch(); // single checkbox - visEnable = new QCheckBox(i18n("Visualize progress in icon tray"), page); + visEnable = new TQCheckBox(i18n("Visualize progress in icon tray"), page); top_box->addWidget(visEnable, 0, 0); // let listbox claim all remaining vertical space top_box->setStretchFactor(box, 10); - connect(confdlg, SIGNAL(helpClicked()), SLOT(help())); + connect(confdlg, TQT_SIGNAL(helpClicked()), TQT_SLOT(help())); } // now add all defined teas (and their times) to the listview @@ -805,7 +805,7 @@ void TopLevel::config() actionEdit->setEnabled(useAction); visEnable->setChecked(useTrayVis); - if (confdlg->exec() == QDialog::Accepted) + if (confdlg->exec() == TQDialog::Accepted) { // activate new settings useNotify = eventEnable->isChecked(); @@ -820,7 +820,7 @@ void TopLevel::config() int i = 0; teas.clear(); teas.resize(listbox->childCount()); - for (QListViewItemIterator it(listbox); it.current() != 0; ++it) { + for (TQListViewItemIterator it(listbox); it.current() != 0; ++it) { teas[i].name = static_cast<TeaListItem *>(it.current())->name(); teas[i].time = static_cast<TeaListItem *>(it.current())->time(); if (it.current() == current_item) @@ -849,9 +849,9 @@ void TopLevel::config() config->deleteGroup("Teas", true); // deep remove of whole group config->setGroup("Teas"); config->writeEntry("Number", teas.count()); - QString key; + TQString key; int index = 1; - for (QValueVector<tea_struct>::ConstIterator it = teas.begin(); it != teas.end(); ++it) { + for (TQValueVector<tea_struct>::ConstIterator it = teas.begin(); it != teas.end(); ++it) { key.sprintf("Tea%d Name", index); config->writeEntry(key, it->name); key.sprintf("Tea%d Time", index); diff --git a/kteatime/toplevel.h b/kteatime/toplevel.h index e8a4e83..118b977 100644 --- a/kteatime/toplevel.h +++ b/kteatime/toplevel.h @@ -24,16 +24,16 @@ #define TOPLEVEL_H #include <kapplication.h> -#include <qpopupmenu.h> -#include <qtimer.h> -#include <qlineedit.h> -#include <qvaluevector.h> -#include <qlistview.h> -#include <qpushbutton.h> -#include <qgroupbox.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> +#include <tqlineedit.h> +#include <tqvaluevector.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqgroupbox.h> #include <knuminput.h> #include <ksystemtray.h> -#include <qpixmap.h> +#include <tqpixmap.h> class KAction; class KDialogBase; @@ -51,10 +51,10 @@ public: protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - void timerEvent(QTimerEvent *); - void resizeEvent(QResizeEvent *); + void paintEvent(TQPaintEvent *); + void mousePressEvent(TQMouseEvent *); + void timerEvent(TQTimerEvent *); + void resizeEvent(TQResizeEvent *); private slots: @@ -65,11 +65,11 @@ private slots: void config(); void help(); void anonymous(); - void setToolTip(const QString &text, bool force=false); + void setToolTip(const TQString &text, bool force=false); void rebuildTeaMenus(); void listBoxItemSelected(); - void nameEditTextChanged(const QString& newText); + void nameEditTextChanged(const TQString& newText); void spinBoxValueChanged(int v); void newButtonClicked(); void delButtonClicked(); @@ -87,10 +87,10 @@ private: static const int DEFAULT_TEA_TIME; struct tea_struct { - QString name; + TQString name; int time; }; - QValueVector<tea_struct> teas; // list of tea-names and times + TQValueVector<tea_struct> teas; // list of tea-names and times bool running, ready, firstFrame, listempty; int seconds; // variable for counting down seconds @@ -98,28 +98,28 @@ private: int percentDone; // ok, this isn't really "per 100", but "per 360" unsigned current_selected; // index of currently +selected+ tea in menu - QListViewItem *current_item; // ptr to currently +selected+ tea in ListView - QString current_name; // name of currently +running+ tea (if any) + TQListViewItem *current_item; // ptr to currently +selected+ tea in ListView + TQString current_name; // name of currently +running+ tea (if any) bool shooting; // anonymous tea currently steeping? bool useNotify, usePopup, useAction; - QString action; + TQString action; bool useTrayVis; // visualize progress in tray icon - QPixmap mugPixmap, teaNotReadyPixmap, teaAnim1Pixmap, teaAnim2Pixmap; + TQPixmap mugPixmap, teaNotReadyPixmap, teaAnim1Pixmap, teaAnim2Pixmap; KAction *startAct, *stopAct, *confAct, *anonAct; - QPopupMenu *menu, *steeping_menu, *start_menu; - QListView *listbox; - QLineEdit *nameEdit, *actionEdit; + TQPopupMenu *menu, *steeping_menu, *start_menu; + TQListView *listbox; + TQLineEdit *nameEdit, *actionEdit; TimeEdit *timeEdit; - QGroupBox *editgroup; - QPushButton *btn_new, *btn_del, *btn_up, *btn_down, *btn_conf; + TQGroupBox *editgroup; + TQPushButton *btn_new, *btn_del, *btn_up, *btn_down, *btn_conf; - QString lastTip; + TQString lastTip; KDialogBase *anondlg, *confdlg; TimeEdit *anon_time; - QCheckBox *eventEnable, *popupEnable, *actionEnable, *visEnable; + TQCheckBox *eventEnable, *popupEnable, *actionEnable, *visEnable; }; #endif |