TQt4 port kdetoys

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1238103 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 8d92c3c2a4
commit a1bd60b348

@ -152,7 +152,7 @@ Amor::Amor() : DCOPObject( "AmorIface" ), TQObject()
TQT_SLOT(slotMouseClicked(const TQPoint &))); TQT_SLOT(slotMouseClicked(const TQPoint &)));
connect(mAmor, TQT_SIGNAL(dragged(const TQPoint &, bool)), connect(mAmor, TQT_SIGNAL(dragged(const TQPoint &, bool)),
TQT_SLOT(slotWidgetDragged(const TQPoint &, bool))); TQT_SLOT(slotWidgetDragged(const TQPoint &, bool)));
mAmor->resize(mTheme.maximumSize()); mAmor->resize(mTheme.tqmaximumSize());
mTimer = new TQTimer(this); mTimer = new TQTimer(this);
connect(mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); connect(mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()));
@ -288,7 +288,7 @@ void Amor::reset()
mPosition = mCurrAnim->hotspot().x(); mPosition = mCurrAnim->hotspot().x();
mState = Normal; mState = Normal;
mAmor->resize(mTheme.maximumSize()); mAmor->resize(mTheme.tqmaximumSize());
mCurrAnim->reset(); mCurrAnim->reset();
mTimer->start(0, true); mTimer->start(0, true);
@ -562,14 +562,14 @@ void Amor::restack()
#endif #endif
Window sibling = mTargetWin; Window sibling = mTargetWin;
Window dw, parent = None, *wins; Window dw, tqparent = None, *wins;
do { do {
unsigned int nwins = 0; unsigned int nwins = 0;
// We must use the target window's parent as our sibling. // We must use the target window's tqparent as our sibling.
// Is there a faster way to get parent window than XQueryTree? // Is there a faster way to get tqparent window than XQueryTree?
if (XQueryTree(qt_xdisplay(), sibling, &dw, &parent, &wins, &nwins)) if (XQueryTree(qt_xdisplay(), sibling, &dw, &tqparent, &wins, &nwins))
{ {
if (nwins) if (nwins)
{ {
@ -577,9 +577,9 @@ void Amor::restack()
} }
} }
if (parent != None && parent != dw ) if (tqparent != None && tqparent != dw )
sibling = parent; sibling = tqparent;
} while ( parent != None && parent != dw ); } while ( tqparent != None && tqparent != dw );
// Set animation's stacking order to be above the window manager's // Set animation's stacking order to be above the window manager's
// decoration of target window. // decoration of target window.
@ -748,7 +748,7 @@ void Amor::slotOffsetChanged(int off)
// //
void Amor::slotAbout() void Amor::slotAbout()
{ {
TQString about = i18n("Amor Version %1\n\n").arg(AMOR_VERSION) + TQString about = i18n("Amor Version %1\n\n").tqarg(AMOR_VERSION) +
i18n("Amusing Misuse Of Resources\n\n") + i18n("Amusing Misuse Of Resources\n\n") +
i18n("Copyright (c) 1999 Martin R. Jones <mjones@kde.org>\n\n") + i18n("Copyright (c) 1999 Martin R. Jones <mjones@kde.org>\n\n") +
i18n("Original Author: Martin R. Jones <mjones@kde.org>\n") + i18n("Original Author: Martin R. Jones <mjones@kde.org>\n") +

@ -55,7 +55,7 @@ public:
QueueItem(itemType ty, TQString te, int ti = -1); QueueItem(itemType ty, TQString te, int ti = -1);
itemType type() { return iType; } itemType type() { return iType; }
QString text() { return iText; }; TQString text() { return iText; };
int time() { return iTime; }; int time() { return iTime; };
void setTime(int newTime) { if (iTime > 0) iTime = newTime; }; void setTime(int newTime) { if (iTime > 0) iTime = newTime; };
@ -73,6 +73,7 @@ private:
class Amor : public TQObject, virtual public AmorIface class Amor : public TQObject, virtual public AmorIface
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Amor(); Amor();
virtual ~Amor(); virtual ~Amor();
@ -150,9 +151,10 @@ private:
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class AmorSessionWidget : public QWidget class AmorSessionWidget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
AmorSessionWidget(); AmorSessionWidget();
~AmorSessionWidget() {}; ~AmorSessionWidget() {};

@ -170,7 +170,7 @@ bool AmorThemeManager::setTheme(const TQString & file)
else else
{ {
// relative to config file. // relative to config file.
mPath.truncate(mPath.findRev('/')+1); mPath.truncate(mPath.tqfindRev('/')+1);
mPath += pixmapPath; mPath += pixmapPath;
} }
@ -195,7 +195,7 @@ AmorAnim *AmorThemeManager::random(const TQString & group)
if (mStatic) if (mStatic)
grp = "Base"; grp = "Base";
AmorAnimationGroup *animGroup = mAnimations.find(grp); AmorAnimationGroup *animGroup = mAnimations.tqfind(grp);
if (animGroup) { if (animGroup) {
int idx = kapp->random()%animGroup->count(); int idx = kapp->random()%animGroup->count();
@ -227,7 +227,7 @@ bool AmorThemeManager::readGroup(const TQString & seq)
mConfig->setGroup(list.at(i)); mConfig->setGroup(list.at(i));
AmorAnim *anim = new AmorAnim(*mConfig); AmorAnim *anim = new AmorAnim(*mConfig);
animList->append(anim); animList->append(anim);
mMaximumSize = mMaximumSize.expandedTo(anim->maximumSize()); mMaximumSize = mMaximumSize.expandedTo(anim->tqmaximumSize());
} }
// If no animations were available for this group, just add the base anim // If no animations were available for this group, just add the base anim
@ -238,7 +238,7 @@ bool AmorThemeManager::readGroup(const TQString & seq)
if (anim) if (anim)
{ {
animList->append(anim); animList->append(anim);
mMaximumSize = mMaximumSize.expandedTo(anim->maximumSize()); mMaximumSize = mMaximumSize.expandedTo(anim->tqmaximumSize());
entries++; entries++;
} }
} }

@ -59,7 +59,7 @@ public:
{ return (mCurrent < mSequence.count()); } { return (mCurrent < mSequence.count()); }
int totalMovement() const int totalMovement() const
{ return mTotalMovement; } { return mTotalMovement; }
TQSize maximumSize() const TQSize tqmaximumSize() const
{ return mMaximumSize; } { return mMaximumSize; }
int delay() const int delay() const
@ -103,7 +103,7 @@ public:
AmorAnim *random(const TQString & group); AmorAnim *random(const TQString & group);
TQSize maximumSize() const { return mMaximumSize; } TQSize tqmaximumSize() const { return mMaximumSize; }
protected: protected:
TQString mPath; TQString mPath;

@ -55,8 +55,8 @@ AmorBubble::AmorBubble()
mBrowser->setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); // too long to fit in one line? mBrowser->setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); // too long to fit in one line?
TQColorGroup clgrp = mBrowser->colorGroup(); TQColorGroup clgrp = mBrowser->tqcolorGroup();
clgrp.setColor(TQColorGroup::Text, Qt::black); clgrp.setColor(TQColorGroup::Text, TQt::black);
//Laurent TQTextBrowser didn't have this function FIX me //Laurent TQTextBrowser didn't have this function FIX me
//mBrowser->setPaperColorGroup( clgrp ); //mBrowser->setPaperColorGroup( clgrp );
mBrowser->setPaper( TQToolTip::palette().active().brush( TQColorGroup::Background ) ); mBrowser->setPaper( TQToolTip::palette().active().brush( TQColorGroup::Background ) );
@ -83,12 +83,12 @@ AmorBubble::~AmorBubble()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// Set the message to display in the bubble. Causes the geometry of the // Set the message to display in the bubble. Causes the tqgeometry of the
// widget to be recalculated. // widget to be recalculated.
// //
void AmorBubble::setMessage(const TQString& message) void AmorBubble::setMessage(const TQString& message)
{ {
mMessage = TQString( "<html>%1</html>" ).arg( message ); mMessage = TQString( "<html>%1</html>" ).tqarg( message );
// hacks because heightForWidth() doesn't work. // hacks because heightForWidth() doesn't work.
setGeometry( -1000, 0, 300, 1000 ); setGeometry( -1000, 0, 300, 1000 );
show(); show();
@ -99,7 +99,7 @@ void AmorBubble::setMessage(const TQString& message)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// Calculates the size, position and mask of the bubble // Calculates the size, position and tqmask of the bubble
// //
void AmorBubble::calcGeometry() void AmorBubble::calcGeometry()
{ {
@ -108,7 +108,7 @@ void AmorBubble::calcGeometry()
mBound.setHeight( mBrowser->contentsHeight() ); mBound.setHeight( mBrowser->contentsHeight() );
mBound.moveBy(ARROW_WIDTH+BORDER_SIZE, BORDER_SIZE); mBound.moveBy(ARROW_WIDTH+BORDER_SIZE, BORDER_SIZE);
// initialise the default geometry of the bubble // initialise the default tqgeometry of the bubble
int w = mBound.width() + BORDER_SIZE * 2 + ARROW_WIDTH; int w = mBound.width() + BORDER_SIZE * 2 + ARROW_WIDTH;
int h = mBound.height() + BORDER_SIZE * 2; int h = mBound.height() + BORDER_SIZE * 2;
int xpos = mOriginX + BUBBLE_OFFSET; int xpos = mOriginX + BUBBLE_OFFSET;
@ -141,13 +141,13 @@ void AmorBubble::calcGeometry()
setGeometry(xpos, ypos, w, h); setGeometry(xpos, ypos, w, h);
mBrowser->setGeometry( mBound ); mBrowser->setGeometry( mBound );
// create and apply the shape mask // create and apply the tqshape tqmask
mMask.resize(w, h); mMask.resize(w, h);
mMask.fill(color0); mMask.fill(color0);
TQPainter maskPainter(&mMask); TQPainter tqmaskPainter(&mMask);
maskPainter.setPen(color1); tqmaskPainter.setPen(color1);
maskPainter.setBrush(color1); tqmaskPainter.setBrush(color1);
drawBubble(maskPainter); drawBubble(tqmaskPainter);
XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0, XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0,
mMask.handle(), ShapeSet ); mMask.handle(), ShapeSet );
} }
@ -195,7 +195,7 @@ void AmorBubble::drawBubble(TQPainter &p)
p.drawPolygon(pointArray); p.drawPolygon(pointArray);
p.setPen(pen); p.setPen(pen);
p.drawPolyline(pointArray, 0, 3); p.tqdrawPolyline(pointArray, 0, 3);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

@ -40,11 +40,12 @@ class TQTimer;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// AmorBubble displays a message in a shaped window // AmorBubble displays a message in a tqshaped window
// //
class AmorBubble : public QWidget class AmorBubble : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
AmorBubble(); AmorBubble();
virtual ~AmorBubble(); virtual ~AmorBubble();
@ -69,7 +70,7 @@ protected:
int mOriginX; // X origin of bubble arrow int mOriginX; // X origin of bubble arrow
int mOriginY; // Y origin of bubble arrow int mOriginY; // Y origin of bubble arrow
TQRect mBound; // bounds of the text TQRect mBound; // bounds of the text
TQBitmap mMask; // shape mask TQBitmap mMask; // tqshape tqmask
VertPos mArrowVert; // vertical position of the arrow VertPos mArrowVert; // vertical position of the arrow
HorzPos mArrowHorz; // horizontal position of the arrow HorzPos mArrowHorz; // horizontal position of the arrow
TQTextBrowser *mBrowser; // displays the message TQTextBrowser *mBrowser; // displays the message

@ -74,7 +74,7 @@ AmorDialog::AmorDialog()
label = new TQLabel(i18n("Offset:"), offsetBox); label = new TQLabel(i18n("Offset:"), offsetBox);
TQSlider *slider = new TQSlider(-40, 40, 5, mConfig.mOffset, TQSlider *slider = new TQSlider(-40, 40, 5, mConfig.mOffset,
TQSlider::Vertical, offsetBox); Qt::Vertical, offsetBox);
connect(slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotOffset(int))); connect(slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotOffset(int)));
// Always on top // Always on top
@ -84,7 +84,7 @@ AmorDialog::AmorDialog()
checkBox = new TQCheckBox(i18n("Show random tips"), mainwidget); checkBox = new TQCheckBox(i18n("Show random tips"), mainwidget);
connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTips(bool))); connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTips(bool)));
checkBox->setChecked(mConfig.mTips); // always keep this one after the connect, or the QList would not be grayed when it should checkBox->setChecked(mConfig.mTips); // always keep this one after the connect, or the TQList would not be grayed when it should
checkBox = new TQCheckBox(i18n("Use a random character"), mainwidget); checkBox = new TQCheckBox(i18n("Use a random character"), mainwidget);
connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTheme(bool))); connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTheme(bool)));
@ -275,7 +275,7 @@ void AmorListBoxItem::paint( TQPainter *p )
int AmorListBoxItem::height(const TQListBox *lb ) const int AmorListBoxItem::height(const TQListBox *lb ) const
{ {
return QMAX( mPixmap.height(), lb->fontMetrics().lineSpacing() + 1 ); return TQMAX( mPixmap.height(), lb->fontMetrics().lineSpacing() + 1 );
} }
int AmorListBoxItem::width(const TQListBox *lb ) const int AmorListBoxItem::width(const TQListBox *lb ) const

@ -41,6 +41,7 @@
class AmorDialog : public KDialogBase class AmorDialog : public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
AmorDialog(); AmorDialog();
@ -86,7 +87,7 @@ protected:
// //
// AmorListBoxItem implements a list box items for selection of themes // AmorListBoxItem implements a list box items for selection of themes
// //
class AmorListBoxItem : public QListBoxItem class AmorListBoxItem : public TQListBoxItem
{ {
public: public:
AmorListBoxItem(const TQString & s, const TQPixmap& p) AmorListBoxItem(const TQString & s, const TQPixmap& p)

@ -56,7 +56,7 @@ AmorPixmapManager::~AmorPixmapManager()
// //
const TQPixmap *AmorPixmapManager::load(const TQString & img) const TQPixmap *AmorPixmapManager::load(const TQString & img)
{ {
TQPixmap *pixmap = mPixmaps.find(img); TQPixmap *pixmap = mPixmaps.tqfind(img);
if (!pixmap) if (!pixmap)
{ {

@ -50,7 +50,7 @@ public:
{ mPixmapDir = "."; mPixmaps.clear(); } { mPixmapDir = "."; mPixmaps.clear(); }
const TQPixmap *load(const TQString & img); const TQPixmap *load(const TQString & img);
const TQPixmap *pixmap(const TQString & img) const const TQPixmap *pixmap(const TQString & img) const
{ return mPixmaps.find(img); } { return mPixmaps.tqfind(img); }
static AmorPixmapManager *manager(); static AmorPixmapManager *manager();

@ -103,11 +103,11 @@ bool AmorTips::readKTips()
const TQRegExp rx("\\n+"); const TQRegExp rx("\\n+");
int pos = -1; int pos = -1;
while ((pos = content.find("<html>", pos + 1, false)) != -1) while ((pos = content.tqfind("<html>", pos + 1, false)) != -1)
{ {
TQString tip = content TQString tip = content
.mid(pos + 6, content.find("</html>", pos, false) - pos - 6) .mid(pos + 6, content.tqfind("</html>", pos, false) - pos - 6)
.replace(rx, "\n"); .tqreplace(rx, "\n");
if (!tip.endsWith("\n")) if (!tip.endsWith("\n"))
tip += "\n"; tip += "\n";
if (tip.startsWith("\n")) if (tip.startsWith("\n"))

@ -60,11 +60,11 @@ void AmorWidget::setPixmap(const TQPixmap *pixmap)
if (mPixmap) if (mPixmap)
{ {
if (mPixmap->mask()) if (mPixmap->tqmask())
{ {
XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0, XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0,
mPixmap->mask()->handle(), ShapeSet ); mPixmap->tqmask()->handle(), ShapeSet );
repaint(false); tqrepaint(false);
} }
update(); update();
@ -98,7 +98,7 @@ void AmorWidget::mousePressEvent(TQMouseEvent *me)
// //
void AmorWidget::mouseMoveEvent(TQMouseEvent *me) void AmorWidget::mouseMoveEvent(TQMouseEvent *me)
{ {
if ( me->state() == LeftButton ) { if ( me->state() == Qt::LeftButton ) {
if ( !dragging && (clickPos-me->globalPos()).manhattanLength() > 3 ) if ( !dragging && (clickPos-me->globalPos()).manhattanLength() > 3 )
dragging = true; dragging = true;
if ( dragging ) { if ( dragging ) {
@ -116,7 +116,7 @@ void AmorWidget::mouseReleaseEvent(TQMouseEvent *me)
{ {
if ( dragging ) if ( dragging )
emit dragged( me->globalPos() - clickPos, true ); emit dragged( me->globalPos() - clickPos, true );
else if ( me->state() == RightButton ) else if ( me->state() == Qt::RightButton )
emit mouseClicked(clickPos); emit mouseClicked(clickPos);
clickPos = TQPoint(); clickPos = TQPoint();

@ -36,11 +36,12 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// AmorWidget displays a shaped pixmap // AmorWidget displays a tqshaped pixmap
// //
class AmorWidget : public QWidget class AmorWidget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
AmorWidget(); AmorWidget();
virtual ~AmorWidget(); virtual ~AmorWidget();

@ -33,17 +33,17 @@
extern "C" extern "C"
{ {
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{ {
KGlobal::locale()->insertCatalogue("keyesapplet"); KGlobal::locale()->insertCatalogue("keyesapplet");
EyesApplet *applet = new EyesApplet(configFile, KPanelApplet::Normal, 0, parent, "keyesapplet"); EyesApplet *applet = new EyesApplet(configFile, KPanelApplet::Normal, 0, tqparent, "keyesapplet");
return applet; return applet;
} }
} }
EyesApplet::EyesApplet(const TQString& configFile, Type t, int actions, EyesApplet::EyesApplet(const TQString& configFile, Type t, int actions,
TQWidget *parent, const char *name) TQWidget *tqparent, const char *name)
: KPanelApplet( configFile, t, actions, parent, name ) : KPanelApplet( configFile, t, actions, tqparent, name )
{ {
setWFlags(WNoAutoErase); setWFlags(WNoAutoErase);
setBackgroundOrigin(AncestorOrigin); setBackgroundOrigin(AncestorOrigin);
@ -55,11 +55,11 @@ EyesApplet::EyesApplet(const TQString& configFile, Type t, int actions,
int EyesApplet::widthForHeight(int h) const int EyesApplet::widthForHeight(int h) const
{ {
return static_cast<int>(1.4 * h); // rectangular shape. return static_cast<int>(1.4 * h); // rectangular tqshape.
} }
int EyesApplet::heightForWidth(int w) const int EyesApplet::heightForWidth(int w) const
{ {
return static_cast<int>(w / 1.4); // rectangular shape. return static_cast<int>(w / 1.4); // rectangular tqshape.
} }
void EyesApplet::resizeEvent( TQResizeEvent*e ) void EyesApplet::resizeEvent( TQResizeEvent*e )
@ -133,7 +133,7 @@ void EyesApplet::drawPupils(TQPainter* p)
oldMouse = mapFromGlobal(TQCursor::pos()); oldMouse = mapFromGlobal(TQCursor::pos());
mouse = oldMouse * AAFACTOR; mouse = oldMouse * AAFACTOR;
int tmp = QMIN(h, w)/6; int tmp = TQMIN(h, w)/6;
// left pupil // left pupil
vect.setX(mouse.x() - h / 4); vect.setX(mouse.x() - h / 4);
@ -152,7 +152,7 @@ void EyesApplet::drawPupils(TQPainter* p)
if(pos != oldleft) { if(pos != oldleft) {
int sizeEye=QMIN(h,w)/6; int sizeEye=TQMIN(h,w)/6;
// // draw over old pos // // draw over old pos
// p->setPen(TQPen(NoPen)); // p->setPen(TQPen(NoPen));
@ -185,7 +185,7 @@ void EyesApplet::drawPupils(TQPainter* p)
if(pos != oldright) { if(pos != oldright) {
int sizeEye=QMIN(h,w)/6; int sizeEye=TQMIN(h,w)/6;
// // draw over old pos // // draw over old pos
// p->setPen(TQPen(NoPen)); // p->setPen(TQPen(NoPen));

@ -25,10 +25,11 @@
class EyesApplet : public KPanelApplet class EyesApplet : public KPanelApplet
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
EyesApplet(const TQString& configFile, Type t = Normal, int actions = 0, EyesApplet(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0); TQWidget *tqparent = 0, const char *name = 0);
int widthForHeight(int height) const; int widthForHeight(int height) const;
int heightForWidth(int width) const; int heightForWidth(int width) const;

@ -38,23 +38,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
extern "C" extern "C"
{ {
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{ {
KGlobal::locale()->insertCatalogue("kfifteenapplet"); KGlobal::locale()->insertCatalogue("kfifteenapplet");
return new FifteenApplet(configFile, KPanelApplet::Normal, return new FifteenApplet(configFile, KPanelApplet::Normal,
KPanelApplet::About, parent, "kfifteenapplet"); KPanelApplet::About, tqparent, "kfifteenapplet");
} }
} }
FifteenApplet::FifteenApplet(const TQString& configFile, Type type, int actions, FifteenApplet::FifteenApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name) TQWidget *tqparent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name), _aboutData(0) : KPanelApplet(configFile, type, actions, tqparent, name), _aboutData(0)
{ {
// setup table // setup table
_table = new PiecesTable(this); _table = new PiecesTable(this);
setCustomMenu(_table->popup()); setCustomMenu(_table->popup());
// setup layout // setup tqlayout
TQHBoxLayout *_layout = new TQHBoxLayout(this); TQHBoxLayout *_layout = new TQHBoxLayout(this);
_layout->add(_table); _layout->add(_table);
@ -87,8 +87,8 @@ void FifteenApplet::about()
dialog.exec(); dialog.exec();
} }
PiecesTable::PiecesTable(TQWidget* parent, const char* name ) PiecesTable::PiecesTable(TQWidget* tqparent, const char* name )
: QtTableView(parent, name), _activeRow(-1), _activeCol(-1), _randomized(false) : QtTableView(tqparent, name), _activeRow(-1), _activeCol(-1), _randomized(false)
{ {
_menu = new TQPopupMenu(this); _menu = new TQPopupMenu(this);
_menu->insertItem(i18n("R&andomize Pieces"), this, TQT_SLOT(randomizeMap())); _menu->insertItem(i18n("R&andomize Pieces"), this, TQT_SLOT(randomizeMap()));
@ -120,7 +120,7 @@ void PiecesTable::paintCell(TQPainter *p, int row, int col)
// draw cell background // draw cell background
if(number == 16) if(number == 16)
p->setBrush(colorGroup().background()); p->setBrush(tqcolorGroup().background());
else else
p->setBrush(_colors[number-1]); p->setBrush(_colors[number-1]);
p->setPen(NoPen); p->setPen(NoPen);
@ -128,7 +128,7 @@ void PiecesTable::paintCell(TQPainter *p, int row, int col)
// draw borders // draw borders
if (height() > 40) { if (height() > 40) {
p->setPen(colorGroup().text()); p->setPen(tqcolorGroup().text());
if(col < numCols()-1) if(col < numCols()-1)
p->drawLine(x2, 0, x2, y2); // right border line p->drawLine(x2, 0, x2, y2); // right border line
@ -198,14 +198,14 @@ void PiecesTable::randomizeMap()
} }
} }
} }
repaint(); tqrepaint();
_randomized = true; _randomized = true;
} }
void PiecesTable::resetMap() void PiecesTable::resetMap()
{ {
initMap(); initMap();
repaint(); tqrepaint();
} }
void PiecesTable::checkwin() void PiecesTable::checkwin()
@ -225,7 +225,7 @@ void PiecesTable::mousePressEvent(TQMouseEvent* e)
{ {
QtTableView::mousePressEvent(e); QtTableView::mousePressEvent(e);
if (e->button() == RightButton) { if (e->button() == Qt::RightButton) {
// execute RMB popup and check result // execute RMB popup and check result
_menu->exec(mapToGlobal(e->pos())); _menu->exec(mapToGlobal(e->pos()));
e->accept(); e->accept();
@ -235,7 +235,7 @@ void PiecesTable::mousePressEvent(TQMouseEvent* e)
// GAME LOGIC // GAME LOGIC
// find the free position // find the free position
int pos = _map.find(15); int pos = _map.tqfind(15);
if(pos < 0) return; if(pos < 0) return;
int frow = pos / numCols(); int frow = pos / numCols();

@ -35,9 +35,10 @@ class KAboutData;
class PiecesTable : public QtTableView class PiecesTable : public QtTableView
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PiecesTable(TQWidget* parent = 0, const char* name = 0); PiecesTable(TQWidget* tqparent = 0, const char* name = 0);
TQPopupMenu* popup() { return _menu; } TQPopupMenu* popup() { return _menu; }
protected: protected:
@ -66,10 +67,11 @@ private:
class FifteenApplet : public KPanelApplet class FifteenApplet : public KPanelApplet
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
FifteenApplet(const TQString& configFile, Type t = Stretch, int actions = 0, FifteenApplet(const TQString& configFile, Type t = Stretch, int actions = 0,
TQWidget *parent = 0, const char *name = 0); TQWidget *tqparent = 0, const char *name = 0);
int widthForHeight(int height) const; int widthForHeight(int height) const;
int heightForWidth(int width) const; int heightForWidth(int width) const;

@ -7,14 +7,14 @@
** **
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
** **
** This file contains a class moved out of the Qt GUI Toolkit API. It ** This file contains a class moved out of the TQt GUI Toolkit API. It
** may be used, distributed and modified without limitation. ** may be used, distributed and modified without limitation.
** **
**********************************************************************/ **********************************************************************/
#include "qttableview.h" #include "qttableview.h"
#include "qttableview.moc" #include "qttableview.moc"
#ifndef QT_NO_QTTABLEVIEW #ifndef TQT_NO_TQTTABLEVIEW
#include "tqscrollbar.h" #include "tqscrollbar.h"
#include "tqpainter.h" #include "tqpainter.h"
#include "tqdrawutil.h" #include "tqdrawutil.h"
@ -34,19 +34,19 @@ enum ScrollBarDirtyFlags {
}; };
#define HSBEXT horizontalScrollBar()->sizeHint().height() #define HSBEXT horizontalScrollBar()->tqsizeHint().height()
#define VSBEXT verticalScrollBar()->sizeHint().width() #define VSBEXT verticalScrollBar()->tqsizeHint().width()
class QCornerSquare : public QWidget // internal class class QCornerSquare : public TQWidget // internal class
{ {
public: public:
QCornerSquare( TQWidget *, const char* = 0 ); QCornerSquare( TQWidget *, const char* = 0 );
void paintEvent( TQPaintEvent * ); void paintEvent( TQPaintEvent * );
}; };
QCornerSquare::QCornerSquare( TQWidget *parent, const char *name ) QCornerSquare::QCornerSquare( TQWidget *tqparent, const char *name )
: TQWidget( parent, name ) : TQWidget( tqparent, name )
{ {
} }
@ -88,7 +88,7 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
used by functions such as setXOffset() or maxYOffset(). used by functions such as setXOffset() or maxYOffset().
\i The \e widget coordinates. (0,0) is the top-left corner of the widget, \i The \e widget coordinates. (0,0) is the top-left corner of the widget,
\e including the frame. They are used by functions such as repaint(). \e including the frame. They are used by functions such as tqrepaint().
\i The \e view coordinates. (0,0) is the top-left corner of the view, \e \i The \e view coordinates. (0,0) is the top-left corner of the view, \e
excluding the frame. This is the least-used coordinate system; it is used by excluding the frame. This is the least-used coordinate system; it is used by
@ -119,13 +119,13 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
it easy to have child widgets inside tables, which QtTableView it easy to have child widgets inside tables, which QtTableView
doesn't support at all. doesn't support at all.
\sa QScrollView \sa TQScrollView
\link guibooks.html#fowler GUI Design Handbook: Table\endlink \link guibooks.html#fowler GUI Design Handbook: Table\endlink
*/ */
/*! /*!
Constructs a table view. The \a parent, \a name and \f arguments Constructs a table view. The \a tqparent, \a name and \f arguments
are passed to the TQFrame constructor. are passed to the TQFrame constructor.
The \link setTableFlags() table flags\endlink are all cleared (set to 0). The \link setTableFlags() table flags\endlink are all cleared (set to 0).
@ -135,7 +135,7 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
The \link setCellHeight() cell height\endlink and \link setCellWidth() The \link setCellHeight() cell height\endlink and \link setCellWidth()
cell width\endlink are set to 0. cell width\endlink are set to 0.
Frame line shapes (TQFrame::HLink and TQFrame::VLine) are disallowed; Frame line tqshapes (TQFrame::HLink and TQFrame::VLine) are disallowed;
see TQFrame::setFrameStyle(). see TQFrame::setFrameStyle().
Note that the \a f argument is \e not \link setTableFlags() table Note that the \a f argument is \e not \link setTableFlags() table
@ -144,8 +144,8 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
*/ */
QtTableView::QtTableView( TQWidget *parent, const char *name, WFlags f ) QtTableView::QtTableView( TQWidget *tqparent, const char *name, WFlags f )
: TQFrame( parent, name, f ) : TQFrame( tqparent, name, f )
{ {
nRows = nCols = 0; // zero rows/cols nRows = nCols = 0; // zero rows/cols
xCellOffs = yCellOffs = 0; // zero offset xCellOffs = yCellOffs = 0; // zero offset
@ -207,7 +207,7 @@ void QtTableView::show()
/*! /*!
\overload void QtTableView::repaint( bool erase ) \overload void QtTableView::tqrepaint( bool erase )
Repaints the entire view. Repaints the entire view.
*/ */
@ -221,16 +221,16 @@ void QtTableView::show()
If \a w is negative, it is replaced with <code>width() - x</code>. If \a w is negative, it is replaced with <code>width() - x</code>.
If \a h is negative, it is replaced with <code>height() - y</code>. If \a h is negative, it is replaced with <code>height() - y</code>.
Doing a repaint() usually is faster than doing an update(), but Doing a tqrepaint() usually is faster than doing an update(), but
calling update() many times in a row will generate a single paint calling update() many times in a row will generate a single paint
event. event.
At present, QtTableView is the only widget that reimplements \link At present, QtTableView is the only widget that reimplements \link
TQWidget::repaint() repaint()\endlink. It does this because by TQWidget::tqrepaint() tqrepaint()\endlink. It does this because by
clearing and then repainting one cell at at time, it can make the clearing and then tqrepainting one cell at at time, it can make the
screen flicker less than it would otherwise. */ screen flicker less than it would otherwise. */
void QtTableView::repaint( int x, int y, int w, int h, bool erase ) void QtTableView::tqrepaint( int x, int y, int w, int h, bool erase )
{ {
if ( !isVisible() || testWState(WState_BlockUpdates) ) if ( !isVisible() || testWState(WState_BlockUpdates) )
return; return;
@ -249,7 +249,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
} }
/*! /*!
\overload void QtTableView::repaint( const TQRect &r, bool erase ) \overload void QtTableView::tqrepaint( const TQRect &r, bool erase )
Replaints rectangle \a r. If \a erase is TRUE draws the background Replaints rectangle \a r. If \a erase is TRUE draws the background
using the palette's background. using the palette's background.
*/ */
@ -265,7 +265,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
Sets the number of rows of the table to \a rows (must be non-negative). Sets the number of rows of the table to \a rows (must be non-negative).
Does not change topCell(). Does not change topCell().
The table repaints itself automatically if autoUpdate() is set. The table tqrepaints itself automatically if autoUpdate() is set.
\sa numCols(), setNumCols(), numRows() \sa numCols(), setNumCols(), numRows()
*/ */
@ -273,7 +273,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
void QtTableView::setNumRows( int rows ) void QtTableView::setNumRows( int rows )
{ {
if ( rows < 0 ) { if ( rows < 0 ) {
#if defined(QT_CHECK_RANGE) #if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::setNumRows: (%s) Negative argument %d.", qWarning( "QtTableView::setNumRows: (%s) Negative argument %d.",
name( "unnamed" ), rows ); name( "unnamed" ), rows );
#endif #endif
@ -288,7 +288,7 @@ void QtTableView::setNumRows( int rows )
nRows = rows; nRows = rows;
if ( autoUpdate() && isVisible() && if ( autoUpdate() && isVisible() &&
( oldLastVisible != lastRowVisible() || oldTopCell != topCell() ) ) ( oldLastVisible != lastRowVisible() || oldTopCell != topCell() ) )
repaint( oldTopCell != topCell() ); tqrepaint( oldTopCell != topCell() );
} else { } else {
// Be more careful - if destructing, bad things might happen. // Be more careful - if destructing, bad things might happen.
nRows = rows; nRows = rows;
@ -307,7 +307,7 @@ void QtTableView::setNumRows( int rows )
Sets the number of columns of the table to \a cols (must be non-negative). Sets the number of columns of the table to \a cols (must be non-negative).
Does not change leftCell(). Does not change leftCell().
The table repaints itself automatically if autoUpdate() is set. The table tqrepaints itself automatically if autoUpdate() is set.
\sa numCols(), numRows(), setNumRows() \sa numCols(), numRows(), setNumRows()
*/ */
@ -315,7 +315,7 @@ void QtTableView::setNumRows( int rows )
void QtTableView::setNumCols( int cols ) void QtTableView::setNumCols( int cols )
{ {
if ( cols < 0 ) { if ( cols < 0 ) {
#if defined(QT_CHECK_RANGE) #if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::setNumCols: (%s) Negative argument %d.", qWarning( "QtTableView::setNumCols: (%s) Negative argument %d.",
name( "unnamed" ), cols ); name( "unnamed" ), cols );
#endif #endif
@ -328,7 +328,7 @@ void QtTableView::setNumCols( int cols )
if ( autoUpdate() && isVisible() ) { if ( autoUpdate() && isVisible() ) {
int maxCol = lastColVisible(); int maxCol = lastColVisible();
if ( maxCol >= oldCols || maxCol >= nCols ) if ( maxCol >= oldCols || maxCol >= nCols )
repaint(); tqrepaint();
} }
updateScrollBars( horRange ); updateScrollBars( horRange );
updateFrameSize(); updateFrameSize();
@ -580,7 +580,7 @@ void QtTableView::setCellWidth( int cellWidth )
{ {
if ( cellW == cellWidth ) if ( cellW == cellWidth )
return; return;
#if defined(QT_CHECK_RANGE) #if defined(TQT_CHECK_RANGE)
if ( cellWidth < 0 || cellWidth > SHRT_MAX ) { if ( cellWidth < 0 || cellWidth > SHRT_MAX ) {
qWarning( "QtTableView::setCellWidth: (%s) Argument out of range (%d)", qWarning( "QtTableView::setCellWidth: (%s) Argument out of range (%d)",
name( "unnamed" ), cellWidth ); name( "unnamed" ), cellWidth );
@ -591,7 +591,7 @@ void QtTableView::setCellWidth( int cellWidth )
updateScrollBars( horSteps | horRange ); updateScrollBars( horSteps | horRange );
if ( autoUpdate() && isVisible() ) if ( autoUpdate() && isVisible() )
repaint(); tqrepaint();
} }
@ -634,7 +634,7 @@ void QtTableView::setCellHeight( int cellHeight )
{ {
if ( cellH == cellHeight ) if ( cellH == cellHeight )
return; return;
#if defined(QT_CHECK_RANGE) #if defined(TQT_CHECK_RANGE)
if ( cellHeight < 0 || cellHeight > SHRT_MAX ) { if ( cellHeight < 0 || cellHeight > SHRT_MAX ) {
qWarning( "QtTableView::setCellHeight: (%s) Argument out of range (%d)", qWarning( "QtTableView::setCellHeight: (%s) Argument out of range (%d)",
name( "unnamed" ), cellHeight ); name( "unnamed" ), cellHeight );
@ -643,7 +643,7 @@ void QtTableView::setCellHeight( int cellHeight )
#endif #endif
cellH = (short)cellHeight; cellH = (short)cellHeight;
if ( autoUpdate() && isVisible() ) if ( autoUpdate() && isVisible() )
repaint(); tqrepaint();
updateScrollBars( verSteps | verRange ); updateScrollBars( verSteps | verRange );
} }
@ -717,7 +717,7 @@ int QtTableView::totalHeight()
Sets the table flags to \a f. Sets the table flags to \a f.
If a flag setting changes the appearance of the table, the table is If a flag setting changes the appearance of the table, the table is
repainted if - and only if - autoUpdate() is TRUE. tqrepainted if - and only if - autoUpdate() is TRUE.
The table flags are mostly single bits, though there are some multibit The table flags are mostly single bits, though there are some multibit
flags for convenience. Here is a complete list: flags for convenience. Here is a complete list:
@ -786,7 +786,7 @@ void QtTableView::setTableFlags( uint f )
bool updateOn = autoUpdate(); bool updateOn = autoUpdate();
setAutoUpdate( FALSE ); setAutoUpdate( FALSE );
uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH; uint tqrepaintMask = Tbl_cutCellsV | Tbl_cutCellsH;
if ( f & Tbl_vScrollBar ) { if ( f & Tbl_vScrollBar ) {
setVerScrollBar( TRUE ); setVerScrollBar( TRUE );
@ -817,15 +817,15 @@ void QtTableView::setTableFlags( uint f )
(f & Tbl_snapToVGrid) != 0 && yCellDelta != 0 ) { (f & Tbl_snapToVGrid) != 0 && yCellDelta != 0 ) {
snapToGrid( (f & Tbl_snapToHGrid) != 0, // do snapping snapToGrid( (f & Tbl_snapToHGrid) != 0, // do snapping
(f & Tbl_snapToVGrid) != 0 ); (f & Tbl_snapToVGrid) != 0 );
repaintMask |= Tbl_snapToGrid; // repaint table tqrepaintMask |= Tbl_snapToGrid; // tqrepaint table
} }
} }
if ( updateOn ) { if ( updateOn ) {
setAutoUpdate( TRUE ); setAutoUpdate( TRUE );
updateScrollBars(); updateScrollBars();
if ( isVisible() && (f & repaintMask) ) if ( isVisible() && (f & tqrepaintMask) )
repaint(); tqrepaint();
} }
} }
@ -852,7 +852,7 @@ void QtTableView::clearTableFlags( uint f )
bool updateOn = autoUpdate(); bool updateOn = autoUpdate();
setAutoUpdate( FALSE ); setAutoUpdate( FALSE );
uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH; uint tqrepaintMask = Tbl_cutCellsV | Tbl_cutCellsH;
if ( f & Tbl_vScrollBar ) { if ( f & Tbl_vScrollBar ) {
setVerScrollBar( FALSE ); setVerScrollBar( FALSE );
@ -864,7 +864,7 @@ void QtTableView::clearTableFlags( uint f )
int maxX = maxXOffset(); int maxX = maxXOffset();
if ( xOffs > maxX ) { if ( xOffs > maxX ) {
setOffset( maxX, yOffs ); setOffset( maxX, yOffs );
repaintMask |= Tbl_scrollLastHCell; tqrepaintMask |= Tbl_scrollLastHCell;
} }
updateScrollBars( horRange ); updateScrollBars( horRange );
} }
@ -872,7 +872,7 @@ void QtTableView::clearTableFlags( uint f )
int maxY = maxYOffset(); int maxY = maxYOffset();
if ( yOffs > maxY ) { if ( yOffs > maxY ) {
setOffset( xOffs, maxY ); setOffset( xOffs, maxY );
repaintMask |= Tbl_scrollLastVCell; tqrepaintMask |= Tbl_scrollLastVCell;
} }
updateScrollBars( verRange ); updateScrollBars( verRange );
} }
@ -881,7 +881,7 @@ void QtTableView::clearTableFlags( uint f )
(f & Tbl_smoothVScrolling) != 0 && yCellDelta != 0 ) { (f & Tbl_smoothVScrolling) != 0 && yCellDelta != 0 ) {
snapToGrid( (f & Tbl_smoothHScrolling) != 0, // do snapping snapToGrid( (f & Tbl_smoothHScrolling) != 0, // do snapping
(f & Tbl_smoothVScrolling) != 0 ); (f & Tbl_smoothVScrolling) != 0 );
repaintMask |= Tbl_smoothScrolling; // repaint table tqrepaintMask |= Tbl_smoothScrolling; // tqrepaint table
} }
} }
if ( f & Tbl_snapToHGrid ) { if ( f & Tbl_snapToHGrid ) {
@ -893,8 +893,8 @@ void QtTableView::clearTableFlags( uint f )
if ( updateOn ) { if ( updateOn ) {
setAutoUpdate( TRUE ); setAutoUpdate( TRUE );
updateScrollBars(); // returns immediately if nothing to do updateScrollBars(); // returns immediately if nothing to do
if ( isVisible() && (f & repaintMask) ) if ( isVisible() && (f & tqrepaintMask) )
repaint(); tqrepaint();
} }
} }
@ -916,20 +916,20 @@ void QtTableView::clearTableFlags( uint f )
automatically whenever it has changed in some way (for example, when a automatically whenever it has changed in some way (for example, when a
\link setTableFlags() flag\endlink is changed). \link setTableFlags() flag\endlink is changed).
If \a enable is FALSE, the view does NOT repaint itself or update If \a enable is FALSE, the view does NOT tqrepaint itself or update
its internal state variables when it is changed. This can be its internal state variables when it is changed. This can be
useful to avoid flicker during large changes and is singularly useful to avoid flicker during large changes and is singularly
useless otherwise. Disable auto-update, do the changes, re-enable useless otherwise. Disable auto-update, do the changes, re-enable
auto-update and call repaint(). auto-update and call tqrepaint().
\warning Do not leave the view in this state for a long time \warning Do not leave the view in this state for a long time
(i.e., between events). If, for example, the user interacts with the (i.e., between events). If, for example, the user interacts with the
view when auto-update is off, strange things can happen. view when auto-update is off, strange things can happen.
Setting auto-update to TRUE does not repaint the view; you must call Setting auto-update to TRUE does not tqrepaint the view; you must call
repaint() to do this. tqrepaint() to do this.
\sa autoUpdate(), repaint() \sa autoUpdate(), tqrepaint()
*/ */
void QtTableView::setAutoUpdate( bool enable ) void QtTableView::setAutoUpdate( bool enable )
@ -948,7 +948,7 @@ void QtTableView::setAutoUpdate( bool enable )
Repaints the cell at row \a row, column \a col if it is inside the view. Repaints the cell at row \a row, column \a col if it is inside the view.
If \a erase is TRUE, the relevant part of the view is cleared to the If \a erase is TRUE, the relevant part of the view is cleared to the
background color/pixmap before the contents are repainted. background color/pixmap before the contents are tqrepainted.
\sa isVisible() \sa isVisible()
*/ */
@ -963,7 +963,7 @@ void QtTableView::updateCell( int row, int col, bool erase )
TQRect uR = TQRect( xPos, yPos, TQRect uR = TQRect( xPos, yPos,
cellW ? cellW : cellWidth(col), cellW ? cellW : cellWidth(col),
cellH ? cellH : cellHeight(row) ); cellH ? cellH : cellHeight(row) );
repaint( uR.intersect(viewRect()), erase ); tqrepaint( uR.intersect(viewRect()), erase );
} }
@ -1266,7 +1266,7 @@ void QtTableView::setupPainter( TQPainter * )
/*! /*!
Handles paint events, \a e, for the table view. Handles paint events, \a e, for the table view.
Calls paintCell() for the cells that needs to be repainted. Calls paintCell() for the cells that needs to be tqrepainted.
*/ */
void QtTableView::paintEvent( TQPaintEvent *e ) void QtTableView::paintEvent( TQPaintEvent *e )
@ -1280,7 +1280,7 @@ void QtTableView::paintEvent( TQPaintEvent *e )
TQPainter paint( this ); TQPainter paint( this );
if ( !contentsRect().contains( updateR, TRUE ) ) {// update frame ? if ( !contentsRect().tqcontains( updateR, TRUE ) ) {// update frame ?
drawFrame( &paint ); drawFrame( &paint );
if ( updateR.left() < frameWidth() ) //### if ( updateR.left() < frameWidth() ) //###
updateR.setLeft( frameWidth() ); updateR.setLeft( frameWidth() );
@ -1315,7 +1315,7 @@ void QtTableView::paintEvent( TQPaintEvent *e )
TQRect winR = viewRect(); TQRect winR = viewRect();
TQRect cellR; TQRect cellR;
TQRect cellUR; TQRect cellUR;
#ifndef QT_NO_TRANSFORMATIONS #ifndef TQT_NO_TRANSFORMATIONS
TQWMatrix matrix; TQWMatrix matrix;
#endif #endif
@ -1339,11 +1339,11 @@ void QtTableView::paintEvent( TQPaintEvent *e )
if ( eraseInPaint ) if ( eraseInPaint )
paint.eraseRect( cellUR ); paint.eraseRect( cellUR );
#ifndef QT_NO_TRANSFORMATIONS #ifndef TQT_NO_TRANSFORMATIONS
matrix.translate( xPos, yPos ); matrix.translate( xPos, yPos );
paint.setWorldMatrix( matrix ); paint.setWorldMatrix( matrix );
if ( testTableFlags(Tbl_clipCellPainting) || if ( testTableFlags(Tbl_clipCellPainting) ||
frameWidth() > 0 && !winR.contains( cellR ) ) { //##arnt frameWidth() > 0 && !winR.tqcontains( cellR ) ) { //##arnt
paint.setClipRect( cellUR ); paint.setClipRect( cellUR );
paintCell( &paint, row, col ); paintCell( &paint, row, col );
paint.setClipping( FALSE ); paint.setClipping( FALSE );
@ -1355,7 +1355,7 @@ void QtTableView::paintEvent( TQPaintEvent *e )
#else #else
paint.translate( xPos, yPos ); paint.translate( xPos, yPos );
if ( testTableFlags(Tbl_clipCellPainting) || if ( testTableFlags(Tbl_clipCellPainting) ||
frameWidth() > 0 && !winR.contains( cellR ) ) { //##arnt frameWidth() > 0 && !winR.tqcontains( cellR ) ) { //##arnt
paint.setClipRect( cellUR ); paint.setClipRect( cellUR );
paintCell( &paint, row, col ); paintCell( &paint, row, col );
paint.setClipping( FALSE ); paint.setClipping( FALSE );
@ -1379,13 +1379,13 @@ void QtTableView::paintEvent( TQPaintEvent *e )
// Note that this needs to be done regardless whether we do // Note that this needs to be done regardless whether we do
// eraseInPaint or not. Reason: a subclass may implement // eraseInPaint or not. Reason: a subclass may implement
// flicker-freeness and encourage the use of repaint(FALSE). // flicker-freeness and encourage the use of tqrepaint(FALSE).
// The subclass, however, cannot draw all pixels, just those // The subclass, however, cannot draw all pixels, just those
// inside the cells. So QtTableView is reponsible for all pixels // inside the cells. So QtTableView is reponsible for all pixels
// outside the cells. // outside the cells.
TQRect viewR = viewRect(); TQRect viewR = viewRect();
const TQColorGroup g = colorGroup(); const TQColorGroup g = tqcolorGroup();
if ( xPos <= maxX ) { if ( xPos <= maxX ) {
TQRect r = viewR; TQRect r = viewR;
@ -1414,8 +1414,8 @@ void QtTableView::resizeEvent( TQResizeEvent * )
verSteps | verGeometry | verRange ); verSteps | verGeometry | verRange );
showOrHideScrollBars(); showOrHideScrollBars();
updateFrameSize(); updateFrameSize();
int maxX = QMIN( xOffs, maxXOffset() ); // ### can be slow int maxX = TQMIN( xOffs, maxXOffset() ); // ### can be slow
int maxY = QMIN( yOffs, maxYOffset() ); int maxY = TQMIN( yOffs, maxYOffset() );
setOffset( maxX, maxY ); setOffset( maxX, maxY );
} }
@ -1426,7 +1426,7 @@ void QtTableView::resizeEvent( TQResizeEvent * )
void QtTableView::updateView() void QtTableView::updateView()
{ {
repaint( viewRect() ); tqrepaint( viewRect() );
} }
/*! /*!
@ -1439,14 +1439,14 @@ TQScrollBar *QtTableView::verticalScrollBar() const
{ {
QtTableView *that = (QtTableView*)this; // semantic const QtTableView *that = (QtTableView*)this; // semantic const
if ( !vScrollBar ) { if ( !vScrollBar ) {
TQScrollBar *sb = new TQScrollBar( TQScrollBar::Vertical, that ); TQScrollBar *sb = new TQScrollBar( Qt::Vertical, that );
#ifndef QT_NO_CURSOR #ifndef TQT_NO_CURSOR
sb->setCursor( arrowCursor ); sb->setCursor( arrowCursor );
#endif #endif
sb->resize( sb->sizeHint() ); // height is irrelevant sb->resize( sb->tqsizeHint() ); // height is irrelevant
Q_CHECK_PTR(sb); Q_CHECK_PTR(sb);
sb->setTracking( FALSE ); sb->setTracking( FALSE );
sb->setFocusPolicy( NoFocus ); sb->setFocusPolicy( TQ_NoFocus );
connect( sb, TQT_SIGNAL(valueChanged(int)), connect( sb, TQT_SIGNAL(valueChanged(int)),
TQT_SLOT(verSbValue(int))); TQT_SLOT(verSbValue(int)));
connect( sb, TQT_SIGNAL(sliderMoved(int)), connect( sb, TQT_SIGNAL(sliderMoved(int)),
@ -1470,12 +1470,12 @@ TQScrollBar *QtTableView::horizontalScrollBar() const
{ {
QtTableView *that = (QtTableView*)this; // semantic const QtTableView *that = (QtTableView*)this; // semantic const
if ( !hScrollBar ) { if ( !hScrollBar ) {
TQScrollBar *sb = new TQScrollBar( TQScrollBar::Horizontal, that ); TQScrollBar *sb = new TQScrollBar( Qt::Horizontal, that );
#ifndef QT_NO_CURSOR #ifndef TQT_NO_CURSOR
sb->setCursor( arrowCursor ); sb->setCursor( arrowCursor );
#endif #endif
sb->resize( sb->sizeHint() ); // width is irrelevant sb->resize( sb->tqsizeHint() ); // width is irrelevant
sb->setFocusPolicy( NoFocus ); sb->setFocusPolicy( TQ_NoFocus );
Q_CHECK_PTR(sb); Q_CHECK_PTR(sb);
sb->setTracking( FALSE ); sb->setTracking( FALSE );
connect( sb, TQT_SIGNAL(valueChanged(int)), connect( sb, TQT_SIGNAL(valueChanged(int)),
@ -1522,7 +1522,7 @@ void QtTableView::setHorScrollBar( bool on, bool update )
else else
sbDirty = sbDirty | verMask; sbDirty = sbDirty | verMask;
if ( hideScrollBar && isVisible() ) if ( hideScrollBar && isVisible() )
repaint( hScrollBar->x(), hScrollBar->y(), tqrepaint( hScrollBar->x(), hScrollBar->y(),
width() - hScrollBar->x(), hScrollBar->height() ); width() - hScrollBar->x(), hScrollBar->height() );
} }
if ( update ) if ( update )
@ -1561,7 +1561,7 @@ void QtTableView::setVerScrollBar( bool on, bool update )
else else
sbDirty = sbDirty | horMask; sbDirty = sbDirty | horMask;
if ( hideScrollBar && isVisible() ) if ( hideScrollBar && isVisible() )
repaint( vScrollBar->x(), vScrollBar->y(), tqrepaint( vScrollBar->x(), vScrollBar->y(),
vScrollBar->width(), height() - vScrollBar->y() ); vScrollBar->width(), height() - vScrollBar->y() );
} }
if ( update ) if ( update )
@ -1579,7 +1579,7 @@ int QtTableView::findRawRow( int yPos, int *cellMaxY, int *cellMinY,
return r; return r;
if ( goOutsideView || yPos >= minViewY() && yPos <= maxViewY() ) { if ( goOutsideView || yPos >= minViewY() && yPos <= maxViewY() ) {
if ( yPos < minViewY() ) { if ( yPos < minViewY() ) {
#if defined(QT_CHECK_RANGE) #if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::findRawRow: (%s) internal error: " qWarning( "QtTableView::findRawRow: (%s) internal error: "
"yPos < minViewY() && goOutsideView " "yPos < minViewY() && goOutsideView "
"not supported. (%d,%d)", "not supported. (%d,%d)",
@ -1626,7 +1626,7 @@ int QtTableView::findRawCol( int xPos, int *cellMaxX, int *cellMinX ,
return c; return c;
if ( goOutsideView || xPos >= minViewX() && xPos <= maxViewX() ) { if ( goOutsideView || xPos >= minViewX() && xPos <= maxViewX() ) {
if ( xPos < minViewX() ) { if ( xPos < minViewX() ) {
#if defined(QT_CHECK_RANGE) #if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::findRawCol: (%s) internal error: " qWarning( "QtTableView::findRawCol: (%s) internal error: "
"xPos < minViewX() && goOutsideView " "xPos < minViewX() && goOutsideView "
"not supported. (%d,%d)", "not supported. (%d,%d)",
@ -1995,7 +1995,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & horSteps ) { if ( sbDirty & horSteps ) {
if ( cellW ) if ( cellW )
hScrollBar->setSteps( QMIN(cellW,viewWidth()/2), viewWidth() ); hScrollBar->setSteps( TQMIN(cellW,viewWidth()/2), viewWidth() );
else else
hScrollBar->setSteps( 16, viewWidth() ); hScrollBar->setSteps( 16, viewWidth() );
} }
@ -2006,7 +2006,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & horValue ) if ( sbDirty & horValue )
hScrollBar->setValue( xOffs ); hScrollBar->setValue( xOffs );
// show scrollbar only when it has a sane geometry // show scrollbar only when it has a sane tqgeometry
if ( !hScrollBar->isVisible() ) if ( !hScrollBar->isVisible() )
hScrollBar->show(); hScrollBar->show();
} }
@ -2019,7 +2019,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & verSteps ) { if ( sbDirty & verSteps ) {
if ( cellH ) if ( cellH )
vScrollBar->setSteps( QMIN(cellH,viewHeight()/2), viewHeight() ); vScrollBar->setSteps( TQMIN(cellH,viewHeight()/2), viewHeight() );
else else
vScrollBar->setSteps( 16, viewHeight() ); // fttb! ### vScrollBar->setSteps( 16, viewHeight() ); // fttb! ###
} }
@ -2030,7 +2030,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & verValue ) if ( sbDirty & verValue )
vScrollBar->setValue( yOffs ); vScrollBar->setValue( yOffs );
// show scrollbar only when it has a sane geometry // show scrollbar only when it has a sane tqgeometry
if ( !vScrollBar->isVisible() ) if ( !vScrollBar->isVisible() )
vScrollBar->show(); vScrollBar->show();
} }
@ -2061,9 +2061,9 @@ void QtTableView::updateFrameSize()
setFrameRect( TQRect(0,0,rw,rh) ); setFrameRect( TQRect(0,0,rw,rh) );
if ( rw != fw ) if ( rw != fw )
update( QMIN(fw,rw) - frameWidth() - 2, 0, frameWidth()+4, rh ); update( TQMIN(fw,rw) - frameWidth() - 2, 0, frameWidth()+4, rh );
if ( rh != fh ) if ( rh != fh )
update( 0, QMIN(fh,rh) - frameWidth() - 2, rw, frameWidth()+4 ); update( 0, TQMIN(fh,rh) - frameWidth() - 2, rw, frameWidth()+4 );
} }
} }
@ -2253,7 +2253,7 @@ void QtTableView::showOrHideScrollBars()
Call this function when the table view's total size is changed; Call this function when the table view's total size is changed;
typically because the result of cellHeight() or cellWidth() have changed. typically because the result of cellHeight() or cellWidth() have changed.
This function does not repaint the widget. This function does not tqrepaint the widget.
*/ */
void QtTableView::updateTableSize() void QtTableView::updateTableSize()

@ -7,38 +7,39 @@
** **
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
** **
** This file contains a class moved out of the Qt GUI Toolkit API. It ** This file contains a class moved out of the TQt GUI Toolkit API. It
** may be used, distributed and modified without limitation. ** may be used, distributed and modified without limitation.
** **
**********************************************************************/ **********************************************************************/
#ifndef QTTABLEVIEW_H #ifndef TQTTABLEVIEW_H
#define QTTABLEVIEW_H #define TQTTABLEVIEW_H
#ifndef QT_H #ifndef TQT_H
#include "tqframe.h" #include "tqframe.h"
#endif // QT_H #endif // TQT_H
#ifndef QT_NO_QTTABLEVIEW #ifndef TQT_NO_TQTTABLEVIEW
class TQScrollBar; class TQScrollBar;
class QCornerSquare; class QCornerSquare;
class QtTableView : public QFrame class QtTableView : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
virtual void setBackgroundColor( const TQColor & ); virtual void setBackgroundColor( const TQColor & );
virtual void setPalette( const TQPalette & ); virtual void setPalette( const TQPalette & );
void show(); void show();
void repaint( bool erase=TRUE ); void tqrepaint( bool erase=TRUE );
void repaint( int x, int y, int w, int h, bool erase=TRUE ); void tqrepaint( int x, int y, int w, int h, bool erase=TRUE );
void repaint( const TQRect &, bool erase=TRUE ); void tqrepaint( const TQRect &, bool erase=TRUE );
protected: protected:
QtTableView( TQWidget *parent=0, const char *name=0, WFlags f=0 ); QtTableView( TQWidget *tqparent=0, const char *name=0, WFlags f=0 );
~QtTableView(); ~QtTableView();
int numRows() const; int numRows() const;
@ -78,8 +79,8 @@ protected:
void updateCell( int row, int column, bool erase=TRUE ); void updateCell( int row, int column, bool erase=TRUE );
QRect cellUpdateRect() const; TQRect cellUpdateRect() const;
QRect viewRect() const; TQRect viewRect() const;
int lastRowVisible() const; int lastRowVisible() const;
int lastColVisible() const; int lastColVisible() const;
@ -162,14 +163,14 @@ private:
uint inSbUpdate : 1; uint inSbUpdate : 1;
uint tFlags; uint tFlags;
QRect cellUpdateR; TQRect cellUpdateR;
TQScrollBar *vScrollBar; TQScrollBar *vScrollBar;
TQScrollBar *hScrollBar; TQScrollBar *hScrollBar;
QCornerSquare *cornerSquare; QCornerSquare *cornerSquare;
private: // Disabled copy constructor and operator= private: // Disabled copy constructor and operator=
#if defined(Q_DISABLE_COPY) #if defined(TQ_DISABLE_COPY)
QtTableView( const QtTableView & ); QtTableView( const QtTableView & );
QtTableView &operator=( const QtTableView & ); QtTableView &operator=( const QtTableView & );
#endif #endif
@ -236,16 +237,16 @@ inline TQRect QtTableView::cellUpdateRect() const
inline bool QtTableView::autoUpdate() const inline bool QtTableView::autoUpdate() const
{ return isUpdatesEnabled(); } { return isUpdatesEnabled(); }
inline void QtTableView::repaint( bool erase ) inline void QtTableView::tqrepaint( bool erase )
{ repaint( 0, 0, width(), height(), erase ); } { tqrepaint( 0, 0, width(), height(), erase ); }
inline void QtTableView::repaint( const TQRect &r, bool erase ) inline void QtTableView::tqrepaint( const TQRect &r, bool erase )
{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); } { tqrepaint( r.x(), r.y(), r.width(), r.height(), erase ); }
inline void QtTableView::updateScrollBars() inline void QtTableView::updateScrollBars()
{ updateScrollBars( 0 ); } { updateScrollBars( 0 ); }
#endif // QT_NO_QTTABLEVIEW #endif // TQT_NO_TQTTABLEVIEW
#endif // QTTABLEVIEW_H #endif // TQTTABLEVIEW_H

@ -53,18 +53,18 @@ const char *description = I18N_NOOP("Moon Phase Indicator for KDE");
extern "C" extern "C"
{ {
KDE_EXPORT KPanelApplet *init(TQWidget *parent, const TQString& configFile) KDE_EXPORT KPanelApplet *init(TQWidget *tqparent, const TQString& configFile)
{ {
KGlobal::locale()->insertCatalogue("kmoon"); KGlobal::locale()->insertCatalogue("kmoon");
return new MoonPAWidget(configFile, KPanelApplet::Normal, return new MoonPAWidget(configFile, KPanelApplet::Normal,
KPanelApplet::About|KPanelApplet::Preferences, KPanelApplet::About|KPanelApplet::Preferences,
parent, "kmoonapplet"); tqparent, "kmoonapplet");
} }
} }
MoonPAWidget::MoonPAWidget(const TQString& configFile, Type type, int actions, MoonPAWidget::MoonPAWidget(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name) TQWidget *tqparent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name) : KPanelApplet(configFile, type, actions, tqparent, name)
{ {
KConfig *config = KGlobal::config(); KConfig *config = KGlobal::config();
config->setGroup("General"); config->setGroup("General");
@ -104,7 +104,7 @@ void MoonPAWidget::showAbout()
KStdGuiItem::ok() ); KStdGuiItem::ok() );
TQPixmap ret = DesktopIcon("kmoon"); TQPixmap ret = DesktopIcon("kmoon");
TQString text = i18n(description) + TQString::fromLatin1("\n\n") + TQString text = i18n(description) + TQString::tqfromLatin1("\n\n") +
i18n("Written by Stephan Kulow <coolo@kde.org>\n" i18n("Written by Stephan Kulow <coolo@kde.org>\n"
"\n" "\n"
"Made an applet by M G Berberich " "Made an applet by M G Berberich "
@ -118,12 +118,12 @@ void MoonPAWidget::showAbout()
dialog->setIcon(ret); dialog->setIcon(ret);
KMessageBox::createKMessageBox(dialog, ret, text, TQStringList(), TQString::null, 0, KMessageBox::Notify); KMessageBox::createKMessageBox(dialog, ret, text, TQStringList(), TQString(), 0, KMessageBox::Notify);
} }
void MoonPAWidget::settings() void MoonPAWidget::settings()
{ {
KMoonDlg dlg(moon->angle(), moon->northHemi(), moon->mask(), KMoonDlg dlg(moon->angle(), moon->northHemi(), moon->tqmask(),
this, "moondlg"); this, "moondlg");
if (dlg.exec() == KMoonDlg::Accepted) { if (dlg.exec() == KMoonDlg::Accepted) {
moon->setAngle(dlg.getAngle()); moon->setAngle(dlg.getAngle());
@ -133,10 +133,10 @@ void MoonPAWidget::settings()
config->setGroup("General"); config->setGroup("General");
config->writeEntry("Rotation", moon->angle()); config->writeEntry("Rotation", moon->angle());
config->writeEntry("Northern", moon->northHemi()); config->writeEntry("Northern", moon->northHemi());
config->writeEntry("Mask", moon->mask()); config->writeEntry("Mask", moon->tqmask());
config->sync(); config->sync();
} }
repaint(); tqrepaint();
} }
void MoonPAWidget::timerEvent( TQTimerEvent * ) void MoonPAWidget::timerEvent( TQTimerEvent * )
@ -144,8 +144,8 @@ void MoonPAWidget::timerEvent( TQTimerEvent * )
time_t clock; time_t clock;
time(&clock); time(&clock);
struct tm *t = localtime(&clock); struct tm *t = localtime(&clock);
moon->calcStatus(mktime(t)); moon->calctqStatus(mktime(t));
moon->repaint(); moon->tqrepaint();
} }
void MoonPAWidget::mousePressEvent( TQMouseEvent *e) void MoonPAWidget::mousePressEvent( TQMouseEvent *e)
@ -153,11 +153,11 @@ void MoonPAWidget::mousePressEvent( TQMouseEvent *e)
if (!popup) if (!popup)
return; return;
if (e->button() == RightButton) { if (e->button() == Qt::RightButton) {
popup->popup(mapToGlobal(e->pos())); popup->popup(mapToGlobal(e->pos()));
popup->exec(); popup->exec();
} }
if (e->button() == LeftButton) { if (e->button() == Qt::LeftButton) {
showAbout(); showAbout();
} }
} }

@ -37,10 +37,11 @@ class MoonWidget;
class MoonPAWidget : public KPanelApplet class MoonPAWidget : public KPanelApplet
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MoonPAWidget(const TQString& configFile, Type t = Normal, int actions = 0, MoonPAWidget(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0); TQWidget *tqparent = 0, const char *name = 0);
~MoonPAWidget(); ~MoonPAWidget();
int widthForHeight(int height) const { return height; } int widthForHeight(int height) const { return height; }

@ -29,9 +29,9 @@
#include "kmoondlg.h" #include "kmoondlg.h"
#include "kmoonwidget.h" #include "kmoonwidget.h"
KMoonDlg::KMoonDlg(int a, bool n, bool m, TQWidget *parent, const char *name) KMoonDlg::KMoonDlg(int a, bool n, bool m, TQWidget *tqparent, const char *name)
: KDialogBase(parent, name, true, i18n("Change View"), : KDialogBase(tqparent, name, true, i18n("Change View"),
Ok|Cancel|Help), angle(a), north(n), mask(m) Ok|Cancel|Help), angle(a), north(n), tqmask(m)
{ {
TQWidget *page = new TQWidget( this ); TQWidget *page = new TQWidget( this );
setMainWidget(page); setMainWidget(page);
@ -71,11 +71,11 @@ KMoonDlg::KMoonDlg(int a, bool n, bool m, TQWidget *parent, const char *name)
connect(hemitoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleHemi())); connect(hemitoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleHemi()));
masktoggle = new TQPushButton(hbox2); tqmasktoggle = new TQPushButton(hbox2);
masktoggle->setText(mask ? i18n("Switch Masking Off") : tqmasktoggle->setText(tqmask ? i18n("Switch Masking Off") :
i18n("Switch Masking On")); i18n("Switch Masking On"));
connect(masktoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleMask())); connect(tqmasktoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleMask()));
topLayout->addWidget(vbox); topLayout->addWidget(vbox);
moon = new MoonWidget(page, "preview"); moon = new MoonWidget(page, "preview");
@ -94,7 +94,7 @@ void KMoonDlg::angleChanged(int value) {
} }
void KMoonDlg::help() { void KMoonDlg::help() {
kapp->invokeHelp(TQString::fromLatin1("config")); kapp->invokeHelp(TQString::tqfromLatin1("config"));
} }
void KMoonDlg::toggleHemi() { void KMoonDlg::toggleHemi() {
@ -105,9 +105,9 @@ void KMoonDlg::toggleHemi() {
} }
void KMoonDlg::toggleMask() { void KMoonDlg::toggleMask() {
moon->setMask(!moon->mask()); moon->setMask(!moon->tqmask());
mask = moon->mask(); tqmask = moon->tqmask();
masktoggle->setText(mask ? i18n("Switch Masking Off") : tqmasktoggle->setText(tqmask ? i18n("Switch Masking Off") :
i18n("Switch Masking On")); i18n("Switch Masking On"));
} }

@ -29,21 +29,22 @@ class TQPushButton;
class KMoonDlg : public KDialogBase { class KMoonDlg : public KDialogBase {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMoonDlg(int angle, bool north, bool mask, TQWidget *parent, const char *name); KMoonDlg(int angle, bool north, bool tqmask, TQWidget *tqparent, const char *name);
int getAngle() const { return angle; } int getAngle() const { return angle; }
bool getNorthHemi() const { return north; } bool getNorthHemi() const { return north; }
bool getMask() const { return mask; } bool getMask() const { return tqmask; }
private: private:
TQSlider *slider; TQSlider *slider;
MoonWidget *moon; MoonWidget *moon;
int angle; int angle;
bool north; bool north;
bool mask; bool tqmask;
TQPushButton *hemitoggle; TQPushButton *hemitoggle;
TQPushButton *masktoggle; TQPushButton *tqmasktoggle;
private slots: private slots:
void help(); void help();

@ -50,8 +50,8 @@
extern double moonphasebylunation(int lun, int phi); extern double moonphasebylunation(int lun, int phi);
extern time_t JDtoDate(double jd, struct tm *event_date); extern time_t JDtoDate(double jd, struct tm *event_date);
MoonWidget::MoonWidget(TQWidget *parent, const char *name) MoonWidget::MoonWidget(TQWidget *tqparent, const char *name)
: TQWidget(parent, name) : TQWidget(tqparent, name)
{ {
struct tm * t; struct tm * t;
time_t clock; time_t clock;
@ -61,23 +61,23 @@ MoonWidget::MoonWidget(TQWidget *parent, const char *name)
config->setGroup("General"); config->setGroup("General");
_angle = config->readNumEntry("Rotation", 0); _angle = config->readNumEntry("Rotation", 0);
_north = config->readBoolEntry("Northern", true); _north = config->readBoolEntry("Northern", true);
_mask = config->readBoolEntry("Mask", true); _tqmask = config->readBoolEntry("Mask", true);
old_angle = old_w = old_h = old_counter = -1; old_angle = old_w = old_h = old_counter = -1;
old_north = false; old_north = false;
old_mask = false; old_tqmask = false;
startTimer(1000 * 60 * 20); startTimer(1000 * 60 * 20);
time(&clock); time(&clock);
t = gmtime(&clock); t = gmtime(&clock);
// kdDebug() << "time " << t->tm_isdst << " " << timezone << " " << daylight << endl ; // kdDebug() << "time " << t->tm_isdst << " " << timezone << " " << daylight << endl ;
calcStatus(mktime(t)); calctqStatus(mktime(t));
} }
MoonWidget::~MoonWidget() MoonWidget::~MoonWidget()
{ {
} }
void MoonWidget::calcStatus( time_t time ) void MoonWidget::calctqStatus( time_t time )
{ {
uint lun = 0; uint lun = 0;
time_t last_new = 0; time_t last_new = 0;
@ -217,17 +217,17 @@ void MoonWidget::calcStatus( time_t time )
} }
renderGraphic(); renderGraphic();
repaint(); tqrepaint();
} }
TQImage MoonWidget::loadMoon(int index) TQImage MoonWidget::loadMoon(int index)
{ {
if (index == 0) // the new moon has the wrong filename if (index == 0) // the new moon has the wrong filename
index = 29; index = 29;
TQString filename = TQString("kmoon/pics/moon%1.png").arg(index); TQString filename = TQString("kmoon/pics/moon%1.png").tqarg(index);
TQString path = locate("data", filename); TQString path = locate("data", filename);
if (path.isNull()) if (path.isNull())
kdFatal() << "cound't find " << filename << ". Exiting.\n"; kdFatal() << "cound't tqfind " << filename << ". Exiting.\n";
TQImage image(path); TQImage image(path);
KIconEffect iconeffect; KIconEffect iconeffect;
image=iconeffect.apply(image, KIcon::Panel, KIcon::DefaultState); image=iconeffect.apply(image, KIcon::Panel, KIcon::DefaultState);
@ -238,21 +238,21 @@ void MoonWidget::setAngle(int value)
{ {
_angle = value; _angle = value;
renderGraphic(); renderGraphic();
repaint(); tqrepaint();
} }
void MoonWidget::setNorthHemi(bool n) void MoonWidget::setNorthHemi(bool n)
{ {
_north = n; _north = n;
renderGraphic(); renderGraphic();
repaint(); tqrepaint();
} }
void MoonWidget::setMask(bool value) void MoonWidget::setMask(bool value)
{ {
_mask = value; _tqmask = value;
renderGraphic(); renderGraphic();
repaint(); tqrepaint();
} }
void MoonWidget::paintEvent(TQPaintEvent *) void MoonWidget::paintEvent(TQPaintEvent *)
@ -263,7 +263,7 @@ void MoonWidget::paintEvent(TQPaintEvent *)
void MoonWidget::resizeEvent(TQResizeEvent *) void MoonWidget::resizeEvent(TQResizeEvent *)
{ {
renderGraphic(); renderGraphic();
repaint(); tqrepaint();
} }
void MoonWidget::renderGraphic() void MoonWidget::renderGraphic()
@ -280,7 +280,7 @@ void MoonWidget::renderGraphic()
im = im.convertDepth(32, 0); im = im.convertDepth(32, 0);
assert(!im.isNull()); assert(!im.isNull());
int mw = QMIN(width(), height()); int mw = TQMIN(width(), height());
TQImage dest; TQImage dest;
if (TQPixmap::defaultDepth() > 8) { if (TQPixmap::defaultDepth() > 8) {
@ -300,7 +300,7 @@ void MoonWidget::renderGraphic()
TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse); TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse);
TQPainter p; TQPainter p;
p.begin(&pixmap); p.begin(&pixmap);
p.fillRect(0, 0, dmw, dmw, Qt::black); p.fillRect(0, 0, dmw, dmw, TQt::black);
p.setClipRegion(r); p.setClipRegion(r);
p.drawPixmap(0, 0, rotated, (rotated.width() - dmw) / 2, p.drawPixmap(0, 0, rotated, (rotated.width() - dmw) / 2,
(rotated.height() - dmw) / 2, (rotated.height() - dmw) / 2,
@ -311,41 +311,41 @@ void MoonWidget::renderGraphic()
im = pixmap.convertToImage(); im = pixmap.convertToImage();
dest = im.copy(0, 0, mw, mw); dest = im.copy(0, 0, mw, mw);
for (int y = 0; y < mw; y++) { for (int y = 0; y < mw; y++) {
QRgb *destline = (QRgb*)dest.scanLine(y); TQRgb *destline = (TQRgb*)dest.scanLine(y);
QRgb *sourceline1 = (QRgb*)im.scanLine(2*y); TQRgb *sourceline1 = (TQRgb*)im.scanLine(2*y);
QRgb *sourceline2 = (QRgb*)im.scanLine(2*y + 1); TQRgb *sourceline2 = (TQRgb*)im.scanLine(2*y + 1);
for (int x = 0; x < mw; x++) { for (int x = 0; x < mw; x++) {
int r = qRed(sourceline1[2*x]) + qRed(sourceline1[2*x+1]); int r = tqRed(sourceline1[2*x]) + tqRed(sourceline1[2*x+1]);
r = r + qRed(sourceline2[2*x]) + qRed(sourceline2[2*x+1]); r = r + tqRed(sourceline2[2*x]) + tqRed(sourceline2[2*x+1]);
int g = qGreen(sourceline1[2*x]) + qGreen(sourceline1[2*x+1]); int g = tqGreen(sourceline1[2*x]) + tqGreen(sourceline1[2*x+1]);
g = g + qGreen(sourceline2[2*x]) + qGreen(sourceline2[2*x+1]); g = g + tqGreen(sourceline2[2*x]) + tqGreen(sourceline2[2*x+1]);
int b = qBlue(sourceline1[2*x]) + qBlue(sourceline1[2*x+1]); int b = tqBlue(sourceline1[2*x]) + tqBlue(sourceline1[2*x+1]);
b = b + qBlue(sourceline2[2*x]) + qBlue(sourceline2[2*x+1]); b = b + tqBlue(sourceline2[2*x]) + tqBlue(sourceline2[2*x+1]);
destline[x] = qRgb(qRound(r / 4), qRound(g / 4), destline[x] = tqRgb(tqRound(r / 4), tqRound(g / 4),
qRound(b / 4)); tqRound(b / 4));
} }
} }
} else { } else {
dest = im.smoothScale(mw, mw).convertDepth(32); dest = im.smoothScale(mw, mw).convertDepth(32);
} }
if (_mask) { if (_tqmask) {
// generate alpha-channel // generate alpha-channel
int dmw = mw*2; int dmw = mw*2;
TQBitmap dMask(dmw, dmw); TQBitmap dMask(dmw, dmw);
TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse); TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse);
TQPainter p; TQPainter p;
p.begin(&dMask); p.begin(&dMask);
p.fillRect(0, 0, dmw, dmw, Qt::white); p.fillRect(0, 0, dmw, dmw, TQt::white);
p.setClipRegion(r); p.setClipRegion(r);
p.fillRect(0, 0, dmw, dmw, Qt::black); p.fillRect(0, 0, dmw, dmw, TQt::black);
p.end(); p.end();
TQImage Mask2 = dMask.convertToImage().convertDepth(32).smoothScale(mw, mw); TQImage Mask2 = TQImage(dMask.convertToImage()).convertDepth(32).smoothScale(mw, mw);
dest.setAlphaBuffer(true); dest.setAlphaBuffer(true);
for (int y = 0; y < mw; y++) { for (int y = 0; y < mw; y++) {
QRgb *destline = (QRgb*)dest.scanLine(y); TQRgb *destline = (TQRgb*)dest.scanLine(y);
QRgb *sourceline = (QRgb*)Mask2.scanLine(y); TQRgb *sourceline = (TQRgb*)Mask2.scanLine(y);
for (int x = 0; x < mw; x++) { for (int x = 0; x < mw; x++) {
destline[x] = (destline[x] & RGB_MASK)|(qRed(sourceline[x]) << 24); destline[x] = (destline[x] & TQRGB_MASK)|(tqRed(sourceline[x]) << 24);
} }
} }
} }

@ -28,15 +28,16 @@
#include <ksystemtray.h> #include <ksystemtray.h>
class TQPopupMenu; class TQPopupMenu;
class MoonWidget : public QWidget class MoonWidget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MoonWidget(TQWidget *parent = 0, const char *name = 0); MoonWidget(TQWidget *tqparent = 0, const char *name = 0);
~MoonWidget(); ~MoonWidget();
void calcStatus( time_t time ); void calctqStatus( time_t time );
int angle() const { return _angle; } int angle() const { return _angle; }
void setAngle(int angle); void setAngle(int angle);
@ -44,14 +45,14 @@ public:
bool northHemi() const { return _north; } bool northHemi() const { return _north; }
void setNorthHemi(bool b); void setNorthHemi(bool b);
bool mask() const { return _mask; } bool tqmask() const { return _tqmask; }
void setMask(bool b); void setMask(bool b);
protected: protected:
int old_w, old_h; int old_w, old_h;
int counter, old_counter; int counter, old_counter;
int _angle, old_angle; int _angle, old_angle;
int _mask, old_mask; int _tqmask, old_tqmask;
bool old_north, _north; bool old_north, _north;
TQPixmap pixmap; TQPixmap pixmap;

@ -166,9 +166,9 @@ double torad(double x)
** since the New Moon of 2000 January 6. ** since the New Moon of 2000 January 6.
** **
** int phi: another phase parameter, selecting the phase of the ** int phi: another phase parameter, selecting the phase of the
** moon. 0 = New, 1 = First Qtr, 2 = Full, 3 = Last Qtr ** moon. 0 = New, 1 = First TQtr, 2 = Full, 3 = Last TQtr
** **
** Return: Apparent JD of the needed phase ** Return: Aptqparent JD of the needed phase
*/ */
#include <stdio.h> #include <stdio.h>

@ -25,12 +25,12 @@
#include "kimagenumber.h" #include "kimagenumber.h"
KImageNumber::KImageNumber(const TQString& font, TQWidget* parent,const char* name) : KImageNumber::KImageNumber(const TQString& font, TQWidget* tqparent,const char* name) :
TQFrame(parent,name), TQFrame(tqparent,name),
m_value(0) m_value(0)
{ {
fontPix = new TQPixmap(font); fontPix = new TQPixmap(font);
resize(sizeHint()); resize(tqsizeHint());
} }
KImageNumber::~KImageNumber() KImageNumber::~KImageNumber()
@ -47,7 +47,7 @@ void KImageNumber::paintEvent(TQPaintEvent*)
data.sprintf("%06.1f", m_value); data.sprintf("%06.1f", m_value);
for(unsigned int i=0; i < data.length(); i++) { for(unsigned int i=0; i < data.length(); i++) {
int wl = data.at(i).latin1() - '0'; int wl = data.tqat(i).latin1() - '0';
if(data.at(i) == '.') if(data.at(i) == '.')
wl = 10; wl = 10;
bitBlt(this, i*each, 0, fontPix, wl*each, 0, each, fontPix->height()); bitBlt(this, i*each, 0, fontPix, wl*each, 0, each, fontPix->height());
@ -57,7 +57,7 @@ void KImageNumber::paintEvent(TQPaintEvent*)
void KImageNumber::setValue(double v) void KImageNumber::setValue(double v)
{ {
m_value = v; m_value = v;
repaint(false); tqrepaint(false);
} }
double KImageNumber::value() const double KImageNumber::value() const
@ -65,7 +65,7 @@ double KImageNumber::value() const
return m_value; return m_value;
} }
TQSize KImageNumber::sizeHint() const TQSize KImageNumber::tqsizeHint() const
{ {
int w = fontPix->width(); int w = fontPix->width();
int each = w/11; int each = w/11;

@ -29,17 +29,18 @@
#include <tqframe.h> #include <tqframe.h>
#include <tqpixmap.h> #include <tqpixmap.h>
class KImageNumber : public QFrame class KImageNumber : public TQFrame
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY( double m_value READ value WRITE setValue ) TQ_OBJECT
TQ_PROPERTY( double m_value READ value WRITE setValue )
public: public:
KImageNumber(const TQString& font, TQWidget* parent=0, const char* name=0); KImageNumber(const TQString& font, TQWidget* tqparent=0, const char* name=0);
virtual ~KImageNumber(); virtual ~KImageNumber();
void paintEvent(TQPaintEvent*); void paintEvent(TQPaintEvent*);
virtual TQSize sizeHint() const; virtual TQSize tqsizeHint() const;
double value() const; double value() const;
public slots: public slots:

@ -42,8 +42,8 @@ static struct conversionEntry ConversionTable[MAX_UNIT] = {
* Note that we use installEventFilter on the two KImageNumber's * Note that we use installEventFilter on the two KImageNumber's
* to make clicks on them bring up the context-menu. * to make clicks on them bring up the context-menu.
*/ */
Kodometer::Kodometer(TQWidget* parent, const char* name) Kodometer::Kodometer(TQWidget* tqparent, const char* name)
: TQFrame(parent, name), : TQFrame(tqparent, name),
dontRefresh(false), dontRefresh(false),
speed(0.0), speed(0.0),
lastDistance(0.0), lastDistance(0.0),
@ -121,7 +121,7 @@ Kodometer::Kodometer(TQWidget* parent, const char* name)
} }
/* /*
* Now I'm not really sure what this does. I assume its here to find * Now I'm not really sure what this does. I assume its here to tqfind
* all the displays on your system, and measure them. During the mouse * all the displays on your system, and measure them. During the mouse
* tracking phase, we use the information stored here to determine how * tracking phase, we use the information stored here to determine how
* far the mouse moved on a given screen. * far the mouse moved on a given screen.
@ -156,9 +156,9 @@ void Kodometer::FindAllScreens(void)
vPixelsPerMM = (double)Dh / (double)DhMM; vPixelsPerMM = (double)Dh / (double)DhMM;
hPixelsPerMM = (double)Dw / (double)DwMM; hPixelsPerMM = (double)Dw / (double)DwMM;
screenInfo[i].PixelsPerMM = (vPixelsPerMM + hPixelsPerMM) / 2.0; screenInfo[i].PixelsPerMM = (vPixelsPerMM + hPixelsPerMM) / 2.0;
// kdDebug() << " Vertical pixels/mm are " << vPixelsPerMM << // kdDebug() << " Qt::Vertical pixels/mm are " << vPixelsPerMM <<
// "mm" << endl; // "mm" << endl;
// kdDebug() << " Horizontal pixels/mm are " << hPixelsPerMM << // kdDebug() << " Qt::Horizontal pixels/mm are " << hPixelsPerMM <<
// "mm" << endl; // "mm" << endl;
// kdDebug() << " Average pixels/mm are " << // kdDebug() << " Average pixels/mm are " <<
// screenInfo[i].PixelsPerMM << "mm" << endl; // screenInfo[i].PixelsPerMM << "mm" << endl;
@ -389,12 +389,12 @@ int Kodometer::CalcDistance(void)
case K_Left: case K_Left:
case K_Top: case K_Top:
finalScreen = 0; finalScreen = 0;
j = QMAX(pointerScreen,lastPointerScreen) - 1; j = TQMAX(pointerScreen,lastPointerScreen) - 1;
increment = -1; increment = -1;
break; break;
case K_Right: case K_Right:
case K_Bottom: case K_Bottom:
finalScreen = QMAX(pointerScreen,lastPointerScreen) - 1; finalScreen = TQMAX(pointerScreen,lastPointerScreen) - 1;
j = 0; j = 0;
increment = 1; increment = 1;
break; break;

@ -89,9 +89,10 @@ typedef struct conversionEntry {
int printPrecision; int printPrecision;
} conversionEntry; } conversionEntry;
class Kodometer : public QFrame class Kodometer : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Kodometer(TQWidget* = 0, const char* = 0); Kodometer(TQWidget* = 0, const char* = 0);

@ -15,24 +15,24 @@ TQString int2time(int time)
{ {
TQString str; TQString str;
if (time / 60) if (time / 60)
str.append(i18n("%1 min").arg(time / 60)); str.append(i18n("%1 min").tqarg(time / 60));
if (time % 60) if (time % 60)
if (str.isEmpty()) if (str.isEmpty())
str.append(i18n("%1 s").arg(time % 60)); str.append(i18n("%1 s").tqarg(time % 60));
else else
str.append(i18n(" %1 s").arg(time % 60)); str.append(i18n(" %1 s").tqarg(time % 60));
return str; return str;
} }
TeaListItem::TeaListItem(TQListView * parent) TeaListItem::TeaListItem(TQListView * tqparent)
:TQListViewItem(parent) :TQListViewItem(tqparent)
{ {
} }
TeaListItem::TeaListItem(TQListView * parent, TQListViewItem *after) TeaListItem::TeaListItem(TQListView * tqparent, TQListViewItem *after)
:TQListViewItem(parent, after) :TQListViewItem(tqparent, after)
{ {
} }

@ -14,12 +14,12 @@ class TQListView;
class TQListViewItem; class TQListViewItem;
class TeaListItem : public QListViewItem class TeaListItem : public TQListViewItem
{ {
public: public:
TeaListItem(TQListView *parent); TeaListItem(TQListView *tqparent);
TeaListItem(TQListView *parent, TQListViewItem *after); TeaListItem(TQListView *tqparent, TQListViewItem *after);
~TeaListItem(); ~TeaListItem();
int time(); int time();

@ -13,8 +13,8 @@
#include "timeedit.h" #include "timeedit.h"
#include "timeedit.moc" #include "timeedit.moc"
WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, TQWidget *parent, const char *name) WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, TQWidget *tqparent, const char *name)
: TQSpinBox(minValue, maxValue, step, parent, name) : TQSpinBox(minValue, maxValue, step, tqparent, name)
{ {
} }
@ -49,27 +49,27 @@ void WrappingSpinBox::stepDown()
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
TimeEdit::TimeEdit(TQWidget* parent, const char* name) TimeEdit::TimeEdit(TQWidget* tqparent, const char* name)
: TQWidget(parent, name) : TQWidget(tqparent, name)
{ {
layout = new TQHBoxLayout(this); tqlayout = new TQHBoxLayout(this);
minuteBox = new TQSpinBox(0, 300, 1, this); minuteBox = new TQSpinBox(0, 300, 1, this);
// minuteBox->setFixedSize(minuteBox->sizeHint()); // minuteBox->setFixedSize(minuteBox->tqsizeHint());
TQLabel* min = new TQLabel(i18n(" min"), this); TQLabel* min = new TQLabel(i18n(" min"), this);
min->setFixedSize(min->sizeHint()); min->setFixedSize(min->tqsizeHint());
secondBox = new WrappingSpinBox(0, 59, 1, this); secondBox = new WrappingSpinBox(0, 59, 1, this);
secondBox->setWrapping(true); secondBox->setWrapping(true);
// secondBox->setFixedSize(secondBox->sizeHint()); // secondBox->setFixedSize(secondBox->tqsizeHint());
TQLabel* sec = new TQLabel(i18n(" sec"),this); TQLabel* sec = new TQLabel(i18n(" sec"),this);
sec->setFixedSize(sec->sizeHint()); sec->setFixedSize(sec->tqsizeHint());
layout->addWidget(minuteBox); tqlayout->addWidget(minuteBox);
layout->addWidget(min); tqlayout->addWidget(min);
layout->addWidget(secondBox); tqlayout->addWidget(secondBox);
layout->addWidget(sec); tqlayout->addWidget(sec);
connect(minuteBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) ); connect(minuteBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) );
connect(secondBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) ); connect(secondBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) );

@ -18,12 +18,13 @@ class TQBoxLayout;
* @short A spinbox that wraps around after reaching minValue resp. maxValue. * @short A spinbox that wraps around after reaching minValue resp. maxValue.
* @author Daniel Teske * @author Daniel Teske
*/ */
class WrappingSpinBox : public QSpinBox class WrappingSpinBox : public TQSpinBox
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
WrappingSpinBox(int minValue, int maxValue, int step = 1, TQWidget *parent=0, const char *name=0); WrappingSpinBox(int minValue, int maxValue, int step = 1, TQWidget *tqparent=0, const char *name=0);
~WrappingSpinBox(); ~WrappingSpinBox();
void stepUp(); void stepUp();
@ -39,12 +40,13 @@ signals:
* @short A widget for entering a timeout in minutes and seconds. * @short A widget for entering a timeout in minutes and seconds.
* @author Daniel Teske * @author Daniel Teske
*/ */
class TimeEdit : public QWidget class TimeEdit : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
TimeEdit(TQWidget* parent = 0, const char* name = 0); TimeEdit(TQWidget* tqparent = 0, const char* name = 0);
~TimeEdit(); ~TimeEdit();
void setValue(int value); void setValue(int value);
@ -65,7 +67,7 @@ signals:
protected: protected:
TQSpinBox *minuteBox; TQSpinBox *minuteBox;
WrappingSpinBox *secondBox; WrappingSpinBox *secondBox;
TQBoxLayout* layout; TQBoxLayout* tqlayout;
}; };
#endif #endif

@ -118,13 +118,13 @@ TopLevel::TopLevel() : KSystemTray()
startAct = new KAction(i18n("&Start"), "1rightarrow", 0, startAct = new KAction(i18n("&Start"), "1rightarrow", 0,
this, TQT_SLOT(start()), actionCollection(), "start"); TQT_TQOBJECT(this), TQT_SLOT(start()), actionCollection(), "start");
stopAct = new KAction(i18n("Sto&p"), "cancel", 0, stopAct = new KAction(i18n("Sto&p"), "cancel", 0,
this, TQT_SLOT(stop()), actionCollection(), "stop"); TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "stop");
confAct = new KAction(i18n("&Configure..."), "configure", 0, confAct = new KAction(i18n("&Configure..."), "configure", 0,
this, TQT_SLOT(config()), actionCollection(), "configure"); TQT_TQOBJECT(this), TQT_SLOT(config()), actionCollection(), "configure");
anonAct = new KAction(i18n("&Anonymous..."), 0, 0, anonAct = new KAction(i18n("&Anonymous..."), 0, 0,
this, TQT_SLOT(anonymous()), actionCollection(), "anonymous"); TQT_TQOBJECT(this), TQT_SLOT(anonymous()), actionCollection(), "anonymous");
// KAction *quitAct = actionCollection()->action("file_quit"); // KAction *quitAct = actionCollection()->action("file_quit");
// create app menu (displayed on right-click) // create app menu (displayed on right-click)
@ -198,7 +198,7 @@ TopLevel::~TopLevel()
delete menu; delete menu;
delete steeping_menu; delete steeping_menu;
delete start_menu; delete start_menu;
// FIXME: must delete more (like all the QWidgets in config-window)? // FIXME: must delete more (like all the TQWidgets in config-window)?
} }
void TopLevel::resizeEvent ( TQResizeEvent * ) void TopLevel::resizeEvent ( TQResizeEvent * )
@ -207,13 +207,13 @@ void TopLevel::resizeEvent ( TQResizeEvent * )
teaNotReadyPixmap = loadSizedIcon("tea_not_ready", width()); teaNotReadyPixmap = loadSizedIcon("tea_not_ready", width());
teaAnim1Pixmap = loadSizedIcon("tea_anim1", width()); teaAnim1Pixmap = loadSizedIcon("tea_anim1", width());
teaAnim2Pixmap = loadSizedIcon("tea_anim2", width()); teaAnim2Pixmap = loadSizedIcon("tea_anim2", width());
repaint(); tqrepaint();
} }
/** Handle mousePressEvent */ /** Handle mousePressEvent */
void TopLevel::mousePressEvent(TQMouseEvent *event) void TopLevel::mousePressEvent(TQMouseEvent *event)
{ {
if (event->button() == LeftButton) { if (event->button() == Qt::LeftButton) {
if (ready) { if (ready) {
stop(); // reset tooltip and stop animation stop(); // reset tooltip and stop animation
} else { } else {
@ -222,7 +222,7 @@ void TopLevel::mousePressEvent(TQMouseEvent *event)
else else
start_menu->popup(TQCursor::pos()); start_menu->popup(TQCursor::pos());
} }
} else if (event->button() == RightButton) } else if (event->button() == Qt::RightButton)
menu->popup(TQCursor::pos()); menu->popup(TQCursor::pos());
// else if (event->button() == MidButton) // currently unused // else if (event->button() == MidButton) // currently unused
} }
@ -251,19 +251,19 @@ void TopLevel::paintEvent(TQPaintEvent *)
// overlay pie chart onto tray icon // overlay pie chart onto tray icon
TQPixmap base(*pm); // make copy of base pixmap TQPixmap base(*pm); // make copy of base pixmap
if (useTrayVis && running) { if (useTrayVis && running) {
// extend mask // extend tqmask
TQBitmap mask = *(base.mask()); TQBitmap tqmask = *(base.tqmask());
TQPainter pm(&mask); TQPainter pm(&tqmask);
pm.setBrush(Qt::color1); // fill with "foreground-colour" pm.setBrush(TQt::color1); // fill with "foreground-colour"
pm.setPen(Qt::NoPen); // no border needed/wanted pm.setPen(TQt::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 pm.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16); // full circle of small size
pm.drawPie(0, ((float) width()/(float) 2.44444444444), ((float) width()/(float) 1.69230769231), ((float) width()/(float) 1.69230769231), 90*16, percentDone*16); // pie part of big size pm.drawPie(0, ((float) width()/(float) 2.44444444444), ((float) width()/(float) 1.69230769231), ((float) width()/(float) 1.69230769231), 90*16, percentDone*16); // pie part of big size
pm.end(); pm.end();
base.setMask(mask); base.setMask(tqmask);
// draw pie chart // draw pie chart
TQPainter px(&base); TQPainter px(&base);
px.setPen(TQPen(Qt::black, 0)); // black border px.setPen(TQPen(TQt::black, 0)); // black border
px.setBrush(TQColor(192, 0, 0)); // red fill colour for small circle 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.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16);
@ -302,14 +302,14 @@ void TopLevel::timerEvent(TQTimerEvent *)
menu->setItemChecked(current_selected, true); menu->setItemChecked(current_selected, true);
} }
TQString teaMessage = i18n("The %1 is now ready!").arg(current_name); TQString teaMessage = i18n("The %1 is now ready!").tqarg(current_name);
// invoke action // invoke action
if (useNotify) { if (useNotify) {
KNotifyClient::event(winId(), "tea", teaMessage); KNotifyClient::event(winId(), "tea", teaMessage);
} }
if (useAction && (!action.isEmpty())) { if (useAction && (!action.isEmpty())) {
TQString cmd = action; TQString cmd = action;
cmd.replace("%t", current_name); cmd.tqreplace("%t", current_name);
system(TQFile::encodeName(cmd)); system(TQFile::encodeName(cmd));
} }
if (usePopup) if (usePopup)
@ -317,7 +317,7 @@ void TopLevel::timerEvent(TQTimerEvent *)
teaMessage, teaAnim1Pixmap, this, "popup", 0); teaMessage, teaAnim1Pixmap, this, "popup", 0);
// FIXME: does auto-deletion work without timeout? // FIXME: does auto-deletion work without timeout?
setToolTip(teaMessage); setToolTip(teaMessage);
repaint(); tqrepaint();
} else { } else {
// timer not yet run out; just update tray-icon (if configured)... // timer not yet run out; just update tray-icon (if configured)...
if (useTrayVis) { if (useTrayVis) {
@ -325,18 +325,18 @@ void TopLevel::timerEvent(TQTimerEvent *)
if (pDone - percentDone > 8) { if (pDone - percentDone > 8) {
// update icon not every second, but only if somewhat noticable // update icon not every second, but only if somewhat noticable
percentDone = pDone; percentDone = pDone;
repaint(); tqrepaint();
} }
} }
// ...and Tooltip // ...and Tooltip
TQString min = int2time(seconds); TQString min = int2time(seconds);
setToolTip(i18n("%1 left for %2").arg(min).arg(current_name)); setToolTip(i18n("%1 left for %2").tqarg(min).tqarg(current_name));
} }
} else { } else {
// no tea is steeping; just animate icon // no tea is steeping; just animate icon
if (ready) { if (ready) {
firstFrame = !firstFrame; firstFrame = !firstFrame;
repaint(); tqrepaint();
} }
} }
} }
@ -440,21 +440,21 @@ void TopLevel::start()
} }
// else both are already defined by dialog handler // else both are already defined by dialog handler
killTimers(); TQT_TQOBJECT(this)->killTimers();
startTimer(1000); // 1000ms = 1s (sufficient resolution) startTimer(1000); // 1000ms = 1s (sufficient resolution)
running = true; running = true;
ready = false; ready = false;
enable_menuEntries(); // disable "start", enable "stop" enable_menuEntries(); // disable "start", enable "stop"
repaint(); tqrepaint();
} }
} }
/* menu-slot: "stop" selected in menu */ /* menu-slot: "stop" selected in menu */
void TopLevel::stop() void TopLevel::stop()
{ {
killTimers(); TQT_TQOBJECT(this)->killTimers();
running = false; running = false;
ready = false; ready = false;
@ -467,7 +467,7 @@ void TopLevel::stop()
} }
setToolTip(i18n("The Tea Cooker"), true); setToolTip(i18n("The Tea Cooker"), true);
repaint(); tqrepaint();
} }
/* open dialog to start an 'anonymous' tea */ /* open dialog to start an 'anonymous' tea */
@ -487,10 +487,10 @@ void TopLevel::anonymous()
prop_box->addWidget(propright); prop_box->addWidget(propright);
anon_time = new TimeEdit(propright); anon_time = new TimeEdit(propright);
anon_time->setFixedHeight(anon_time->sizeHint().height()); anon_time->setFixedHeight(anon_time->tqsizeHint().height());
anon_time->setValue(DEFAULT_TEA_TIME); anon_time->setValue(DEFAULT_TEA_TIME);
TQLabel *l = new TQLabel(anon_time, i18n("Tea time:"), propleft); TQLabel *l = new TQLabel(anon_time, i18n("Tea time:"), propleft);
l->setFixedSize(l->sizeHint()); l->setFixedSize(l->tqsizeHint());
top_box->addStretch(); top_box->addStretch();
@ -670,7 +670,7 @@ void TopLevel::config()
/* left side - tea list and list-modifying buttons */ /* left side - tea list and list-modifying buttons */
TQBoxLayout *leftside = new TQVBoxLayout(box); TQBoxLayout *leftside = new TQVBoxLayout(box);
TQGroupBox *listgroup = new TQGroupBox(2, Vertical, i18n("Tea List"), page); TQGroupBox *listgroup = new TQGroupBox(2,Qt::Vertical, i18n("Tea List"), page);
leftside->addWidget(listgroup, 0, 0); leftside->addWidget(listgroup, 0, 0);
listbox = new TQListView(listgroup, "listBox"); listbox = new TQListView(listgroup, "listBox");
@ -685,31 +685,31 @@ void TopLevel::config()
TQWidget *listgroup_widget = new TQWidget(listgroup); TQWidget *listgroup_widget = new TQWidget(listgroup);
TQBoxLayout *hbox = new TQHBoxLayout(listgroup_widget); TQBoxLayout *hbox = new TQHBoxLayout(listgroup_widget);
hbox->setSpacing(4); hbox->setSpacing(4);
btn_new = new TQPushButton(TQString::null, listgroup_widget); btn_new = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_new, i18n("New")); TQToolTip::add(btn_new, i18n("New"));
btn_new->setPixmap(SmallIcon("filenew")); btn_new->setPixmap(SmallIcon("filenew"));
btn_new->setMinimumSize(btn_new->sizeHint() * 1.2); btn_new->setMinimumSize(btn_new->tqsizeHint() * 1.2);
connect(btn_new, TQT_SIGNAL(clicked()), TQT_SLOT(newButtonClicked())); connect(btn_new, TQT_SIGNAL(clicked()), TQT_SLOT(newButtonClicked()));
hbox->addWidget(btn_new); hbox->addWidget(btn_new);
btn_del = new TQPushButton(TQString::null, listgroup_widget); btn_del = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_del, i18n("Delete")); TQToolTip::add(btn_del, i18n("Delete"));
btn_del->setIconSet(SmallIconSet("editdelete")); btn_del->setIconSet(SmallIconSet("editdelete"));
btn_del->setMinimumSize(btn_new->sizeHint() * 1.2); btn_del->setMinimumSize(btn_new->tqsizeHint() * 1.2);
connect(btn_del, TQT_SIGNAL(clicked()), TQT_SLOT(delButtonClicked())); connect(btn_del, TQT_SIGNAL(clicked()), TQT_SLOT(delButtonClicked()));
hbox->addWidget(btn_del); hbox->addWidget(btn_del);
btn_up = new TQPushButton(TQString::null, listgroup_widget); btn_up = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_up, i18n("Up")); TQToolTip::add(btn_up, i18n("Up"));
btn_up->setIconSet(SmallIconSet("up")); btn_up->setIconSet(SmallIconSet("up"));
btn_up->setMinimumSize(btn_up->sizeHint() * 1.2); btn_up->setMinimumSize(btn_up->tqsizeHint() * 1.2);
connect(btn_up, TQT_SIGNAL(clicked()), TQT_SLOT(upButtonClicked())); connect(btn_up, TQT_SIGNAL(clicked()), TQT_SLOT(upButtonClicked()));
hbox->addWidget(btn_up); hbox->addWidget(btn_up);
btn_down = new TQPushButton(TQString::null, listgroup_widget); btn_down = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_down, i18n("Down")); TQToolTip::add(btn_down, i18n("Down"));
btn_down->setIconSet(SmallIconSet("down")); btn_down->setIconSet(SmallIconSet("down"));
btn_down->setMinimumSize(btn_down->sizeHint() * 1.2); btn_down->setMinimumSize(btn_down->tqsizeHint() * 1.2);
connect(btn_down, TQT_SIGNAL(clicked()), TQT_SLOT(downButtonClicked())); connect(btn_down, TQT_SIGNAL(clicked()), TQT_SLOT(downButtonClicked()));
hbox->addWidget(btn_down); hbox->addWidget(btn_down);
@ -717,29 +717,29 @@ void TopLevel::config()
/* right side - tea properties */ /* right side - tea properties */
TQBoxLayout *rightside = new TQVBoxLayout(box); TQBoxLayout *rightside = new TQVBoxLayout(box);
editgroup = new TQGroupBox(2, Vertical, i18n("Tea Properties"), page); editgroup = new TQGroupBox(2,Qt::Vertical, i18n("Tea Properties"), page);
rightside->addWidget(editgroup, 0, 0); rightside->addWidget(editgroup, 0, 0);
TQHBox *propbox = new TQHBox(editgroup); TQHBox *propbox = new TQHBox(editgroup);
// FIXME: - must enforce correct vertical alignment of each label-editor pair // FIXME: - must enforce correct vertical tqalignment of each label-editor pair
// (better use one HBox for each label-editor pair?) // (better use one HBox for each label-editor pair?)
TQVBox *propleft = new TQVBox(propbox); TQVBox *propleft = new TQVBox(propbox);
TQVBox *propright = new TQVBox(propbox); TQVBox *propright = new TQVBox(propbox);
nameEdit = new TQLineEdit(propright); nameEdit = new TQLineEdit(propright);
nameEdit->setFixedHeight(nameEdit->sizeHint().height()); nameEdit->setFixedHeight(nameEdit->tqsizeHint().height());
nameEdit->setAlignment(TQLineEdit::AlignLeft); nameEdit->tqsetAlignment(TQLineEdit::AlignLeft);
TQLabel *l = new TQLabel(nameEdit, i18n("Name:"), propleft); TQLabel *l = new TQLabel(nameEdit, i18n("Name:"), propleft);
l->setFixedSize(l->sizeHint()); l->setFixedSize(l->tqsizeHint());
connect(nameEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(nameEditTextChanged(const TQString&)) ); connect(nameEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(nameEditTextChanged(const TQString&)) );
timeEdit = new TimeEdit(propright); timeEdit = new TimeEdit(propright);
timeEdit->setFixedHeight(timeEdit->sizeHint().height()); timeEdit->setFixedHeight(timeEdit->tqsizeHint().height());
l = new TQLabel(timeEdit, i18n("Tea time:"), propleft); l = new TQLabel(timeEdit, i18n("Tea time:"), propleft);
l->setFixedSize(l->sizeHint()); l->setFixedSize(l->tqsizeHint());
connect(timeEdit, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int))); connect(timeEdit, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)));
/* bottom - timeout actions */ /* bottom - timeout actions */
TQGroupBox *actiongroup = new TQGroupBox(4, Vertical, i18n("Action"), page); TQGroupBox *actiongroup = new TQGroupBox(4,Qt::Vertical, i18n("Action"), page);
top_box->addWidget(actiongroup, 0, 0); top_box->addWidget(actiongroup, 0, 0);
TQWidget *actionconf_widget = new TQWidget(actiongroup); TQWidget *actionconf_widget = new TQWidget(actiongroup);
@ -751,15 +751,15 @@ void TopLevel::config()
eventEnable = new TQCheckBox(i18n("Event"), actiongroup); eventEnable = new TQCheckBox(i18n("Event"), actiongroup);
popupEnable = new TQCheckBox(i18n("Popup"), actiongroup); popupEnable = new TQCheckBox(i18n("Popup"), actiongroup);
eventEnable->setFixedHeight(eventEnable->sizeHint().height()); eventEnable->setFixedHeight(eventEnable->tqsizeHint().height());
popupEnable->setFixedHeight(popupEnable->sizeHint().height()); popupEnable->setFixedHeight(popupEnable->tqsizeHint().height());
TQHBox *actionbox = new TQHBox(actiongroup); TQHBox *actionbox = new TQHBox(actiongroup);
actionEnable = new TQCheckBox(actionbox); actionEnable = new TQCheckBox(actionbox);
// FIXME: add text to this line: // FIXME: add text to this line:
// TQLabel *actionLabel = new TQLabel(i18n("Execute: "), actiongroup); // TQLabel *actionLabel = new TQLabel(i18n("Execute: "), actiongroup);
actionEdit = new TQLineEdit(actionbox); actionEdit = new TQLineEdit(actionbox);
actionEdit->setFixedHeight(actionEdit->sizeHint().height()); actionEdit->setFixedHeight(actionEdit->tqsizeHint().height());
TQToolTip::add(actionEdit, i18n("Enter command here; '%t' will be replaced with name of steeping tea")); 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))); connect(actionEnable, TQT_SIGNAL(toggled(bool)), TQT_SLOT(actionEnableToggled(bool)));
rightside->addStretch(); rightside->addStretch();
@ -776,7 +776,7 @@ void TopLevel::config()
} }
// now add all defined teas (and their times) to the listview // now add all defined teas (and their times) to the listview
// this is done backwards because QListViewItems are inserted at the top // this is done backwards because TQListViewItems are inserted at the top
listbox->clear(); listbox->clear();
for (int i=teas.count()-1; i>=0; i--) { for (int i=teas.count()-1; i>=0; i--) {
TeaListItem *item = new TeaListItem(listbox); TeaListItem *item = new TeaListItem(listbox);
@ -816,7 +816,7 @@ void TopLevel::config()
teas.clear(); teas.clear();
// Copy over teas and times from the QListView // Copy over teas and times from the TQListView
int i = 0; int i = 0;
teas.clear(); teas.clear();
teas.resize(listbox->childCount()); teas.resize(listbox->childCount());

@ -43,6 +43,7 @@ class TimeEdit;
class TopLevel : public KSystemTray class TopLevel : public KSystemTray
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:

@ -43,8 +43,8 @@ extern "C"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name ) KSpriteSetup::KSpriteSetup( TQWidget *tqparent, const char *name )
: TQDialog( parent, name, TRUE ) : TQDialog( tqparent, name, TRUE )
{ {
KGlobal::locale()->insertCatalogue("ktux"); KGlobal::locale()->insertCatalogue("ktux");
saver = 0; saver = 0;
@ -60,11 +60,11 @@ KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name )
tl1->addLayout(tl11); tl1->addLayout(tl11);
TQLabel *label = new TQLabel( i18n("Speed:"), this ); TQLabel *label = new TQLabel( i18n("Speed:"), this );
label->setMinimumSize(label->sizeHint()); label->setMinimumSize(label->tqsizeHint());
tl11->addStretch(1); tl11->addStretch(1);
tl11->addWidget(label); tl11->addWidget(label);
TQSlider *sb = new TQSlider(0, 100, 10, speed, TQSlider::Horizontal, this ); TQSlider *sb = new TQSlider(0, 100, 10, speed, Qt::Horizontal, this );
tl11->addWidget(sb); tl11->addWidget(sb);
connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) ); connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) );
@ -85,7 +85,7 @@ KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name )
button = bbox->addButton(KStdGuiItem::cancel()); button = bbox->addButton(KStdGuiItem::cancel());
connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) ); connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) );
bbox->layout(); bbox->tqlayout();
tl->addWidget(bbox); tl->addWidget(bbox);
tl->freeze(); tl->freeze();
@ -203,7 +203,7 @@ void KSpriteSaver::initialise()
{ {
mCanvas = new TQCanvas(); mCanvas = new TQCanvas();
TQPixmap pm( locate("sprite", "bg.png") ); TQPixmap pm( locate("sprite", "bg.png") );
mCanvas->setBackgroundPixmap( pm ); mCanvas->tqsetBackgroundPixmap( pm );
mCanvas->resize( width(), height() ); mCanvas->resize( width(), height() );
mView = new TQCanvasView(mCanvas); mView = new TQCanvasView(mCanvas);
mView->viewport()->setBackgroundColor( black ); mView->viewport()->setBackgroundColor( black );

@ -20,6 +20,7 @@
class KSpriteSaver : public KScreenSaver class KSpriteSaver : public KScreenSaver
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KSpriteSaver( WId id ); KSpriteSaver( WId id );
virtual ~KSpriteSaver(); virtual ~KSpriteSaver();
@ -38,19 +39,20 @@ protected:
virtual void timerEvent(TQTimerEvent *); virtual void timerEvent(TQTimerEvent *);
protected: protected:
QCanvas *mCanvas; TQCanvas *mCanvas;
QCanvasView *mView; TQCanvasView *mView;
QTimer mTimer; TQTimer mTimer;
int mSpeed; int mSpeed;
TQPtrList<SpriteGroup> mGroups; TQPtrList<SpriteGroup> mGroups;
TQMemArray<int> mTimerIds; TQMemArray<int> mTimerIds;
}; };
class KSpriteSetup : public QDialog class KSpriteSetup : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KSpriteSetup( TQWidget *parent = NULL, const char *name = NULL ); KSpriteSetup( TQWidget *tqparent = NULL, const char *name = NULL );
~KSpriteSetup(); ~KSpriteSetup();
protected: protected:

@ -44,7 +44,7 @@ void SpriteObject::setBounds( int x1, int y1, int x2, int y2 )
bool SpriteObject::outOfBounds() const bool SpriteObject::outOfBounds() const
{ {
bool in = mBound.contains( static_cast<int>(x()), static_cast<int>(y()) ); bool in = mBound.tqcontains( static_cast<int>(x()), static_cast<int>(y()) );
return !in; return !in;
} }

@ -24,7 +24,7 @@
// //
// SpriteObject stores the animations that create an object // SpriteObject stores the animations that create an object
// //
class SpriteObject : public QCanvasSprite class SpriteObject : public TQCanvasSprite
{ {
public: public:
SpriteObject(SpritePixmapSequence *seq, TQCanvas *c); SpriteObject(SpritePixmapSequence *seq, TQCanvas *c);
@ -39,7 +39,7 @@ protected:
int mCycle; int mCycle;
int mLifeSpan; int mLifeSpan;
SpritePixmapSequence *mSeq; SpritePixmapSequence *mSeq;
QRect mBound; TQRect mBound;
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -89,7 +89,7 @@ protected:
TQPtrList<SpriteObject> mActive; TQPtrList<SpriteObject> mActive;
int mCount; int mCount;
SpriteRange mRefresh; SpriteRange mRefresh;
QCanvas *mCanvas; TQCanvas *mCanvas;
}; };
#endif // SPRITEANIM_H #endif // SPRITEANIM_H

@ -29,7 +29,7 @@ int SpriteRange::random() const
void SpriteRange::set(const TQString &str) void SpriteRange::set(const TQString &str)
{ {
int r = str.find(".."); int r = str.tqfind("..");
if (r > 0) if (r > 0)
{ {

@ -39,7 +39,7 @@ SpritePixmapManager::~SpritePixmapManager()
// //
const TQPixmap *SpritePixmapManager::load(const TQString & img) const TQPixmap *SpritePixmapManager::load(const TQString & img)
{ {
TQPixmap *pixmap = mPixmaps.find(img); TQPixmap *pixmap = mPixmaps.tqfind(img);
if (!pixmap) if (!pixmap)
{ {
@ -115,7 +115,7 @@ SpriteSequenceManager::~SpriteSequenceManager()
SpritePixmapSequence *SpriteSequenceManager::load(KConfigBase &config, SpritePixmapSequence *SpriteSequenceManager::load(KConfigBase &config,
const TQString & name) const TQString & name)
{ {
SpritePixmapSequence *sprite = mSprites.find(name); SpritePixmapSequence *sprite = mSprites.tqfind(name);
if (!sprite) if (!sprite)
{ {

@ -34,7 +34,7 @@ public:
{ mPixmapDir = "."; mPixmaps.clear(); } { mPixmapDir = "."; mPixmaps.clear(); }
const TQPixmap *load(const TQString & img); const TQPixmap *load(const TQString & img);
const TQPixmap *pixmap(const char *img) const const TQPixmap *pixmap(const char *img) const
{ return mPixmaps.find(img); } { return mPixmaps.tqfind(img); }
static SpritePixmapManager *manager(); static SpritePixmapManager *manager();
@ -46,7 +46,7 @@ public:
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
class SpritePixmapSequence : public QCanvasPixmapArray class SpritePixmapSequence : public TQCanvasPixmapArray
{ {
public: public:
SpritePixmapSequence(TQPtrList<TQPixmap> pm, TQPtrList<TQPoint> hs, TQMemArray<int> d); SpritePixmapSequence(TQPtrList<TQPixmap> pm, TQPtrList<TQPoint> hs, TQMemArray<int> d);
@ -69,7 +69,7 @@ public:
SpritePixmapSequence *load(KConfigBase &config, const TQString & name); SpritePixmapSequence *load(KConfigBase &config, const TQString & name);
SpritePixmapSequence *sprite(const char *name) SpritePixmapSequence *sprite(const char *name)
{ return mSprites.find(name); } { return mSprites.tqfind(name); }
static SpriteSequenceManager *manager(); static SpriteSequenceManager *manager();

@ -30,8 +30,8 @@
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <klocale.h> #include <klocale.h>
dockwidget::dockwidget(const TQString &location, TQWidget *parent, dockwidget::dockwidget(const TQString &location, TQWidget *tqparent,
const char *name) : TQWidget(parent,name), m_locationCode( location ), m_orientation( Horizontal ) const char *name) : TQWidget(tqparent,name), m_locationCode( location ), m_orientation(Qt::Horizontal )
{ {
m_font = KGlobalSettings::generalFont(); m_font = KGlobalSettings::generalFont();
setBackgroundOrigin( AncestorOrigin ); setBackgroundOrigin( AncestorOrigin );
@ -112,19 +112,19 @@ void dockwidget::showWeather()
"<th><nobr>" + i18n( "Rel. Humidity:" ) + "</nobr></th><td><nobr>%4</nobr></td></nobr></tr>" "<th><nobr>" + i18n( "Rel. Humidity:" ) + "</nobr></th><td><nobr>%4</nobr></td></nobr></tr>"
"<tr><th><nobr>" + i18n( "Wind Speed:" ) + "</nobr></th><td><nobr>%5</nobr></td>") "<tr><th><nobr>" + i18n( "Wind Speed:" ) + "</nobr></th><td><nobr>%5</nobr></td>")
.arg(temp).arg(dewPoint).arg(pressure).arg(relHumidity).arg(wind); .tqarg(temp).tqarg(dewPoint).tqarg(pressure).tqarg(relHumidity).tqarg(wind);
if ( !heatIndex.isEmpty() ) if ( !heatIndex.isEmpty() )
tip += TQString("<th><nobr>" + i18n( "Heat Index:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(heatIndex); tip += TQString("<th><nobr>" + i18n( "Heat Index:" ) + "</nobr></th><td><nobr>%1</nobr></td>").tqarg(heatIndex);
else if ( !windChill.isEmpty() ) else if ( !windChill.isEmpty() )
tip += TQString("<th><nobr>" + i18n( "Wind Chill:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(windChill); tip += TQString("<th><nobr>" + i18n( "Wind Chill:" ) + "</nobr></th><td><nobr>%1</nobr></td>").tqarg(windChill);
else else
tip += "<td>&nbsp;</td><td>&nbsp;</td>"; tip += "<td>&nbsp;</td><td>&nbsp;</td>";
tip += "</tr>"; tip += "</tr>";
tip += TQString("<tr><th><nobr>" + i18n( "Sunrise:" ) + "</nobr></th><td><nobr>%1</nobr></td>" + tip += TQString("<tr><th><nobr>" + i18n( "Sunrise:" ) + "</nobr></th><td><nobr>%1</nobr></td>" +
"<th><nobr>" + i18n( "Sunset:" ) + "</nobr></th><td><nobr>%2</nobr></td>") "<th><nobr>" + i18n( "Sunset:" ) + "</nobr></th><td><nobr>%2</nobr></td>")
.arg(sunRiseTime).arg(sunSetTime); .tqarg(sunRiseTime).tqarg(sunSetTime);
tip += "</tr></table>"; tip += "</tr></table>";
@ -182,14 +182,14 @@ void dockwidget::initDock()
TQBoxLayout *mainLayout = new TQBoxLayout(this, TQBoxLayout::TopToBottom); TQBoxLayout *mainLayout = new TQBoxLayout(this, TQBoxLayout::TopToBottom);
mainLayout->setSpacing(0); mainLayout->setSpacing(0);
mainLayout->setMargin(0); mainLayout->setMargin(0);
mainLayout->addWidget(m_button, 0, Qt::AlignCenter); mainLayout->addWidget(m_button, 0, TQt::AlignCenter);
TQBoxLayout *layout = new TQBoxLayout(mainLayout, TQBoxLayout::TopToBottom); TQBoxLayout *tqlayout = new TQBoxLayout(mainLayout, TQBoxLayout::TopToBottom);
layout->setSpacing(0); tqlayout->setSpacing(0);
layout->setMargin(0); tqlayout->setMargin(0);
layout->addWidget(m_lblTemp); tqlayout->addWidget(m_lblTemp);
layout->addWidget(m_lblWind); tqlayout->addWidget(m_lblWind);
layout->addWidget(m_lblPres); tqlayout->addWidget(m_lblPres);
mainLayout->addSpacing(8); mainLayout->addSpacing(8);
@ -204,27 +204,27 @@ void dockwidget::resizeView( const TQSize &size )
kdDebug(12004) << "Changing to size " << size << endl; kdDebug(12004) << "Changing to size " << size << endl;
resize(size); resize(size);
if ( m_orientation == Horizontal ) // Kicker in horizontal mode if ( m_orientation ==Qt::Horizontal ) // Kicker in horizontal mode
{ {
int h = size.height(); int h = size.height();
if ( m_mode == ShowAll ) if ( m_mode == ShowAll )
{ {
if ( h <= 128 ) // left to right layout if ( h <= 128 ) // left to right tqlayout
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblWind->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblPres->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
} }
else // top to bottom else // top to bottom
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
h = 128 - (3 * fm.height()); // 3 lines of text below the button h = 128 - (3 * fm.height()); // 3 lines of text below the button
m_lblTemp->setAlignment(Qt::AlignCenter); m_lblTemp->tqsetAlignment(TQt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter); m_lblWind->tqsetAlignment(TQt::AlignCenter);
m_lblPres->setAlignment(Qt::AlignCenter); m_lblPres->tqsetAlignment(TQt::AlignCenter);
} }
m_button->setFixedSize(h, h); m_button->setFixedSize(h, h);
} }
@ -232,21 +232,21 @@ void dockwidget::resizeView( const TQSize &size )
{ {
if ( h <= 32 ) // left to right if ( h <= 32 ) // left to right
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
} }
else // top to bottom else // top to bottom
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
h = QMIN(128, h) - fm.height(); h = TQMIN(128, h) - fm.height();
m_lblTemp->setAlignment(Qt::AlignCenter); m_lblTemp->tqsetAlignment(TQt::AlignCenter);
} }
m_button->setFixedSize(h, h); m_button->setFixedSize(h, h);
} }
else else
{ {
h = QMIN(h, 128); h = TQMIN(h, 128);
m_button->setFixedSize(h, h); m_button->setFixedSize(h, h);
} }
} }
@ -259,21 +259,21 @@ void dockwidget::resizeView( const TQSize &size )
{ {
if ( w <= 128 ) // top to bottom if ( w <= 128 ) // top to bottom
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter); m_lblTemp->tqsetAlignment(TQt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter); m_lblWind->tqsetAlignment(TQt::AlignCenter);
m_lblPres->setAlignment(Qt::AlignCenter); m_lblPres->tqsetAlignment(TQt::AlignCenter);
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
h = h - (3 * fm.height()); // 3 lines of text below the button h = h - (3 * fm.height()); // 3 lines of text below the button
h = QMIN(w, h); h = TQMIN(w, h);
} }
else // left to right layout else // left to right tqlayout
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblWind->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblPres->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
} }
m_button->setFixedSize(h, h); m_button->setFixedSize(h, h);
} }
@ -281,15 +281,15 @@ void dockwidget::resizeView( const TQSize &size )
{ {
if ( w <= 128 ) // top to bottom if ( w <= 128 ) // top to bottom
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter); m_lblTemp->tqsetAlignment(TQt::AlignCenter);
h = w; h = w;
} }
else // left to right layout else // left to right tqlayout
{ {
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight); static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
h = static_cast<int>(w * 0.33); h = static_cast<int>(w * 0.33);
} }
@ -297,7 +297,7 @@ void dockwidget::resizeView( const TQSize &size )
} }
else else
{ {
w = QMIN(w, 128); w = TQMIN(w, 128);
m_button->setFixedSize(w, w); m_button->setFixedSize(w, w);
} }
} }
@ -310,13 +310,13 @@ int dockwidget::widthForHeight(int h)
if ( m_mode == ShowAll ) if ( m_mode == ShowAll )
{ {
if ( h <= 128 ) // left to right layout if ( h <= 128 ) // left to right tqlayout
{ {
int pixelSize = h/3 - 3; int pixelSize = h/3 - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large pixelSize = TQMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize); m_font.setPixelSize(pixelSize);
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
w = h + QMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1; w = h + TQMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
} }
else // top to bottom else // top to bottom
{ {
@ -331,16 +331,16 @@ int dockwidget::widthForHeight(int h)
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
// size of icon // size of icon
h = 128 - (3 * fm.height()); // 3 lines of text below the button h = 128 - (3 * fm.height()); // 3 lines of text below the button
w = QMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1; w = TQMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
w = QMAX(h, w); // at least width of square icon w = TQMAX(h, w); // at least width of square icon
} }
} }
else if ( m_mode == ShowTempOnly ) else if ( m_mode == ShowTempOnly )
{ {
if ( h <= 32 ) // left to right layout if ( h <= 32 ) // left to right tqlayout
{ {
int pixelSize = h - 3; int pixelSize = h - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large pixelSize = TQMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize); m_font.setPixelSize(pixelSize);
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
w = h + fm.width(m_lblTemp->text()) + 1; w = h + fm.width(m_lblTemp->text()) + 1;
@ -357,14 +357,14 @@ int dockwidget::widthForHeight(int h)
} }
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
// size of icon // size of icon
h = QMIN(128, h) - fm.height(); h = TQMIN(128, h) - fm.height();
w = fm.width(m_lblTemp->text()) + 1; w = fm.width(m_lblTemp->text()) + 1;
w = QMAX(h, w); // at least width of square icon w = TQMAX(h, w); // at least width of square icon
} }
} }
else else
{ {
w = QMIN(128, h); // don't make it too large w = TQMIN(128, h); // don't make it too large
} }
updateFont(); updateFont();
@ -441,12 +441,12 @@ int dockwidget::heightForWidth( int w )
} }
TQFontMetrics fm(m_font); TQFontMetrics fm(m_font);
h = QMAX(fm.height(), static_cast<int>(w * 0.33)); h = TQMAX(fm.height(), static_cast<int>(w * 0.33));
} }
} }
else else
{ {
h = QMIN(128, w); // don't make it too large h = TQMIN(128, w); // don't make it too large
} }
updateFont(); updateFont();

@ -28,19 +28,20 @@ class TQLabel;
class WeatherService_stub; class WeatherService_stub;
class WeatherButton; class WeatherButton;
class dockwidget : public QWidget class dockwidget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
dockwidget(const TQString &location, TQWidget *parent=0, const char *name=0); dockwidget(const TQString &location, TQWidget *tqparent=0, const char *name=0);
~dockwidget(); ~dockwidget();
enum {ShowIconOnly=1, ShowTempOnly=2, ShowAll=3 }; enum {ShowIconOnly=1, ShowTempOnly=2, ShowAll=3 };
void setLocationCode(const TQString &locationCode); void setLocationCode(const TQString &locationCode);
void setViewMode(int); void setViewMode(int);
void setOrientation(Orientation o) { m_orientation = o; } void setOrientation(Qt::Orientation o) { m_orientation = o; }
/** resize the view **/ /** resize the view **/
void resizeView(const TQSize &size); void resizeView(const TQSize &size);
int widthForHeight(int h); int widthForHeight(int h);
@ -64,7 +65,7 @@ private:
TQLabel *m_lblTemp; TQLabel *m_lblTemp;
TQLabel *m_lblWind; TQLabel *m_lblWind;
TQLabel *m_lblPres; TQLabel *m_lblPres;
Orientation m_orientation; Qt::Orientation m_orientation;
WeatherService_stub *m_weatherService; WeatherService_stub *m_weatherService;
}; };

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable, with any edition of TQt, and distribute the resulting executable,
without including the source code for Qt in the source distribution. without including the source code for TQt in the source distribution.
*/ */
#include <tqbuttongroup.h> #include <tqbuttongroup.h>
@ -43,23 +43,23 @@
extern "C" extern "C"
{ {
KDE_EXPORT KCModule *create_weather( TQWidget *parent, const char * ) KDE_EXPORT KCModule *create_weather( TQWidget *tqparent, const char * )
{ {
return new KCMWeather( parent, "kweather" ); return new KCMWeather( tqparent, "kweather" );
} }
} }
KCMWeather::KCMWeather( TQWidget *parent, const char *name ) KCMWeather::KCMWeather( TQWidget *tqparent, const char *name )
: KCModule( parent, name ) : KCModule( tqparent, name )
{ {
mWeatherService = new WeatherService_stub( "KWeatherService", mWeatherService = new WeatherService_stub( "KWeatherService",
"WeatherService" ); "WeatherService" );
TQVBoxLayout *layout = new TQVBoxLayout( this ); TQVBoxLayout *tqlayout = new TQVBoxLayout( this );
mWidget = new prefsDialogData( this ); mWidget = new prefsDialogData( this );
mWidget->m_reportLocation->setFocus(); mWidget->m_reportLocation->setFocus();
layout->addWidget( mWidget ); tqlayout->addWidget( mWidget );
layout->addStretch(); tqlayout->addStretch();
fillStationList(); fillStationList();
load(); load();
@ -169,7 +169,7 @@ void KCMWeather::load()
mWidget->m_enableLog->setChecked( enabled ); mWidget->m_enableLog->setChecked( enabled );
enableLogWidgets( enabled ); enableLogWidgets( enabled );
static TQColor black(Qt::black); static TQColor black(TQt::black);
TQColor textColor = config.readColorEntry("textColor", &black); TQColor textColor = config.readColorEntry("textColor", &black);
mWidget->m_textColor->setColor(textColor); mWidget->m_textColor->setColor(textColor);

@ -16,8 +16,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable, with any edition of TQt, and distribute the resulting executable,
without including the source code for Qt in the source distribution. without including the source code for TQt in the source distribution.
*/ */
#ifndef KCMWEATHER_H #ifndef KCMWEATHER_H
@ -30,9 +30,10 @@ class prefsDialogData;
class KCMWeather : public KCModule class KCMWeather : public KCModule
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCMWeather( TQWidget *parent = 0, const char *name = 0 ); KCMWeather( TQWidget *tqparent = 0, const char *name = 0 );
~KCMWeather(); ~KCMWeather();
virtual void load(); virtual void load();

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable, with any edition of TQt, and distribute the resulting executable,
without including the source code for Qt in the source distribution. without including the source code for TQt in the source distribution.
*/ */
#include <tqlayout.h> #include <tqlayout.h>
@ -33,21 +33,21 @@
extern "C" extern "C"
{ {
KDE_EXPORT KCModule *create_weatherservice( TQWidget *parent, const char * ) { KDE_EXPORT KCModule *create_weatherservice( TQWidget *tqparent, const char * ) {
return new KCMWeatherService( parent, "kweather" ); return new KCMWeatherService( tqparent, "kweather" );
} }
} }
KCMWeatherService::KCMWeatherService( TQWidget *parent, const char *name ) KCMWeatherService::KCMWeatherService( TQWidget *tqparent, const char *name )
: KCModule( parent, name ) : KCModule( tqparent, name )
{ {
TQVBoxLayout *layout = new TQVBoxLayout( this ); TQVBoxLayout *tqlayout = new TQVBoxLayout( this );
mWidget = new ServiceConfigWidget( this ); mWidget = new ServiceConfigWidget( this );
// not needed, as a change immediately changes the service // not needed, as a change immediately changes the service
//connect(mWidget, TQT_SIGNAL(changed(bool)), this, TQT_SIGNAL(changed(bool))); //connect(mWidget, TQT_SIGNAL(changed(bool)), this, TQT_SIGNAL(changed(bool)));
layout->addWidget( mWidget ); tqlayout->addWidget( mWidget );
KAboutData *about = new KAboutData( "kcmweatherservice", KAboutData *about = new KAboutData( "kcmweatherservice",
I18N_NOOP( "KWeather Configure Dialog" ), I18N_NOOP( "KWeather Configure Dialog" ),
0, 0, KAboutData::License_GPL, 0, 0, KAboutData::License_GPL,

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable, with any edition of TQt, and distribute the resulting executable,
without including the source code for Qt in the source distribution. without including the source code for TQt in the source distribution.
*/ */
#ifndef KCMWEATHERSERVICE_H #ifndef KCMWEATHERSERVICE_H
@ -31,9 +31,10 @@ class ServiceConfigWidget;
class KCMWeatherService : public KCModule class KCMWeatherService : public KCModule
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCMWeatherService( TQWidget *parent = 0, const char *name = 0 ); KCMWeatherService( TQWidget *tqparent = 0, const char *name = 0 );
virtual void load(); virtual void load();
virtual void save(); virtual void save();

@ -40,20 +40,20 @@
extern "C" extern "C"
{ {
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{ {
KGlobal::locale()->insertCatalogue("kweather"); KGlobal::locale()->insertCatalogue("kweather");
kweather *theApplet = new kweather(configFile, KPanelApplet::Normal, kweather *theApplet = new kweather(configFile, KPanelApplet::Normal,
0, parent, "kweather"); 0, tqparent, "kweather");
return theApplet; return theApplet;
} }
} }
kweather::kweather(const TQString& configFile, Type t, int actions, kweather::kweather(const TQString& configFile, Type t, int actions,
TQWidget *parent, const char *name): TQWidget *tqparent, const char *name):
KPanelApplet(configFile, t, actions, parent, name), weatherIface(), KPanelApplet(configFile, t, actions, tqparent, name), weatherIface(),
mFirstRun( false ), mReport( 0 ), mClient( 0 ), mFirstRun( false ), mReport( 0 ), mClient( 0 ),
mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), mTextColor(Qt::black) mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), mTextColor(TQt::black)
{ {
kdDebug(12004) << "Constructor " << endl; kdDebug(12004) << "Constructor " << endl;
setObjId("weatherIface"); setObjId("weatherIface");
@ -86,7 +86,7 @@ kweather::~kweather()
void kweather::initContextMenu() void kweather::initContextMenu()
{ {
mContextMenu = new KPopupMenu(this); mContextMenu = new KPopupMenu(this);
mContextMenu->insertTitle(i18n("KWeather - %1").arg( reportLocation ), -1, 0); mContextMenu->insertTitle(i18n("KWeather - %1").tqarg( reportLocation ), -1, 0);
mContextMenu->insertItem(SmallIcon("viewmag"), i18n("Show &Report"), mContextMenu->insertItem(SmallIcon("viewmag"), i18n("Show &Report"),
this, TQT_SLOT(doReport()), 0, -1, 1); this, TQT_SLOT(doReport()), 0, -1, 1);
mContextMenu->insertItem(SmallIcon("reload"), i18n("&Update Now"), mContextMenu->insertItem(SmallIcon("reload"), i18n("&Update Now"),
@ -171,7 +171,7 @@ void kweather::preferences()
/** The help handler */ /** The help handler */
void kweather::help() void kweather::help()
{ {
kapp->invokeHelp(TQString::null, TQString::fromLatin1("kweather")); kapp->invokeHelp(TQString(), TQString::tqfromLatin1("kweather"));
} }
/** Display the current weather report. */ /** Display the current weather report. */
@ -216,7 +216,7 @@ void kweather::loadPrefs(){
reportLocation = kcConfig->readEntry("report_location"); reportLocation = kcConfig->readEntry("report_location");
mViewMode = kcConfig->readNumEntry("smallview_mode", dockwidget::ShowAll); mViewMode = kcConfig->readNumEntry("smallview_mode", dockwidget::ShowAll);
static TQColor black(Qt::black); static TQColor black(TQt::black);
mTextColor = kcConfig->readColorEntry("textColor", &black); mTextColor = kcConfig->readColorEntry("textColor", &black);
} }
@ -299,7 +299,7 @@ void kweather::timeout()
int kweather::widthForHeight(int h) const int kweather::widthForHeight(int h) const
{ {
//kdDebug(12004) << "widthForHeight " << h << endl; //kdDebug(12004) << "widthForHeight " << h << endl;
dockWidget->setOrientation(Horizontal); dockWidget->setOrientation(Qt::Horizontal);
int w = dockWidget->widthForHeight(h); int w = dockWidget->widthForHeight(h);
return w; return w;
} }
@ -307,7 +307,7 @@ int kweather::widthForHeight(int h) const
int kweather::heightForWidth(int w) const int kweather::heightForWidth(int w) const
{ {
kdDebug(12004) << "heightForWidth " << w<< endl; kdDebug(12004) << "heightForWidth " << w<< endl;
dockWidget->setOrientation(Vertical); dockWidget->setOrientation(Qt::Vertical);
int h = dockWidget->heightForWidth( w ); int h = dockWidget->heightForWidth( w );
return h; return h;
} }
@ -363,7 +363,7 @@ void kweather::slotPrefsAccepted()
void kweather::mousePressEvent(TQMouseEvent *e) void kweather::mousePressEvent(TQMouseEvent *e)
{ {
if ( e->button() != RightButton ) if ( e->button() != Qt::RightButton )
{ {
KPanelApplet::mousePressEvent( e ); KPanelApplet::mousePressEvent( e );
return; return;

@ -33,9 +33,10 @@ class TQPalette;
class kweather : public KPanelApplet, public weatherIface class kweather : public KPanelApplet, public weatherIface
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
kweather(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *parent = 0, const char *name = 0); kweather(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *tqparent = 0, const char *name = 0);
~kweather(); ~kweather();
void help(); void help();
void resizeEvent(TQResizeEvent*); void resizeEvent(TQResizeEvent*);

@ -29,7 +29,7 @@ int main (int argc, char *argv[])
// This app is started automatically, no need for session management // This app is started automatically, no need for session management
app.disableSessionManagement(); app.disableSessionManagement();
kdDebug() << "starting dcopservice " << endl; kdDebug() << "starting dcopservice " << endl;
new WeatherService(&app, "WeatherService"); new WeatherService(TQT_TQOBJECT(&app), "WeatherService");
return app.exec(); return app.exec();
} }

@ -54,7 +54,7 @@ MetarParser::MetarParser(StationDatabase *stationDB,
void MetarParser::reset() void MetarParser::reset()
{ {
// Initialize the WeatherInfo structure // Initialize the WeatherInfo structure
weatherInfo.theWeather = TQString::null; weatherInfo.theWeather = TQString();
weatherInfo.clouds = 0; weatherInfo.clouds = 0;
weatherInfo.windMPH = 0; weatherInfo.windMPH = 0;
weatherInfo.tempC = 0; weatherInfo.tempC = 0;
@ -64,15 +64,15 @@ void MetarParser::reset()
weatherInfo.qsCurrentList.clear(); weatherInfo.qsCurrentList.clear();
weatherInfo.qsDate = m_date; weatherInfo.qsDate = m_date;
weatherInfo.qsTime = m_time; weatherInfo.qsTime = m_time;
weatherInfo.qsPressure = TQString::null; weatherInfo.qsPressure = TQString();
weatherInfo.qsTemperature = TQString::null; weatherInfo.qsTemperature = TQString();
weatherInfo.qsDewPoint = TQString::null; weatherInfo.qsDewPoint = TQString();
weatherInfo.qsRelHumidity = TQString::null; weatherInfo.qsRelHumidity = TQString();
weatherInfo.qsVisibility = TQString::null; weatherInfo.qsVisibility = TQString();
weatherInfo.qsWindSpeed = TQString::null; weatherInfo.qsWindSpeed = TQString();
weatherInfo.qsWindChill = TQString::null; weatherInfo.qsWindChill = TQString();
weatherInfo.qsHeatIndex = TQString::null; weatherInfo.qsHeatIndex = TQString();
weatherInfo.qsWindDirection = TQString::null; weatherInfo.qsWindDirection = TQString();
weatherInfo.stationNeedsMaintenance = false; weatherInfo.stationNeedsMaintenance = false;
} }
@ -147,7 +147,7 @@ bool MetarParser::parseCover(const TQString &s)
{ {
if (CoverRegExp.search(s) > -1) if (CoverRegExp.search(s) > -1)
{ {
kdDebug(12006) << "Cover: " << CoverRegExp.capturedTexts().join("-") kdDebug(12006) << "Cover: " << TQString(CoverRegExp.tqcapturedTexts().join("-"))
<< endl; << endl;
TQString sCode = CoverRegExp.cap(1); TQString sCode = CoverRegExp.cap(1);
@ -170,22 +170,22 @@ bool MetarParser::parseCover(const TQString &s)
if (sCode == "FEW") if (sCode == "FEW")
{ {
skycondition = i18n( "Few clouds at %1" ).arg(sClouds); skycondition = i18n( "Few clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 2; weatherInfo.clouds += 2;
} }
else if (sCode == "SCT") else if (sCode == "SCT")
{ {
skycondition = i18n( "Scattered clouds at %1" ).arg(sClouds); skycondition = i18n( "Scattered clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 4; weatherInfo.clouds += 4;
} }
else if (sCode == "BKN") else if (sCode == "BKN")
{ {
skycondition = i18n( "Broken clouds at %1" ).arg(sClouds); skycondition = i18n( "Broken clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 8; weatherInfo.clouds += 8;
} }
else if (sCode == "OVC") else if (sCode == "OVC")
{ {
skycondition = i18n( "Overcast clouds at %1" ).arg(sClouds); skycondition = i18n( "Overcast clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 64; weatherInfo.clouds += 64;
} }
else if ((sCode == "CLR") || (sCode == "SKC") || (sCode == "CAVOK")) else if ((sCode == "CLR") || (sCode == "SKC") || (sCode == "CAVOK"))
@ -211,7 +211,7 @@ bool MetarParser::parseCurrent(const TQString &s)
TQString sCode = CurrentRegExp.cap(2); TQString sCode = CurrentRegExp.cap(2);
TQString intensity, descriptor, phenomena, currentWeather; TQString intensity, descriptor, phenomena, currentWeather;
kdDebug(12006) << "Current: " << CurrentRegExp.capturedTexts().join("-") << endl; kdDebug(12006) << "Current: " << TQString(CurrentRegExp.tqcapturedTexts().join("-")) << endl;
// Decode the intensity // Decode the intensity
if (sIntensity == "+") if (sIntensity == "+")
@ -226,78 +226,78 @@ bool MetarParser::parseCurrent(const TQString &s)
} }
// Decode the descriptor // Decode the descriptor
if (sCode.contains("MI")) if (sCode.tqcontains("MI"))
descriptor = i18n("Shallow"); descriptor = i18n("Shallow");
else if (sCode.contains("PR")) else if (sCode.tqcontains("PR"))
descriptor = i18n("Partial"); descriptor = i18n("Partial");
else if (sCode.contains("BC")) else if (sCode.tqcontains("BC"))
descriptor = i18n("Patches"); descriptor = i18n("Patches");
else if (sCode.contains("DR")) else if (sCode.tqcontains("DR"))
descriptor = i18n("Low Drifting"); descriptor = i18n("Low Drifting");
else if (sCode.contains("BL")) else if (sCode.tqcontains("BL"))
descriptor = i18n("Blowing"); descriptor = i18n("Blowing");
else if (sCode.contains("SH")) else if (sCode.tqcontains("SH"))
{ {
descriptor = i18n("Showers"); descriptor = i18n("Showers");
weatherInfo.theWeather = "shower"; weatherInfo.theWeather = "shower";
} }
else if (sCode.contains("TS")) else if (sCode.tqcontains("TS"))
{ {
descriptor = i18n("Thunder Storm"); descriptor = i18n("Thunder Storm");
weatherInfo.theWeather = "tstorm"; weatherInfo.theWeather = "tstorm";
} }
else if (sCode.contains("FZ")) else if (sCode.tqcontains("FZ"))
{ {
descriptor = i18n("Freezing"); descriptor = i18n("Freezing");
} }
// Decode weather phenomena // Decode weather phenomena
if (sCode.contains("DZ")) if (sCode.tqcontains("DZ"))
{ {
phenomena = i18n("Drizzle"); phenomena = i18n("Drizzle");
weatherInfo.theWeather = "light_rain"; weatherInfo.theWeather = "light_rain";
} }
else if (sCode.contains("RA")) else if (sCode.tqcontains("RA"))
{ {
phenomena = i18n("Rain"); phenomena = i18n("Rain");
weatherInfo.theWeather = "shower"; weatherInfo.theWeather = "shower";
} }
else if (sCode.contains("SN")) else if (sCode.tqcontains("SN"))
{ {
phenomena = i18n("Snow"); phenomena = i18n("Snow");
weatherInfo.theWeather = "snow"; weatherInfo.theWeather = "snow";
} }
else if (sCode.contains("SG")) else if (sCode.tqcontains("SG"))
{ {
phenomena = i18n("Snow Grains"); phenomena = i18n("Snow Grains");
weatherInfo.theWeather = "snow4"; weatherInfo.theWeather = "snow4";
} }
else if (sCode.contains("IC")) else if (sCode.tqcontains("IC"))
{ {
phenomena = i18n("Ice Crystals"); phenomena = i18n("Ice Crystals");
weatherInfo.theWeather = "hail"; weatherInfo.theWeather = "hail";
} }
else if (sCode.contains("PE")) else if (sCode.tqcontains("PE"))
{ {
phenomena = i18n("Ice Pellets"); phenomena = i18n("Ice Pellets");
weatherInfo.theWeather = "hail"; weatherInfo.theWeather = "hail";
} }
else if (s.contains("GR")) else if (s.tqcontains("GR"))
{ {
phenomena = i18n("Hail"); phenomena = i18n("Hail");
weatherInfo.theWeather = "hail"; weatherInfo.theWeather = "hail";
} }
else if (sCode.contains("GS")) else if (sCode.tqcontains("GS"))
{ {
phenomena = i18n("Small Hail Pellets"); phenomena = i18n("Small Hail Pellets");
weatherInfo.theWeather = "hail"; weatherInfo.theWeather = "hail";
} }
else if (s.contains("UP")) else if (s.tqcontains("UP"))
{ {
phenomena = i18n("Unknown Precipitation"); phenomena = i18n("Unknown Precipitation");
weatherInfo.theWeather = iconName("shower1"); weatherInfo.theWeather = iconName("shower1");
} }
else if (sCode.contains("BR")) else if (sCode.tqcontains("BR"))
{ {
phenomena = i18n("Mist"); phenomena = i18n("Mist");
// Mist has lower priority than say rain or snow // Mist has lower priority than say rain or snow
@ -306,7 +306,7 @@ bool MetarParser::parseCurrent(const TQString &s)
weatherInfo.theWeather = "mist"; weatherInfo.theWeather = "mist";
} }
} }
else if (sCode.contains("FG")) else if (sCode.tqcontains("FG"))
{ {
phenomena = i18n("Fog"); phenomena = i18n("Fog");
// Fog has lower priority than say rain or snow // Fog has lower priority than say rain or snow
@ -315,35 +315,35 @@ bool MetarParser::parseCurrent(const TQString &s)
weatherInfo.theWeather = "fog"; weatherInfo.theWeather = "fog";
} }
} }
else if (sCode.contains("FU")) else if (sCode.tqcontains("FU"))
phenomena = i18n("Smoke"); phenomena = i18n("Smoke");
else if (sCode.contains("VA")) else if (sCode.tqcontains("VA"))
phenomena = i18n("Volcanic Ash"); phenomena = i18n("Volcanic Ash");
else if (sCode.contains("DU")) else if (sCode.tqcontains("DU"))
phenomena = i18n("Widespread Dust"); phenomena = i18n("Widespread Dust");
else if (sCode.contains("SA")) else if (sCode.tqcontains("SA"))
phenomena = i18n("Sand"); phenomena = i18n("Sand");
else if (sCode.contains("HZ")) else if (sCode.tqcontains("HZ"))
phenomena = i18n("Haze"); phenomena = i18n("Haze");
else if (sCode.contains("PY")) else if (sCode.tqcontains("PY"))
phenomena = i18n("Spray"); phenomena = i18n("Spray");
else if (sCode.contains("PO")) else if (sCode.tqcontains("PO"))
phenomena = i18n("Dust/Sand Swirls"); phenomena = i18n("Dust/Sand Swirls");
else if (sCode.contains("SQ")) else if (sCode.tqcontains("SQ"))
phenomena = i18n("Sudden Winds"); phenomena = i18n("Sudden Winds");
else if (sCode.contains("FC")) else if (sCode.tqcontains("FC"))
{ {
if (sIntensity == "+") if (sIntensity == "+")
currentWeather = i18n("Tornado"); currentWeather = i18n("Tornado");
else else
phenomena = i18n("Funnel Cloud"); phenomena = i18n("Funnel Cloud");
} }
else if (sCode.contains("SS")) else if (sCode.tqcontains("SS"))
phenomena = i18n("Sand Storm"); phenomena = i18n("Sand Storm");
else if (sCode.contains("DS")) else if (sCode.tqcontains("DS"))
phenomena = i18n("Dust Storm"); phenomena = i18n("Dust Storm");
if (currentWeather.isEmpty()) currentWeather = i18n("%1 is the intensity, %2 is the descriptor and %3 is the phenomena", "%1 %2 %3").arg(intensity).arg(descriptor).arg(phenomena); if (currentWeather.isEmpty()) currentWeather = i18n("%1 is the intensity, %2 is the descriptor and %3 is the phenomena", "%1 %2 %3").tqarg(intensity).tqarg(descriptor).tqarg(phenomena);
if (!currentWeather.isEmpty()) if (!currentWeather.isEmpty())
weatherInfo.qsCurrentList << currentWeather; weatherInfo.qsCurrentList << currentWeather;
@ -358,7 +358,7 @@ bool MetarParser::parseTemperature(const TQString &s)
{ {
if (TempRegExp.search(s) > -1) if (TempRegExp.search(s) > -1)
{ {
kdDebug(12006) << "Temp: " << TempRegExp.capturedTexts().join("-") kdDebug(12006) << "Temp: " << TQString(TempRegExp.tqcapturedTexts().join("-"))
<< endl; << endl;
float fTemp = TempRegExp.cap(2).toFloat(); float fTemp = TempRegExp.cap(2).toFloat();
@ -379,7 +379,7 @@ bool MetarParser::parseTemperatureTenths(const TQString &s)
{ {
if (TempTenRegExp.search(s) > -1) if (TempTenRegExp.search(s) > -1)
{ {
kdDebug(12006) << "Temp Tenths: " << TempTenRegExp.capturedTexts().join("-") kdDebug(12006) << "Temp Tenths: " << TQString(TempTenRegExp.tqcapturedTexts().join("-"))
<< endl; << endl;
float temperature = TempTenRegExp.cap( 1 ).toFloat() / 10; float temperature = TempTenRegExp.cap( 1 ).toFloat() / 10;
@ -473,7 +473,7 @@ bool MetarParser::parseDate(const TQString &s)
{ {
if (DateRegExp.search(s) > -1) if (DateRegExp.search(s) > -1)
{ {
kdDebug(12006) << "Date: " << DateRegExp.capturedTexts().join("-") kdDebug(12006) << "Date: " << TQString(DateRegExp.tqcapturedTexts().join("-"))
<< endl; << endl;
TQString dateString = DateRegExp.cap(1); TQString dateString = DateRegExp.cap(1);
TQString day, month, year; TQString day, month, year;
@ -496,7 +496,7 @@ bool MetarParser::parseTime(const TQString &s)
{ {
if (TimeRegExp.search(s) > -1) if (TimeRegExp.search(s) > -1)
{ {
kdDebug(12006) << "Time: " << TimeRegExp.capturedTexts().join("-") kdDebug(12006) << "Time: " << TQString(TimeRegExp.tqcapturedTexts().join("-"))
<< endl; << endl;
TQString hour, minute, dateString; TQString hour, minute, dateString;
@ -521,7 +521,7 @@ bool MetarParser::parseVisibility(TQStringList::ConstIterator it)
{ {
fVisibility = VisRegExp.cap(1).toFloat(); fVisibility = VisRegExp.cap(1).toFloat();
kdDebug(12006) << "Visibility: " << VisRegExp.capturedTexts().join("-") kdDebug(12006) << "Visibility: " << TQString(VisRegExp.tqcapturedTexts().join("-"))
<< endl; << endl;
} }
@ -564,7 +564,7 @@ bool MetarParser::parsePressure( const TQString &s)
TQString type = PressRegExp.cap(1); TQString type = PressRegExp.cap(1);
float fPressure = PressRegExp.cap(2).toFloat(); float fPressure = PressRegExp.cap(2).toFloat();
kdDebug(12006) << "Pressure: " << PressRegExp.capturedTexts().join("-") kdDebug(12006) << "Pressure: " << TQString(PressRegExp.tqcapturedTexts().join("-"))
<< endl; << endl;
if (m_units == KLocale::Metric) if (m_units == KLocale::Metric)
@ -643,7 +643,7 @@ bool MetarParser::parseWindSpeed(const TQString &s)
float gustSpeed = WindRegExp.cap(3).toFloat(); float gustSpeed = WindRegExp.cap(3).toFloat();
TQString sWindUnit = WindRegExp.cap(4); TQString sWindUnit = WindRegExp.cap(4);
kdDebug(12006) << "Wind: " << WindRegExp.capturedTexts().join("-") kdDebug(12006) << "Wind: " << WindRegExp.tqcapturedTexts().join("-")
<< endl; << endl;
if (m_units == KLocale::Metric) if (m_units == KLocale::Metric)
@ -854,7 +854,7 @@ bool MetarParser::isNight(const TQString &stationID) const
// Midnight Sun & Polar Night - In summer, the Sun is always // Midnight Sun & Polar Night - In summer, the Sun is always
// over the horizon line ... so use latitude & today date to // over the horizon line ... so use latitude & today date to
// set isNight() value. // set isNight() value.
return ((m_date.daysInYear() >= 80 || m_date.daysInYear() <= 264) && latitude.contains("S")); return ((m_date.daysInYear() >= 80 || m_date.daysInYear() <= 264) && latitude.tqcontains("S"));
} }
} }
} }

@ -60,7 +60,7 @@ class MetarParser
public: public:
MetarParser(StationDatabase *stationDB, MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units = KLocale::Imperial, KLocale::MeasureSystem units = KLocale::Imperial,
TQDate date = TQDate::currentDate(), TQDate date = TQDate::tqcurrentDate(),
TQTime time = TQTime::currentTime(), TQTime time = TQTime::currentTime(),
unsigned int localUTCOffset = KRFCDate::localUTCOffset()); unsigned int localUTCOffset = KRFCDate::localUTCOffset());

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>prefsDialogData</class> <class>prefsDialogData</class>
<author>ian reinhart geiser &lt;geiseri@kde.org&gt;</author> <author>ian reinhart geiser &lt;geiseri@kde.org&gt;</author>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>prefsDialogData</cstring> <cstring>prefsDialogData</cstring>
</property> </property>
@ -21,7 +21,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
@ -37,7 +37,7 @@
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>GroupBox2</cstring> <cstring>GroupBox2</cstring>
</property> </property>
@ -62,7 +62,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>TextLabel1_4_2_2</cstring> <cstring>TextLabel1_4_2_2</cstring>
</property> </property>
@ -85,7 +85,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
@ -102,7 +102,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>MinimumExpanding</enum> <enum>MinimumExpanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -111,7 +111,7 @@
</spacer> </spacer>
</hbox> </hbox>
</widget> </widget>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>m_viewMode</cstring> <cstring>m_viewMode</cstring>
</property> </property>
@ -129,7 +129,7 @@
<property name="title"> <property name="title">
<string>Panel Display Options</string> <string>Panel Display Options</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignVCenter|AlignLeft</set> <set>AlignVCenter|AlignLeft</set>
</property> </property>
<property name="exclusive"> <property name="exclusive">
@ -139,7 +139,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_smallView</cstring> <cstring>m_smallView</cstring>
</property> </property>
@ -161,10 +161,10 @@
<string>&lt;qt&gt;Click here to show only the weather icon.&lt;/qt&gt;</string> <string>&lt;qt&gt;Click here to show only the weather icon.&lt;/qt&gt;</string>
</property> </property>
<property name="whatsThis" stdset="0"> <property name="whatsThis" stdset="0">
<string>This feature will allow you to make KWeather take up only one slot on the kicker. Normally this application will take up two slots. The small view will only show the weather icon, while the normal view will display both the icon and the current weather statistics. For the small view the weather statistics will be put on the buttons tool tip.</string> <string>This feature will allow you to make KWeather take up only one slot on the kicker. Normally this application will take up two Q_SLOTS. The small view will only show the weather icon, while the normal view will display both the icon and the current weather statistics. For the small view the weather statistics will be put on the buttons tool tip.</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>CheckBox9</cstring> <cstring>CheckBox9</cstring>
</property> </property>
@ -175,7 +175,7 @@
<number>2</number> <number>2</number>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>CheckBox10</cstring> <cstring>CheckBox10</cstring>
</property> </property>
@ -191,7 +191,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>GroupBox1</cstring> <cstring>GroupBox1</cstring>
</property> </property>
@ -210,7 +210,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>m_enableLog</cstring> <cstring>m_enableLog</cstring>
</property> </property>
@ -228,14 +228,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>294</width> <width>294</width>
<height>16</height> <height>16</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLabel" row="1" column="0"> <widget class="TQLabel" row="1" column="0">
<property name="name"> <property name="name">
<cstring>m_labelLogFile</cstring> <cstring>m_labelLogFile</cstring>
</property> </property>
@ -256,7 +256,7 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>252</width> <width>252</width>
<height>0</height> <height>0</height>
@ -271,7 +271,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox3</cstring> <cstring>groupBox3</cstring>
</property> </property>
@ -282,15 +282,15 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout1</cstring> <cstring>tqlayout1</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -318,7 +318,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>170</width> <width>170</width>
<height>20</height> <height>20</height>
@ -348,8 +348,8 @@
<includes> <includes>
<include location="local" impldecl="in implementation">kdialog.h</include> <include location="local" impldecl="in implementation">kdialog.h</include>
</includes> </includes>
<layoutdefaults spacing="3" margin="6"/> <tqlayoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> <tqlayoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
<includehints> <includehints>
<includehint>kcombobox.h</includehint> <includehint>kcombobox.h</includehint>
<includehint>kurlrequester.h</includehint> <includehint>kurlrequester.h</includehint>

@ -31,7 +31,7 @@
#include "weatherservice_stub.h" #include "weatherservice_stub.h"
reportView::reportView(const TQString &reportLocation) reportView::reportView(const TQString &reportLocation)
: KDialogBase( (TQWidget *)0, "report", false, TQString::null, Close ), : KDialogBase( (TQWidget *)0, "report", false, TQString(), Close ),
m_locationCode(reportLocation) m_locationCode(reportLocation)
{ {
TQVBox *vbox = makeVBoxMainWidget(); TQVBox *vbox = makeVBoxMainWidget();
@ -55,7 +55,7 @@ reportView::reportView(const TQString &reportLocation)
reportView::~reportView(){ reportView::~reportView(){
delete m_weatherService; delete m_weatherService;
// we do not have to delete m_reportView because this class is // we do not have to delete m_reportView because this class is
// the parent of the TQVBox, and that is the parent of the KHTMLPart. // the tqparent of the TQVBox, and that is the tqparent of the KHTMLPart.
KConfig config( "weather_panelappletrc" ); KConfig config( "weather_panelappletrc" );
config.setGroup( "General Options" ); config.setGroup( "General Options" );
@ -72,7 +72,7 @@ void reportView::render(){
TQString textColor = KGlobalSettings::textColor().name(); TQString textColor = KGlobalSettings::textColor().name();
TQString baseColor = KGlobalSettings::baseColor().name(); TQString baseColor = KGlobalSettings::baseColor().name();
TQColorGroup cg = palette().active(); TQColorGroup cg = tqpalette().active();
TQString bgColor = cg.background().name(); TQString bgColor = cg.background().name();
TQString hlColor = cg.highlight().name(); TQString hlColor = cg.highlight().name();
TQString hlTextColor = cg.highlightedText().name(); TQString hlTextColor = cg.highlightedText().name();
@ -93,7 +93,7 @@ void reportView::render(){
TQStringList cover = m_weatherService->cover(m_locationCode ); TQStringList cover = m_weatherService->cover(m_locationCode );
TQStringList weather = m_weatherService->weather(m_locationCode ); TQStringList weather = m_weatherService->weather(m_locationCode );
setCaption(i18n("Weather Report - %1").arg( locationName ) ); setCaption(i18n("Weather Report - %1").tqarg( locationName ) );
TQString weatherText = "<ul>\n"; TQString weatherText = "<ul>\n";
@ -114,24 +114,24 @@ void reportView::render(){
TQString contents = TQString contents =
"<html><head><style type=\"text/css\">" + "<html><head><style type=\"text/css\">" +
TQString("body { font-family: \"%1\"; font-size: %2pt; color: %3; background-color: %4; }\n") TQString("body { font-family: \"%1\"; font-size: %2pt; color: %3; background-color: %4; }\n")
.arg(fntFamily).arg(fntSize).arg(textColor).arg(baseColor) + .tqarg(fntFamily).tqarg(fntSize).tqarg(textColor).tqarg(baseColor) +
TQString("div.headerTitle { background-color: %1; color: %2; padding: 4px; font-size: 120%; border: solid %3 1px; }\n") TQString("div.headerTitle { background-color: %1; color: %2; padding: 4px; font-size: 120%; border: solid %3 1px; }\n")
.arg(hlColor).arg(hlTextColor).arg(textColor) + .tqarg(hlColor).tqarg(hlTextColor).tqarg(textColor) +
TQString("div.headerMsg { background-color: %1; color: %2; border-bottom: solid %3 1px; " TQString("div.headerMsg { background-color: %1; color: %2; border-bottom: solid %3 1px; "
"border-left: solid %4 1px; border-right: solid %5 1px; margin-bottom: 1em; padding: 2px; }\n") "border-left: solid %4 1px; border-right: solid %5 1px; margin-bottom: 1em; padding: 2px; }\n")
.arg(bgColor).arg(textColor).arg(textColor).arg(textColor).arg(textColor) + .tqarg(bgColor).tqarg(textColor).tqarg(textColor).tqarg(textColor).tqarg(textColor) +
TQString("</style><title></title></head><body dir=\"%1\">").arg( TQApplication::reverseLayout()?"rtl":"ltr") + TQString("</style><title></title></head><body dir=\"%1\">").tqarg( TQApplication::reverseLayout()?"rtl":"ltr") +
"<div class=\"headerTitle\"><b>" + i18n( "Weather Report - %1 - %2" ).arg( locationName ).arg( countryName ) + "<div class=\"headerTitle\"><b>" + i18n( "Weather Report - %1 - %2" ).tqarg( locationName ).tqarg( countryName ) +
"</b></div>\n"; "</b></div>\n";
if ( ! date.isEmpty() ) if ( ! date.isEmpty() )
contents += "<div class=\"headerMsg\"><b>" + i18n( "Latest data from %1" ).arg(date) + "</b></div>\n"; contents += "<div class=\"headerMsg\"><b>" + i18n( "Latest data from %1" ).tqarg(date) + "</b></div>\n";
contents += TQString( contents += TQString(
"<table><tr><td width=\"60\" style=\"text-align: center; border: dotted %1 1px;\">" "<table><tr><td width=\"60\" style=\"text-align: center; border: dotted %1 1px;\">"
"<img width=\"64\" height=\"64\" src=\"%2\" /></td>" "<img width=\"64\" height=\"64\" src=\"%2\" /></td>"
"<td style=\"vertical-align: top\">%3</td></tr>") "<td style=\"vertical-align: top\">%3</td></tr>")
.arg(bgColor).arg(KURL(icon).url()).arg(weatherText) + .tqarg(bgColor).tqarg(KURL(icon).url()).tqarg(weatherText) +
"</table><table>" + "</table><table>" +
TQString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" ) TQString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" )
+ "</th><td>%1</td>" + "</th><td>%1</td>"
@ -145,15 +145,15 @@ void reportView::render(){
+ "</th><td>%4</td></tr>" + "</th><td>%4</td></tr>"
"<tr><th style=\"text-align: right\">" + i18n( "Wind Speed:" ) "<tr><th style=\"text-align: right\">" + i18n( "Wind Speed:" )
+ "</th><td>%5</td>") + "</th><td>%5</td>")
.arg(temp).arg(dewPoint).arg(pressure).arg(relHumidity) .tqarg(temp).tqarg(dewPoint).tqarg(pressure).tqarg(relHumidity)
.arg(wind) + "<td width=\"50\">&nbsp;</td>"; .tqarg(wind) + "<td width=\"50\">&nbsp;</td>";
if (!heatIndex.isEmpty()) if (!heatIndex.isEmpty())
contents += TQString("<th style=\"text-align: right\">" contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Heat Index:" ) + "</th><td>%1</td>").arg(heatIndex); + i18n( "Heat Index:" ) + "</th><td>%1</td>").tqarg(heatIndex);
else if (!windChill.isEmpty()) else if (!windChill.isEmpty())
contents += TQString("<th style=\"text-align: right\">" contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Wind Chill:" ) + "</th><td>%1</td>").arg(windChill); + i18n( "Wind Chill:" ) + "</th><td>%1</td>").tqarg(windChill);
else else
contents += "<td>&nbsp;</td><td>&nbsp;</td>"; contents += "<td>&nbsp;</td><td>&nbsp;</td>";
contents += "</tr>"; contents += "</tr>";
@ -162,7 +162,7 @@ void reportView::render(){
+ i18n( "Sunrise:" ) + "</th><td>%1</td>" + + i18n( "Sunrise:" ) + "</th><td>%1</td>" +
"<td width=\"50\">&nbsp;</td><th style=\"text-align: right\">" "<td width=\"50\">&nbsp;</td><th style=\"text-align: right\">"
+ i18n( "Sunset:" ) + "</th><td>%2</td>") + i18n( "Sunset:" ) + "</th><td>%2</td>")
.arg(sunRiseTime).arg(sunSetTime); .tqarg(sunRiseTime).tqarg(sunSetTime);
contents += "</tr></table></body></html>"; contents += "</tr></table></body></html>";

@ -31,6 +31,7 @@ class WeatherService_stub;
class reportView : public KDialogBase { class reportView : public KDialogBase {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
reportView(const TQString &reportLocation); reportView(const TQString &reportLocation);

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>wsPrefs</class> <class>wsPrefs</class>
<author>Ian Reinhart Geiser &lt;geiseri@kde.org&gt;</author> <author>Ian Reinhart Geiser &lt;geiseri@kde.org&gt;</author>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>wsPrefs</cstring> <cstring>wsPrefs</cstring>
</property> </property>
@ -28,7 +28,7 @@
<string>A&amp;dd</string> <string>A&amp;dd</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="2"> <widget class="TQLabel" row="0" column="2">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -39,7 +39,7 @@
<cstring>mSelectedStations</cstring> <cstring>mSelectedStations</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="0"> <widget class="TQLabel" row="0" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -60,7 +60,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>86</height> <height>86</height>
@ -121,7 +121,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>85</height> <height>85</height>
@ -167,9 +167,9 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="3"> <widget class="TQLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>layout1</cstring> <cstring>tqlayout1</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -224,9 +224,9 @@
</connection> </connection>
<connection> <connection>
<sender>mSelectedStations</sender> <sender>mSelectedStations</sender>
<signal>selectionChanged(QListViewItem*)</signal> <signal>selectionChanged(TQListViewItem*)</signal>
<receiver>wsPrefs</receiver> <receiver>wsPrefs</receiver>
<slot>selectionChanged(QListViewItem*)</slot> <slot>selectionChanged(TQListViewItem*)</slot>
</connection> </connection>
</connections> </connections>
<tabstops> <tabstops>
@ -242,15 +242,15 @@
<include location="global" impldecl="in implementation">kdialog.h</include> <include location="global" impldecl="in implementation">kdialog.h</include>
<include location="global" impldecl="in implementation">knuminput.h</include> <include location="global" impldecl="in implementation">knuminput.h</include>
</includes> </includes>
<slots> <Q_SLOTS>
<slot>exitWeatherService()</slot> <slot>exitWeatherService()</slot>
<slot>removeStation()</slot> <slot>removeStation()</slot>
<slot>updateStations()</slot> <slot>updateStations()</slot>
<slot>addStation()</slot> <slot>addStation()</slot>
<slot>selectionChanged( QListViewItem* )</slot> <slot>selectionChanged( TQListViewItem* )</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="3" margin="6"/> <tqlayoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> <tqlayoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
<includehints> <includehints>
<includehint>klistview.h</includehint> <includehint>klistview.h</includehint>
<includehint>klistview.h</includehint> <includehint>klistview.h</includehint>

@ -34,7 +34,7 @@
#include "serviceconfigwidget.h" #include "serviceconfigwidget.h"
#include "weatherservice_stub.h" #include "weatherservice_stub.h"
class StationItem : public QListViewItem class StationItem : public TQListViewItem
{ {
public: public:
StationItem( TQListView *view, const TQString &name, const TQString &uid ) StationItem( TQListView *view, const TQString &name, const TQString &uid )
@ -55,8 +55,8 @@ class StationItem : public QListViewItem
static void parseStationEntry( const TQString &line, TQString &name, TQString &uid ); static void parseStationEntry( const TQString &line, TQString &name, TQString &uid );
ServiceConfigWidget::ServiceConfigWidget( TQWidget *parent, const char *name ) ServiceConfigWidget::ServiceConfigWidget( TQWidget *tqparent, const char *name )
: wsPrefs( parent, name ), mService(0) : wsPrefs( tqparent, name ), mService(0)
{ {
mService = new WeatherService_stub( "KWeatherService", "WeatherService" ); mService = new WeatherService_stub( "KWeatherService", "WeatherService" );
connect( mAllStations, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), TQT_SLOT( addStation() ) ); connect( mAllStations, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), TQT_SLOT( addStation() ) );
@ -194,7 +194,7 @@ void ServiceConfigWidget::loadLocations()
parseStationEntry( entryIt.data(), station, uid ); parseStationEntry( entryIt.data(), station, uid );
new StationItem( stateItem, station, uid ); new StationItem( stateItem, station, uid );
mStationMap.insert( uid, TQString( "%1, %2" ) mStationMap.insert( uid, TQString( "%1, %2" )
.arg( station ).arg( *stateIt ) ); .tqarg( station ).tqarg( *stateIt ) );
} }
} }
} }
@ -224,7 +224,7 @@ void parseStationEntry( const TQString &line, TQString &name, TQString &uid )
for ( uint i = 0; i < list.count(); ++i ) { for ( uint i = 0; i < list.count(); ++i ) {
if ( inName ) { if ( inName ) {
if ( list[ i ].endsWith( "\\" ) ) { if ( list[ i ].endsWith( "\\" ) ) {
name.append( list[ i ].replace( "\\", " " ) ); name.append( list[ i ].tqreplace( "\\", " " ) );
} else { } else {
name.append( list[ i ] ); name.append( list[ i ] );
inName = false; inName = false;

@ -28,9 +28,10 @@ class WeatherService_stub;
class ServiceConfigWidget : public wsPrefs class ServiceConfigWidget : public wsPrefs
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ServiceConfigWidget( TQWidget *parent, const char *name = 0 ); ServiceConfigWidget( TQWidget *tqparent, const char *name = 0 );
virtual ~ServiceConfigWidget(); virtual ~ServiceConfigWidget();
signals: signals:

@ -22,8 +22,8 @@
#include "sidebarwidget.h" #include "sidebarwidget.h"
#include <tqscrollview.h> #include <tqscrollview.h>
sidebarwidget::sidebarwidget(TQWidget* parent, const char* name) : sidebarwidget::sidebarwidget(TQWidget* tqparent, const char* name) :
sidebarwidgetbase(parent,name) sidebarwidgetbase(tqparent,name)
{ {
view = new TQVBox(reportGrid->viewport()); view = new TQVBox(reportGrid->viewport());
reportGrid->addChild(view); reportGrid->addChild(view);

@ -29,8 +29,9 @@
class sidebarwidget : public sidebarwidgetbase class sidebarwidget : public sidebarwidgetbase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
sidebarwidget(TQWidget* parent, const char* name = 0); sidebarwidget(TQWidget* tqparent, const char* name = 0);
virtual ~sidebarwidget(); virtual ~sidebarwidget();
void addWidget(TQWidget *w, const TQString &s); void addWidget(TQWidget *w, const TQString &s);
TQWidget *viewport(); TQWidget *viewport();

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>sidebarwidgetbase</class> <class>sidebarwidgetbase</class>
<author>ian reinhart geiser &lt;geiseri@kde.org&gt;</author> <author>ian reinhart geiser &lt;geiseri@kde.org&gt;</author>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Form1</cstring> <cstring>Form1</cstring>
</property> </property>
@ -17,7 +17,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QGroupBox" row="1" column="0"> <widget class="TQGroupBox" row="1" column="0">
<property name="name"> <property name="name">
<cstring>GroupBox2</cstring> <cstring>GroupBox2</cstring>
</property> </property>
@ -28,7 +28,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget" row="0" column="0"> <widget class="TQLayoutWidget" row="0" column="0">
<property name="name"> <property name="name">
<cstring>Layout1</cstring> <cstring>Layout1</cstring>
</property> </property>
@ -61,7 +61,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -70,7 +70,7 @@
</spacer> </spacer>
</grid> </grid>
</widget> </widget>
<widget class="QGroupBox" row="0" column="0"> <widget class="TQGroupBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>reportGroup</cstring> <cstring>reportGroup</cstring>
</property> </property>
@ -81,7 +81,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QScrollView" row="0" column="0"> <widget class="TQScrollView" row="0" column="0">
<property name="name"> <property name="name">
<cstring>reportGrid</cstring> <cstring>reportGrid</cstring>
</property> </property>
@ -108,5 +108,5 @@
<pixmap>image0</pixmap> <pixmap>image0</pixmap>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<layoutdefaults spacing="5" margin="5"/> <tqlayoutdefaults spacing="5" margin="5"/>
</UI> </UI>

@ -76,7 +76,7 @@ TQString StationDatabase::stationNameFromID( const TQString & stationID )
{ {
TQString result; TQString result;
if ( theDB.find( stationID ) == theDB.end() ) if ( theDB.tqfind( stationID ) == theDB.end() )
{ {
if ( loadStation( stationID ) ) if ( loadStation( stationID ) )
result = theDB[ stationID ].cityName; result = theDB[ stationID ].cityName;
@ -98,7 +98,7 @@ TQString StationDatabase::stationLongitudeFromID( const TQString & stationID )
{ {
TQString result; TQString result;
if ( theDB.find( stationID ) == theDB.end() ) if ( theDB.tqfind( stationID ) == theDB.end() )
{ {
if ( loadStation( stationID ) ) if ( loadStation( stationID ) )
result = theDB[ stationID ].longitude; result = theDB[ stationID ].longitude;
@ -120,7 +120,7 @@ TQString StationDatabase::stationLatitudeFromID( const TQString & stationID )
{ {
TQString result; TQString result;
if ( theDB.find( stationID ) == theDB.end() ) if ( theDB.tqfind( stationID ) == theDB.end() )
{ {
if ( loadStation( stationID ) ) if ( loadStation( stationID ) )
result = theDB[ stationID ].latitude; result = theDB[ stationID ].latitude;
@ -142,7 +142,7 @@ TQString StationDatabase::stationCountryFromID( const TQString &stationID )
{ {
TQString result; TQString result;
if ( theDB.find( stationID ) == theDB.end() ) if ( theDB.tqfind( stationID ) == theDB.end() )
{ {
if ( loadStation( stationID ) ) if ( loadStation( stationID ) )
result = theDB[ stationID ].country; result = theDB[ stationID ].country;

@ -176,7 +176,7 @@ static double latitudeToDouble( const TQString &latitude )
result = dd + (mm / 60); result = dd + (mm / 60);
if (latitude.contains("S")) if (latitude.tqcontains("S"))
result *= -1; result *= -1;
return result; return result;
@ -192,7 +192,7 @@ static double longitudeToDouble( const TQString &longitude )
result = ddd + (mm / 60); result = ddd + (mm / 60);
if (longitude.contains("W")) if (longitude.tqcontains("W"))
result *= -1; result *= -1;
return result; return result;
@ -282,7 +282,7 @@ static int __sunriset__( int year, int month, int day, double lon, double lat,
double sr; /* Solar distance, astronomical units */ double sr; /* Solar distance, astronomical units */
double sRA; /* Sun's Right Ascension */ double sRA; /* Sun's Right Ascension */
double sdec; /* Sun's declination */ double sdec; /* Sun's declination */
double sradius; /* Sun's apparent radius */ double sradius; /* Sun's aptqparent radius */
double t; /* Diurnal arc */ double t; /* Diurnal arc */
double tsouth; /* Time when Sun is at south */ double tsouth; /* Time when Sun is at south */
double sidtime; /* Local sidereal time */ double sidtime; /* Local sidereal time */
@ -303,7 +303,7 @@ static int __sunriset__( int year, int month, int day, double lon, double lat,
/* Compute time when Sun is at south - in hours UT */ /* Compute time when Sun is at south - in hours UT */
tsouth = 12.0 - rev180(sidtime - sRA) / 15.0; tsouth = 12.0 - rev180(sidtime - sRA) / 15.0;
/* Compute the Sun's apparent radius, degrees */ /* Compute the Sun's aptqparent radius, degrees */
sradius = 0.2666 / sr; sradius = 0.2666 / sr;
/* Do correction to upper limb, if necessary */ /* Do correction to upper limb, if necessary */

@ -37,7 +37,7 @@ class Sun
*/ */
Sun( const TQString &latitude, Sun( const TQString &latitude,
const TQString &longitude, const TQString &longitude,
TQDate date = TQDate::currentDate(), TQDate date = TQDate::tqcurrentDate(),
const int localUTCOffset = KRFCDate::localUTCOffset() ); const int localUTCOffset = KRFCDate::localUTCOffset() );
TQTime computeRiseTime(); TQTime computeRiseTime();

@ -36,11 +36,11 @@
#include <dcopref.h> #include <dcopref.h>
KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, TQObject* parent, KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, TQObject* tqparent,
TQWidget* widgetParent, TQWidget* widgetParent,
TQString& desktopName, const char* name) TQString& desktopName, const char* name)
: KonqSidebarPlugin(inst, parent, widgetParent, desktopName, name), : KonqSidebarPlugin(inst, tqparent, widgetParent, desktopName, name),
DCOPObject(name) DCOPObject(name)
{ {
@ -100,7 +100,7 @@ TQWidget* KonqSidebarWeather::getWidget()
void KonqSidebarWeather::refresh(TQString stationID) void KonqSidebarWeather::refresh(TQString stationID)
{ {
kdDebug() << "refresh " << stationID << endl; kdDebug() << "refresh " << stationID << endl;
if(m_widgets.find(stationID)) if(m_widgets.tqfind(stationID))
{ {
DCOPRef dcopCall( "KWeatherService", "WeatherService" ); DCOPRef dcopCall( "KWeatherService", "WeatherService" );
m_widgets[stationID]->setWeatherIcon(dcopCall.call("currentIcon(TQString)", stationID ,true )); m_widgets[stationID]->setWeatherIcon(dcopCall.call("currentIcon(TQString)", stationID ,true ));
@ -134,7 +134,7 @@ void KonqSidebarWeather::update()
TQStringList replyList = reply; TQStringList replyList = reply;
for(int i = 0; i < replyList.size(); i++) for(int i = 0; i < replyList.size(); i++)
{ {
if(!m_widgets.find(replyList[i])) if(!m_widgets.tqfind(replyList[i]))
{ {
dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1()); dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1());
m_container->addWidget(d, replyList[i].latin1()); m_container->addWidget(d, replyList[i].latin1());

@ -19,8 +19,8 @@
* $Id$ * $Id$
*/ */
#ifndef __KONQSIDEBARWEATHER_H__ #ifndef __KONTQSIDEBARWEATHER_H__
#define __KONQSIDEBARWEATHER_H__ #define __KONTQSIDEBARWEATHER_H__
#include <konqsidebarplugin.h> #include <konqsidebarplugin.h>
#include <kparts/part.h> #include <kparts/part.h>
@ -37,9 +37,10 @@ class sidebarwidget;
class KonqSidebarWeather: public KonqSidebarPlugin, virtual public DCOPObject class KonqSidebarWeather: public KonqSidebarPlugin, virtual public DCOPObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
K_DCOP K_DCOP
public: public:
KonqSidebarWeather(KInstance* inst, TQObject* parent, TQWidget* widgetParent, KonqSidebarWeather(KInstance* inst, TQObject* tqparent, TQWidget* widgetParent,
TQString& desktopName_, const char* name = 0); TQString& desktopName_, const char* name = 0);
~KonqSidebarWeather(); ~KonqSidebarWeather();

@ -29,8 +29,8 @@
#include <kipc.h> #include <kipc.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
WeatherButton::WeatherButton( TQWidget *parent, const char *name ) WeatherButton::WeatherButton( TQWidget *tqparent, const char *name )
: TQButton( parent, name ), m_highlight( false ) : TQButton( tqparent, name ), m_highlight( false )
{ {
setBackgroundOrigin( AncestorOrigin ); setBackgroundOrigin( AncestorOrigin );
@ -98,7 +98,7 @@ void WeatherButton::generateIcons()
return; return;
TQImage image = pixmap()->convertToImage(); TQImage image = pixmap()->convertToImage();
image = image.smoothScale( pixmapSize(), TQImage::ScaleMin ); image = image.smoothScale( pixmapSize(), TQ_ScaleMin );
KIconEffect effect; KIconEffect effect;
@ -124,14 +124,14 @@ void WeatherButton::slotIconChanged( int group )
return; return;
generateIcons(); generateIcons();
repaint( false ); tqrepaint( false );
} }
void WeatherButton::enterEvent( TQEvent *e ) void WeatherButton::enterEvent( TQEvent *e )
{ {
m_highlight = true; m_highlight = true;
repaint( false ); tqrepaint( false );
TQButton::enterEvent( e ); TQButton::enterEvent( e );
} }
@ -139,7 +139,7 @@ void WeatherButton::leaveEvent( TQEvent *e )
{ {
m_highlight = false; m_highlight = false;
repaint( false ); tqrepaint( false );
TQButton::enterEvent( e ); TQButton::enterEvent( e );
} }

@ -23,12 +23,13 @@
#include <tqbutton.h> #include <tqbutton.h>
#include <tqpixmap.h> #include <tqpixmap.h>
class WeatherButton : public QButton class WeatherButton : public TQButton
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
WeatherButton( TQWidget *parent, const char *name ); WeatherButton( TQWidget *tqparent, const char *name );
void setPixmap( const TQPixmap &pix ); void setPixmap( const TQPixmap &pix );
protected: protected:

@ -65,7 +65,7 @@ WeatherLib::Data::Data()
void WeatherLib::Data::clear() void WeatherLib::Data::clear()
{ {
age = TQDateTime::currentDateTime(); age = TQDateTime::tqcurrentDateTime();
downloading = false; downloading = false;
updated = false; updated = false;
job = 0; job = 0;
@ -77,8 +77,8 @@ void WeatherLib::Data::clear()
} }
} }
WeatherLib::WeatherLib(StationDatabase *stationDB, TQObject *parent, const char *name) WeatherLib::WeatherLib(StationDatabase *stationDB, TQObject *tqparent, const char *name)
: TQObject (parent, name) : TQObject (tqparent, name)
{ {
KGlobal::locale()->insertCatalogue("kweather"); KGlobal::locale()->insertCatalogue("kweather");
@ -124,7 +124,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
//TQTextStream *t = d->target->textStream(); //TQTextStream *t = d->target->textStream();
if( t ) if( t )
{ {
TQString s = TQString::null; TQString s = TQString();
while ( !t->eof() ) while ( !t->eof() )
{ {
s += " " + t->readLine(); s += " " + t->readLine();
@ -135,7 +135,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
kdDebug( 12006 ) << "Parse: " << s << endl; kdDebug( 12006 ) << "Parse: " << s << endl;
MetarParser parser(m_StationDb, KGlobal::locale()->measureSystem()); MetarParser parser(m_StationDb, KGlobal::locale()->measureSystem());
d->wi = parser.processData(d->wi.reportLocation, s); d->wi = parser.processData(d->wi.reportLocation, s);
d->age = TQDateTime::currentDateTime().addSecs(1800); d->age = TQDateTime::tqcurrentDateTime().addSecs(1800);
emit fileUpdate(d->wi.reportLocation); emit fileUpdate(d->wi.reportLocation);
d->updated = true; d->updated = true;
} }
@ -144,7 +144,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
// File error // File error
kdDebug( 12006 ) << "File empty error..." << endl; kdDebug( 12006 ) << "File empty error..." << endl;
KPassivePopup::message( i18n("KWeather Error!"), KPassivePopup::message( i18n("KWeather Error!"),
i18n("The temp file %1 was empty.").arg(d->target->name()), 0L,"error" ); i18n("The temp file %1 was empty.").tqarg(d->target->name()), 0L,"error" );
d->updated = false; d->updated = false;
} }
} }
@ -153,7 +153,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
// File error // File error
kdDebug( 12006 ) << "File read error..." << endl; kdDebug( 12006 ) << "File read error..." << endl;
KPassivePopup::message( i18n("KWeather Error!"), KPassivePopup::message( i18n("KWeather Error!"),
i18n("Could not read the temp file %1.").arg(d->target->name()), 0L,"error" ); i18n("Could not read the temp file %1.").tqarg(d->target->name()), 0L,"error" );
d->updated = false; d->updated = false;
} }
delete d->target; delete d->target;
@ -197,7 +197,7 @@ void WeatherLib::getData(Data *d, bool force /* try even if host was down last t
u += d->wi.reportLocation.upper().stripWhiteSpace(); u += d->wi.reportLocation.upper().stripWhiteSpace();
u += ".TXT"; u += ".TXT";
d->target = new KTempFile(TQString::null, "-weather"); d->target = new KTempFile(TQString(), "-weather");
d->target->setAutoDelete(true); d->target->setAutoDelete(true);
d->target->file(); d->target->file();
@ -322,7 +322,7 @@ void WeatherLib::update(const TQString &stationID)
// Only grab new data if its more than 50 minutes old // Only grab new data if its more than 50 minutes old
Data *d = findData(stationID); Data *d = findData(stationID);
TQDateTime timeout = TQDateTime::currentDateTime(); TQDateTime timeout = TQDateTime::tqcurrentDateTime();
kdDebug (12006) << "Current Time: " << KGlobal::locale()->formatDateTime(timeout, false, false) << kdDebug (12006) << "Current Time: " << KGlobal::locale()->formatDateTime(timeout, false, false) <<
" Update at: " << KGlobal::locale()->formatDateTime(d->age, false, false) << endl; " Update at: " << KGlobal::locale()->formatDateTime(d->age, false, false) << endl;

@ -29,14 +29,15 @@ namespace KIO
class StationDatabase; class StationDatabase;
class WeatherLib : public QObject class WeatherLib : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
class Data; class Data;
WeatherLib(StationDatabase *stationDB, TQObject *parent =0L, const char *name =0L); WeatherLib(StationDatabase *stationDB, TQObject *tqparent =0L, const char *name =0L);
virtual ~WeatherLib(); virtual ~WeatherLib();
TQString temperature(const TQString &stationID); TQString temperature(const TQString &stationID);

@ -31,7 +31,7 @@
#include "stationdatabase.h" #include "stationdatabase.h"
#include "sun.h" #include "sun.h"
WeatherService::WeatherService(TQObject *parent, const char *name) : TQObject (parent, name), DCOPObject("WeatherService") WeatherService::WeatherService(TQObject *tqparent, const char *name) : TQObject (tqparent, name), DCOPObject("WeatherService")
{ {
kdDebug(12006) << "Starting new service... " << endl; kdDebug(12006) << "Starting new service... " << endl;

@ -32,6 +32,7 @@ class StationDatabase;
class WeatherService : public TQObject, public DCOPObject class WeatherService : public TQObject, public DCOPObject
{ {
Q_OBJECT Q_OBJECT
// TQ_OBJECT
K_DCOP K_DCOP
private: private:
@ -43,7 +44,7 @@ class WeatherService : public TQObject, public DCOPObject
void slotStationRemoved(const TQString &stationID); void slotStationRemoved(const TQString &stationID);
public: public:
WeatherService(TQObject *parent, const char *name); WeatherService(TQObject *tqparent, const char *name);
~WeatherService(); ~WeatherService();
k_dcop_signals: k_dcop_signals:

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>AboutDialog</class> <class>AboutDialog</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>AboutDialog</cstring> <cstring>AboutDialog</cstring>
</property> </property>
@ -28,7 +28,7 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>Layout1</cstring> <cstring>Layout1</cstring>
</property> </property>
@ -42,7 +42,7 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>PixmapLabel3</cstring> <cstring>PixmapLabel3</cstring>
</property> </property>
@ -61,7 +61,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>TextLabel3</cstring> <cstring>TextLabel3</cstring>
</property> </property>
@ -79,7 +79,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>Layout4</cstring> <cstring>Layout4</cstring>
</property> </property>
@ -103,14 +103,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>41</width> <width>41</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>TextLabel4</cstring> <cstring>TextLabel4</cstring>
</property> </property>
@ -119,7 +119,7 @@
Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string> Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter|AlignLeft</set> <set>WordBreak|AlignVCenter|AlignLeft</set>
</property> </property>
<property name="wordwrap" stdset="0"> <property name="wordwrap" stdset="0">
@ -127,7 +127,7 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>Layout3</cstring> <cstring>Layout3</cstring>
</property> </property>
@ -151,14 +151,14 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>PushButton2</cstring> <cstring>PushButton2</cstring>
</property> </property>
@ -179,7 +179,7 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -209,9 +209,9 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
<includes> <includes>
<include location="global" impldecl="in declaration">kseparator.h</include> <include location="global" impldecl="in declaration">kseparator.h</include>
</includes> </includes>
<slots> <Q_SLOTS>
<slot>PushButton2_clicked()</slot> <slot>PushButton2_clicked()</slot>
<slot>accept()</slot> <slot>accept()</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
</UI> </UI>

@ -1,6 +1,6 @@
/* /*
** **
** Copyright (C) 1998-2001 by Matthias Hölzer-Klüpfel <hoelzer@kde.org> ** Copyright (C) 1998-2001 by Matthias H<EFBFBD>lzer-Kl<EFBFBD>pfel <hoelzer@kde.org>
** Maintainence has ceased - send questions to kde-devel@kde.org. ** Maintainence has ceased - send questions to kde-devel@kde.org.
** **
*/ */
@ -42,20 +42,20 @@
extern "C" extern "C"
{ {
KDE_EXPORT KPanelApplet *init(TQWidget *parent, const TQString& configFile) KDE_EXPORT KPanelApplet *init(TQWidget *tqparent, const TQString& configFile)
{ {
KGlobal::locale()->insertCatalogue("kworldclock"); KGlobal::locale()->insertCatalogue("kworldclock");
KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation
return new KWWApplet(configFile, KPanelApplet::Normal, return new KWWApplet(configFile, KPanelApplet::Normal,
0, 0,
parent, "kwwapplet"); tqparent, "kwwapplet");
} }
} }
KWWApplet::KWWApplet(const TQString& configFile, Type type, int actions, KWWApplet::KWWApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name) TQWidget *tqparent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name) : KPanelApplet(configFile, type, actions, tqparent, name)
{ {
// make use of the icons installed for ksaferppp // make use of the icons installed for ksaferppp
KGlobal::iconLoader()->addAppDir("kworldwatch"); KGlobal::iconLoader()->addAppDir("kworldwatch");
@ -94,7 +94,7 @@ bool KWWApplet::eventFilter( TQObject *o, TQEvent *e )
{ {
if ((e->type() == TQEvent::MouseButtonPress) || (e->type() == TQEvent::MouseButtonDblClick)) if ((e->type() == TQEvent::MouseButtonPress) || (e->type() == TQEvent::MouseButtonDblClick))
{ {
mousePressEvent(static_cast<TQMouseEvent*>(e)); mousePressEvent(TQT_TQMOUSEEVENT(e));
return true; return true;
} }
@ -115,7 +115,7 @@ void KWWApplet::mousePressEvent(TQMouseEvent *e)
clicked = e->type() == TQMouseEvent::MouseButtonDblClick; clicked = e->type() == TQMouseEvent::MouseButtonDblClick;
} }
if (clicked && e->button() == TQMouseEvent::LeftButton) if (clicked && e->button() == Qt::LeftButton)
{ {
KRun::run("kworldclock", KURL::List()); KRun::run("kworldclock", KURL::List());
} }

@ -42,11 +42,12 @@ class MapWidget;
class KWWApplet : public KPanelApplet class KWWApplet : public KPanelApplet
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KWWApplet(const TQString& configFile, Type t = Normal, int actions = 0, KWWApplet(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0); TQWidget *tqparent = 0, const char *name = 0);
~KWWApplet(); ~KWWApplet();
int widthForHeight(int height) const; int widthForHeight(int height) const;

@ -7,7 +7,7 @@
long jdate(struct tm *); long jdate(struct tm *);
double jtime(struct tm *); double jtime(struct tm *);
double kepler(double m, double ecc); double kepler(double m, double ecc);
void sunpos(double jd, int apparent, double *ra, double *dec, double *rv, double *slong); void sunpos(double jd, int aptqparent, double *ra, double *dec, double *rv, double *slong);
double gmst(double jd); double gmst(double jd);
/* JDATE -- Convert internal GMT date and time to Julian day /* JDATE -- Convert internal GMT date and time to Julian day
@ -65,19 +65,19 @@ double m, ecc;
/* SUNPOS -- Calculate position of the Sun. JD is the Julian date /* SUNPOS -- Calculate position of the Sun. JD is the Julian date
of the instant for which the position is desired and of the instant for which the position is desired and
APPARENT should be nonzero if the apparent position APPARENT should be nonzero if the aptqparent position
(corrected for nutation and aberration) is desired. (corrected for nutation and aberration) is desired.
The Sun's co-ordinates are returned in RA and DEC, The Sun's co-ordinates are returned in RA and DEC,
both specified in degrees (divide RA by 15 to obtain both specified in degrees (divide RA by 15 to obtain
hours). The radius vector to the Sun in astronomical hours). The radius vector to the Sun in astronomical
units is returned in RV and the Sun's longitude (true units is returned in RV and the Sun's longitude (true
or apparent, as desired) is returned as degrees in or aptqparent, as desired) is returned as degrees in
SLONG. */ SLONG. */
void void
sunpos(jd, apparent, ra, dec, rv, slong) sunpos(jd, aptqparent, ra, dec, rv, slong)
double jd; double jd;
int apparent; int aptqparent;
double *ra, *dec, *rv, *slong; double *ra, *dec, *rv, *slong;
{ {
double t, t2, t3, l, m, e, ea, v, theta, omega, double t, t2, t3, l, m, e, ea, v, theta, omega,
@ -119,9 +119,9 @@ double *ra, *dec, *rv, *slong;
eps = 23.452294 - 0.0130125 * t - 0.00000164 * t2 + 0.000000503 * t3; eps = 23.452294 - 0.0130125 * t - 0.00000164 * t2 + 0.000000503 * t3;
/* Corrections for Sun's apparent longitude, if desired. */ /* Corrections for Sun's aptqparent longitude, if desired. */
if (apparent) { if (aptqparent) {
omega = fixangle(259.18 - 1934.142 * t); omega = fixangle(259.18 - 1934.142 * t);
theta = theta - 0.00569 - 0.00479 * sin(dtr(omega)); theta = theta - 0.00569 - 0.00479 * sin(dtr(omega));
eps += 0.00256 * cos(dtr(omega)); eps += 0.00256 * cos(dtr(omega));

@ -34,7 +34,7 @@
extern "C" { extern "C" {
double jtime(struct tm *t); double jtime(struct tm *t);
double kepler(double m, double ecc); double kepler(double m, double ecc);
void sunpos(double jd, int apparent, double *ra, double *dec, double *rv, double *slong); void sunpos(double jd, int aptqparent, double *ra, double *dec, double *rv, double *slong);
void projillum(short *wtab, int xdots, int ydots, double dec); void projillum(short *wtab, int xdots, int ydots, double dec);
} }

@ -128,9 +128,9 @@ void CityList::readCityList(const TQString &fname)
if (!c.isEmpty() && !n.isEmpty()) if (!c.isEmpty() && !n.isEmpty())
{ {
double la, lo; double la, lo;
pos = c.find("+", 1); pos = c.tqfind("+", 1);
if (pos < 0) if (pos < 0)
pos = c.find("-", 1); pos = c.tqfind("-", 1);
if (pos > 0) if (pos > 0)
{ {
la = coordinate(c.left(pos)); la = coordinate(c.left(pos));
@ -157,7 +157,7 @@ TQPoint CityList::getPosition(double la, double lo, int w, int h, int offset)
void CityList::paint(TQPainter *p, int width, int height, int offset) void CityList::paint(TQPainter *p, int width, int height, int offset)
{ {
p->setPen(Qt::black); p->setPen(TQt::black);
TQPtrListIterator<City> it(_cities); TQPtrListIterator<City> it(_cities);
for ( ; it.current(); ++it) for ( ; it.current(); ++it)

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>ClockDialog</class> <class>ClockDialog</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>ClockDialog</cstring> <cstring>ClockDialog</cstring>
</property> </property>
@ -28,7 +28,7 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>Layout5</cstring> <cstring>Layout5</cstring>
</property> </property>
@ -42,7 +42,7 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<widget class="QLabel" row="0" column="0"> <widget class="TQLabel" row="0" column="0">
<property name="name"> <property name="name">
<cstring>PixmapLabel1</cstring> <cstring>PixmapLabel1</cstring>
</property> </property>
@ -71,7 +71,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -88,14 +88,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLayoutWidget" row="0" column="1" rowspan="2" colspan="1"> <widget class="TQLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
<property name="name"> <property name="name">
<cstring>Layout2</cstring> <cstring>Layout2</cstring>
</property> </property>
@ -109,12 +109,12 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<widget class="QComboBox" row="2" column="1"> <widget class="TQComboBox" row="2" column="1">
<property name="name"> <property name="name">
<cstring>ClockZone</cstring> <cstring>ClockZone</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>TextLabel2</cstring> <cstring>TextLabel2</cstring>
</property> </property>
@ -122,7 +122,7 @@
<string>Please enter the settings for the clock.</string> <string>Please enter the settings for the clock.</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="0"> <widget class="TQLabel" row="1" column="0">
<property name="name"> <property name="name">
<cstring>TextLabel3</cstring> <cstring>TextLabel3</cstring>
</property> </property>
@ -133,12 +133,12 @@
<cstring>ClockCaption</cstring> <cstring>ClockCaption</cstring>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" row="1" column="1"> <widget class="TQLineEdit" row="1" column="1">
<property name="name"> <property name="name">
<cstring>ClockCaption</cstring> <cstring>ClockCaption</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="2" column="0"> <widget class="TQLabel" row="2" column="0">
<property name="name"> <property name="name">
<cstring>TextLabel4</cstring> <cstring>TextLabel4</cstring>
</property> </property>
@ -153,7 +153,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>Layout1</cstring> <cstring>Layout1</cstring>
</property> </property>
@ -177,14 +177,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>PushButton1</cstring> <cstring>PushButton1</cstring>
</property> </property>
@ -195,7 +195,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>PushButton2</cstring> <cstring>PushButton2</cstring>
</property> </property>
@ -213,7 +213,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -255,5 +255,5 @@
<includes> <includes>
<include location="global" impldecl="in declaration">kseparator.h</include> <include location="global" impldecl="in declaration">kseparator.h</include>
</includes> </includes>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
</UI> </UI>

@ -39,7 +39,7 @@ FlagList::FlagList()
_flags.setAutoDelete(true); _flags.setAutoDelete(true);
_flagPixmap = TQPixmap(locate("data", "kworldclock/pics/flag.png")); _flagPixmap = TQPixmap(locate("data", "kworldclock/pics/flag.png"));
_flagMask = TQPixmap(locate("data", "kworldclock/pics/flag-mask.xpm"), 0, TQPixmap::ThresholdDither); _flagMask = TQPixmap(locate("data", "kworldclock/pics/flag-tqmask.xpm"), 0, TQPixmap::ThresholdDither);
_flagMask.setMask(_flagMask.createHeuristicMask()); _flagMask.setMask(_flagMask.createHeuristicMask());
} }
@ -62,7 +62,7 @@ TQPoint FlagList::getPosition(double la, double lo, int w, int h, int offset)
void FlagList::paint(TQPainter *p, int width, int height, int offset) void FlagList::paint(TQPainter *p, int width, int height, int offset)
{ {
p->setPen(Qt::black); p->setPen(TQt::black);
TQPtrListIterator<Flag> it(_flags); TQPtrListIterator<Flag> it(_flags);
for ( ; it.current(); ++it) for ( ; it.current(); ++it)
@ -121,9 +121,9 @@ void FlagList::save(KConfig *config)
int cnt=0; int cnt=0;
for ( ; it.current(); ++it) for ( ; it.current(); ++it)
{ {
config->writeEntry(TQString("Flag_%1_Color").arg(cnt), it.current()->color()); config->writeEntry(TQString("Flag_%1_Color").tqarg(cnt), it.current()->color());
config->writeEntry(TQString("Flag_%1_Latitude").arg(cnt), it.current()->latitude()); config->writeEntry(TQString("Flag_%1_Latitude").tqarg(cnt), it.current()->latitude());
config->writeEntry(TQString("Flag_%1_Longitude").arg(cnt), it.current()->longitude()); config->writeEntry(TQString("Flag_%1_Longitude").tqarg(cnt), it.current()->longitude());
cnt++; cnt++;
} }
} }
@ -136,9 +136,9 @@ void FlagList::load(KConfig *config)
for (int i=0; i<num; ++i) for (int i=0; i<num; ++i)
{ {
addFlag(new Flag(config->readDoubleNumEntry(TQString("Flag_%1_Longitude").arg(i)), addFlag(new Flag(config->readDoubleNumEntry(TQString("Flag_%1_Longitude").tqarg(i)),
config->readDoubleNumEntry(TQString("Flag_%1_Latitude").arg(i)), config->readDoubleNumEntry(TQString("Flag_%1_Latitude").tqarg(i)),
config->readColorEntry(TQString("Flag_%1_Color").arg(i)))); config->readColorEntry(TQString("Flag_%1_Color").tqarg(i))));
} }
} }

@ -1,18 +1,18 @@
/**************************************************************************** /****************************************************************************
** $Id$ ** $Id$
** **
** Implementing your own layout: flow example ** Implementing your own tqlayout: flow example
** **
** Copyright (C) 1996 by Trolltech AS. All rights reserved. ** Copyright (C) 1996 by Trolltech AS. All rights reserved.
** **
** This file is part of an example program for Qt. This example ** This file is part of an example program for TQt. This example
** program may be used, distributed and modified without limitation. ** program may be used, distributed and modified without limitation.
** **
*****************************************************************************/ *****************************************************************************/
#include "flow.h" #include "flow.h"
class SimpleFlowIterator :public QGLayoutIterator class SimpleFlowIterator :public TQGLayoutIterator
{ {
public: public:
SimpleFlowIterator( TQPtrList<TQLayoutItem> *l ) :idx(0), list(l) {} SimpleFlowIterator( TQPtrList<TQLayoutItem> *l ) :idx(0), list(l) {}
@ -66,9 +66,9 @@ int SimpleFlow::heightForWidth( int w ) const
return cached_hfw; return cached_hfw;
} }
void SimpleFlow::addItem( TQLayoutItem *item) void SimpleFlow::addItem( QLayoutItem *item)
{ {
list.append( item ); list.append( TQT_TQLAYOUTITEM(item) );
} }
bool SimpleFlow::hasHeightForWidth() const bool SimpleFlow::hasHeightForWidth() const
@ -76,19 +76,29 @@ bool SimpleFlow::hasHeightForWidth() const
return TRUE; return TRUE;
} }
TQSize SimpleFlow::sizeHint() const TQSize SimpleFlow::tqsizeHint() const
{ {
return minimumSize(); return tqminimumSize();
} }
TQSizePolicy::ExpandData SimpleFlow::expanding() const TQSizePolicy::ExpandData SimpleFlow::expanding() const
{ {
#ifdef USE_QT4
return (Qt::Orientation)TQSizePolicy::NoDirection;
#else // USE_QT4
return TQSizePolicy::NoDirection; return TQSizePolicy::NoDirection;
#endif // USE_QT4
} }
TQLayoutIterator SimpleFlow::iterator() TQLayoutIterator SimpleFlow::iterator()
{ {
// [FIXME]
#ifdef USE_QT4
#warning [FIXME] ContainerAreaLayout iterators may not function correctly under Qt4
return TQLayoutIterator(this); // [FIXME]
#else // USE_QT4
return TQLayoutIterator( new SimpleFlowIterator( &list ) ); return TQLayoutIterator( new SimpleFlowIterator( &list ) );
#endif // USE_QT4
} }
void SimpleFlow::setGeometry( const TQRect &r ) void SimpleFlow::setGeometry( const TQRect &r )
@ -106,30 +116,60 @@ int SimpleFlow::doLayout( const TQRect &r, bool testonly )
TQLayoutItem *o; TQLayoutItem *o;
while ( (o=it.current()) != 0 ) { while ( (o=it.current()) != 0 ) {
++it; ++it;
int nextX = x + o->sizeHint().width() + spacing(); int nextX = x + o->tqsizeHint().width() + spacing();
if ( nextX - spacing() > r.right() && h > 0 ) { if ( nextX - spacing() > r.right() && h > 0 ) {
x = r.x(); x = r.x();
y = y + h + spacing(); y = y + h + spacing();
nextX = x + o->sizeHint().width() + spacing(); nextX = x + o->tqsizeHint().width() + spacing();
h = 0; h = 0;
} }
if ( !testonly ) if ( !testonly )
o->setGeometry( TQRect( TQPoint( x, y ), o->sizeHint() ) ); o->setGeometry( TQRect( TQPoint( x, y ), o->tqsizeHint() ) );
x = nextX; x = nextX;
h = QMAX( h, o->sizeHint().height() ); h = TQMAX( h, o->tqsizeHint().height() );
} }
return y + h - r.y(); return y + h - r.y();
} }
TQSize SimpleFlow::minimumSize() const TQSize SimpleFlow::tqminimumSize() const
{ {
TQSize s(0,0); TQSize s(0,0);
TQPtrListIterator<TQLayoutItem> it(list); TQPtrListIterator<TQLayoutItem> it(list);
TQLayoutItem *o; TQLayoutItem *o;
while ( (o=it.current()) != 0 ) { while ( (o=it.current()) != 0 ) {
++it; ++it;
s = s.expandedTo( o->minimumSize() ); s = s.expandedTo( o->tqminimumSize() );
} }
return s; return s;
} }
#ifdef USE_QT4
/*!
\reimp
*/
int SimpleFlow::count() const {
return list.count();
}
/*!
\reimp
*/
TQLayoutItem* SimpleFlow::itemAt(int index) const {
return index >= 0 && index < list.count() ? (const_cast<TQPtrList<TQLayoutItem>&>(list).tqat(index)) : 0;
}
/*!
\reimp
*/
TQLayoutItem* SimpleFlow::takeAt(int index) {
if (index < 0 || index >= list.count())
return 0;
TQLayoutItem *item = list.tqat(index);
list.remove(list.tqat(index));
delete item;
invalidate();
return item;
}
#endif // USE_QT4

@ -1,13 +1,13 @@
/**************************************************************************** /****************************************************************************
** $Id$ ** $Id$
** **
** Definition of simple flow layout for custom layout example ** Definition of simple flow tqlayout for custom tqlayout example
** **
** Created : 979899 ** Created : 979899
** **
** Copyright (C) 1997 by Trolltech AS. All rights reserved. ** Copyright (C) 1997 by Trolltech AS. All rights reserved.
** **
** This file is part of an example program for Qt. This example ** This file is part of an example program for TQt. This example
** program may be used, distributed and modified without limitation. ** program may be used, distributed and modified without limitation.
** **
*****************************************************************************/ *****************************************************************************/
@ -18,15 +18,15 @@
#include <tqlayout.h> #include <tqlayout.h>
#include <tqptrlist.h> #include <tqptrlist.h>
class SimpleFlow : public QLayout class SimpleFlow : public TQLayout
{ {
public: public:
SimpleFlow( TQWidget *parent, int border=0, int space=-1, SimpleFlow( TQWidget *tqparent, int border=0, int space=-1,
const char *name=0 ) const char *name=0 )
: TQLayout( parent, border, space, name ), : TQLayout( tqparent, border, space, name ),
cached_width(0), cached_hfw(0) {} cached_width(0), cached_hfw(0) {}
SimpleFlow( TQLayout* parent, int space=-1, const char *name=0 ) SimpleFlow( TQLayout* tqparent, int space=-1, const char *name=0 )
: TQLayout( parent, space, name ), : TQLayout( tqparent, space, name ),
cached_width(0), cached_hfw(0) {} cached_width(0), cached_hfw(0) {}
SimpleFlow( int space=-1, const char *name=0 ) SimpleFlow( int space=-1, const char *name=0 )
: TQLayout( space, name ), : TQLayout( space, name ),
@ -34,14 +34,18 @@ public:
~SimpleFlow(); ~SimpleFlow();
void addItem( TQLayoutItem *item); void addItem( QLayoutItem *item);
bool hasHeightForWidth() const; bool hasHeightForWidth() const;
int heightForWidth( int ) const; int heightForWidth( int ) const;
TQSize sizeHint() const; TQSize tqsizeHint() const;
TQSize minimumSize() const; TQSize tqminimumSize() const;
TQLayoutIterator iterator(); TQLayoutIterator iterator();
TQSizePolicy::ExpandData expanding() const; TQSizePolicy::ExpandData expanding() const;
#ifdef USE_QT4
QLAYOUT_REQUIRED_METHOD_DECLARATIONS
#endif // USE_QT4
protected: protected:
void setGeometry( const TQRect& ); void setGeometry( const TQRect& );

@ -48,8 +48,8 @@
#include "zoneclock.h" #include "zoneclock.h"
WorldWideWatch::WorldWideWatch(bool restore, TQWidget *parent, const char *name) WorldWideWatch::WorldWideWatch(bool restore, TQWidget *tqparent, const char *name)
: KMainWindow(parent, name) : KMainWindow(tqparent, name)
{ {
KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation

@ -40,10 +40,11 @@ class ZoneClockPanel;
class WorldWideWatch : public KMainWindow class WorldWideWatch : public KMainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
WorldWideWatch(bool restore=false, TQWidget *parent=0, const char *name=0); WorldWideWatch(bool restore=false, TQWidget *tqparent=0, const char *name=0);
void save(KConfig *config); void save(KConfig *config);
void load(KConfig *load); void load(KConfig *load);
@ -71,6 +72,7 @@ private:
class WatchApplication : public KUniqueApplication class WatchApplication : public KUniqueApplication
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:

@ -63,7 +63,7 @@ TQPtrList<MapTheme> MapLoader::themes()
TQStringList MapLoader::maps(const TQString &theme) TQStringList MapLoader::maps(const TQString &theme)
{ {
return KGlobal::dirs()->findAllResources("data", TQString("kworldclock/maps/%1/*.jpg").arg(theme)); return KGlobal::dirs()->findAllResources("data", TQString("kworldclock/maps/%1/*.jpg").tqarg(theme));
} }
@ -75,10 +75,10 @@ void MapLoader::load(unsigned int width, const TQString &theme, unsigned int hei
for (uint i=0; i<files.count(); ++i) for (uint i=0; i<files.count(); ++i)
{ {
TQString f = files[i]; TQString f = files[i];
int pos = f.findRev("/"); int pos = f.tqfindRev("/");
if (pos >= 0) if (pos >= 0)
f = f.mid(pos+1); f = f.mid(pos+1);
pos = f.findRev("."); pos = f.tqfindRev(".");
if (pos >= 0) if (pos >= 0)
f = f.left(pos); f = f.left(pos);
sizes.append(f.toInt()); sizes.append(f.toInt());
@ -101,7 +101,7 @@ void MapLoader::load(unsigned int width, const TQString &theme, unsigned int hei
size = 800; size = 800;
} }
else else
image = TQImage(locate("data", TQString("kworldclock/maps/%1/%2.jpg").arg(theme).arg(size))); image = TQImage(locate("data", TQString("kworldclock/maps/%1/%2.jpg").tqarg(theme).tqarg(size)));
if (height == 0) if (height == 0)
height = width/2; height = width/2;
@ -113,7 +113,7 @@ void MapLoader::load(unsigned int width, const TQString &theme, unsigned int hei
_light.convertFromImage(image); _light.convertFromImage(image);
// calculate dark map // calculate dark map
_dark.convertFromImage(KImageEffect::blend(Qt::black, image, opacity)); _dark.convertFromImage(KImageEffect::blend(TQt::black, image, opacity));
} }
@ -140,7 +140,7 @@ TQBitmap MapLoader::darkMask(int width, int height)
projillum(wtab,width,height,sundec); projillum(wtab,width,height,sundec);
// draw illumination // draw illumination
illuMask.fill(Qt::black); illuMask.fill(TQt::black);
TQPainter p; TQPainter p;
p.begin(&illuMask); p.begin(&illuMask);

@ -56,8 +56,8 @@
#include "mapwidget.moc" #include "mapwidget.moc"
MapWidget::MapWidget(bool applet, bool restore, TQWidget *parent, const char *name) MapWidget::MapWidget(bool applet, bool restore, TQWidget *tqparent, const char *name)
: TQWidget(parent, name), _loader(), _illumination(true), _cities(true), _flags(true), _cityList(0), : TQWidget(tqparent, name), _loader(), _illumination(true), _cities(true), _flags(true), _cityList(0),
_applet(applet), _width(0), _height(0) _applet(applet), _width(0), _height(0)
{ {
// this ugly construction is necessary so we don't load // this ugly construction is necessary so we don't load
@ -143,7 +143,7 @@ MapWidget::MapWidget(bool applet, bool restore, TQWidget *parent, const char *na
_cityIndicator->setIndent(0); _cityIndicator->setIndent(0);
_cityIndicator->setAutoMask(false); _cityIndicator->setAutoMask(false);
_cityIndicator->setLineWidth(1); _cityIndicator->setLineWidth(1);
_cityIndicator->setAlignment(TQLabel::AlignAuto | TQLabel::AlignTop); _cityIndicator->tqsetAlignment(TQLabel::AlignAuto | TQLabel::AlignTop);
_cityIndicator->setAutoResize(true); _cityIndicator->setAutoResize(true);
_cityIndicator->setFrameStyle(TQFrame::Box | TQFrame::Plain); _cityIndicator->setFrameStyle(TQFrame::Box | TQFrame::Plain);
_cityIndicator->setPalette(TQToolTip::palette()); _cityIndicator->setPalette(TQToolTip::palette());
@ -223,18 +223,18 @@ void MapWidget::addClock()
void MapWidget::addFlag(int index) void MapWidget::addFlag(int index)
{ {
TQColor col = Qt::red; TQColor col = TQt::red;
switch (index) switch (index)
{ {
case 0: case 0:
col = Qt::red; col = TQt::red;
break; break;
case 1: case 1:
col = Qt::green; col = TQt::green;
break; break;
case 2: case 2:
col = Qt::blue; col = TQt::blue;
break; break;
case 3: case 3:
if (KColorDialog::getColor(col, this) != KColorDialog::Accepted) if (KColorDialog::getColor(col, this) != KColorDialog::Accepted)
@ -262,7 +262,7 @@ void MapWidget::removeFlag()
void MapWidget::removeAllFlags() void MapWidget::removeAllFlags()
{ {
if ( KMessageBox::warningContinueCancel( this, i18n( "Do you really want to remove all flags?" ), TQString::null, KStdGuiItem::del() ) == KMessageBox::Continue ) if ( KMessageBox::warningContinueCancel( this, i18n( "Do you really want to remove all flags?" ), TQString(), KStdGuiItem::del() ) == KMessageBox::Continue )
_flagList->removeAllFlags(); _flagList->removeAllFlags();
update(); update();
@ -353,10 +353,10 @@ void MapWidget::timeout()
TQString MapWidget::cityTime(const TQString &city) TQString MapWidget::cityTime(const TQString &city)
{ {
TQString result = i18n(city.latin1()); // Time zone translation TQString result = i18n(city.latin1()); // Time zone translation
int pos = result.find("/"); int pos = result.tqfind("/");
if (pos >= 0) if (pos >= 0)
result = result.mid(pos+1); result = result.mid(pos+1);
result.replace(TQRegExp("_"), " "); result.tqreplace(TQRegExp("_"), " ");
result.append(": "); result.append(": ");
char *initial_TZ = getenv("TZ"); char *initial_TZ = getenv("TZ");
@ -366,7 +366,7 @@ TQString MapWidget::cityTime(const TQString &city)
time_t t = time(NULL); time_t t = time(NULL);
TQDateTime dt; TQDateTime dt;
dt.setTime_t(t); dt.setTime_t(t);
result.append(TQString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true))); result.append(TQString("%1, %2").tqarg(KGlobal::locale()->formatTime(dt.time(), true)).tqarg(KGlobal::locale()->formatDate(dt.date(), true)));
if (initial_TZ != 0) if (initial_TZ != 0)
setenv("TZ", initial_TZ, 1); setenv("TZ", initial_TZ, 1);
@ -407,7 +407,7 @@ void MapWidget::themeSelected(int index)
void MapWidget::mousePressEvent(TQMouseEvent *ev) void MapWidget::mousePressEvent(TQMouseEvent *ev)
{ {
if (ev->button() == TQMouseEvent::RightButton) if (ev->button() == Qt::RightButton)
{ {
_flagPos = ev->pos(); _flagPos = ev->pos();
_popup->exec(ev->globalPos()); _popup->exec(ev->globalPos());
@ -563,13 +563,13 @@ TQPixmap MapWidget::calculatePixmap()
if (gmt_position >= greenwich) if (gmt_position >= greenwich)
{ {
p.drawPixmap(gmt_position-greenwich, 0, map, 0, 0, map.width()-gmt_position+greenwich); p.tqdrawPixmap(gmt_position-greenwich, 0, map, 0, 0, map.width()-gmt_position+greenwich);
p.drawPixmap(0,0, map, map.width()-gmt_position+greenwich, 0, gmt_position-greenwich); p.tqdrawPixmap(0,0, map, map.width()-gmt_position+greenwich, 0, gmt_position-greenwich);
} }
else else
{ {
p.drawPixmap(0,0, map, greenwich-gmt_position, 0, map.width()+gmt_position-greenwich); p.tqdrawPixmap(0,0, map, greenwich-gmt_position, 0, map.width()+gmt_position-greenwich);
p.drawPixmap(map.width()+gmt_position-greenwich, 0, map, 0, 0, greenwich-gmt_position); p.tqdrawPixmap(map.width()+gmt_position-greenwich, 0, map, 0, 0, greenwich-gmt_position);
} }
return pm; return pm;

@ -53,13 +53,14 @@ class FlagList;
#include "maploader.h" #include "maploader.h"
class MapWidget : public QWidget class MapWidget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MapWidget(bool applet=false, bool restore=false, TQWidget *parent=0, const char *name=0); MapWidget(bool applet=false, bool restore=false, TQWidget *tqparent=0, const char *name=0);
~MapWidget(); ~MapWidget();
void setTheme(const TQString &theme); void setTheme(const TQString &theme);

@ -1,6 +1,6 @@
/* /*
** **
** Copyright (C) 1998-2001 by Matthias Hölzer-Klüpfel <hoelzer@kde.org> ** Copyright (C) 1998-2001 by Matthias H<EFBFBD>lzer-Kl<EFBFBD>pfel <hoelzer@kde.org>
** Maintainence has ceased - send questions to kde-devel@kde.org. ** Maintainence has ceased - send questions to kde-devel@kde.org.
** **
*/ */
@ -51,8 +51,8 @@
#include "zoneclock.moc" #include "zoneclock.moc"
#include <kdebug.h> #include <kdebug.h>
ZoneClock::ZoneClock(const TQString &zone, const TQString &name, TQWidget *parent, const char *n) ZoneClock::ZoneClock(const TQString &zone, const TQString &name, TQWidget *tqparent, const char *n)
: TQFrame(parent, n), _zone(zone), _name(name) : TQFrame(tqparent, n), _zone(zone), _name(name)
{ {
setFrameStyle(TQFrame::Panel | TQFrame::Raised); setFrameStyle(TQFrame::Panel | TQFrame::Raised);
TQHBoxLayout *hbox = new TQHBoxLayout(this, 2,2); TQHBoxLayout *hbox = new TQHBoxLayout(this, 2,2);
@ -63,7 +63,7 @@ ZoneClock::ZoneClock(const TQString &zone, const TQString &name, TQWidget *paren
hbox->addSpacing(4); hbox->addSpacing(4);
_timeLabel = new TQLabel(this); _timeLabel = new TQLabel(this);
hbox->addWidget(_timeLabel, 0, Qt::AlignRight); hbox->addWidget(_timeLabel, 0, TQt::AlignRight);
_popup = new TQPopupMenu(this); _popup = new TQPopupMenu(this);
_popup->insertItem(i18n("&Edit..."), this, TQT_SLOT(editClock())); _popup->insertItem(i18n("&Edit..."), this, TQT_SLOT(editClock()));
@ -122,7 +122,7 @@ void ZoneClock::editClock()
_name = _dlg->ClockCaption->text().append(":"); _name = _dlg->ClockCaption->text().append(":");
_nameLabel->setText(_dlg->ClockCaption->text().append(":")); _nameLabel->setText(_dlg->ClockCaption->text().append(":"));
updateTime(); updateTime();
layout()->invalidate(); tqlayout()->tqinvalidate();
emit changed(); emit changed();
} }
@ -135,7 +135,7 @@ bool ZoneClock::eventFilter(TQObject *obj, TQEvent *ev)
if (ev->type() == TQEvent::MouseButtonPress) if (ev->type() == TQEvent::MouseButtonPress)
{ {
TQMouseEvent *e = (TQMouseEvent*)ev; TQMouseEvent *e = (TQMouseEvent*)ev;
if (e->button() == TQMouseEvent::RightButton) if (e->button() == Qt::RightButton)
_popup->exec(e->globalPos()); _popup->exec(e->globalPos());
} }
@ -152,7 +152,7 @@ void ZoneClock::updateTime()
time_t t = time(NULL); time_t t = time(NULL);
TQDateTime dt; TQDateTime dt;
dt.setTime_t(t); dt.setTime_t(t);
_timeLabel->setText(TQString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true))); _timeLabel->setText(TQString("%1, %2").tqarg(KGlobal::locale()->formatTime(dt.time(), true)).tqarg(KGlobal::locale()->formatDate(dt.date(), true)));
if (initial_TZ != 0) if (initial_TZ != 0)
setenv("TZ", initial_TZ, 1); setenv("TZ", initial_TZ, 1);
@ -162,8 +162,8 @@ void ZoneClock::updateTime()
} }
ZoneClockPanel::ZoneClockPanel(TQWidget *parent, const char *name) ZoneClockPanel::ZoneClockPanel(TQWidget *tqparent, const char *name)
: TQFrame(parent, name), _dlg(0) : TQFrame(tqparent, name), _dlg(0)
{ {
_flow = new SimpleFlow(this,1,1); _flow = new SimpleFlow(this,1,1);
@ -218,8 +218,8 @@ void ZoneClockPanel::realign()
int w = 0; int w = 0;
TQPtrListIterator<ZoneClock> it(_clocks); TQPtrListIterator<ZoneClock> it(_clocks);
for ( ; it.current(); ++it) for ( ; it.current(); ++it)
if (it.current()->sizeHint().width() > w) if (it.current()->tqsizeHint().width() > w)
w = it.current()->sizeHint().width(); w = it.current()->tqsizeHint().width();
it.toFirst(); it.toFirst();
for ( ; it.current(); ++it) for ( ; it.current(); ++it)
it.current()->setFixedWidth(w); it.current()->setFixedWidth(w);
@ -266,8 +266,8 @@ void ZoneClockPanel::save(KConfig *config)
{ {
TQString n = it.current()->name(); TQString n = it.current()->name();
n = n.left(n.length()-1); n = n.left(n.length()-1);
config->writeEntry(TQString("Clock_%1_Name").arg(cnt), n); config->writeEntry(TQString("Clock_%1_Name").tqarg(cnt), n);
config->writeEntry(TQString("Clock_%1_Zone").arg(cnt), it.current()->zone()); config->writeEntry(TQString("Clock_%1_Zone").tqarg(cnt), it.current()->zone());
cnt++; cnt++;
} }
} }
@ -281,7 +281,7 @@ void ZoneClockPanel::load(KConfig *config)
for (int i=0; i<num; ++i) for (int i=0; i<num; ++i)
{ {
addClock(config->readEntry(TQString("Clock_%1_Zone").arg(i)), config->readEntry(TQString("Clock_%1_Name").arg(i))); addClock(config->readEntry(TQString("Clock_%1_Zone").tqarg(i)), config->readEntry(TQString("Clock_%1_Name").tqarg(i)));
} }
} }

@ -43,13 +43,14 @@ class KConfig;
class ClockDialog; class ClockDialog;
class ZoneClock : public QFrame class ZoneClock : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ZoneClock(const TQString &zone, const TQString &name, TQWidget *parent=0, const char *n=0); ZoneClock(const TQString &zone, const TQString &name, TQWidget *tqparent=0, const char *n=0);
TQString zone() const { return _zone; }; TQString zone() const { return _zone; };
@ -94,13 +95,14 @@ private:
}; };
class ZoneClockPanel : public QFrame class ZoneClockPanel : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ZoneClockPanel(TQWidget *parent=0, const char *name=0); ZoneClockPanel(TQWidget *tqparent=0, const char *name=0);
void addClock(const TQString &zone, const TQString &name); void addClock(const TQString &zone, const TQString &name);

Loading…
Cancel
Save