Trinity Qt initial conversion

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1157650 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent a73fc4d7e6
commit cfc42a28c3

@ -36,9 +36,9 @@ class AmorIface : virtual public DCOPObject
public:
k_dcop:
virtual void showTip(QString tip) = 0;
virtual void showMessage(QString message ) = 0;
virtual void showMessage(QString message, int msec ) = 0;
virtual void showTip(TQString tip) = 0;
virtual void showMessage(TQString message ) = 0;
virtual void showMessage(TQString message, int msec ) = 0;
virtual void screenSaverStopped() = 0;
virtual void screenSaverStarted() = 0;

@ -31,9 +31,9 @@
#include <kdebug.h>
#include <kpopupmenu.h>
#include <qtimer.h>
#include <qcursor.h>
#include <qvaluelist.h>
#include <tqtimer.h>
#include <tqcursor.h>
#include <tqvaluelist.h>
#include <klocale.h>
#include <kmessagebox.h>
@ -78,7 +78,7 @@
// Constructor
//
QueueItem::QueueItem(itemType ty, QString te, int ti)
QueueItem::QueueItem(itemType ty, TQString te, int ti)
{
// if the time field was not given, calculate one based on the type
// and length of the item
@ -120,7 +120,7 @@ QueueItem::QueueItem(itemType ty, QString te, int ti)
// AMOR
// Constructor
//
Amor::Amor() : DCOPObject( "AmorIface" ), QObject()
Amor::Amor() : DCOPObject( "AmorIface" ), TQObject()
{
mAmor = 0;
mBubble = 0;
@ -136,37 +136,37 @@ Amor::Amor() : DCOPObject( "AmorIface" ), QObject()
mState = Normal;
mWin = new KWinModule;
connect(mWin, SIGNAL(activeWindowChanged(WId)),
this, SLOT(slotWindowActivate(WId)));
connect(mWin, SIGNAL(windowRemoved(WId)),
this, SLOT(slotWindowRemove(WId)));
connect(mWin, SIGNAL(stackingOrderChanged()),
this, SLOT(slotStackingChanged()));
connect(mWin, SIGNAL(windowChanged(WId, const unsigned long *)),
this, SLOT(slotWindowChange(WId, const unsigned long *)));
connect(mWin, SIGNAL(currentDesktopChanged(int)),
this, SLOT(slotDesktopChange(int)));
connect(mWin, TQT_SIGNAL(activeWindowChanged(WId)),
this, TQT_SLOT(slotWindowActivate(WId)));
connect(mWin, TQT_SIGNAL(windowRemoved(WId)),
this, TQT_SLOT(slotWindowRemove(WId)));
connect(mWin, TQT_SIGNAL(stackingOrderChanged()),
this, TQT_SLOT(slotStackingChanged()));
connect(mWin, TQT_SIGNAL(windowChanged(WId, const unsigned long *)),
this, TQT_SLOT(slotWindowChange(WId, const unsigned long *)));
connect(mWin, TQT_SIGNAL(currentDesktopChanged(int)),
this, TQT_SLOT(slotDesktopChange(int)));
mAmor = new AmorWidget();
connect(mAmor, SIGNAL(mouseClicked(const QPoint &)),
SLOT(slotMouseClicked(const QPoint &)));
connect(mAmor, SIGNAL(dragged(const QPoint &, bool)),
SLOT(slotWidgetDragged(const QPoint &, bool)));
connect(mAmor, TQT_SIGNAL(mouseClicked(const TQPoint &)),
TQT_SLOT(slotMouseClicked(const TQPoint &)));
connect(mAmor, TQT_SIGNAL(dragged(const TQPoint &, bool)),
TQT_SLOT(slotWidgetDragged(const TQPoint &, bool)));
mAmor->resize(mTheme.maximumSize());
mTimer = new QTimer(this);
connect(mTimer, SIGNAL(timeout()), SLOT(slotTimeout()));
mTimer = new TQTimer(this);
connect(mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()));
mStackTimer = new QTimer(this);
connect(mStackTimer, SIGNAL(timeout()), SLOT(restack()));
mStackTimer = new TQTimer(this);
connect(mStackTimer, TQT_SIGNAL(timeout()), TQT_SLOT(restack()));
mBubbleTimer = new QTimer(this);
connect(mBubbleTimer, SIGNAL(timeout()), SLOT(slotBubbleTimeout()));
mBubbleTimer = new TQTimer(this);
connect(mBubbleTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotBubbleTimeout()));
time(&mActiveTime);
mCursPos = QCursor::pos();
mCursorTimer = new QTimer(this);
connect(mCursorTimer, SIGNAL(timeout()), SLOT(slotCursorTimeout()));
mCursPos = TQCursor::pos();
mCursorTimer = new TQTimer(this);
connect(mCursorTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotCursorTimeout()));
mCursorTimer->start( 500 );
if (mWin->activeWindow())
@ -234,7 +234,7 @@ void Amor::screenSaverStarted()
//---------------------------------------------------------------------------
//
void Amor::showTip( QString tip )
void Amor::showTip( TQString tip )
{
if (mTipsQueue.count() < 5 && !mForceHideAmorWidget) // start dropping tips if the queue is too long
mTipsQueue.enqueue(new QueueItem(QueueItem::Tip, tip));
@ -247,12 +247,12 @@ void Amor::showTip( QString tip )
}
void Amor::showMessage( QString message )
void Amor::showMessage( TQString message )
{
showMessage(message, -1);
}
void Amor::showMessage( QString message , int msec )
void Amor::showMessage( TQString message , int msec )
{
// FIXME: What should be done about messages and tips while the screensaver is on?
if (mForceHideAmorWidget) return; // do not show messages sent while in the screensaver
@ -311,12 +311,12 @@ bool Amor::readConfig()
// Select a random theme if user requested it
if (mConfig.mRandomTheme)
{
QStringList files;
TQStringList files;
// Store relative paths into files to avoid storing absolute pathnames.
KGlobal::dirs()->findAllResources("appdata", "*rc", false, false, files);
int randomTheme = kapp->random() % files.count();
mConfig.mTheme = (QString)*files.at(randomTheme);
mConfig.mTheme = (TQString)*files.at(randomTheme);
}
// read selected theme
@ -439,14 +439,14 @@ void Amor::selectAnimation(State state)
// if the animation falls outside of the working area,
// then relocate it so that is inside the desktop again
QRect desktopArea = mWin->workArea();
TQRect desktopArea = mWin->workArea();
mInDesktopBottom = false;
if (mTargetRect.y() - mCurrAnim->hotspot().y() + mConfig.mOffset <
desktopArea.y())
{
// relocate the animation at the bottom of the screen
mTargetRect = QRect(desktopArea.x(),
mTargetRect = TQRect(desktopArea.x(),
desktopArea.y() + desktopArea.height(),
desktopArea.width(), 0);
@ -594,7 +594,7 @@ void Amor::restack()
//
// The user clicked on our animation.
//
void Amor::slotMouseClicked(const QPoint &pos)
void Amor::slotMouseClicked(const TQPoint &pos)
{
bool restartTimer = mTimer->isActive();
@ -610,10 +610,10 @@ void Amor::slotMouseClicked(const QPoint &pos)
KPopupMenu* helpMnu = help->menu();
mMenu = new KPopupMenu();
mMenu->insertTitle("Amor"); // I really don't want this i18n'ed
mMenu->insertItem(SmallIcon("configure"), i18n("&Configure..."), this, SLOT(slotConfigure()));
mMenu->insertItem(SmallIcon("configure"), i18n("&Configure..."), this, TQT_SLOT(slotConfigure()));
mMenu->insertSeparator();
mMenu->insertItem(SmallIcon("help"), i18n("&Help"), helpMnu);
mMenu->insertItem(SmallIcon("exit"), i18n("&Quit"), kapp, SLOT(quit()));
mMenu->insertItem(SmallIcon("exit"), i18n("&Quit"), kapp, TQT_SLOT(quit()));
}
mMenu->exec(pos);
@ -630,8 +630,8 @@ void Amor::slotMouseClicked(const QPoint &pos)
//
void Amor::slotCursorTimeout()
{
QPoint currPos = QCursor::pos();
QPoint diff = currPos - mCursPos;
TQPoint currPos = TQCursor::pos();
TQPoint diff = currPos - mCursPos;
time_t now = time(0);
if (mForceHideAmorWidget) return; // we're hidden, do nothing
@ -710,9 +710,9 @@ void Amor::slotConfigure()
if (!mAmorDialog)
{
mAmorDialog = new AmorDialog();
connect(mAmorDialog, SIGNAL(changed()), SLOT(slotConfigChanged()));
connect(mAmorDialog, SIGNAL(offsetChanged(int)),
SLOT(slotOffsetChanged(int)));
connect(mAmorDialog, TQT_SIGNAL(changed()), TQT_SLOT(slotConfigChanged()));
connect(mAmorDialog, TQT_SIGNAL(offsetChanged(int)),
TQT_SLOT(slotOffsetChanged(int)));
}
mAmorDialog->show();
@ -748,7 +748,7 @@ void Amor::slotOffsetChanged(int off)
//
void Amor::slotAbout()
{
QString about = i18n("Amor Version %1\n\n").arg(AMOR_VERSION) +
TQString about = i18n("Amor Version %1\n\n").arg(AMOR_VERSION) +
i18n("Amusing Misuse Of Resources\n\n") +
i18n("Copyright (c) 1999 Martin R. Jones <mjones@kde.org>\n\n") +
i18n("Original Author: Martin R. Jones <mjones@kde.org>\n") +
@ -761,7 +761,7 @@ void Amor::slotAbout()
//
// Widget dragged
//
void Amor::slotWidgetDragged( const QPoint &delta, bool release )
void Amor::slotWidgetDragged( const TQPoint &delta, bool release )
{
if (mCurrAnim->frame())
{
@ -903,14 +903,14 @@ void Amor::slotWindowChange(WId win, const unsigned long * properties)
kdDebug(10000) << "Target window moved or resized" << endl;
#endif
QRect newTargetRect = KWin::windowInfo(mTargetWin).frameGeometry();
TQRect newTargetRect = KWin::windowInfo(mTargetWin).frameGeometry();
// if the change in the window caused the animation to fall
// out of the working area of the desktop, or if the animation
// didn't fall in the working area before but it does now, then
// refocus on the current window so that the animation is
// relocated.
QRect desktopArea = mWin->workArea();
TQRect desktopArea = mWin->workArea();
bool fitsInWorkArea = !(newTargetRect.y() - mCurrAnim->hotspot().y() + mConfig.mOffset < desktopArea.y());
if ((!fitsInWorkArea && !mInDesktopBottom) || (fitsInWorkArea && mInDesktopBottom))
@ -1014,7 +1014,7 @@ AmorSessionWidget::AmorSessionWidget()
{
// the only function of this widget is to catch & forward the
// saveYourself() signal from the session manager
connect(kapp, SIGNAL(saveYourself()), SLOT(wm_saveyourself()));
connect(kapp, TQT_SIGNAL(saveYourself()), TQT_SLOT(wm_saveyourself()));
}
void AmorSessionWidget::wm_saveyourself()

@ -31,8 +31,8 @@
#include <config.h>
#endif
#include <qwidget.h>
#include <qptrqueue.h>
#include <tqwidget.h>
#include <tqptrqueue.h>
#include "amoranim.h"
#include "amortips.h"
@ -52,7 +52,7 @@ public:
enum itemType { Talk , Tip };
QueueItem(itemType ty, QString te, int ti = -1);
QueueItem(itemType ty, TQString te, int ti = -1);
itemType type() { return iType; }
QString text() { return iText; };
@ -62,7 +62,7 @@ public:
private:
itemType iType;
QString iText;
TQString iText;
int iTime;
};
@ -70,16 +70,16 @@ private:
//
// Amor handles window manager input and animation selection and updates.
//
class Amor : public QObject, virtual public AmorIface
class Amor : public TQObject, virtual public AmorIface
{
Q_OBJECT
public:
Amor();
virtual ~Amor();
virtual void showTip(QString tip);
virtual void showMessage(QString message);
virtual void showMessage(QString message, int msec);
virtual void showTip(TQString tip);
virtual void showMessage(TQString message);
virtual void showMessage(TQString message, int msec);
virtual void screenSaverStopped();
virtual void screenSaverStarted();
@ -93,14 +93,14 @@ public slots:
void slotDesktopChange(int);
protected slots:
void slotMouseClicked(const QPoint &pos);
void slotMouseClicked(const TQPoint &pos);
void slotTimeout();
void slotCursorTimeout();
void slotConfigure();
void slotConfigChanged();
void slotOffsetChanged(int);
void slotAbout();
void slotWidgetDragged( const QPoint &delta, bool release );
void slotWidgetDragged( const TQPoint &delta, bool release );
void restack();
void hideBubble(bool forceDequeue = false);
@ -110,17 +110,17 @@ protected:
enum State { Focus, Blur, Normal, Sleeping, Waking, Destroy };
bool readConfig();
void readGroupConfig(KConfigBase &config, QPtrList<AmorAnim> &animList,
void readGroupConfig(KConfigBase &config, TQPtrList<AmorAnim> &animList,
const char *seq);
void showBubble();
AmorAnim *randomAnimation(QPtrList<AmorAnim> &animList);
AmorAnim *randomAnimation(TQPtrList<AmorAnim> &animList);
void selectAnimation(State state=Normal);
void active();
private:
KWinModule *mWin;
WId mTargetWin; // The window that the animations sits on
QRect mTargetRect; // The goemetry of the target window
TQRect mTargetRect; // The goemetry of the target window
WId mNextTarget; // The window that will become the target
AmorWidget *mAmor; // The widget displaying the animation
AmorThemeManager mTheme; // Animations used by current theme
@ -128,15 +128,15 @@ private:
AmorAnim *mCurrAnim; // The currently running animation
int mPosition; // The position of the animation
State mState; // The current state of the animation
QTimer *mTimer; // Frame timer
QTimer *mCursorTimer;// Cursor timer
QTimer *mStackTimer; // Restacking timer
QTimer *mBubbleTimer;// Bubble tip timer (GP: I didn't create this one, it had no use when I found it)
TQTimer *mTimer; // Frame timer
TQTimer *mCursorTimer;// Cursor timer
TQTimer *mStackTimer; // Restacking timer
TQTimer *mBubbleTimer;// Bubble tip timer (GP: I didn't create this one, it had no use when I found it)
AmorDialog *mAmorDialog; // Setup dialog
KPopupMenu *mMenu; // Our menu
time_t mActiveTime; // The time an active event occurred
QPoint mCursPos; // The last recorded position of the pointer
QString mTipText; // Text to display in a bubble when possible
TQPoint mCursPos; // The last recorded position of the pointer
TQString mTipText; // Text to display in a bubble when possible
AmorBubble *mBubble; // Text bubble
AmorTips mTips; // Tips to display in the bubble
bool mInDesktopBottom; // the animation is not on top of the
@ -145,7 +145,7 @@ private:
AmorConfig mConfig; // Configuration parameters
bool mForceHideAmorWidget;
QPtrQueue<QueueItem> mTipsQueue; // GP: tips queue
TQPtrQueue<QueueItem> mTipsQueue; // GP: tips queue
};
//---------------------------------------------------------------------------

@ -54,9 +54,9 @@ AmorAnim::~AmorAnim()
//
// Get the Pixmap for the current frame.
//
const QPixmap *AmorAnim::frame()
const TQPixmap *AmorAnim::frame()
{
const QPixmap *pixmap = 0;
const TQPixmap *pixmap = 0;
if (validFrame())
pixmap = AmorPixmapManager::manager()->pixmap(*mSequence.at(mCurrent));
@ -75,18 +75,18 @@ void AmorAnim::readConfig(KConfigBase &config)
// manager.
mSequence = config.readListEntry("Sequence");
int frames = mSequence.count();
for ( QStringList::Iterator it = mSequence.begin();
for ( TQStringList::Iterator it = mSequence.begin();
it != mSequence.end();
++it )
{
const QPixmap *pixmap =
const TQPixmap *pixmap =
AmorPixmapManager::manager()->load(*it);
if (pixmap)
mMaximumSize = mMaximumSize.expandedTo(pixmap->size());
}
// Read the delays between frames.
QStrList list;
TQStrList list;
int entries = config.readListEntry("Delay",list);
mDelay.resize(frames);
for (int i = 0; i < entries && i < frames; i++)
@ -113,10 +113,10 @@ void AmorAnim::readConfig(KConfigBase &config)
mHotspot[i].setY(atoi(list.at(i)));
// Add the overlap of the last frame to the total movement.
const QPoint &lastHotspot = mHotspot[mHotspot.size()-1];
const TQPoint &lastHotspot = mHotspot[mHotspot.size()-1];
if (mTotalMovement > 0)
{
const QPixmap *lastFrame =
const TQPixmap *lastFrame =
AmorPixmapManager::manager()->pixmap(mSequence.last());
if (lastFrame)
{
@ -147,7 +147,7 @@ AmorThemeManager::~AmorThemeManager()
//---------------------------------------------------------------------------
//
bool AmorThemeManager::setTheme(const QString & file)
bool AmorThemeManager::setTheme(const TQString & file)
{
mPath = locate("appdata", file);
@ -158,7 +158,7 @@ bool AmorThemeManager::setTheme(const QString & file)
// Get the directory where the pixmaps are stored and tell the
// pixmap manager.
QString pixmapPath = mConfig->readPathEntry("PixmapPath");
TQString pixmapPath = mConfig->readPathEntry("PixmapPath");
if (pixmapPath.isEmpty())
return false;
@ -188,9 +188,9 @@ bool AmorThemeManager::setTheme(const QString & file)
//
// Select an animimation randomly from a group
//
AmorAnim *AmorThemeManager::random(const QString & group)
AmorAnim *AmorThemeManager::random(const TQString & group)
{
QString grp( group );
TQString grp( group );
if (mStatic)
grp = "Base";
@ -209,7 +209,7 @@ AmorAnim *AmorThemeManager::random(const QString & group)
//
// Read an animation group.
//
bool AmorThemeManager::readGroup(const QString & seq)
bool AmorThemeManager::readGroup(const TQString & seq)
{
AmorPixmapManager::manager()->setPixmapDir(mPath);
@ -218,7 +218,7 @@ bool AmorThemeManager::readGroup(const QString & seq)
// Read the list of available animations.
mConfig->setGroup("Config");
QStrList list;
TQStrList list;
int entries = mConfig->readListEntry(seq, list);
// Read each individual animation

@ -33,9 +33,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <qmemarray.h>
#include <qdict.h>
#include <qstringlist.h>
#include <tqmemarray.h>
#include <tqdict.h>
#include <tqstringlist.h>
#include <kconfigbase.h>
#include <ksimpleconfig.h>
@ -59,32 +59,32 @@ public:
{ return (mCurrent < mSequence.count()); }
int totalMovement() const
{ return mTotalMovement; }
QSize maximumSize() const
TQSize maximumSize() const
{ return mMaximumSize; }
int delay() const
{ return (validFrame() ? mDelay[mCurrent] : 100); }
QPoint hotspot() const
{ return (validFrame() ? mHotspot[mCurrent] : QPoint(16,16)); }
TQPoint hotspot() const
{ return (validFrame() ? mHotspot[mCurrent] : TQPoint(16,16)); }
int movement() const
{ return (validFrame() ? mMovement[mCurrent] : 0); }
const QPixmap *frame();
const TQPixmap *frame();
protected:
void readConfig(KConfigBase &config);
protected:
unsigned int mCurrent; // current frame in sequence
QStringList mSequence; // sequence of images to display
QMemArray<int> mDelay; // delay between frames
QMemArray<QPoint> mHotspot; // the hotspot in a frame
QMemArray<int> mMovement; // the distance to move between frames
TQStringList mSequence; // sequence of images to display
TQMemArray<int> mDelay; // delay between frames
TQMemArray<TQPoint> mHotspot; // the hotspot in a frame
TQMemArray<int> mMovement; // the distance to move between frames
int mTotalMovement; // the total distance this animation moves
QSize mMaximumSize; // the maximum size of any frame
TQSize mMaximumSize; // the maximum size of any frame
};
//---------------------------------------------------------------------------
typedef QPtrList<AmorAnim> AmorAnimationGroup;
typedef TQPtrList<AmorAnim> AmorAnimationGroup;
//---------------------------------------------------------------------------
//
@ -96,20 +96,20 @@ public:
AmorThemeManager();
virtual ~AmorThemeManager();
bool setTheme(const QString & file);
bool readGroup(const QString & seq);
bool setTheme(const TQString & file);
bool readGroup(const TQString & seq);
bool isStatic() const
{ return mStatic; }
AmorAnim *random(const QString & group);
AmorAnim *random(const TQString & group);
QSize maximumSize() const { return mMaximumSize; }
TQSize maximumSize() const { return mMaximumSize; }
protected:
QString mPath;
TQString mPath;
KSimpleConfig *mConfig;
QSize mMaximumSize; // The largest pixmap used
QDict<AmorAnimationGroup> mAnimations; // list of animation groups
TQSize mMaximumSize; // The largest pixmap used
TQDict<AmorAnimationGroup> mAnimations; // list of animation groups
bool mStatic; // static image
};

@ -26,13 +26,13 @@
*/
#include "amorbubble.h"
#include "amorbubble.moc"
#include <qpainter.h>
#include <tqpainter.h>
#include <ktextbrowser.h>
#include <qtooltip.h>
#include <tqtooltip.h>
#include <kstandarddirs.h>
#include <X11/Xlib.h>
#include <X11/extensions/shape.h>
#include <qtimer.h>
#include <tqtimer.h>
#define ARROW_WIDTH 10
#define ARROW_HEIGHT 12
@ -45,28 +45,28 @@
// Constructor
//
AmorBubble::AmorBubble()
: QWidget(0, 0, WStyle_Customize | WStyle_NoBorder | WX11BypassWM )
: TQWidget(0, 0, WStyle_Customize | WStyle_NoBorder | WX11BypassWM )
{
mOriginX = 0;
mOriginY = 0;
mBrowser = new KTextBrowser( this );
mBrowser->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
mBrowser->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain );
mBrowser->setMargin( 0 );
mBrowser->setWrapPolicy(QTextEdit::AtWordOrDocumentBoundary); // too long to fit in one line?
mBrowser->setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); // too long to fit in one line?
QColorGroup clgrp = mBrowser->colorGroup();
clgrp.setColor(QColorGroup::Text, Qt::black);
//Laurent QTextBrowser didn't have this function FIX me
TQColorGroup clgrp = mBrowser->colorGroup();
clgrp.setColor(TQColorGroup::Text, Qt::black);
//Laurent TQTextBrowser didn't have this function FIX me
//mBrowser->setPaperColorGroup( clgrp );
mBrowser->setPaper( QToolTip::palette().active().brush( QColorGroup::Background ) );
mBrowser->setVScrollBarMode( QTextBrowser::AlwaysOff );
mBrowser->setHScrollBarMode( QTextBrowser::AlwaysOff );
mBrowser->setPaper( TQToolTip::palette().active().brush( TQColorGroup::Background ) );
mBrowser->setVScrollBarMode( TQTextBrowser::AlwaysOff );
mBrowser->setHScrollBarMode( TQTextBrowser::AlwaysOff );
mBrowser->viewport()->installEventFilter( this );
mBrowser->mimeSourceFactory()->addFilePath(KGlobal::dirs()->findResourceDir("data", "kdewizard/pics")+"kdewizard/pics/");
QStringList icons = KGlobal::dirs()->resourceDirs("icon");
QStringList::Iterator it;
TQStringList icons = KGlobal::dirs()->resourceDirs("icon");
TQStringList::Iterator it;
for (it = icons.begin(); it != icons.end(); ++it)
mBrowser->mimeSourceFactory()->addFilePath(*it);
@ -86,9 +86,9 @@ AmorBubble::~AmorBubble()
// Set the message to display in the bubble. Causes the geometry of the
// widget to be recalculated.
//
void AmorBubble::setMessage(const QString& message)
void AmorBubble::setMessage(const TQString& message)
{
mMessage = QString( "<html>%1</html>" ).arg( message );
mMessage = TQString( "<html>%1</html>" ).arg( message );
// hacks because heightForWidth() doesn't work.
setGeometry( -1000, 0, 300, 1000 );
show();
@ -103,7 +103,7 @@ void AmorBubble::setMessage(const QString& message)
//
void AmorBubble::calcGeometry()
{
mBound = QRect( 0, 0, 250, 0 );
mBound = TQRect( 0, 0, 250, 0 );
// mBound.setHeight( mBrowser->heightForWidth( mBound.width() ) );
mBound.setHeight( mBrowser->contentsHeight() );
mBound.moveBy(ARROW_WIDTH+BORDER_SIZE, BORDER_SIZE);
@ -144,7 +144,7 @@ void AmorBubble::calcGeometry()
// create and apply the shape mask
mMask.resize(w, h);
mMask.fill(color0);
QPainter maskPainter(&mMask);
TQPainter maskPainter(&mMask);
maskPainter.setPen(color1);
maskPainter.setBrush(color1);
drawBubble(maskPainter);
@ -157,9 +157,9 @@ void AmorBubble::calcGeometry()
// Draw the bubble that text will be draw into using the current pen
// as the outline and the current brush as the fill.
//
void AmorBubble::drawBubble(QPainter &p)
void AmorBubble::drawBubble(TQPainter &p)
{
QPointArray pointArray(3);
TQPointArray pointArray(3);
int left = ARROW_WIDTH;
@ -190,7 +190,7 @@ void AmorBubble::drawBubble(QPainter &p)
// p.drawRoundRect(left, 0, width() - ARROW_WIDTH, height(), 10, 20);
p.drawRect(left, 0, width() - ARROW_WIDTH, height());
QPen pen(p.pen());
TQPen pen(p.pen());
p.setPen(NoPen);
p.drawPolygon(pointArray);
@ -202,11 +202,11 @@ void AmorBubble::drawBubble(QPainter &p)
//
// Draw the message in a bubble
//
void AmorBubble::paintEvent(QPaintEvent *)
void AmorBubble::paintEvent(TQPaintEvent *)
{
QPainter painter(this);
TQPainter painter(this);
painter.setPen(black);
painter.setBrush( QToolTip::palette().active().brush( QColorGroup::Background ) );
painter.setBrush( TQToolTip::palette().active().brush( TQColorGroup::Background ) );
drawBubble(painter);
}
@ -214,32 +214,32 @@ void AmorBubble::paintEvent(QPaintEvent *)
//
// The user clicked on the widget
//
void AmorBubble::mouseReleaseEvent(QMouseEvent *)
void AmorBubble::mouseReleaseEvent(TQMouseEvent *)
{
hide();
}
//---------------------------------------------------------------------------
//
bool AmorBubble::eventFilter( QObject *, QEvent *e )
bool AmorBubble::eventFilter( TQObject *, TQEvent *e )
{
switch ( e->type() )
{
// GP case QEvent::Enter:
// GP case TQEvent::Enter:
// GP mBubbleTimer->stop();
// GP break;
// GP case QEvent::Leave:
// GP case TQEvent::Leave:
// GP if ( isVisible() )
// GP mBubbleTimer->start( 1000, true );
// GP break;
case QEvent::Enter:
case TQEvent::Enter:
mMouseWithin = true;
break;
case QEvent::Leave:
case TQEvent::Leave:
mMouseWithin = false;
break;
case QEvent::MouseButtonRelease:
case TQEvent::MouseButtonRelease:
hide(); // GP This is the only reason a bubble might posibly be created but hidden
break;
default:

@ -32,8 +32,8 @@
#endif
#include <kapplication.h>
#include <qwidget.h>
#include <qbitmap.h>
#include <tqwidget.h>
#include <tqbitmap.h>
class QTextBrowser;
class QTimer;
@ -50,7 +50,7 @@ public:
virtual ~AmorBubble();
void setOrigin(int x, int y) { mOriginX = x; mOriginY = y; }
void setMessage(const QString& message);
void setMessage(const TQString& message);
bool mouseWithin() { return mMouseWithin; }
@ -59,20 +59,20 @@ protected:
enum HorzPos { Left, Right };
void calcGeometry();
void drawBubble(QPainter &p);
virtual void paintEvent(QPaintEvent *);
virtual void mouseReleaseEvent(QMouseEvent *);
virtual bool eventFilter( QObject *, QEvent * );
void drawBubble(TQPainter &p);
virtual void paintEvent(TQPaintEvent *);
virtual void mouseReleaseEvent(TQMouseEvent *);
virtual bool eventFilter( TQObject *, TQEvent * );
protected:
QString mMessage; // message to display
TQString mMessage; // message to display
int mOriginX; // X origin of bubble arrow
int mOriginY; // Y origin of bubble arrow
QRect mBound; // bounds of the text
QBitmap mMask; // shape mask
TQRect mBound; // bounds of the text
TQBitmap mMask; // shape mask
VertPos mArrowVert; // vertical position of the arrow
HorzPos mArrowHorz; // horizontal position of the arrow
QTextBrowser *mBrowser; // displays the message
TQTextBrowser *mBrowser; // displays the message
bool mMouseWithin; // the mouse pointer is inside the bubble
};

@ -31,7 +31,7 @@
#include <config.h>
#endif
#include <qstring.h>
#include <tqstring.h>
//---------------------------------------------------------------------------
//
@ -45,7 +45,7 @@ public:
void read();
void write();
QString mTheme;
TQString mTheme;
bool mOnTop;
int mOffset;
bool mTips;

@ -25,17 +25,17 @@
** Bug reports and questions can be sent to kde-devel@kde.org
*/
#include <qcheckbox.h>
#include <qlabel.h>
#include <qslider.h>
#include <qpainter.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqslider.h>
#include <tqpainter.h>
#include <kapplication.h>
#include <ksimpleconfig.h>
#include "amordialog.h"
#include "amordialog.moc"
#include "version.h"
#include <klocale.h>
#include <qvbox.h>
#include <tqvbox.h>
#include <kstandarddirs.h>
//---------------------------------------------------------------------------
@ -46,22 +46,22 @@ AmorDialog::AmorDialog()
: KDialogBase(0, "amordlg", false, i18n("Options"), Ok|Apply|Cancel, Ok )
{
mConfig.read();
QVBox *mainwidget = makeVBoxMainWidget();
TQVBox *mainwidget = makeVBoxMainWidget();
QHBox *hb = new QHBox(mainwidget);
TQHBox *hb = new TQHBox(mainwidget);
// Theme list
QVBox *themeBox = new QVBox(hb);
TQVBox *themeBox = new TQVBox(hb);
themeBox->setSpacing(spacingHint());
QLabel *label = new QLabel(i18n("Theme:"), themeBox);
TQLabel *label = new TQLabel(i18n("Theme:"), themeBox);
mThemeListBox = new QListBox(themeBox);
connect(mThemeListBox,SIGNAL(highlighted(int)),SLOT(slotHighlighted(int)));
mThemeListBox = new TQListBox(themeBox);
connect(mThemeListBox,TQT_SIGNAL(highlighted(int)),TQT_SLOT(slotHighlighted(int)));
mThemeListBox->setMinimumSize( fontMetrics().maxWidth()*20,
fontMetrics().lineSpacing()*6 );
mAboutEdit = new QMultiLineEdit(themeBox);
mAboutEdit = new TQMultiLineEdit(themeBox);
mAboutEdit->setReadOnly(true);
mAboutEdit->setMinimumHeight( fontMetrics().lineSpacing()*4 );
@ -69,29 +69,29 @@ AmorDialog::AmorDialog()
themeBox->setStretchFactor(mAboutEdit, 1);
// Animation offset
QVBox *offsetBox = new QVBox(hb);
TQVBox *offsetBox = new TQVBox(hb);
offsetBox->setSpacing(spacingHint());
label = new QLabel(i18n("Offset:"), offsetBox);
label = new TQLabel(i18n("Offset:"), offsetBox);
QSlider *slider = new QSlider(-40, 40, 5, mConfig.mOffset,
QSlider::Vertical, offsetBox);
connect(slider, SIGNAL(valueChanged(int)), SLOT(slotOffset(int)));
TQSlider *slider = new TQSlider(-40, 40, 5, mConfig.mOffset,
TQSlider::Vertical, offsetBox);
connect(slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotOffset(int)));
// Always on top
QCheckBox *checkBox = new QCheckBox(i18n("Always on top"), mainwidget);
connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotOnTop(bool)));
TQCheckBox *checkBox = new TQCheckBox(i18n("Always on top"), mainwidget);
connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotOnTop(bool)));
checkBox->setChecked(mConfig.mOnTop);
checkBox = new QCheckBox(i18n("Show random tips"), mainwidget);
connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotRandomTips(bool)));
checkBox = new TQCheckBox(i18n("Show random tips"), mainwidget);
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 = new QCheckBox(i18n("Use a random character"), mainwidget);
connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotRandomTheme(bool)));
checkBox = new TQCheckBox(i18n("Use a random character"), mainwidget);
connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTheme(bool)));
checkBox->setChecked(mConfig.mRandomTheme);
checkBox = new QCheckBox(i18n("Allow application tips"), mainwidget);
connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotApplicationTips(bool)));
checkBox = new TQCheckBox(i18n("Allow application tips"), mainwidget);
connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotApplicationTips(bool)));
checkBox->setChecked(mConfig.mAppTips);
readThemes();
@ -111,13 +111,13 @@ AmorDialog::~AmorDialog()
//
void AmorDialog::readThemes()
{
QStringList files;
TQStringList files;
// Non-recursive search for theme files, with the relative paths stored
// in files so that absolute paths are not used.
KGlobal::dirs()->findAllResources("appdata", "*rc", false, false, files);
for (QStringList::ConstIterator it = files.begin();
for (TQStringList::ConstIterator it = files.begin();
it != files.end();
it++)
addTheme(*it);
@ -127,13 +127,13 @@ void AmorDialog::readThemes()
//
// Add a single theme to the list
//
void AmorDialog::addTheme(const QString& file)
void AmorDialog::addTheme(const TQString& file)
{
KSimpleConfig config(locate("appdata", file), true);
config.setGroup("Config");
QString pixmapPath = config.readPathEntry("PixmapPath");
TQString pixmapPath = config.readPathEntry("PixmapPath");
if (pixmapPath.isEmpty())
{
return;
@ -147,13 +147,13 @@ void AmorDialog::addTheme(const QString& file)
pixmapPath = locate("appdata", pixmapPath);
}
QString description = config.readEntry("Description");
QString about = config.readEntry("About", " ");
QString pixmapName = config.readEntry("Icon");
TQString description = config.readEntry("Description");
TQString about = config.readEntry("About", " ");
TQString pixmapName = config.readEntry("Icon");
pixmapPath += pixmapName;
QPixmap pixmap(pixmapPath);
TQPixmap pixmap(pixmapPath);
AmorListBoxItem *item = new AmorListBoxItem(description, pixmap);
mThemeListBox->insertItem(item);
@ -261,10 +261,10 @@ void AmorDialog::slotCancel()
//
// AmorListBoxItem implements a list box items for selection of themes
//
void AmorListBoxItem::paint( QPainter *p )
void AmorListBoxItem::paint( TQPainter *p )
{
p->drawPixmap( 3, 0, mPixmap );
QFontMetrics fm = p->fontMetrics();
TQFontMetrics fm = p->fontMetrics();
int yPos; // vertical text position
if ( mPixmap.height() < fm.height() )
yPos = fm.ascent() + fm.leading()/2;
@ -273,12 +273,12 @@ void AmorListBoxItem::paint( QPainter *p )
p->drawText( mPixmap.width() + 5, yPos, text() );
}
int AmorListBoxItem::height(const QListBox *lb ) const
int AmorListBoxItem::height(const TQListBox *lb ) const
{
return QMAX( mPixmap.height(), lb->fontMetrics().lineSpacing() + 1 );
}
int AmorListBoxItem::width(const QListBox *lb ) const
int AmorListBoxItem::width(const TQListBox *lb ) const
{
return mPixmap.width() + lb->fontMetrics().width( text() ) + 6;
}

@ -27,10 +27,10 @@
#ifndef AMORDIALOG_H
#define AMORDIALOG_H
#include <qdialog.h>
#include <qlistbox.h>
#include <qptrlist.h>
#include <qmultilineedit.h>
#include <tqdialog.h>
#include <tqlistbox.h>
#include <tqptrlist.h>
#include <tqmultilineedit.h>
#include "amorconfig.h"
#include <kdialogbase.h>
@ -72,13 +72,13 @@ protected slots:
protected:
void readThemes();
void addTheme(const QString& file);
void addTheme(const TQString& file);
protected:
QListBox *mThemeListBox;
QMultiLineEdit *mAboutEdit;
QStringList mThemes;
QStringList mThemeAbout;
TQListBox *mThemeListBox;
TQMultiLineEdit *mAboutEdit;
TQStringList mThemes;
TQStringList mThemeAbout;
AmorConfig mConfig;
};
@ -89,18 +89,18 @@ protected:
class AmorListBoxItem : public QListBoxItem
{
public:
AmorListBoxItem(const QString & s, const QPixmap& p)
: QListBoxItem(), mPixmap(p)
AmorListBoxItem(const TQString & s, const TQPixmap& p)
: TQListBoxItem(), mPixmap(p)
{ setText(s); }
protected:
virtual void paint(QPainter *);
virtual int height(const QListBox *) const;
virtual int width(const QListBox *) const;
virtual const QPixmap *pixmap() const { return &mPixmap; }
virtual void paint(TQPainter *);
virtual int height(const TQListBox *) const;
virtual int width(const TQListBox *) const;
virtual const TQPixmap *pixmap() const { return &mPixmap; }
private:
QPixmap mPixmap;
TQPixmap mPixmap;
};
#endif // AMORDIALOG_H

@ -54,15 +54,15 @@ AmorPixmapManager::~AmorPixmapManager()
// Returns:
// pointer to pixmap if loaded successfully, 0 otherwise.
//
const QPixmap *AmorPixmapManager::load(const QString & img)
const TQPixmap *AmorPixmapManager::load(const TQString & img)
{
QPixmap *pixmap = mPixmaps.find(img);
TQPixmap *pixmap = mPixmaps.find(img);
if (!pixmap)
{
// pixmap has not yet been loaded.
QString path = mPixmapDir + QString("/") + img;
pixmap = new QPixmap(path);
TQString path = mPixmapDir + TQString("/") + img;
pixmap = new TQPixmap(path);
if (!pixmap->isNull())
{

@ -31,8 +31,8 @@
#include <config.h>
#endif
#include <qdict.h>
#include <qpixmap.h>
#include <tqdict.h>
#include <tqpixmap.h>
//---------------------------------------------------------------------------
//
@ -44,19 +44,19 @@ public:
AmorPixmapManager();
virtual ~AmorPixmapManager();
void setPixmapDir(const QString &dir)
void setPixmapDir(const TQString &dir)
{ mPixmapDir = dir; }
void reset()
{ mPixmapDir = "."; mPixmaps.clear(); }
const QPixmap *load(const QString & img);
const QPixmap *pixmap(const QString & img) const
const TQPixmap *load(const TQString & img);
const TQPixmap *pixmap(const TQString & img) const
{ return mPixmaps.find(img); }
static AmorPixmapManager *manager();
public:
QString mPixmapDir; // get pixmaps from here
QDict<QPixmap> mPixmaps; // list of pixmaps
TQString mPixmapDir; // get pixmaps from here
TQDict<TQPixmap> mPixmaps; // list of pixmaps
static AmorPixmapManager *mManager; // static pointer to instance
};

@ -29,8 +29,8 @@
#include "amortips.h"
#include <kstandarddirs.h>
#include <klocale.h>
#include <qfile.h>
#include <qregexp.h>
#include <tqfile.h>
#include <tqregexp.h>
#include <kdebug.h>
//---------------------------------------------------------------------------
@ -45,11 +45,11 @@ AmorTips::AmorTips()
// Set the file containing tips. This reads all tips into memory at the
// moment - need to make more efficient.
//
bool AmorTips::setFile(const QString& file)
bool AmorTips::setFile(const TQString& file)
{
bool rv = false;
QString path( locate("appdata", file) );
TQString path( locate("appdata", file) );
if(path.length() && read(path))
rv = true;
@ -71,11 +71,11 @@ void AmorTips::reset()
//
// Get a tip randomly from the list
//
QString AmorTips::tip()
TQString AmorTips::tip()
{
if (mTips.count())
{
QString tip = *mTips.at(kapp->random() % mTips.count());
TQString tip = *mTips.at(kapp->random() % mTips.count());
return i18n(tip.utf8());
}
@ -88,24 +88,24 @@ QString AmorTips::tip()
//
bool AmorTips::readKTips()
{
QString fname;
TQString fname;
fname = locate("data", QString("kdewizard/tips"));
fname = locate("data", TQString("kdewizard/tips"));
if (fname.isEmpty())
return false;
QFile f(fname);
TQFile f(fname);
if (f.open(IO_ReadOnly))
{
// Reading of tips must be exactly as in KTipDatabase::loadTips for translation
QString content = f.readAll();
const QRegExp rx("\\n+");
TQString content = f.readAll();
const TQRegExp rx("\\n+");
int pos = -1;
while ((pos = content.find("<html>", pos + 1, false)) != -1)
{
QString tip = content
TQString tip = content
.mid(pos + 6, content.find("</html>", pos, false) - pos - 6)
.replace(rx, "\n");
if (!tip.endsWith("\n"))
@ -130,9 +130,9 @@ bool AmorTips::readKTips()
//
// Read all tips from the specified file.
//
bool AmorTips::read(const QString& path)
bool AmorTips::read(const TQString& path)
{
QFile file(path);
TQFile file(path);
if (file.open(IO_ReadOnly))
{
@ -151,17 +151,17 @@ bool AmorTips::read(const QString& path)
//
// Read a single tip.
//
bool AmorTips::readTip(QFile &file)
bool AmorTips::readTip(TQFile &file)
{
char buffer[1024] = "";
QString tip;
TQString tip;
while (!file.atEnd() && buffer[0] != '%')
{
file.readLine(buffer, 1024);
if (buffer[0] != '%')
{
tip += QString::fromUtf8(buffer);
tip += TQString::fromUtf8(buffer);
}
}

@ -31,7 +31,7 @@
#include <config.h>
#endif
#include <qstrlist.h>
#include <tqstrlist.h>
class QFile;
//---------------------------------------------------------------------------
@ -43,17 +43,17 @@ class AmorTips
public:
AmorTips();
bool setFile(const QString& file);
bool setFile(const TQString& file);
void reset();
QString tip();
TQString tip();
protected:
bool readKTips();
bool read(const QString& file);
bool readTip(QFile &file);
bool read(const TQString& file);
bool readTip(TQFile &file);
protected:
QStringList mTips;
TQStringList mTips;
};
#endif // AMORTIPS_H

@ -26,7 +26,7 @@
*/
#include "amorwidget.h"
#include "amorwidget.moc"
#include <qbitmap.h>
#include <tqbitmap.h>
#include <X11/Xlib.h>
#include <X11/extensions/shape.h>
@ -35,7 +35,7 @@
// Constructor
//
AmorWidget::AmorWidget()
: QWidget(0, 0, WStyle_Customize | WStyle_NoBorder | WX11BypassWM ),
: TQWidget(0, 0, WStyle_Customize | WStyle_NoBorder | WX11BypassWM ),
mPixmap(0)
{
setBackgroundMode( NoBackground );
@ -54,7 +54,7 @@ AmorWidget::~AmorWidget()
//
// Set the pixmap to display
//
void AmorWidget::setPixmap(const QPixmap *pixmap)
void AmorWidget::setPixmap(const TQPixmap *pixmap)
{
mPixmap = pixmap;
@ -75,7 +75,7 @@ void AmorWidget::setPixmap(const QPixmap *pixmap)
//
// Draw the pixmap
//
void AmorWidget::paintEvent(QPaintEvent *)
void AmorWidget::paintEvent(TQPaintEvent *)
{
if (mPixmap)
bitBlt( this, 0, 0, mPixmap );
@ -87,7 +87,7 @@ void AmorWidget::paintEvent(QPaintEvent *)
//
// The user clicked on the widget
//
void AmorWidget::mousePressEvent(QMouseEvent *me)
void AmorWidget::mousePressEvent(TQMouseEvent *me)
{
clickPos = me->globalPos();
}
@ -96,7 +96,7 @@ void AmorWidget::mousePressEvent(QMouseEvent *me)
//
// The user moved the mouse
//
void AmorWidget::mouseMoveEvent(QMouseEvent *me)
void AmorWidget::mouseMoveEvent(TQMouseEvent *me)
{
if ( me->state() == LeftButton ) {
if ( !dragging && (clickPos-me->globalPos()).manhattanLength() > 3 )
@ -112,14 +112,14 @@ void AmorWidget::mouseMoveEvent(QMouseEvent *me)
//
// The user clicked on the widget
//
void AmorWidget::mouseReleaseEvent(QMouseEvent *me)
void AmorWidget::mouseReleaseEvent(TQMouseEvent *me)
{
if ( dragging )
emit dragged( me->globalPos() - clickPos, true );
else if ( me->state() == RightButton )
emit mouseClicked(clickPos);
clickPos = QPoint();
clickPos = TQPoint();
dragging = false;
}

@ -32,7 +32,7 @@
#endif
#include <kapplication.h>
#include <qwidget.h>
#include <tqwidget.h>
//---------------------------------------------------------------------------
//
@ -45,21 +45,21 @@ public:
AmorWidget();
virtual ~AmorWidget();
void setPixmap(const QPixmap *pixmap);
void setPixmap(const TQPixmap *pixmap);
signals:
void mouseClicked(const QPoint &pos);
void dragged( const QPoint &delta, bool release );
void mouseClicked(const TQPoint &pos);
void dragged( const TQPoint &delta, bool release );
protected:
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void paintEvent(TQPaintEvent *);
void mousePressEvent(TQMouseEvent *);
void mouseMoveEvent(TQMouseEvent *);
void mouseReleaseEvent(TQMouseEvent *);
protected:
const QPixmap *mPixmap;
QPoint clickPos;
const TQPixmap *mPixmap;
TQPoint clickPos;
bool dragging;
};

@ -18,9 +18,9 @@
#include <math.h>
#include <qpainter.h>
#include <qcursor.h>
#include <qimage.h>
#include <tqpainter.h>
#include <tqcursor.h>
#include <tqimage.h>
#include <klocale.h>
#include <kglobal.h>
@ -33,7 +33,7 @@
extern "C"
{
KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile)
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("keyesapplet");
EyesApplet *applet = new EyesApplet(configFile, KPanelApplet::Normal, 0, parent, "keyesapplet");
@ -41,16 +41,16 @@ extern "C"
}
}
EyesApplet::EyesApplet(const QString& configFile, Type t, int actions,
QWidget *parent, const char *name)
EyesApplet::EyesApplet(const TQString& configFile, Type t, int actions,
TQWidget *parent, const char *name)
: KPanelApplet( configFile, t, actions, parent, name )
{
setWFlags(WNoAutoErase);
setBackgroundOrigin(AncestorOrigin);
startTimer(50);
oldleft = QPoint(-1, -1);
oldright = QPoint(-1, -1);
oldMouse = QPoint(-1, -1);
oldleft = TQPoint(-1, -1);
oldright = TQPoint(-1, -1);
oldMouse = TQPoint(-1, -1);
}
int EyesApplet::widthForHeight(int h) const
@ -62,19 +62,19 @@ int EyesApplet::heightForWidth(int w) const
return static_cast<int>(w / 1.4); // rectangular shape.
}
void EyesApplet::resizeEvent( QResizeEvent*e )
void EyesApplet::resizeEvent( TQResizeEvent*e )
{
QWidget::resizeEvent(e);
TQWidget::resizeEvent(e);
}
void EyesApplet::timerEvent(QTimerEvent*)
void EyesApplet::timerEvent(TQTimerEvent*)
{
QPoint mouse = mapFromGlobal(QCursor::pos());
TQPoint mouse = mapFromGlobal(TQCursor::pos());
if (mouse != oldMouse)
update();
}
void EyesApplet::paintEvent(QPaintEvent*)
void EyesApplet::paintEvent(TQPaintEvent*)
{
int spWidth = width() * AAFACTOR;
int spHeight = height() * AAFACTOR;
@ -82,16 +82,16 @@ void EyesApplet::paintEvent(QPaintEvent*)
if (spWidth != _cache.width() || spHeight != _cache.height())
_cache.resize(spWidth, spHeight);
QPainter paint(&_cache);
TQPainter paint(&_cache);
if (paletteBackgroundPixmap())
{
QPixmap bg(width(), height());
QPainter p(&bg);
QPoint offset = backgroundOffset();
TQPixmap bg(width(), height());
TQPainter p(&bg);
TQPoint offset = backgroundOffset();
p.drawTiledPixmap(0, 0, width(), height(), *paletteBackgroundPixmap(), offset.x(), offset.y());
p.end();
QImage bgImage = bg.convertToImage().scale(spWidth, spHeight);
TQImage bgImage = bg.convertToImage().scale(spWidth, spHeight);
paint.drawImage(0, 0, bgImage);
}
else
@ -100,8 +100,8 @@ void EyesApplet::paintEvent(QPaintEvent*)
}
// draw eyes, no pupils
paint.setPen(QPen(black, 2 * AAFACTOR));
paint.setBrush(QBrush(white));
paint.setPen(TQPen(black, 2 * AAFACTOR));
paint.setBrush(TQBrush(white));
int w = spWidth; // - AAFACTOR * 2;
int h = spHeight; // - AAFACTOR * 2;
@ -116,22 +116,22 @@ void EyesApplet::paintEvent(QPaintEvent*)
drawPupils(&paint);
paint.end();
QPainter paintFinal(this);
QImage spImage = _cache.convertToImage();
QImage displayImage = spImage.smoothScale(size());
TQPainter paintFinal(this);
TQImage spImage = _cache.convertToImage();
TQImage displayImage = spImage.smoothScale(size());
paintFinal.drawImage(0, 0, displayImage);
paintFinal.end();
}
void EyesApplet::drawPupils(QPainter* p)
void EyesApplet::drawPupils(TQPainter* p)
{
QPoint pos, mouse, vect;
TQPoint pos, mouse, vect;
double cos_alpha,sin_alpha;
int w = width() * AAFACTOR;
int h = height() * AAFACTOR;
oldMouse = mapFromGlobal(QCursor::pos());
oldMouse = mapFromGlobal(TQCursor::pos());
mouse = oldMouse * AAFACTOR;
int tmp = QMIN(h, w)/6;
@ -155,13 +155,13 @@ void EyesApplet::drawPupils(QPainter* p)
int sizeEye=QMIN(h,w)/6;
// // draw over old pos
// p->setPen(QPen(NoPen));
// p->setBrush(QBrush(white));
// p->setPen(TQPen(NoPen));
// p->setBrush(TQBrush(white));
// p->drawEllipse(oldleft.x() - sizeEye/2, oldleft.y() - sizeEye/2, sizeEye, sizeEye);
// draw left pupil
p->setPen(QPen(NoPen));
p->setBrush(QBrush(black));
p->setPen(TQPen(NoPen));
p->setBrush(TQBrush(black));
p->drawEllipse(pos.x() - sizeEye/2, pos.y() - sizeEye/2, sizeEye, sizeEye);
//oldleft = pos;
@ -188,13 +188,13 @@ void EyesApplet::drawPupils(QPainter* p)
int sizeEye=QMIN(h,w)/6;
// // draw over old pos
// p->setPen(QPen(NoPen));
// p->setBrush(QBrush(white));
// p->setPen(TQPen(NoPen));
// p->setBrush(TQBrush(white));
// p->drawEllipse(oldright.x() - sizeEye/2, oldright.y() - sizeEye/2, sizeEye, sizeEye);
// draw left pupil
p->setPen(QPen(NoPen));
p->setBrush(QBrush(black));
p->setPen(TQPen(NoPen));
p->setBrush(TQBrush(black));
p->drawEllipse(pos.x() - sizeEye/2, pos.y() - sizeEye/2, sizeEye, sizeEye);
//oldright = pos;

@ -19,7 +19,7 @@
#ifndef __eyes_h__
#define __eyes_h__
#include <qpixmap.h>
#include <tqpixmap.h>
#include <kpanelapplet.h>
class EyesApplet : public KPanelApplet
@ -27,22 +27,22 @@ class EyesApplet : public KPanelApplet
Q_OBJECT
public:
EyesApplet(const QString& configFile, Type t = Normal, int actions = 0,
QWidget *parent = 0, const char *name = 0);
EyesApplet(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
int widthForHeight(int height) const;
int heightForWidth(int width) const;
protected:
void timerEvent(QTimerEvent*);
void resizeEvent(QResizeEvent*);
void paintEvent(QPaintEvent*);
void timerEvent(TQTimerEvent*);
void resizeEvent(TQResizeEvent*);
void paintEvent(TQPaintEvent*);
private:
void drawPupils(QPainter* p);
void drawPupils(TQPainter* p);
QPoint oldleft, oldright, oldMouse;
QPixmap _cache;
TQPoint oldleft, oldright, oldMouse;
TQPixmap _cache;
};
#endif // __eyes_h__

@ -24,9 +24,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stdlib.h>
#include <time.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <tqlayout.h>
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <klocale.h>
#include <kglobal.h>
@ -38,7 +38,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
extern "C"
{
KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile)
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kfifteenapplet");
return new FifteenApplet(configFile, KPanelApplet::Normal,
@ -46,8 +46,8 @@ extern "C"
}
}
FifteenApplet::FifteenApplet(const QString& configFile, Type type, int actions,
QWidget *parent, const char *name)
FifteenApplet::FifteenApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name), _aboutData(0)
{
// setup table
@ -55,7 +55,7 @@ FifteenApplet::FifteenApplet(const QString& configFile, Type type, int actions,
setCustomMenu(_table->popup());
// setup layout
QHBoxLayout *_layout = new QHBoxLayout(this);
TQHBoxLayout *_layout = new TQHBoxLayout(this);
_layout->add(_table);
srand(time(0));
@ -87,12 +87,12 @@ void FifteenApplet::about()
dialog.exec();
}
PiecesTable::PiecesTable(QWidget* parent, const char* name )
PiecesTable::PiecesTable(TQWidget* parent, const char* name )
: QtTableView(parent, name), _activeRow(-1), _activeCol(-1), _randomized(false)
{
_menu = new QPopupMenu(this);
_menu->insertItem(i18n("R&andomize Pieces"), this, SLOT(randomizeMap()));
_menu->insertItem(i18n("&Reset Pieces"), this, SLOT(resetMap()));
_menu = new TQPopupMenu(this);
_menu->insertItem(i18n("R&andomize Pieces"), this, TQT_SLOT(randomizeMap()));
_menu->insertItem(i18n("&Reset Pieces"), this, TQT_SLOT(resetMap()));
_menu->adjustSize(); // setup table view
setFrameStyle(StyledPanel | Sunken);
@ -107,7 +107,7 @@ PiecesTable::PiecesTable(QWidget* parent, const char* name )
initColors();
}
void PiecesTable::paintCell(QPainter *p, int row, int col)
void PiecesTable::paintCell(TQPainter *p, int row, int col)
{
int w = cellWidth();
int h = cellHeight();
@ -142,15 +142,15 @@ void PiecesTable::paintCell(QPainter *p, int row, int col)
p->setPen(white);
else
p->setPen(black);
p->drawText(0, 0, x2, y2, AlignHCenter | AlignVCenter, QString::number(number));
p->drawText(0, 0, x2, y2, AlignHCenter | AlignVCenter, TQString::number(number));
}
void PiecesTable::resizeEvent(QResizeEvent *e)
void PiecesTable::resizeEvent(TQResizeEvent *e)
{
QtTableView::resizeEvent(e);
// set font
QFont f = font();
TQFont f = font();
if (height() > 50)
f.setPixelSize(8);
else if (height() > 40)
@ -171,7 +171,7 @@ void PiecesTable::initColors()
_colors.resize(numRows() * numCols());
for (int r = 0; r < numRows(); r++)
for (int c = 0; c < numCols(); c++)
_colors[c + r *numCols()] = QColor(255 - 70 * c,255 - 70 * r, 150);
_colors[c + r *numCols()] = TQColor(255 - 70 * c,255 - 70 * r, 150);
}
void PiecesTable::initMap()
@ -185,7 +185,7 @@ void PiecesTable::initMap()
void PiecesTable::randomizeMap()
{
QMemArray<int> positions;
TQMemArray<int> positions;
positions.fill(0, 16);
for (unsigned int i = 0; i < 16; i++) {
@ -221,7 +221,7 @@ void PiecesTable::checkwin()
KMessageBox::information(this, i18n("Congratulations!\nYou win the game!"), i18n("Fifteen Pieces"));
}
void PiecesTable::mousePressEvent(QMouseEvent* e)
void PiecesTable::mousePressEvent(TQMouseEvent* e)
{
QtTableView::mousePressEvent(e);
@ -293,7 +293,7 @@ void PiecesTable::mousePressEvent(QMouseEvent* e)
}
}
void PiecesTable::mouseMoveEvent(QMouseEvent* e)
void PiecesTable::mouseMoveEvent(TQMouseEvent* e)
{
QtTableView::mouseMoveEvent(e);

@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define __fifteenapplet_h__
#include "qttableview.h"
#include <qmemarray.h>
#include <tqmemarray.h>
#include <kpanelapplet.h>
@ -37,15 +37,15 @@ class PiecesTable : public QtTableView
Q_OBJECT
public:
PiecesTable(QWidget* parent = 0, const char* name = 0);
QPopupMenu* popup() { return _menu; }
PiecesTable(TQWidget* parent = 0, const char* name = 0);
TQPopupMenu* popup() { return _menu; }
protected:
void resizeEvent(QResizeEvent*);
void mousePressEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
void resizeEvent(TQResizeEvent*);
void mousePressEvent(TQMouseEvent*);
void mouseMoveEvent(TQMouseEvent*);
void paintCell(QPainter *, int row, int col);
void paintCell(TQPainter *, int row, int col);
void initMap();
void initColors();
@ -56,9 +56,9 @@ protected slots:
void resetMap();
private:
QMemArray<int> _map;
QMemArray<QColor> _colors;
QPopupMenu *_menu;
TQMemArray<int> _map;
TQMemArray<TQColor> _colors;
TQPopupMenu *_menu;
int _activeRow, _activeCol;
bool _randomized;
};
@ -68,8 +68,8 @@ class FifteenApplet : public KPanelApplet
Q_OBJECT
public:
FifteenApplet(const QString& configFile, Type t = Stretch, int actions = 0,
QWidget *parent = 0, const char *name = 0);
FifteenApplet(const TQString& configFile, Type t = Stretch, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
int widthForHeight(int height) const;
int heightForWidth(int width) const;

@ -15,9 +15,9 @@
#include "qttableview.h"
#include "qttableview.moc"
#ifndef QT_NO_QTTABLEVIEW
#include "qscrollbar.h"
#include "qpainter.h"
#include "qdrawutil.h"
#include "tqscrollbar.h"
#include "tqpainter.h"
#include "tqdrawutil.h"
#include <limits.h>
enum ScrollBarDirtyFlags {
@ -41,16 +41,16 @@ enum ScrollBarDirtyFlags {
class QCornerSquare : public QWidget // internal class
{
public:
QCornerSquare( QWidget *, const char* = 0 );
void paintEvent( QPaintEvent * );
QCornerSquare( TQWidget *, const char* = 0 );
void paintEvent( TQPaintEvent * );
};
QCornerSquare::QCornerSquare( QWidget *parent, const char *name )
: QWidget( parent, name )
QCornerSquare::QCornerSquare( TQWidget *parent, const char *name )
: TQWidget( parent, name )
{
}
void QCornerSquare::paintEvent( QPaintEvent * )
void QCornerSquare::paintEvent( TQPaintEvent * )
{
}
@ -113,9 +113,9 @@ void QCornerSquare::paintEvent( QPaintEvent * )
\warning Experience has shown that use of this widget tends to cause
more bugs than expected and our analysis indicates that the widget's
very flexibility is the problem. If QScrollView or QListBox can
very flexibility is the problem. If TQScrollView or TQListBox can
easily be made to do the job you need, we recommend subclassing
those widgets rather than QtTableView. In addition, QScrollView makes
those widgets rather than QtTableView. In addition, TQScrollView makes
it easy to have child widgets inside tables, which QtTableView
doesn't support at all.
@ -126,7 +126,7 @@ void QCornerSquare::paintEvent( QPaintEvent * )
/*!
Constructs a table view. The \a parent, \a name and \f arguments
are passed to the QFrame constructor.
are passed to the TQFrame constructor.
The \link setTableFlags() table flags\endlink are all cleared (set to 0).
Set \c Tbl_autoVScrollBar or \c Tbl_autoHScrollBar to get automatic scroll
@ -135,17 +135,17 @@ void QCornerSquare::paintEvent( QPaintEvent * )
The \link setCellHeight() cell height\endlink and \link setCellWidth()
cell width\endlink are set to 0.
Frame line shapes (QFrame::HLink and QFrame::VLine) are disallowed;
see QFrame::setFrameStyle().
Frame line shapes (TQFrame::HLink and TQFrame::VLine) are disallowed;
see TQFrame::setFrameStyle().
Note that the \a f argument is \e not \link setTableFlags() table
flags \endlink but rather \link QWidget::QWidget() widget
flags \endlink but rather \link TQWidget::TQWidget() widget
flags. \endlink
*/
QtTableView::QtTableView( QWidget *parent, const char *name, WFlags f )
: QFrame( parent, name, f )
QtTableView::QtTableView( TQWidget *parent, const char *name, WFlags f )
: TQFrame( parent, name, f )
{
nRows = nCols = 0; // zero rows/cols
xCellOffs = yCellOffs = 0; // zero offset
@ -179,21 +179,21 @@ QtTableView::~QtTableView()
/*!
\internal
Reimplements QWidget::setBackgroundColor() for binary compatibility.
Reimplements TQWidget::setBackgroundColor() for binary compatibility.
\sa setPalette()
*/
void QtTableView::setBackgroundColor( const QColor &c )
void QtTableView::setBackgroundColor( const TQColor &c )
{
QWidget::setBackgroundColor( c );
TQWidget::setBackgroundColor( c );
}
/*!\reimp
*/
void QtTableView::setPalette( const QPalette &p )
void QtTableView::setPalette( const TQPalette &p )
{
QWidget::setPalette( p );
TQWidget::setPalette( p );
}
/*!\reimp
@ -202,7 +202,7 @@ void QtTableView::setPalette( const QPalette &p )
void QtTableView::show()
{
showOrHideScrollBars();
QWidget::show();
TQWidget::show();
}
@ -226,7 +226,7 @@ void QtTableView::show()
event.
At present, QtTableView is the only widget that reimplements \link
QWidget::repaint() repaint()\endlink. It does this because by
TQWidget::repaint() repaint()\endlink. It does this because by
clearing and then repainting one cell at at time, it can make the
screen flicker less than it would otherwise. */
@ -238,10 +238,10 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
w = width() - x;
if ( h < 0 )
h = height() - y;
QRect r( x, y, w, h );
TQRect r( x, y, w, h );
if ( r.isEmpty() )
return; // nothing to do
QPaintEvent e( r );
TQPaintEvent e( r );
if ( erase && backgroundMode() != NoBackground )
eraseInPaint = TRUE; // erase when painting
paintEvent( &e );
@ -249,7 +249,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
}
/*!
\overload void QtTableView::repaint( const QRect &r, bool erase )
\overload void QtTableView::repaint( const TQRect &r, bool erase )
Replaints rectangle \a r. If \a erase is TRUE draws the background
using the palette's background.
*/
@ -730,7 +730,7 @@ int QtTableView::totalHeight()
<dt> Tbl_autoHScrollBar <dd> The table has a horizontal scroll bar if
- and only if - the table is wider than the view.
<dt> Tbl_autoScrollBars <dd> - The union of the previous two flags.
<dt> Tbl_clipCellPainting <dd> - The table uses QPainter::setClipRect() to
<dt> Tbl_clipCellPainting <dd> - The table uses TQPainter::setClipRect() to
make sure that paintCell() will not draw outside the cell
boundaries.
<dt> Tbl_cutCellsV <dd> - The table will never show part of a
@ -960,7 +960,7 @@ void QtTableView::updateCell( int row, int col, bool erase )
return;
if ( !rowYPos( row, &yPos ) )
return;
QRect uR = QRect( xPos, yPos,
TQRect uR = TQRect( xPos, yPos,
cellW ? cellW : cellWidth(col),
cellH ? cellH : cellHeight(row) );
repaint( uR.intersect(viewRect()), erase );
@ -968,7 +968,7 @@ void QtTableView::updateCell( int row, int col, bool erase )
/*!
\fn QRect QtTableView::cellUpdateRect() const
\fn TQRect QtTableView::cellUpdateRect() const
This function should be called only from the paintCell() function in
subclasses. It returns the portion of a cell that actually needs to be
@ -982,9 +982,9 @@ void QtTableView::updateCell( int row, int col, bool erase )
frame, in \e widget coordinates.
*/
QRect QtTableView::viewRect() const
TQRect QtTableView::viewRect() const
{
return QRect( frameWidth(), frameWidth(), viewWidth(), viewHeight() );
return TQRect( frameWidth(), frameWidth(), viewWidth(), viewHeight() );
}
@ -1127,7 +1127,7 @@ void QtTableView::snapToGrid( bool horizontal, bool vertical )
/*!
\internal
This internal slot is connected to the horizontal scroll bar's
QScrollBar::valueChanged() signal.
TQScrollBar::valueChanged() signal.
Moves the table horizontally to offset \a val without updating the
scroll bar.
@ -1148,7 +1148,7 @@ void QtTableView::horSbValue( int val )
/*!
\internal
This internal slot is connected to the horizontal scroll bar's
QScrollBar::sliderMoved() signal.
TQScrollBar::sliderMoved() signal.
Scrolls the table smoothly horizontally even if \c Tbl_snapToHGrid is set.
*/
@ -1168,7 +1168,7 @@ void QtTableView::horSbSliding( int val )
/*!
\internal
This internal slot is connected to the horizontal scroll bar's
QScrollBar::sliderReleased() signal.
TQScrollBar::sliderReleased() signal.
*/
void QtTableView::horSbSlidingDone( )
@ -1181,7 +1181,7 @@ void QtTableView::horSbSlidingDone( )
/*!
\internal
This internal slot is connected to the vertical scroll bar's
QScrollBar::valueChanged() signal.
TQScrollBar::valueChanged() signal.
Moves the table vertically to offset \a val without updating the
scroll bar.
@ -1202,7 +1202,7 @@ void QtTableView::verSbValue( int val )
/*!
\internal
This internal slot is connected to the vertical scroll bar's
QScrollBar::sliderMoved() signal.
TQScrollBar::sliderMoved() signal.
Scrolls the table smoothly vertically even if \c Tbl_snapToVGrid is set.
*/
@ -1222,7 +1222,7 @@ void QtTableView::verSbSliding( int val )
/*!
\internal
This internal slot is connected to the vertical scroll bar's
QScrollBar::sliderReleased() signal.
TQScrollBar::sliderReleased() signal.
*/
void QtTableView::verSbSlidingDone( )
@ -1240,18 +1240,18 @@ void QtTableView::verSbSlidingDone( )
do so for each cell.
*/
void QtTableView::setupPainter( QPainter * )
void QtTableView::setupPainter( TQPainter * )
{
}
/*!
\fn void QtTableView::paintCell( QPainter *p, int row, int col )
\fn void QtTableView::paintCell( TQPainter *p, int row, int col )
This pure virtual function is called to paint the single cell at \a
(row,col) using \a p, which is open when paintCell() is called and
must remain open.
The coordinate system is \link QPainter::translate() translated \endlink
The coordinate system is \link TQPainter::translate() translated \endlink
so that the origin is at the top-left corner of the cell to be
painted, i.e. \e cell coordinates. Do not scale or shear the coordinate
system (or if you do, restore the transformation matrix before you
@ -1269,16 +1269,16 @@ void QtTableView::setupPainter( QPainter * )
Calls paintCell() for the cells that needs to be repainted.
*/
void QtTableView::paintEvent( QPaintEvent *e )
void QtTableView::paintEvent( TQPaintEvent *e )
{
QRect updateR = e->rect(); // update rectangle
TQRect updateR = e->rect(); // update rectangle
if ( sbDirty ) {
bool e = eraseInPaint;
updateScrollBars();
eraseInPaint = e;
}
QPainter paint( this );
TQPainter paint( this );
if ( !contentsRect().contains( updateR, TRUE ) ) {// update frame ?
drawFrame( &paint );
@ -1312,11 +1312,11 @@ void QtTableView::paintEvent( QPaintEvent *e )
int xPos = maxX+1; // in case the while() is empty
int nextX;
int nextY;
QRect winR = viewRect();
QRect cellR;
QRect cellUR;
TQRect winR = viewRect();
TQRect cellR;
TQRect cellUR;
#ifndef QT_NO_TRANSFORMATIONS
QWMatrix matrix;
TQWMatrix matrix;
#endif
while ( yPos <= maxY && row < nRows ) {
@ -1384,22 +1384,22 @@ void QtTableView::paintEvent( QPaintEvent *e )
// inside the cells. So QtTableView is reponsible for all pixels
// outside the cells.
QRect viewR = viewRect();
const QColorGroup g = colorGroup();
TQRect viewR = viewRect();
const TQColorGroup g = colorGroup();
if ( xPos <= maxX ) {
QRect r = viewR;
TQRect r = viewR;
r.setLeft( xPos );
r.setBottom( yPos<maxY?yPos:maxY );
if ( inherits( "QMultiLineEdit" ) )
if ( inherits( "TQMultiLineEdit" ) )
paint.fillRect( r.intersect( updateR ), g.base() );
else
paint.eraseRect( r.intersect( updateR ) );
}
if ( yPos <= maxY ) {
QRect r = viewR;
TQRect r = viewR;
r.setTop( yPos );
if ( inherits( "QMultiLineEdit" ) )
if ( inherits( "TQMultiLineEdit" ) )
paint.fillRect( r.intersect( updateR ), g.base() );
else
paint.eraseRect( r.intersect( updateR ) );
@ -1408,7 +1408,7 @@ void QtTableView::paintEvent( QPaintEvent *e )
/*!\reimp
*/
void QtTableView::resizeEvent( QResizeEvent * )
void QtTableView::resizeEvent( TQResizeEvent * )
{
updateScrollBars( horValue | verValue | horSteps | horGeometry | horRange |
verSteps | verGeometry | verRange );
@ -1435,11 +1435,11 @@ void QtTableView::updateView()
values; use findRow() to translate to cell numbers.
*/
QScrollBar *QtTableView::verticalScrollBar() const
TQScrollBar *QtTableView::verticalScrollBar() const
{
QtTableView *that = (QtTableView*)this; // semantic const
if ( !vScrollBar ) {
QScrollBar *sb = new QScrollBar( QScrollBar::Vertical, that );
TQScrollBar *sb = new TQScrollBar( TQScrollBar::Vertical, that );
#ifndef QT_NO_CURSOR
sb->setCursor( arrowCursor );
#endif
@ -1447,12 +1447,12 @@ QScrollBar *QtTableView::verticalScrollBar() const
Q_CHECK_PTR(sb);
sb->setTracking( FALSE );
sb->setFocusPolicy( NoFocus );
connect( sb, SIGNAL(valueChanged(int)),
SLOT(verSbValue(int)));
connect( sb, SIGNAL(sliderMoved(int)),
SLOT(verSbSliding(int)));
connect( sb, SIGNAL(sliderReleased()),
SLOT(verSbSlidingDone()));
connect( sb, TQT_SIGNAL(valueChanged(int)),
TQT_SLOT(verSbValue(int)));
connect( sb, TQT_SIGNAL(sliderMoved(int)),
TQT_SLOT(verSbSliding(int)));
connect( sb, TQT_SIGNAL(sliderReleased()),
TQT_SLOT(verSbSlidingDone()));
sb->hide();
that->vScrollBar = sb;
return sb;
@ -1466,11 +1466,11 @@ QScrollBar *QtTableView::verticalScrollBar() const
values; use findCol() to translate to cell numbers.
*/
QScrollBar *QtTableView::horizontalScrollBar() const
TQScrollBar *QtTableView::horizontalScrollBar() const
{
QtTableView *that = (QtTableView*)this; // semantic const
if ( !hScrollBar ) {
QScrollBar *sb = new QScrollBar( QScrollBar::Horizontal, that );
TQScrollBar *sb = new TQScrollBar( TQScrollBar::Horizontal, that );
#ifndef QT_NO_CURSOR
sb->setCursor( arrowCursor );
#endif
@ -1478,12 +1478,12 @@ QScrollBar *QtTableView::horizontalScrollBar() const
sb->setFocusPolicy( NoFocus );
Q_CHECK_PTR(sb);
sb->setTracking( FALSE );
connect( sb, SIGNAL(valueChanged(int)),
SLOT(horSbValue(int)));
connect( sb, SIGNAL(sliderMoved(int)),
SLOT(horSbSliding(int)));
connect( sb, SIGNAL(sliderReleased()),
SLOT(horSbSlidingDone()));
connect( sb, TQT_SIGNAL(valueChanged(int)),
TQT_SLOT(horSbValue(int)));
connect( sb, TQT_SIGNAL(sliderMoved(int)),
TQT_SLOT(horSbSliding(int)));
connect( sb, TQT_SIGNAL(sliderReleased()),
TQT_SLOT(horSbSlidingDone()));
sb->hide();
that->hScrollBar = sb;
return sb;
@ -1787,10 +1787,10 @@ bool QtTableView::colXPos( int col, int *xPos ) const
Moves the visible area of the table right by \a xPixels and
down by \a yPixels pixels. Both may be negative.
\warning You might find that QScrollView offers a higher-level of
\warning You might find that TQScrollView offers a higher-level of
functionality than using QtTableView and this function.
This function is \e not the same as QWidget::scroll(); in particular,
This function is \e not the same as TQWidget::scroll(); in particular,
the signs of \a xPixels and \a yPixels have the reverse semantics.
\sa setXOffset(), setYOffset(), setOffset(), setTopCell(),
@ -1799,7 +1799,7 @@ bool QtTableView::colXPos( int col, int *xPos ) const
void QtTableView::scroll( int xPixels, int yPixels )
{
QWidget::scroll( -xPixels, -yPixels, contentsRect() );
TQWidget::scroll( -xPixels, -yPixels, contentsRect() );
}
@ -2058,7 +2058,7 @@ void QtTableView::updateFrameSize()
if ( autoUpdate() ) {
int fh = frameRect().height();
int fw = frameRect().width();
setFrameRect( QRect(0,0,rw,rh) );
setFrameRect( TQRect(0,0,rw,rh) );
if ( rw != fw )
update( QMIN(fw,rw) - frameWidth() - 2, 0, frameWidth()+4, rh );

@ -16,7 +16,7 @@
#define QTTABLEVIEW_H
#ifndef QT_H
#include "qframe.h"
#include "tqframe.h"
#endif // QT_H
#ifndef QT_NO_QTTABLEVIEW
@ -29,16 +29,16 @@ class QtTableView : public QFrame
{
Q_OBJECT
public:
virtual void setBackgroundColor( const QColor & );
virtual void setPalette( const QPalette & );
virtual void setBackgroundColor( const TQColor & );
virtual void setPalette( const TQPalette & );
void show();
void repaint( bool erase=TRUE );
void repaint( int x, int y, int w, int h, bool erase=TRUE );
void repaint( const QRect &, bool erase=TRUE );
void repaint( const TQRect &, bool erase=TRUE );
protected:
QtTableView( QWidget *parent=0, const char *name=0, WFlags f=0 );
QtTableView( TQWidget *parent=0, const char *name=0, WFlags f=0 );
~QtTableView();
int numRows() const;
@ -87,8 +87,8 @@ protected:
bool rowIsVisible( int row ) const;
bool colIsVisible( int col ) const;
QScrollBar *verticalScrollBar() const;
QScrollBar *horizontalScrollBar() const;
TQScrollBar *verticalScrollBar() const;
TQScrollBar *horizontalScrollBar() const;
private slots:
void horSbValue( int );
@ -99,11 +99,11 @@ private slots:
void verSbSlidingDone();
protected:
virtual void paintCell( QPainter *, int row, int col ) = 0;
virtual void setupPainter( QPainter * );
virtual void paintCell( TQPainter *, int row, int col ) = 0;
virtual void setupPainter( TQPainter * );
void paintEvent( QPaintEvent * );
void resizeEvent( QResizeEvent * );
void paintEvent( TQPaintEvent * );
void resizeEvent( TQResizeEvent * );
int findRow( int yPos ) const;
int findCol( int xPos ) const;
@ -164,8 +164,8 @@ private:
uint tFlags;
QRect cellUpdateR;
QScrollBar *vScrollBar;
QScrollBar *hScrollBar;
TQScrollBar *vScrollBar;
TQScrollBar *hScrollBar;
QCornerSquare *cornerSquare;
private: // Disabled copy constructor and operator=
@ -230,7 +230,7 @@ inline uint QtTableView::tableFlags() const
inline bool QtTableView::testTableFlags( uint f ) const
{ return (tFlags & f) != 0; }
inline QRect QtTableView::cellUpdateRect() const
inline TQRect QtTableView::cellUpdateRect() const
{ return cellUpdateR; }
inline bool QtTableView::autoUpdate() const
@ -239,7 +239,7 @@ inline bool QtTableView::autoUpdate() const
inline void QtTableView::repaint( bool erase )
{ repaint( 0, 0, width(), height(), erase ); }
inline void QtTableView::repaint( const QRect &r, bool erase )
inline void QtTableView::repaint( const TQRect &r, bool erase )
{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); }
inline void QtTableView::updateScrollBars()

@ -23,11 +23,11 @@
#include <assert.h>
#include <unistd.h>
#include <qbitmap.h>
#include <qtooltip.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qlayout.h>
#include <tqbitmap.h>
#include <tqtooltip.h>
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqlayout.h>
#include <dcopclient.h>
#include <kdebug.h>
@ -53,7 +53,7 @@ const char *description = I18N_NOOP("Moon Phase Indicator for KDE");
extern "C"
{
KDE_EXPORT KPanelApplet *init(QWidget *parent, const QString& configFile)
KDE_EXPORT KPanelApplet *init(TQWidget *parent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kmoon");
return new MoonPAWidget(configFile, KPanelApplet::Normal,
@ -62,14 +62,14 @@ extern "C"
}
}
MoonPAWidget::MoonPAWidget(const QString& configFile, Type type, int actions,
QWidget *parent, const char *name)
MoonPAWidget::MoonPAWidget(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name)
{
KConfig *config = KGlobal::config();
config->setGroup("General");
QVBoxLayout *vbox = new QVBoxLayout(this, 0,0);
TQVBoxLayout *vbox = new TQVBoxLayout(this, 0,0);
moon = new MoonWidget(this);
moon->setAngle(config->readNumEntry("Rotation", 0));
moon->setNorthHemi(config->readBoolEntry("Northern", true));
@ -77,12 +77,12 @@ MoonPAWidget::MoonPAWidget(const QString& configFile, Type type, int actions,
vbox->addWidget(moon);
startTimer(1000 * 60 * 20);
popup = new QPopupMenu();
popup = new TQPopupMenu();
popup->insertItem(SmallIcon("kmoon"),
i18n("&About"), this,
SLOT(showAbout()));
TQT_SLOT(showAbout()));
popup->insertItem(SmallIcon("configure"), i18n("&Configure..."), this,
SLOT(settings()));
TQT_SLOT(settings()));
// missuse timerEvent for initialising
timerEvent(0);
@ -103,8 +103,8 @@ void MoonPAWidget::showAbout()
0, "about", true, true,
KStdGuiItem::ok() );
QPixmap ret = DesktopIcon("kmoon");
QString text = i18n(description) + QString::fromLatin1("\n\n") +
TQPixmap ret = DesktopIcon("kmoon");
TQString text = i18n(description) + TQString::fromLatin1("\n\n") +
i18n("Written by Stephan Kulow <coolo@kde.org>\n"
"\n"
"Made an applet by M G Berberich "
@ -118,7 +118,7 @@ void MoonPAWidget::showAbout()
dialog->setIcon(ret);
KMessageBox::createKMessageBox(dialog, ret, text, QStringList(), QString::null, 0, KMessageBox::Notify);
KMessageBox::createKMessageBox(dialog, ret, text, TQStringList(), TQString::null, 0, KMessageBox::Notify);
}
void MoonPAWidget::settings()
@ -139,7 +139,7 @@ void MoonPAWidget::settings()
repaint();
}
void MoonPAWidget::timerEvent( QTimerEvent * )
void MoonPAWidget::timerEvent( TQTimerEvent * )
{
time_t clock;
time(&clock);
@ -148,7 +148,7 @@ void MoonPAWidget::timerEvent( QTimerEvent * )
moon->repaint();
}
void MoonPAWidget::mousePressEvent( QMouseEvent *e)
void MoonPAWidget::mousePressEvent( TQMouseEvent *e)
{
if (!popup)
return;

@ -21,8 +21,8 @@
#ifndef KMOONAPPLET
#define KMOONAPPLET
#include <qwidget.h>
#include <qimage.h>
#include <tqwidget.h>
#include <tqimage.h>
#include <sys/types.h>
#include <time.h>
#include <ksystemtray.h>
@ -39,29 +39,29 @@ class MoonPAWidget : public KPanelApplet
Q_OBJECT
public:
MoonPAWidget(const QString& configFile, Type t = Normal, int actions = 0,
QWidget *parent = 0, const char *name = 0);
MoonPAWidget(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
~MoonPAWidget();
int widthForHeight(int height) const { return height; }
int heightForWidth(int width) const { return width; }
protected:
QPopupMenu *popup;
TQPopupMenu *popup;
MoonWidget *moon;
QString tooltip;
TQString tooltip;
void about() { showAbout(); }
void preferences() { settings(); }
protected slots:
void timerEvent( QTimerEvent *e);
void timerEvent( TQTimerEvent *e);
void showAbout();
void settings();
protected:
void mousePressEvent( QMouseEvent *e);
void mousePressEvent( TQMouseEvent *e);
};
#endif

@ -18,31 +18,31 @@
*
*/
#include <qslider.h>
#include <qlayout.h>
#include <tqslider.h>
#include <tqlayout.h>
#include <klocale.h>
#include <qwhatsthis.h>
#include <qvbox.h>
#include <tqwhatsthis.h>
#include <tqvbox.h>
#include <kapplication.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
#include "kmoondlg.h"
#include "kmoonwidget.h"
KMoonDlg::KMoonDlg(int a, bool n, bool m, QWidget *parent, const char *name)
KMoonDlg::KMoonDlg(int a, bool n, bool m, TQWidget *parent, const char *name)
: KDialogBase(parent, name, true, i18n("Change View"),
Ok|Cancel|Help), angle(a), north(n), mask(m)
{
QWidget *page = new QWidget( this );
TQWidget *page = new TQWidget( this );
setMainWidget(page);
QHBoxLayout *topLayout = new QHBoxLayout( page, 0, spacingHint() );
TQHBoxLayout *topLayout = new TQHBoxLayout( page, 0, spacingHint() );
QVBox *vbox = new QVBox(page);
QHBox *hbox1 = new QHBox(vbox);
TQVBox *vbox = new TQVBox(page);
TQHBox *hbox1 = new TQHBox(vbox);
hbox1->setSpacing(15);
QLabel *label = new QLabel( i18n("View angle:"), hbox1, "caption" );
QString text = i18n("You can use this to rotate the moon to the correct\n"
TQLabel *label = new TQLabel( i18n("View angle:"), hbox1, "caption" );
TQString text = i18n("You can use this to rotate the moon to the correct\n"
"angle for your location.\n"
"\n"
"This angle is (almost) impossible to\n"
@ -52,39 +52,39 @@ KMoonDlg::KMoonDlg(int a, bool n, bool m, QWidget *parent, const char *name)
"The default value is 0, but it is very\n"
"unlikely that you would see the moon\n"
"at this angle.");
QWhatsThis::add(label, text);
TQWhatsThis::add(label, text);
slider = new QSlider( -90, 90, 2, angle, Qt::Horizontal, hbox1, "slider" );
slider->setTickmarks(QSlider::Above);
slider = new TQSlider( -90, 90, 2, angle, Qt::Horizontal, hbox1, "slider" );
slider->setTickmarks(TQSlider::Above);
slider->setTickInterval(45);
slider->setEnabled(QPixmap::defaultDepth() > 8);
label->setEnabled(QPixmap::defaultDepth() > 8);
QWhatsThis::add(slider, text);
connect(slider, SIGNAL(valueChanged(int)), SLOT(angleChanged(int)));
slider->setEnabled(TQPixmap::defaultDepth() > 8);
label->setEnabled(TQPixmap::defaultDepth() > 8);
TQWhatsThis::add(slider, text);
connect(slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(angleChanged(int)));
QHBox *hbox2 = new QHBox(vbox);
TQHBox *hbox2 = new TQHBox(vbox);
hbox2->setSpacing(spacingHint());
hemitoggle = new QPushButton(hbox2);
hemitoggle = new TQPushButton(hbox2);
hemitoggle->setText(north ? i18n("Switch to Southern Hemisphere") :
i18n("Switch to Northern Hemisphere"));
connect(hemitoggle, SIGNAL(clicked()), SLOT(toggleHemi()));
connect(hemitoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleHemi()));
masktoggle = new QPushButton(hbox2);
masktoggle = new TQPushButton(hbox2);
masktoggle->setText(mask ? i18n("Switch Masking Off") :
i18n("Switch Masking On"));
connect(masktoggle, SIGNAL(clicked()), SLOT(toggleMask()));
connect(masktoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleMask()));
topLayout->addWidget(vbox);
moon = new MoonWidget(page, "preview");
moon->setMinimumSize(50, 50);
moon->setMaximumSize(200,200);
QWhatsThis::add(moon, i18n("The moon as KMoon would display it\n"
TQWhatsThis::add(moon, i18n("The moon as KMoon would display it\n"
"following your current setting and time."));
topLayout->addWidget(moon);
connect(this, SIGNAL(helpClicked()), SLOT(help()));
connect(this, TQT_SIGNAL(helpClicked()), TQT_SLOT(help()));
// disableResize();
}
@ -94,7 +94,7 @@ void KMoonDlg::angleChanged(int value) {
}
void KMoonDlg::help() {
kapp->invokeHelp(QString::fromLatin1("config"));
kapp->invokeHelp(TQString::fromLatin1("config"));
}
void KMoonDlg::toggleHemi() {

@ -31,19 +31,19 @@ class KMoonDlg : public KDialogBase {
Q_OBJECT
public:
KMoonDlg(int angle, bool north, bool mask, QWidget *parent, const char *name);
KMoonDlg(int angle, bool north, bool mask, TQWidget *parent, const char *name);
int getAngle() const { return angle; }
bool getNorthHemi() const { return north; }
bool getMask() const { return mask; }
private:
QSlider *slider;
TQSlider *slider;
MoonWidget *moon;
int angle;
bool north;
bool mask;
QPushButton *hemitoggle;
QPushButton *masktoggle;
TQPushButton *hemitoggle;
TQPushButton *masktoggle;
private slots:
void help();

@ -23,11 +23,11 @@
#include <assert.h>
#include <unistd.h>
#include <qbitmap.h>
#include <qtooltip.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qcolor.h>
#include <tqbitmap.h>
#include <tqtooltip.h>
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqcolor.h>
#include <dcopclient.h>
#include <kdebug.h>
@ -50,8 +50,8 @@
extern double moonphasebylunation(int lun, int phi);
extern time_t JDtoDate(double jd, struct tm *event_date);
MoonWidget::MoonWidget(QWidget *parent, const char *name)
: QWidget(parent, name)
MoonWidget::MoonWidget(TQWidget *parent, const char *name)
: TQWidget(parent, name)
{
struct tm * t;
time_t clock;
@ -92,30 +92,30 @@ void MoonWidget::calcStatus( time_t time )
lun -= 2;
QDateTime ln;
TQDateTime ln;
ln.setTime_t( last_new );
kdDebug() << KGlobal::locale()->formatDateTime( ln ) << endl;
time_t first_quarter = JDtoDate( moonphasebylunation( lun, 1 ), 0 );
QDateTime fq;
TQDateTime fq;
fq.setTime_t( first_quarter );
kdDebug() << KGlobal::locale()->formatDateTime( fq ) << endl;
time_t full_moon = JDtoDate( moonphasebylunation( lun, 2 ), 0 );
QDateTime fm;
TQDateTime fm;
fm.setTime_t( full_moon );
kdDebug() << KGlobal::locale()->formatDateTime( fm ) << endl;
time_t third_quarter = JDtoDate( moonphasebylunation( lun, 3 ), 0 );
QDateTime tq;
TQDateTime tq;
tq.setTime_t( third_quarter );
kdDebug() << KGlobal::locale()->formatDateTime( tq ) << endl;
QDateTime nn;
TQDateTime nn;
nn.setTime_t( next_new );
kdDebug() << KGlobal::locale()->formatDateTime( nn ) << endl;
QDateTime now;
TQDateTime now;
now.setTime_t( time );
kdDebug() << KGlobal::locale()->formatDateTime( now ) << endl;
@ -220,15 +220,15 @@ void MoonWidget::calcStatus( time_t time )
repaint();
}
QImage MoonWidget::loadMoon(int index)
TQImage MoonWidget::loadMoon(int index)
{
if (index == 0) // the new moon has the wrong filename
index = 29;
QString filename = QString("kmoon/pics/moon%1.png").arg(index);
QString path = locate("data", filename);
TQString filename = TQString("kmoon/pics/moon%1.png").arg(index);
TQString path = locate("data", filename);
if (path.isNull())
kdFatal() << "cound't find " << filename << ". Exiting.\n";
QImage image(path);
TQImage image(path);
KIconEffect iconeffect;
image=iconeffect.apply(image, KIcon::Panel, KIcon::DefaultState);
return image;
@ -255,12 +255,12 @@ void MoonWidget::setMask(bool value)
repaint();
}
void MoonWidget::paintEvent(QPaintEvent *)
void MoonWidget::paintEvent(TQPaintEvent *)
{
bitBlt(this, 0, 0, &pixmap, 0, 0);
}
void MoonWidget::resizeEvent(QResizeEvent *)
void MoonWidget::resizeEvent(TQResizeEvent *)
{
renderGraphic();
repaint();
@ -275,15 +275,15 @@ void MoonWidget::renderGraphic()
old_w = width();
old_h = height();
old_north = _north;
QImage im = loadMoon(counter);
TQImage im = loadMoon(counter);
assert(!im.isNull());
im = im.convertDepth(32, 0);
assert(!im.isNull());
int mw = QMIN(width(), height());
QImage dest;
TQImage dest;
if (QPixmap::defaultDepth() > 8) {
if (TQPixmap::defaultDepth() > 8) {
if (fabs(_angle)!=0) { // nothing to rotate
//We expand the image 2x before rotating, rotate it, and then average out
@ -292,13 +292,13 @@ void MoonWidget::renderGraphic()
if (!pixmap.convertFromImage(im.smoothScale(dmw, dmw), 0)) {
return;
}
QWMatrix m;
TQWMatrix m;
m.rotate(_angle);
QPixmap rotated = pixmap.xForm(m);
TQPixmap rotated = pixmap.xForm(m);
//Copy the relevant part back to the pixmap
QRegion r(QRect(0, 0, dmw, dmw), QRegion::Ellipse);
QPainter p;
TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse);
TQPainter p;
p.begin(&pixmap);
p.fillRect(0, 0, dmw, dmw, Qt::black);
p.setClipRegion(r);
@ -331,15 +331,15 @@ void MoonWidget::renderGraphic()
if (_mask) {
// generate alpha-channel
int dmw = mw*2;
QBitmap dMask(dmw, dmw);
QRegion r(QRect(0, 0, dmw, dmw), QRegion::Ellipse);
QPainter p;
TQBitmap dMask(dmw, dmw);
TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse);
TQPainter p;
p.begin(&dMask);
p.fillRect(0, 0, dmw, dmw, Qt::white);
p.setClipRegion(r);
p.fillRect(0, 0, dmw, dmw, Qt::black);
p.end();
QImage Mask2 = dMask.convertToImage().convertDepth(32).smoothScale(mw, mw);
TQImage Mask2 = dMask.convertToImage().convertDepth(32).smoothScale(mw, mw);
dest.setAlphaBuffer(true);
for (int y = 0; y < mw; y++) {
QRgb *destline = (QRgb*)dest.scanLine(y);
@ -360,9 +360,9 @@ void MoonWidget::renderGraphic()
return;
}
QToolTip::remove(this);
TQToolTip::remove(this);
QToolTip::add(this, tooltip);
TQToolTip::add(this, tooltip);
}

@ -21,8 +21,8 @@
#ifndef KMOON
#define KMOON
#include <qwidget.h>
#include <qimage.h>
#include <tqwidget.h>
#include <tqimage.h>
#include <sys/types.h>
#include <time.h>
#include <ksystemtray.h>
@ -33,7 +33,7 @@ class MoonWidget : public QWidget
Q_OBJECT
public:
MoonWidget(QWidget *parent = 0, const char *name = 0);
MoonWidget(TQWidget *parent = 0, const char *name = 0);
~MoonWidget();
void calcStatus( time_t time );
@ -54,14 +54,14 @@ protected:
int _mask, old_mask;
bool old_north, _north;
QPixmap pixmap;
QString tooltip;
TQPixmap pixmap;
TQString tooltip;
void paintEvent( QPaintEvent *e);
void resizeEvent( QResizeEvent *e);
void paintEvent( TQPaintEvent *e);
void resizeEvent( TQResizeEvent *e);
private:
QImage loadMoon(int index);
TQImage loadMoon(int index);
void renderGraphic();
};

@ -25,11 +25,11 @@
#include "kimagenumber.h"
KImageNumber::KImageNumber(const QString& font, QWidget* parent,const char* name) :
QFrame(parent,name),
KImageNumber::KImageNumber(const TQString& font, TQWidget* parent,const char* name) :
TQFrame(parent,name),
m_value(0)
{
fontPix = new QPixmap(font);
fontPix = new TQPixmap(font);
resize(sizeHint());
}
@ -38,12 +38,12 @@ KImageNumber::~KImageNumber()
delete fontPix;
}
void KImageNumber::paintEvent(QPaintEvent*)
void KImageNumber::paintEvent(TQPaintEvent*)
{
int w = fontPix->width();
int each = w/11;
QString data;
TQString data;
data.sprintf("%06.1f", m_value);
for(unsigned int i=0; i < data.length(); i++) {
@ -65,15 +65,15 @@ double KImageNumber::value() const
return m_value;
}
QSize KImageNumber::sizeHint() const
TQSize KImageNumber::sizeHint() const
{
int w = fontPix->width();
int each = w/11;
QString data;
TQString data;
data.sprintf("%06.1f", m_value);
return QSize(data.length()*each, fontPix->height());
return TQSize(data.length()*each, fontPix->height());
}
#include "kimagenumber.moc"

@ -26,20 +26,20 @@
#ifndef KIMGNUM_H
#define KIMGNUM_H
#include <qframe.h>
#include <qpixmap.h>
#include <tqframe.h>
#include <tqpixmap.h>
class KImageNumber : public QFrame
{
Q_OBJECT
Q_PROPERTY( double m_value READ value WRITE setValue )
public:
KImageNumber(const QString& font, QWidget* parent=0, const char* name=0);
KImageNumber(const TQString& font, TQWidget* parent=0, const char* name=0);
virtual ~KImageNumber();
void paintEvent(QPaintEvent*);
virtual QSize sizeHint() const;
void paintEvent(TQPaintEvent*);
virtual TQSize sizeHint() const;
double value() const;
public slots:
@ -47,7 +47,7 @@ public slots:
protected:
double m_value;
QPixmap* fontPix;
TQPixmap* fontPix;
};
#endif

@ -42,8 +42,8 @@ static struct conversionEntry ConversionTable[MAX_UNIT] = {
* Note that we use installEventFilter on the two KImageNumber's
* to make clicks on them bring up the context-menu.
*/
Kodometer::Kodometer(QWidget* parent, const char* name)
: QFrame(parent, name),
Kodometer::Kodometer(TQWidget* parent, const char* name)
: TQFrame(parent, name),
dontRefresh(false),
speed(0.0),
lastDistance(0.0),
@ -88,18 +88,18 @@ Kodometer::Kodometer(QWidget* parent, const char* name)
menu->insertTitle(kapp->miniIcon(), KGlobal::instance()->aboutData()->programName());
enabledID = menu->insertItem(i18n("&Enable"), this, SLOT(toggleEnabled()));
enabledID = menu->insertItem(i18n("&Enable"), this, TQT_SLOT(toggleEnabled()));
metricID = menu->insertItem(i18n("&Metric Display"), this,
SLOT(toggleUnits()));
TQT_SLOT(toggleUnits()));
autoResetID = menu->insertItem(i18n("Auto &Reset Trip"), this,
SLOT(toggleAutoReset()));
menu->insertItem(i18n("Reset &Trip"), this, SLOT(resetTrip()));
menu->insertItem(i18n("Reset &Odometer"), this, SLOT(resetTotal()));
TQT_SLOT(toggleAutoReset()));
menu->insertItem(i18n("Reset &Trip"), this, TQT_SLOT(resetTrip()));
menu->insertItem(i18n("Reset &Odometer"), this, TQT_SLOT(resetTotal()));
menu->insertSeparator();
menu->insertItem(SmallIconSet("help"), i18n("&Help"), helpMnu);
menu->insertItem(SmallIconSet("exit"), i18n("&Quit"), this, SLOT(quit()));
menu->insertItem(SmallIconSet("exit"), i18n("&Quit"), this, TQT_SLOT(quit()));
menu->setCheckable(true);
menu->setItemChecked(enabledID, Enabled);
@ -169,10 +169,10 @@ void Kodometer::FindAllScreens(void)
* Here's where we override events to the KImgNum's to display
* the context menu
*/
bool Kodometer::eventFilter( QObject *, QEvent *e )
bool Kodometer::eventFilter( TQObject *, TQEvent *e )
{
if ( e->type() == QEvent::MouseButtonPress ) {
mousePressEvent((QMouseEvent*)e);
if ( e->type() == TQEvent::MouseButtonPress ) {
mousePressEvent((TQMouseEvent*)e);
return true;
}
return false;
@ -181,7 +181,7 @@ bool Kodometer::eventFilter( QObject *, QEvent *e )
/*
* Show the context menu
*/
void Kodometer::mousePressEvent(QMouseEvent* e)
void Kodometer::mousePressEvent(TQMouseEvent* e)
{
//FIXME fix this!
//dontRefresh = true;
@ -193,7 +193,7 @@ void Kodometer::mousePressEvent(QMouseEvent* e)
* compare it to the last known position, and then to calculate
* the distance moved.
*/
void Kodometer::timerEvent(QTimerEvent* e)
void Kodometer::timerEvent(TQTimerEvent* e)
{
if (Enabled) {
if(e->timerId() == distanceID) {
@ -237,17 +237,17 @@ void Kodometer::toggleUnits()
menu->setItemChecked(metricID, UseMetric);
QToolTip::remove(totalLabel);
QToolTip::remove(tripLabel);
TQToolTip::remove(totalLabel);
TQToolTip::remove(tripLabel);
if(!UseMetric) {
QToolTip::add(totalLabel,
TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].fromUnitTagPlural));
QToolTip::add(tripLabel,
TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].fromUnitTagPlural));
} else {
QToolTip::add(totalLabel,
TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].toUnitTagPlural));
QToolTip::add(tripLabel,
TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].toUnitTagPlural));
}
refresh();
@ -284,29 +284,29 @@ void Kodometer::refresh(void)
{
if(distanceUnit != lastDUnit) {
lastDUnit = distanceUnit;
QToolTip::remove(totalLabel);
TQToolTip::remove(totalLabel);
if(!UseMetric)
QToolTip::add(totalLabel,
TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].fromUnitTagPlural));
else
QToolTip::add(totalLabel,
TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].toUnitTagPlural));
}
if(tripDistanceUnit != lastTUnit) {
lastTUnit = tripDistanceUnit;
QToolTip::remove(tripLabel);
TQToolTip::remove(tripLabel);
if(!UseMetric)
QToolTip::add(tripLabel,
TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].fromUnitTagPlural));
else
QToolTip::add(tripLabel,
TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].toUnitTagPlural));
}
//now draw everything
QString distance_s;
QString trip_s;
TQString distance_s;
TQString trip_s;
double distance_d = 0;
double trip_d = 0;
@ -519,9 +519,9 @@ int Kodometer::CalcDistance(void)
* pretty OO world.
*/
#define THERE_IS_A_NEXT (ConversionTable[unit].maxToBeforeNext != -1.0)
QString Kodometer::FormatDistance(double &dist, Units unit)
TQString Kodometer::FormatDistance(double &dist, Units unit)
{
QString string;
TQString string;
const char *tag;
int precision;

@ -30,10 +30,10 @@
#include <math.h>
#include <qlabel.h>
#include <qptrlist.h>
#include <qkeycode.h>
#include <qtooltip.h>
#include <tqlabel.h>
#include <tqptrlist.h>
#include <tqkeycode.h>
#include <tqtooltip.h>
#include <kaboutdata.h>
#include <kuniqueapplication.h>
@ -94,15 +94,15 @@ class Kodometer : public QFrame
Q_OBJECT
public:
Kodometer(QWidget* = 0, const char* = 0);
Kodometer(TQWidget* = 0, const char* = 0);
~Kodometer() {}
void refresh(void);
void readSettings(void);
void saveSettings(void);
void timerEvent(QTimerEvent*);
void mousePressEvent(QMouseEvent*);
bool eventFilter( QObject *, QEvent *e );
void timerEvent(TQTimerEvent*);
void mousePressEvent(TQMouseEvent*);
bool eventFilter( TQObject *, TQEvent *e );
public slots:
void toggleEnabled();
@ -117,7 +117,7 @@ protected:
double multiplier(Units);
int CalcDistance(void);
QString FormatDistance(double &dist, Units);
TQString FormatDistance(double &dist, Units);
void FindAllScreens();
KImageNumber* tripLabel;
@ -131,7 +131,7 @@ protected:
int enabledID;
double speed;
QPtrList<double> speeds;
TQPtrList<double> speeds;
double lastDistance;
int distanceID;
int speedID;

@ -7,13 +7,13 @@
------------------------------------------------------------- */
#include <klocale.h>
#include <qlistview.h>
#include <tqlistview.h>
#include "tealist.h"
QString int2time(int time)
TQString int2time(int time)
{
QString str;
TQString str;
if (time / 60)
str.append(i18n("%1 min").arg(time / 60));
if (time % 60)
@ -25,14 +25,14 @@ QString int2time(int time)
}
TeaListItem::TeaListItem(QListView * parent)
:QListViewItem(parent)
TeaListItem::TeaListItem(TQListView * parent)
:TQListViewItem(parent)
{
}
TeaListItem::TeaListItem(QListView * parent, QListViewItem *after)
:QListViewItem(parent, after)
TeaListItem::TeaListItem(TQListView * parent, TQListViewItem *after)
:TQListViewItem(parent, after)
{
}
@ -43,17 +43,17 @@ TeaListItem::~TeaListItem()
void TeaListItem::setTime(int t)
{
QListViewItem::setText(1, int2time(t));
TQListViewItem::setText(1, int2time(t));
tim = t;
}
void TeaListItem::setName(const QString &n)
void TeaListItem::setName(const TQString &n)
{
nam = n;
QListViewItem::setText(0, n);
TQListViewItem::setText(0, n);
}
QString TeaListItem::name()
TQString TeaListItem::name()
{
return nam;
}

@ -8,7 +8,7 @@
#ifndef TEALIST_H
#define TEALIST_H
#include <qstring.h>
#include <tqstring.h>
class QListView;
class QListViewItem;
@ -18,20 +18,20 @@ class TeaListItem : public QListViewItem
{
public:
TeaListItem(QListView *parent);
TeaListItem(QListView *parent, QListViewItem *after);
TeaListItem(TQListView *parent);
TeaListItem(TQListView *parent, TQListViewItem *after);
~TeaListItem();
int time();
QString name();
TQString name();
void setTime(int v);
void setName(const QString &n);
void setName(const TQString &n);
private:
int tim;
QString nam;
TQString nam;
};
QString int2time(int t);
TQString int2time(int t);
#endif

@ -7,14 +7,14 @@
------------------------------------------------------------- */
#include <klocale.h>
#include <qlabel.h>
#include <qlayout.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include "timeedit.h"
#include "timeedit.moc"
WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, QWidget *parent, const char *name)
: QSpinBox(minValue, maxValue, step, parent, name)
WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, TQWidget *parent, const char *name)
: TQSpinBox(minValue, maxValue, step, parent, name)
{
}
@ -23,7 +23,7 @@ WrappingSpinBox::~WrappingSpinBox()
}
/** Overloaded QSpinBox method */
/** Overloaded TQSpinBox method */
void WrappingSpinBox::stepUp()
{
bool wrap = false;
@ -31,16 +31,16 @@ void WrappingSpinBox::stepUp()
wrap = true;
if (wrap)
emit wrapUp(); // must wrap first (to avoid double-step-up)
QSpinBox::stepUp();
TQSpinBox::stepUp();
}
/** Overloaded QSpinBox method */
/** Overloaded TQSpinBox method */
void WrappingSpinBox::stepDown()
{
bool wrap = false;
if (value() == 0)
wrap = true;
QSpinBox::stepDown();
TQSpinBox::stepDown();
if (wrap)
emit wrapDown();
}
@ -49,20 +49,20 @@ void WrappingSpinBox::stepDown()
// -------------------------------------------------------------------------
TimeEdit::TimeEdit(QWidget* parent, const char* name)
: QWidget(parent, name)
TimeEdit::TimeEdit(TQWidget* parent, const char* name)
: TQWidget(parent, name)
{
layout = new QHBoxLayout(this);
minuteBox = new QSpinBox(0, 300, 1, this);
layout = new TQHBoxLayout(this);
minuteBox = new TQSpinBox(0, 300, 1, this);
// minuteBox->setFixedSize(minuteBox->sizeHint());
QLabel* min = new QLabel(i18n(" min"), this);
TQLabel* min = new TQLabel(i18n(" min"), this);
min->setFixedSize(min->sizeHint());
secondBox = new WrappingSpinBox(0, 59, 1, this);
secondBox->setWrapping(true);
// secondBox->setFixedSize(secondBox->sizeHint());
QLabel* sec = new QLabel(i18n(" sec"),this);
TQLabel* sec = new TQLabel(i18n(" sec"),this);
sec->setFixedSize(sec->sizeHint());
layout->addWidget(minuteBox);
@ -71,10 +71,10 @@ TimeEdit::TimeEdit(QWidget* parent, const char* name)
layout->addWidget(secondBox);
layout->addWidget(sec);
connect(minuteBox, SIGNAL(valueChanged(int)), SLOT(spinBoxValueChanged(int)) );
connect(secondBox, SIGNAL(valueChanged(int)), SLOT(spinBoxValueChanged(int)) );
connect(secondBox, SIGNAL(wrapUp()), SLOT(wrappedUp()));
connect(secondBox, SIGNAL(wrapDown()), SLOT(wrappedDown()));
connect(minuteBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) );
connect(secondBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) );
connect(secondBox, TQT_SIGNAL(wrapUp()), TQT_SLOT(wrappedUp()));
connect(secondBox, TQT_SIGNAL(wrapDown()), TQT_SLOT(wrappedDown()));
}
TimeEdit::~TimeEdit()
@ -139,7 +139,7 @@ void TimeEdit::spinBoxValueChanged(int)
emit valueChanged(value());
}
/** SLOT (overloading QSpinBox): set focus */
/** TQT_SLOT (overloading TQSpinBox): set focus */
void TimeEdit::setFocus()
{
minuteBox->setFocus();

@ -8,8 +8,8 @@
#ifndef TIMEEDIT_H
#define TIMEEDIT_H
#include <qspinbox.h>
#include <qwidget.h>
#include <tqspinbox.h>
#include <tqwidget.h>
class QBoxLayout;
@ -23,7 +23,7 @@ class WrappingSpinBox : public QSpinBox
Q_OBJECT
public:
WrappingSpinBox(int minValue, int maxValue, int step = 1, QWidget *parent=0, const char *name=0);
WrappingSpinBox(int minValue, int maxValue, int step = 1, TQWidget *parent=0, const char *name=0);
~WrappingSpinBox();
void stepUp();
@ -44,7 +44,7 @@ class TimeEdit : public QWidget
Q_OBJECT
public:
TimeEdit(QWidget* parent = 0, const char* name = 0);
TimeEdit(TQWidget* parent = 0, const char* name = 0);
~TimeEdit();
void setValue(int value);
@ -63,9 +63,9 @@ signals:
protected:
QSpinBox *minuteBox;
TQSpinBox *minuteBox;
WrappingSpinBox *secondBox;
QBoxLayout* layout;
TQBoxLayout* layout;
};
#endif

@ -23,20 +23,20 @@
#include <stdlib.h>
#include <assert.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qvbox.h>
#include <qlineedit.h>
#include <qpainter.h>
#include <qtooltip.h>
#include <qfile.h>
#include <qcursor.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qheader.h>
#include <qpixmap.h>
#include <qbitmap.h>
#include <tqcheckbox.h>
#include <tqlayout.h>
#include <tqhbox.h>
#include <tqvbox.h>
#include <tqlineedit.h>
#include <tqpainter.h>
#include <tqtooltip.h>
#include <tqfile.h>
#include <tqcursor.h>
#include <tqpushbutton.h>
#include <tqgroupbox.h>
#include <tqheader.h>
#include <tqpixmap.h>
#include <tqbitmap.h>
#include <kconfig.h>
#include <khelpmenu.h>
@ -64,7 +64,7 @@ const int TopLevel::DEFAULT_TEA_TIME = 3*60;
TopLevel::TopLevel() : KSystemTray()
{
setBackgroundMode(X11ParentRelative); // what for?
QString n, key;
TQString n, key;
unsigned int num;
teas.clear();
@ -76,7 +76,7 @@ TopLevel::TopLevel() : KSystemTray()
// assuming this is a new-style config
num = config->readNumEntry("Number", 0);
teas.resize(num);
QString tempstr;
TQString tempstr;
for (unsigned int index=1; index<=num; ++index) {
key.sprintf("Tea%d Time", index);
tempstr = config->readEntry(key, NULL);
@ -118,24 +118,24 @@ TopLevel::TopLevel() : KSystemTray()
startAct = new KAction(i18n("&Start"), "1rightarrow", 0,
this, SLOT(start()), actionCollection(), "start");
this, TQT_SLOT(start()), actionCollection(), "start");
stopAct = new KAction(i18n("Sto&p"), "cancel", 0,
this, SLOT(stop()), actionCollection(), "stop");
this, TQT_SLOT(stop()), actionCollection(), "stop");
confAct = new KAction(i18n("&Configure..."), "configure", 0,
this, SLOT(config()), actionCollection(), "configure");
this, TQT_SLOT(config()), actionCollection(), "configure");
anonAct = new KAction(i18n("&Anonymous..."), 0, 0,
this, SLOT(anonymous()), actionCollection(), "anonymous");
this, TQT_SLOT(anonymous()), actionCollection(), "anonymous");
// KAction *quitAct = actionCollection()->action("file_quit");
// create app menu (displayed on right-click)
menu = new QPopupMenu();
menu = new TQPopupMenu();
menu->setCheckable(true);
connect(menu, SIGNAL(activated(int)), this, SLOT(teaSelected(int)));
connect(menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(teaSelected(int)));
// this menu will be displayed when no tea is steeping, and left mouse button is clicked
start_menu = new QPopupMenu();
start_menu = new TQPopupMenu();
start_menu->setCheckable(true); // menu isn't tickable, but this gives some add. spacing
connect(start_menu, SIGNAL(activated(int)), this, SLOT(teaStartSelected(int)));
connect(start_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(teaStartSelected(int)));
rebuildTeaMenus(); // populate tops of menus with tea-entries from config
@ -152,13 +152,13 @@ TopLevel::TopLevel() : KSystemTray()
menu->insertSeparator();
confAct->plug(menu);
menu->insertItem(SmallIcon("help"), i18n("&Help"), helpMnu);
menu->insertItem(SmallIcon("exit"), i18n("Quit"), kapp, SLOT(quit()));
menu->insertItem(SmallIcon("exit"), i18n("Quit"), kapp, TQT_SLOT(quit()));
// quitAct->plug(menu); // FIXME: this doesn't seem to work with above definition of quitAct?
// (need special 'quit'-method?)
// this menu will be displayed when a tea is steeping, and left mouse button is clicked
steeping_menu = new QPopupMenu();
// steeping_menu->insertItem(SmallIcon("cancel"), i18n("Just &Cancel Current"), this, SLOT(stop()));
steeping_menu = new TQPopupMenu();
// steeping_menu->insertItem(SmallIcon("cancel"), i18n("Just &Cancel Current"), this, TQT_SLOT(stop()));
stopAct->plug(steeping_menu); // FIXME: can provide different text for this incarnation?
// start_menu->insertSeparator();
@ -201,7 +201,7 @@ TopLevel::~TopLevel()
// FIXME: must delete more (like all the QWidgets in config-window)?
}
void TopLevel::resizeEvent ( QResizeEvent * )
void TopLevel::resizeEvent ( TQResizeEvent * )
{
mugPixmap = loadSizedIcon("mug", width());
teaNotReadyPixmap = loadSizedIcon("tea_not_ready", width());
@ -211,26 +211,26 @@ void TopLevel::resizeEvent ( QResizeEvent * )
}
/** Handle mousePressEvent */
void TopLevel::mousePressEvent(QMouseEvent *event)
void TopLevel::mousePressEvent(TQMouseEvent *event)
{
if (event->button() == LeftButton) {
if (ready) {
stop(); // reset tooltip and stop animation
} else {
if (running)
steeping_menu->popup(QCursor::pos());
steeping_menu->popup(TQCursor::pos());
else
start_menu->popup(QCursor::pos());
start_menu->popup(TQCursor::pos());
}
} else if (event->button() == RightButton)
menu->popup(QCursor::pos());
menu->popup(TQCursor::pos());
// else if (event->button() == MidButton) // currently unused
}
/** Handle paintEvent (ie. animate icon) */
void TopLevel::paintEvent(QPaintEvent *)
void TopLevel::paintEvent(TQPaintEvent *)
{
QPixmap *pm = &mugPixmap;
TQPixmap *pm = &mugPixmap;
if (running) {
if (useTrayVis)
@ -239,7 +239,7 @@ void TopLevel::paintEvent(QPaintEvent *)
pm = &teaNotReadyPixmap; // generic "steeping" icon
} else {
// use simple two-frame "animation"
// FIXME: how about using a QMovie instead? (eg. MNG)
// FIXME: how about using a TQMovie instead? (eg. MNG)
if (ready) {
if (firstFrame)
pm = &teaAnim1Pixmap;
@ -249,11 +249,11 @@ void TopLevel::paintEvent(QPaintEvent *)
}
// overlay pie chart onto tray icon
QPixmap base(*pm); // make copy of base pixmap
TQPixmap base(*pm); // make copy of base pixmap
if (useTrayVis && running) {
// extend mask
QBitmap mask = *(base.mask());
QPainter pm(&mask);
TQBitmap mask = *(base.mask());
TQPainter pm(&mask);
pm.setBrush(Qt::color1); // fill with "foreground-colour"
pm.setPen(Qt::NoPen); // no border needed/wanted
pm.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16); // full circle of small size
@ -262,21 +262,21 @@ void TopLevel::paintEvent(QPaintEvent *)
base.setMask(mask);
// draw pie chart
QPainter px(&base);
px.setPen(QPen(Qt::black, 0)); // black border
px.setBrush(QColor(192, 0, 0)); // red fill colour for small circle
TQPainter px(&base);
px.setPen(TQPen(Qt::black, 0)); // black border
px.setBrush(TQColor(192, 0, 0)); // red fill colour for small circle
px.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16);
px.setBrush(QColor(0, 192, 0)); // green fill colour for pie part
px.setBrush(TQColor(0, 192, 0)); // green fill colour for pie part
px.drawPie(0, ((float) width()/(float) 2.44444444444), ((float) width()/(float) 1.69230769231), ((float) width()/(float) 1.69230769231), 90*16, percentDone*16);
px.end();
}
// FIXME: over-emphasize first and last few percent? (for better visibility)
// FIXME: some optimizations (eg. store pre-drawn QPixmap with small circle)
// FIXME: some optimizations (eg. store pre-drawn TQPixmap with small circle)
// (and use drawEllipse() instead of drawPie() for small circle!)
// set new tray icon
QPainter p(this);
TQPainter p(this);
int x = 1 + (((float) width()/(float) 1.83333333333) - pm->width()/2);
int y = 1 + (((float) width()/(float) 1.83333333333) - pm->height()/2);
p.drawPixmap(x, y, base);
@ -284,7 +284,7 @@ void TopLevel::paintEvent(QPaintEvent *)
}
/** Check timer and initiate appropriate action if finished */
void TopLevel::timerEvent(QTimerEvent *)
void TopLevel::timerEvent(TQTimerEvent *)
{
if (running) {
// a tea is steeping; must count down
@ -302,15 +302,15 @@ void TopLevel::timerEvent(QTimerEvent *)
menu->setItemChecked(current_selected, true);
}
QString teaMessage = i18n("The %1 is now ready!").arg(current_name);
TQString teaMessage = i18n("The %1 is now ready!").arg(current_name);
// invoke action
if (useNotify) {
KNotifyClient::event(winId(), "tea", teaMessage);
}
if (useAction && (!action.isEmpty())) {
QString cmd = action;
TQString cmd = action;
cmd.replace("%t", current_name);
system(QFile::encodeName(cmd));
system(TQFile::encodeName(cmd));
}
if (usePopup)
KPassivePopup::message(i18n("The Tea Cooker"),
@ -329,7 +329,7 @@ void TopLevel::timerEvent(QTimerEvent *)
}
}
// ...and Tooltip
QString min = int2time(seconds);
TQString min = int2time(seconds);
setToolTip(i18n("%1 left for %2").arg(min).arg(current_name));
}
} else {
@ -342,7 +342,7 @@ void TopLevel::timerEvent(QTimerEvent *)
}
/** update ToolTip */
void TopLevel::setToolTip(const QString &text, bool force)
void TopLevel::setToolTip(const TQString &text, bool force)
{
// don't update if text hasn't changed
if (lastTip == text)
@ -352,8 +352,8 @@ void TopLevel::setToolTip(const QString &text, bool force)
// FIXME: this isn't too nice: currently mouse must stay outside for >1s for update to occur
if (force || !this->hasMouse() || (lastTip == i18n("The Tea Cooker"))) {
lastTip = text;
QToolTip::remove(this);
QToolTip::add(this, text);
TQToolTip::remove(this);
TQToolTip::add(this, text);
}
}
@ -369,9 +369,9 @@ void TopLevel::rebuildTeaMenus() {
// now add new tea-entries to top of menus
int id = 0;
int index = 0;
for (QValueVector<tea_struct>::ConstIterator it=teas.begin(); it != teas.end(); ++it) {
for (TQValueVector<tea_struct>::ConstIterator it=teas.begin(); it != teas.end(); ++it) {
// construct string with name and steeping time
QString str = it->name;
TQString str = it->name;
str.append(" (");
str.append(int2time(it->time));
str.append(")");
@ -478,18 +478,18 @@ void TopLevel::anonymous()
anondlg = new KDialogBase(KDialogBase::Plain, i18n("Anonymous Tea"),
KDialogBase::Ok | KDialogBase::Cancel,
KDialogBase::Ok, this, "anonymous", true);
QWidget *page = anondlg->plainPage();
QBoxLayout *top_box = new QVBoxLayout(page);
QBoxLayout *prop_box = new QHBoxLayout(top_box);
QVBox *propleft = new QVBox(page);
TQWidget *page = anondlg->plainPage();
TQBoxLayout *top_box = new TQVBoxLayout(page);
TQBoxLayout *prop_box = new TQHBoxLayout(top_box);
TQVBox *propleft = new TQVBox(page);
prop_box->addWidget(propleft);
QVBox *propright = new QVBox(page);
TQVBox *propright = new TQVBox(page);
prop_box->addWidget(propright);
anon_time = new TimeEdit(propright);
anon_time->setFixedHeight(anon_time->sizeHint().height());
anon_time->setValue(DEFAULT_TEA_TIME);
QLabel *l = new QLabel(anon_time, i18n("Tea time:"), propleft);
TQLabel *l = new TQLabel(anon_time, i18n("Tea time:"), propleft);
l->setFixedSize(l->sizeHint());
top_box->addStretch();
@ -501,7 +501,7 @@ void TopLevel::anonymous()
// (why? - better use LRU, and save that to config)
}
if (anondlg->exec() == QDialog::Accepted) {
if (anondlg->exec() == TQDialog::Accepted) {
shooting = true;
if (!listempty)
menu->setItemChecked(current_selected, false); // no item is to be checked
@ -557,7 +557,7 @@ void TopLevel::listBoxItemSelected() {
}
/* config-slot: name of a tea edited */
void TopLevel::nameEditTextChanged(const QString& newText) {
void TopLevel::nameEditTextChanged(const TQString& newText) {
/* this method also gets called when the last TeaListItem has been deleted
* (to clear the name edit widget), so check for empty listbox */
if (listbox->currentItem() != NULL) {
@ -618,7 +618,7 @@ void TopLevel::delButtonClicked() {
/* config-slot: "up" button clicked */
void TopLevel::upButtonClicked() {
QListViewItem* item = listbox->currentItem();
TQListViewItem* item = listbox->currentItem();
if (item && item->itemAbove())
item->itemAbove()->moveItem(item);
@ -628,7 +628,7 @@ void TopLevel::upButtonClicked() {
/* config-slot: "down" button clicked */
void TopLevel::downButtonClicked() {
QListViewItem* item = listbox->currentItem();
TQListViewItem* item = listbox->currentItem();
if (item && item->itemBelow())
item->moveItem(item->itemBelow());
@ -661,118 +661,118 @@ void TopLevel::config()
confdlg = new KDialogBase(KDialogBase::Plain, i18n("Configure Tea Cooker"),
KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help,
KDialogBase::Ok, this, "config", true);
QWidget *page = confdlg->plainPage();
TQWidget *page = confdlg->plainPage();
// FIXME: enforce sensible initial/default size of dialog
// FIXME: modal is ok, but can avoid always-on-top?
QBoxLayout *top_box = new QVBoxLayout(page, 0, 8); // whole config-stuff
QBoxLayout *box = new QHBoxLayout(top_box); // list + properties
TQBoxLayout *top_box = new TQVBoxLayout(page, 0, 8); // whole config-stuff
TQBoxLayout *box = new TQHBoxLayout(top_box); // list + properties
/* left side - tea list and list-modifying buttons */
QBoxLayout *leftside = new QVBoxLayout(box);
QGroupBox *listgroup = new QGroupBox(2, Vertical, i18n("Tea List"), page);
TQBoxLayout *leftside = new TQVBoxLayout(box);
TQGroupBox *listgroup = new TQGroupBox(2, Vertical, i18n("Tea List"), page);
leftside->addWidget(listgroup, 0, 0);
listbox = new QListView(listgroup, "listBox");
listbox = new TQListView(listgroup, "listBox");
listbox->addColumn(i18n("Name"));
listbox->header()->setClickEnabled(false, listbox->header()->count()-1);
listbox->addColumn(i18n("Time"));
listbox->header()->setClickEnabled(false, listbox->header()->count()-1);
listbox->setSorting(-1);
connect(listbox, SIGNAL(selectionChanged()), SLOT(listBoxItemSelected()));
connect(listbox, TQT_SIGNAL(selectionChanged()), TQT_SLOT(listBoxItemSelected()));
// now buttons for editing the tea-list
QWidget *listgroup_widget = new QWidget(listgroup);
QBoxLayout *hbox = new QHBoxLayout(listgroup_widget);
TQWidget *listgroup_widget = new TQWidget(listgroup);
TQBoxLayout *hbox = new TQHBoxLayout(listgroup_widget);
hbox->setSpacing(4);
btn_new = new QPushButton(QString::null, listgroup_widget);
QToolTip::add(btn_new, i18n("New"));
btn_new = new TQPushButton(TQString::null, listgroup_widget);
TQToolTip::add(btn_new, i18n("New"));
btn_new->setPixmap(SmallIcon("filenew"));
btn_new->setMinimumSize(btn_new->sizeHint() * 1.2);
connect(btn_new, SIGNAL(clicked()), SLOT(newButtonClicked()));
connect(btn_new, TQT_SIGNAL(clicked()), TQT_SLOT(newButtonClicked()));
hbox->addWidget(btn_new);
btn_del = new QPushButton(QString::null, listgroup_widget);
QToolTip::add(btn_del, i18n("Delete"));
btn_del = new TQPushButton(TQString::null, listgroup_widget);
TQToolTip::add(btn_del, i18n("Delete"));
btn_del->setIconSet(SmallIconSet("editdelete"));
btn_del->setMinimumSize(btn_new->sizeHint() * 1.2);
connect(btn_del, SIGNAL(clicked()), SLOT(delButtonClicked()));
connect(btn_del, TQT_SIGNAL(clicked()), TQT_SLOT(delButtonClicked()));
hbox->addWidget(btn_del);
btn_up = new QPushButton(QString::null, listgroup_widget);
QToolTip::add(btn_up, i18n("Up"));
btn_up = new TQPushButton(TQString::null, listgroup_widget);
TQToolTip::add(btn_up, i18n("Up"));
btn_up->setIconSet(SmallIconSet("up"));
btn_up->setMinimumSize(btn_up->sizeHint() * 1.2);
connect(btn_up, SIGNAL(clicked()), SLOT(upButtonClicked()));
connect(btn_up, TQT_SIGNAL(clicked()), TQT_SLOT(upButtonClicked()));
hbox->addWidget(btn_up);
btn_down = new QPushButton(QString::null, listgroup_widget);
QToolTip::add(btn_down, i18n("Down"));
btn_down = new TQPushButton(TQString::null, listgroup_widget);
TQToolTip::add(btn_down, i18n("Down"));
btn_down->setIconSet(SmallIconSet("down"));
btn_down->setMinimumSize(btn_down->sizeHint() * 1.2);
connect(btn_down, SIGNAL(clicked()), SLOT(downButtonClicked()));
connect(btn_down, TQT_SIGNAL(clicked()), TQT_SLOT(downButtonClicked()));
hbox->addWidget(btn_down);
hbox->addStretch(10);
/* right side - tea properties */
QBoxLayout *rightside = new QVBoxLayout(box);
editgroup = new QGroupBox(2, Vertical, i18n("Tea Properties"), page);
TQBoxLayout *rightside = new TQVBoxLayout(box);
editgroup = new TQGroupBox(2, Vertical, i18n("Tea Properties"), page);
rightside->addWidget(editgroup, 0, 0);
QHBox *propbox = new QHBox(editgroup);
TQHBox *propbox = new TQHBox(editgroup);
// FIXME: - must enforce correct vertical alignment of each label-editor pair
// (better use one HBox for each label-editor pair?)
QVBox *propleft = new QVBox(propbox);
QVBox *propright = new QVBox(propbox);
nameEdit = new QLineEdit(propright);
TQVBox *propleft = new TQVBox(propbox);
TQVBox *propright = new TQVBox(propbox);
nameEdit = new TQLineEdit(propright);
nameEdit->setFixedHeight(nameEdit->sizeHint().height());
nameEdit->setAlignment(QLineEdit::AlignLeft);
QLabel *l = new QLabel(nameEdit, i18n("Name:"), propleft);
nameEdit->setAlignment(TQLineEdit::AlignLeft);
TQLabel *l = new TQLabel(nameEdit, i18n("Name:"), propleft);
l->setFixedSize(l->sizeHint());
connect(nameEdit, SIGNAL(textChanged(const QString&)), SLOT(nameEditTextChanged(const QString&)) );
connect(nameEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(nameEditTextChanged(const TQString&)) );
timeEdit = new TimeEdit(propright);
timeEdit->setFixedHeight(timeEdit->sizeHint().height());
l = new QLabel(timeEdit, i18n("Tea time:"), propleft);
l = new TQLabel(timeEdit, i18n("Tea time:"), propleft);
l->setFixedSize(l->sizeHint());
connect(timeEdit, SIGNAL(valueChanged(int)), SLOT(spinBoxValueChanged(int)));
connect(timeEdit, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)));
/* bottom - timeout actions */
QGroupBox *actiongroup = new QGroupBox(4, Vertical, i18n("Action"), page);
TQGroupBox *actiongroup = new TQGroupBox(4, Vertical, i18n("Action"), page);
top_box->addWidget(actiongroup, 0, 0);
QWidget *actionconf_widget = new QWidget(actiongroup);
QBoxLayout *actionconf_hbox = new QHBoxLayout(actionconf_widget);
btn_conf = new QPushButton(i18n("Configure Events..."), actionconf_widget);
TQWidget *actionconf_widget = new TQWidget(actiongroup);
TQBoxLayout *actionconf_hbox = new TQHBoxLayout(actionconf_widget);
btn_conf = new TQPushButton(i18n("Configure Events..."), actionconf_widget);
actionconf_hbox->addWidget(btn_conf);
connect(btn_conf, SIGNAL(clicked()), SLOT(confButtonClicked()));
connect(btn_conf, TQT_SIGNAL(clicked()), TQT_SLOT(confButtonClicked()));
actionconf_hbox->addStretch(10);
eventEnable = new QCheckBox(i18n("Event"), actiongroup);
popupEnable = new QCheckBox(i18n("Popup"), actiongroup);
eventEnable = new TQCheckBox(i18n("Event"), actiongroup);
popupEnable = new TQCheckBox(i18n("Popup"), actiongroup);
eventEnable->setFixedHeight(eventEnable->sizeHint().height());
popupEnable->setFixedHeight(popupEnable->sizeHint().height());
QHBox *actionbox = new QHBox(actiongroup);
actionEnable = new QCheckBox(actionbox);
TQHBox *actionbox = new TQHBox(actiongroup);
actionEnable = new TQCheckBox(actionbox);
// FIXME: add text to this line:
// QLabel *actionLabel = new QLabel(i18n("Execute: "), actiongroup);
actionEdit = new QLineEdit(actionbox);
// TQLabel *actionLabel = new TQLabel(i18n("Execute: "), actiongroup);
actionEdit = new TQLineEdit(actionbox);
actionEdit->setFixedHeight(actionEdit->sizeHint().height());
QToolTip::add(actionEdit, i18n("Enter command here; '%t' will be replaced with name of steeping tea"));
connect(actionEnable, SIGNAL(toggled(bool)), SLOT(actionEnableToggled(bool)));
TQToolTip::add(actionEdit, i18n("Enter command here; '%t' will be replaced with name of steeping tea"));
connect(actionEnable, TQT_SIGNAL(toggled(bool)), TQT_SLOT(actionEnableToggled(bool)));
rightside->addStretch();
// single checkbox
visEnable = new QCheckBox(i18n("Visualize progress in icon tray"), page);
visEnable = new TQCheckBox(i18n("Visualize progress in icon tray"), page);
top_box->addWidget(visEnable, 0, 0);
// let listbox claim all remaining vertical space
top_box->setStretchFactor(box, 10);
connect(confdlg, SIGNAL(helpClicked()), SLOT(help()));
connect(confdlg, TQT_SIGNAL(helpClicked()), TQT_SLOT(help()));
}
// now add all defined teas (and their times) to the listview
@ -805,7 +805,7 @@ void TopLevel::config()
actionEdit->setEnabled(useAction);
visEnable->setChecked(useTrayVis);
if (confdlg->exec() == QDialog::Accepted)
if (confdlg->exec() == TQDialog::Accepted)
{
// activate new settings
useNotify = eventEnable->isChecked();
@ -820,7 +820,7 @@ void TopLevel::config()
int i = 0;
teas.clear();
teas.resize(listbox->childCount());
for (QListViewItemIterator it(listbox); it.current() != 0; ++it) {
for (TQListViewItemIterator it(listbox); it.current() != 0; ++it) {
teas[i].name = static_cast<TeaListItem *>(it.current())->name();
teas[i].time = static_cast<TeaListItem *>(it.current())->time();
if (it.current() == current_item)
@ -849,9 +849,9 @@ void TopLevel::config()
config->deleteGroup("Teas", true); // deep remove of whole group
config->setGroup("Teas");
config->writeEntry("Number", teas.count());
QString key;
TQString key;
int index = 1;
for (QValueVector<tea_struct>::ConstIterator it = teas.begin(); it != teas.end(); ++it) {
for (TQValueVector<tea_struct>::ConstIterator it = teas.begin(); it != teas.end(); ++it) {
key.sprintf("Tea%d Name", index);
config->writeEntry(key, it->name);
key.sprintf("Tea%d Time", index);

@ -24,16 +24,16 @@
#define TOPLEVEL_H
#include <kapplication.h>
#include <qpopupmenu.h>
#include <qtimer.h>
#include <qlineedit.h>
#include <qvaluevector.h>
#include <qlistview.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <tqpopupmenu.h>
#include <tqtimer.h>
#include <tqlineedit.h>
#include <tqvaluevector.h>
#include <tqlistview.h>
#include <tqpushbutton.h>
#include <tqgroupbox.h>
#include <knuminput.h>
#include <ksystemtray.h>
#include <qpixmap.h>
#include <tqpixmap.h>
class KAction;
class KDialogBase;
@ -51,10 +51,10 @@ public:
protected:
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *);
void timerEvent(QTimerEvent *);
void resizeEvent(QResizeEvent *);
void paintEvent(TQPaintEvent *);
void mousePressEvent(TQMouseEvent *);
void timerEvent(TQTimerEvent *);
void resizeEvent(TQResizeEvent *);
private slots:
@ -65,11 +65,11 @@ private slots:
void config();
void help();
void anonymous();
void setToolTip(const QString &text, bool force=false);
void setToolTip(const TQString &text, bool force=false);
void rebuildTeaMenus();
void listBoxItemSelected();
void nameEditTextChanged(const QString& newText);
void nameEditTextChanged(const TQString& newText);
void spinBoxValueChanged(int v);
void newButtonClicked();
void delButtonClicked();
@ -87,10 +87,10 @@ private:
static const int DEFAULT_TEA_TIME;
struct tea_struct {
QString name;
TQString name;
int time;
};
QValueVector<tea_struct> teas; // list of tea-names and times
TQValueVector<tea_struct> teas; // list of tea-names and times
bool running, ready, firstFrame, listempty;
int seconds; // variable for counting down seconds
@ -98,28 +98,28 @@ private:
int percentDone; // ok, this isn't really "per 100", but "per 360"
unsigned current_selected; // index of currently +selected+ tea in menu
QListViewItem *current_item; // ptr to currently +selected+ tea in ListView
QString current_name; // name of currently +running+ tea (if any)
TQListViewItem *current_item; // ptr to currently +selected+ tea in ListView
TQString current_name; // name of currently +running+ tea (if any)
bool shooting; // anonymous tea currently steeping?
bool useNotify, usePopup, useAction;
QString action;
TQString action;
bool useTrayVis; // visualize progress in tray icon
QPixmap mugPixmap, teaNotReadyPixmap, teaAnim1Pixmap, teaAnim2Pixmap;
TQPixmap mugPixmap, teaNotReadyPixmap, teaAnim1Pixmap, teaAnim2Pixmap;
KAction *startAct, *stopAct, *confAct, *anonAct;
QPopupMenu *menu, *steeping_menu, *start_menu;
QListView *listbox;
QLineEdit *nameEdit, *actionEdit;
TQPopupMenu *menu, *steeping_menu, *start_menu;
TQListView *listbox;
TQLineEdit *nameEdit, *actionEdit;
TimeEdit *timeEdit;
QGroupBox *editgroup;
QPushButton *btn_new, *btn_del, *btn_up, *btn_down, *btn_conf;
TQGroupBox *editgroup;
TQPushButton *btn_new, *btn_del, *btn_up, *btn_down, *btn_conf;
QString lastTip;
TQString lastTip;
KDialogBase *anondlg, *confdlg;
TimeEdit *anon_time;
QCheckBox *eventEnable, *popupEnable, *actionEnable, *visEnable;
TQCheckBox *eventEnable, *popupEnable, *actionEnable, *visEnable;
};
#endif

@ -1,16 +1,16 @@
//-----------------------------------------------------------------------------
//
// KTux - QCanvas based screensaver
// KTux - TQCanvas based screensaver
//
// Copyright (c) Martin R. Jones 1999
//
#include <stdlib.h>
#include <time.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include <qlayout.h>
#include <qslider.h>
#include <tqlabel.h>
#include <tqmessagebox.h>
#include <tqlayout.h>
#include <tqslider.h>
#include <kstandarddirs.h>
#include <klocale.h>
#include <kdebug.h>
@ -35,7 +35,7 @@ extern "C"
return new KSpriteSaver( id );
}
KDE_EXPORT QDialog *kss_setup()
KDE_EXPORT TQDialog *kss_setup()
{
return new KSpriteSetup();
}
@ -43,8 +43,8 @@ extern "C"
//-----------------------------------------------------------------------------
KSpriteSetup::KSpriteSetup( QWidget *parent, const char *name )
: QDialog( parent, name, TRUE )
KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name )
: TQDialog( parent, name, TRUE )
{
KGlobal::locale()->insertCatalogue("ktux");
saver = 0;
@ -53,22 +53,22 @@ KSpriteSetup::KSpriteSetup( QWidget *parent, const char *name )
setCaption(i18n("Setup KTux") );
QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
QHBoxLayout *tl1 = new QHBoxLayout;
TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
TQHBoxLayout *tl1 = new QHBoxLayout;
tl->addLayout(tl1);
QVBoxLayout *tl11 = new QVBoxLayout(5);
TQVBoxLayout *tl11 = new TQVBoxLayout(5);
tl1->addLayout(tl11);
QLabel *label = new QLabel( i18n("Speed:"), this );
TQLabel *label = new TQLabel( i18n("Speed:"), this );
label->setMinimumSize(label->sizeHint());
tl11->addStretch(1);
tl11->addWidget(label);
QSlider *sb = new QSlider(0, 100, 10, speed, QSlider::Horizontal, this );
TQSlider *sb = new TQSlider(0, 100, 10, speed, TQSlider::Horizontal, this );
tl11->addWidget(sb);
connect( sb, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) );
connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) );
preview = new QWidget( this );
preview = new TQWidget( this );
preview->setFixedSize( 220, 170 );
preview->setBackgroundColor( black );
preview->show(); // otherwise saver does not get correct size
@ -76,15 +76,15 @@ KSpriteSetup::KSpriteSetup( QWidget *parent, const char *name )
tl1->addWidget(preview);
KButtonBox *bbox = new KButtonBox(this);
QButton *button = bbox->addButton( i18n("About"));
connect( button, SIGNAL( clicked() ), SLOT(slotAbout() ) );
TQButton *button = bbox->addButton( i18n("About"));
connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT(slotAbout() ) );
bbox->addStretch(1);
button = bbox->addButton( KStdGuiItem::ok());
connect( button, SIGNAL( clicked() ), SLOT( slotOkPressed() ) );
connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOkPressed() ) );
button = bbox->addButton(KStdGuiItem::cancel());
connect( button, SIGNAL( clicked() ), SLOT( reject() ) );
connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) );
bbox->layout();
tl->addWidget(bbox);
@ -128,7 +128,7 @@ void KSpriteSetup::slotOkPressed()
void KSpriteSetup::slotAbout()
{
QMessageBox::message(i18n("About KTux"),
TQMessageBox::message(i18n("About KTux"),
i18n("KTux Version 1.0\n\nWritten by Martin R. Jones 1999\nmjones@kde.org"),
i18n("OK"));
}
@ -144,7 +144,7 @@ KSpriteSaver::KSpriteSaver( WId id ) : KScreenSaver( id )
readSettings();
blank();
connect(&mTimer, SIGNAL(timeout()), SLOT(slotTimeout()));
connect(&mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()));
mTimer.start(120-mSpeed, true);
}
@ -169,14 +169,14 @@ void KSpriteSaver::setSpeed(int speed)
//
void KSpriteSaver::readSettings()
{
QString str;
TQString str;
KConfig *config = KGlobal::config();
config->setGroup("Settings");
mSpeed = config->readNumEntry("Speed", 50);
QString path = KGlobal::dirs()->findResourceDir( "sprite", "bg.png" );
TQString path = KGlobal::dirs()->findResourceDir( "sprite", "bg.png" );
SpritePixmapManager::manager()->setPixmapDir(path);
@ -184,7 +184,7 @@ void KSpriteSaver::readSettings()
KSimpleConfig *mConfig = new KSimpleConfig(path, true);
mConfig->setGroup("Config");
QStrList list;
TQStrList list;
int groups = mConfig->readListEntry("Groups", list);
mTimerIds.resize(groups);
for (int i = 0; i < groups; i++)
@ -201,16 +201,16 @@ void KSpriteSaver::readSettings()
//-----------------------------------------------------------------------------
void KSpriteSaver::initialise()
{
mCanvas = new QCanvas();
QPixmap pm( locate("sprite", "bg.png") );
mCanvas = new TQCanvas();
TQPixmap pm( locate("sprite", "bg.png") );
mCanvas->setBackgroundPixmap( pm );
mCanvas->resize( width(), height() );
mView = new QCanvasView(mCanvas);
mView = new TQCanvasView(mCanvas);
mView->viewport()->setBackgroundColor( black );
mView->resize( size());
mView->setFrameStyle( QFrame::NoFrame );
mView->setVScrollBarMode( QScrollView::AlwaysOff );
mView->setHScrollBarMode( QScrollView::AlwaysOff );
mView->setFrameStyle( TQFrame::NoFrame );
mView->setVScrollBarMode( TQScrollView::AlwaysOff );
mView->setHScrollBarMode( TQScrollView::AlwaysOff );
embed( mView );
mView->show();
SpriteRange::setFieldSize(mView->size());
@ -231,7 +231,7 @@ void KSpriteSaver::slotTimeout()
}
//-----------------------------------------------------------------------------
void KSpriteSaver::timerEvent(QTimerEvent *ev)
void KSpriteSaver::timerEvent(TQTimerEvent *ev)
{
for (unsigned i = 0; i < mTimerIds.size(); i++)
{

@ -1,6 +1,6 @@
//-----------------------------------------------------------------------------
//
// ksprite - QCanvas based screensaver
// ksprite - TQCanvas based screensaver
//
// Copyright (c) Martin R. Jones 1996
//
@ -8,11 +8,11 @@
#ifndef __SPRITE_H__
#define __SPRITE_H__
#include <qtimer.h>
#include <qpushbutton.h>
#include <qptrlist.h>
#include <qstrlist.h>
#include <qcanvas.h>
#include <tqtimer.h>
#include <tqpushbutton.h>
#include <tqptrlist.h>
#include <tqstrlist.h>
#include <tqcanvas.h>
#include <kscreensaver.h>
#include "spriteanim.h"
@ -35,22 +35,22 @@ protected slots:
void slotTimeout();
protected:
virtual void timerEvent(QTimerEvent *);
virtual void timerEvent(TQTimerEvent *);
protected:
QCanvas *mCanvas;
QCanvasView *mView;
QTimer mTimer;
int mSpeed;
QPtrList<SpriteGroup> mGroups;
QMemArray<int> mTimerIds;
TQPtrList<SpriteGroup> mGroups;
TQMemArray<int> mTimerIds;
};
class KSpriteSetup : public QDialog
{
Q_OBJECT
public:
KSpriteSetup( QWidget *parent = NULL, const char *name = NULL );
KSpriteSetup( TQWidget *parent = NULL, const char *name = NULL );
~KSpriteSetup();
protected:
@ -63,7 +63,7 @@ private slots:
private:
int speed;
QWidget *preview;
TQWidget *preview;
KSpriteSaver *saver;
};

@ -14,8 +14,8 @@
//
// SpriteObject stores the animations that create an object
//
SpriteObject::SpriteObject(SpritePixmapSequence *seq, QCanvas *c )
: QCanvasSprite(seq, c),
SpriteObject::SpriteObject(SpritePixmapSequence *seq, TQCanvas *c )
: TQCanvasSprite(seq, c),
mCycle(0),
mLifeSpan(-1),
mSeq(seq)
@ -39,7 +39,7 @@ void SpriteObject::age()
void SpriteObject::setBounds( int x1, int y1, int x2, int y2 )
{
mBound = QRect( x1, y1, x2-x1, y2-y1 );
mBound = TQRect( x1, y1, x2-x1, y2-y1 );
}
bool SpriteObject::outOfBounds() const
@ -58,7 +58,7 @@ SpriteDef::SpriteDef(KConfigBase &config)
}
//---------------------------------------------------------------------------
SpriteObject *SpriteDef::create( QCanvas *c )
SpriteObject *SpriteDef::create( TQCanvas *c )
{
SpriteObject *sprite = 0;
if (mSeq)
@ -92,7 +92,7 @@ void SpriteDef::read(KConfigBase &config)
mEndY.set(config.readEntry("EndY", "10000"));
mLifeSpan = config.readNumEntry("LifeSpan", -1);
mZ = config.readNumEntry("Z", 1);
QString animation = config.readEntry("Animation", "");
TQString animation = config.readEntry("Animation", "");
mSeq = SpriteSequenceManager::manager()->load(config, animation);
kdDebug() << "Set Z = " << mZ << endl;
}
@ -101,7 +101,7 @@ void SpriteDef::read(KConfigBase &config)
//
// SpriteGroup
//
SpriteGroup::SpriteGroup(QCanvas *c, KConfigBase &config)
SpriteGroup::SpriteGroup(TQCanvas *c, KConfigBase &config)
: mCanvas(c)
{
mAvailable.setAutoDelete(true);
@ -112,7 +112,7 @@ SpriteGroup::SpriteGroup(QCanvas *c, KConfigBase &config)
//---------------------------------------------------------------------------
void SpriteGroup::next()
{
QPtrListIterator<SpriteObject> it(mActive);
TQPtrListIterator<SpriteObject> it(mActive);
for (; it.current(); ++it)
{
@ -148,7 +148,7 @@ void SpriteGroup::read(KConfigBase &config)
mRefresh.set(config.readEntry("Refresh", "1000"));
QStrList anims;
TQStrList anims;
config.readListEntry("Animations", anims);
for (anims.first(); anims.current(); anims.next())

@ -12,11 +12,11 @@
#include <config.h>
#endif
#include <qpixmap.h>
#include <qdict.h>
#include <qptrlist.h>
#include <qstrlist.h>
#include <qcanvas.h>
#include <tqpixmap.h>
#include <tqdict.h>
#include <tqptrlist.h>
#include <tqstrlist.h>
#include <tqcanvas.h>
#include <kconfigbase.h>
#include <ksimpleconfig.h>
@ -27,7 +27,7 @@
class SpriteObject : public QCanvasSprite
{
public:
SpriteObject(SpritePixmapSequence *seq, QCanvas *c);
SpriteObject(SpritePixmapSequence *seq, TQCanvas *c);
void setLifeSpan(int l) { mLifeSpan = l; }
void age();
@ -51,7 +51,7 @@ class SpriteDef
public:
SpriteDef(KConfigBase &config);
SpriteObject *create( QCanvas *c );
SpriteObject *create( TQCanvas *c );
protected:
void read(KConfigBase &config);
@ -75,7 +75,7 @@ protected:
class SpriteGroup
{
public:
SpriteGroup(QCanvas *c, KConfigBase &config);
SpriteGroup(TQCanvas *c, KConfigBase &config);
void next();
void refresh();
@ -85,8 +85,8 @@ protected:
void read(KConfigBase &config);
protected:
QPtrList<SpriteDef> mAvailable;
QPtrList<SpriteObject> mActive;
TQPtrList<SpriteDef> mAvailable;
TQPtrList<SpriteObject> mActive;
int mCount;
SpriteRange mRefresh;
QCanvas *mCanvas;

@ -8,9 +8,9 @@
#include <kapplication.h>
#include "spritemisc.h"
QSize SpriteRange::mFieldSize;
TQSize SpriteRange::mFieldSize;
SpriteRange::SpriteRange(const QString &str)
SpriteRange::SpriteRange(const TQString &str)
{
set(str);
}
@ -27,7 +27,7 @@ int SpriteRange::random() const
return val;
}
void SpriteRange::set(const QString &str)
void SpriteRange::set(const TQString &str)
{
int r = str.find("..");
@ -42,12 +42,12 @@ void SpriteRange::set(const QString &str)
}
}
void SpriteRange::setFieldSize(const QSize &size)
void SpriteRange::setFieldSize(const TQSize &size)
{
mFieldSize = size;
}
int SpriteRange::parse(const QString &str)
int SpriteRange::parse(const TQString &str)
{
int val = 0;

@ -8,13 +8,13 @@
#ifndef __SPRITEMISC_H__
#define __SPRITEMISC_H__
#include <qstring.h>
#include <qsize.h>
#include <tqstring.h>
#include <tqsize.h>
class SpriteRange
{
public:
SpriteRange(const QString &str);
SpriteRange(const TQString &str);
SpriteRange(int l=0, int h=0) : mMin(l), mMax(h) {}
int min() const { return mMin; }
@ -23,18 +23,18 @@ public:
int random() const;
void set(int l, int h) { mMin=l; mMax=h; }
void set(const QString &str);
void set(const TQString &str);
static void setFieldSize(const QSize &size);
static QSize fieldSize() { return mFieldSize; }
static void setFieldSize(const TQSize &size);
static TQSize fieldSize() { return mFieldSize; }
protected:
int parse(const QString &str);
int parse(const TQString &str);
protected:
int mMin;
int mMax;
static QSize mFieldSize;
static TQSize mFieldSize;
};
#endif

@ -37,16 +37,16 @@ SpritePixmapManager::~SpritePixmapManager()
// Returns:
// pointer to pixmap if loaded successfully, 0 otherwise.
//
const QPixmap *SpritePixmapManager::load(const QString & img)
const TQPixmap *SpritePixmapManager::load(const TQString & img)
{
QPixmap *pixmap = mPixmaps.find(img);
TQPixmap *pixmap = mPixmaps.find(img);
if (!pixmap)
{
// pixmap has not yet been loaded.
kdDebug() << "Reading pixmap: " << img << endl;
QString path = mPixmapDir + QString("/") + img;
pixmap = new QPixmap(path);
TQString path = mPixmapDir + TQString("/") + img;
pixmap = new TQPixmap(path);
if (!pixmap->isNull())
{
@ -79,9 +79,9 @@ SpritePixmapManager *SpritePixmapManager::manager()
//===========================================================================
//
SpritePixmapSequence::SpritePixmapSequence(QPtrList<QPixmap> pm, QPtrList<QPoint> hs,
QMemArray<int> d)
: QCanvasPixmapArray(pm, hs), mDelays(d)
SpritePixmapSequence::SpritePixmapSequence(TQPtrList<TQPixmap> pm, TQPtrList<TQPoint> hs,
TQMemArray<int> d)
: TQCanvasPixmapArray(pm, hs), mDelays(d)
{
}
@ -113,7 +113,7 @@ SpriteSequenceManager::~SpriteSequenceManager()
// pointer to sprite if loaded successfully, 0 otherwise.
//
SpritePixmapSequence *SpriteSequenceManager::load(KConfigBase &config,
const QString & name)
const TQString & name)
{
SpritePixmapSequence *sprite = mSprites.find(name);
@ -135,24 +135,24 @@ SpritePixmapSequence *SpriteSequenceManager::load(KConfigBase &config,
//
SpritePixmapSequence *SpriteSequenceManager::read(KConfigBase &config)
{
QStrList strImages;
QStrList strDelays;
QPtrList<QPixmap> pixmaps;
QPtrList<QPoint> hotspots;
TQStrList strImages;
TQStrList strDelays;
TQPtrList<TQPixmap> pixmaps;
TQPtrList<TQPoint> hotspots;
int frames = config.readListEntry("Images", strImages);
config.readListEntry("Delays", strDelays);
QMemArray<int> delays(frames);
TQMemArray<int> delays(frames);
for (int i = 0; i < frames; i++)
{
const QPixmap *pixmap =
const TQPixmap *pixmap =
SpritePixmapManager::manager()->load(strImages.at(i));
if (pixmap)
{
pixmaps.append(pixmap);
hotspots.append(new QPoint(0,0));
hotspots.append(new TQPoint(0,0));
delays[i] = atoi(strDelays.at(i));
}
}

@ -12,9 +12,9 @@
#include <config.h>
#endif
#include <qdict.h>
#include <qpixmap.h>
#include <qcanvas.h>
#include <tqdict.h>
#include <tqpixmap.h>
#include <tqcanvas.h>
#include <kconfigbase.h>
#include <ksimpleconfig.h>
@ -28,19 +28,19 @@ public:
SpritePixmapManager();
virtual ~SpritePixmapManager();
void setPixmapDir(const QString &dir)
void setPixmapDir(const TQString &dir)
{ mPixmapDir = dir; }
void reset()
{ mPixmapDir = "."; mPixmaps.clear(); }
const QPixmap *load(const QString & img);
const QPixmap *pixmap(const char *img) const
const TQPixmap *load(const TQString & img);
const TQPixmap *pixmap(const char *img) const
{ return mPixmaps.find(img); }
static SpritePixmapManager *manager();
public:
QString mPixmapDir; // get pixmaps from here
QDict<QPixmap> mPixmaps; // list of pixmaps
TQString mPixmapDir; // get pixmaps from here
TQDict<TQPixmap> mPixmaps; // list of pixmaps
static SpritePixmapManager *mManager; // static pointer to instance
};
@ -49,12 +49,12 @@ public:
class SpritePixmapSequence : public QCanvasPixmapArray
{
public:
SpritePixmapSequence(QPtrList<QPixmap> pm, QPtrList<QPoint> hs, QMemArray<int> d);
SpritePixmapSequence(TQPtrList<TQPixmap> pm, TQPtrList<TQPoint> hs, TQMemArray<int> d);
int delay(int i) const { return mDelays[i]; }
protected:
QMemArray<int> mDelays;
TQMemArray<int> mDelays;
};
//---------------------------------------------------------------------------
@ -67,7 +67,7 @@ public:
SpriteSequenceManager();
~SpriteSequenceManager();
SpritePixmapSequence *load(KConfigBase &config, const QString & name);
SpritePixmapSequence *load(KConfigBase &config, const TQString & name);
SpritePixmapSequence *sprite(const char *name)
{ return mSprites.find(name); }
@ -77,7 +77,7 @@ protected:
SpritePixmapSequence *read(KConfigBase &config);
protected:
QDict<SpritePixmapSequence> mSprites;
TQDict<SpritePixmapSequence> mSprites;
static SpriteSequenceManager *mManager;
};

@ -20,23 +20,23 @@
#include "weatherbutton.h"
#include "weatherservice_stub.h"
#include <qtooltip.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qtimer.h>
#include <qobjectlist.h>
#include <tqtooltip.h>
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqtimer.h>
#include <tqobjectlist.h>
#include <kdebug.h>
#include <kglobalsettings.h>
#include <klocale.h>
dockwidget::dockwidget(const QString &location, QWidget *parent,
const char *name) : QWidget(parent,name), m_locationCode( location ), m_orientation( Horizontal )
dockwidget::dockwidget(const TQString &location, TQWidget *parent,
const char *name) : TQWidget(parent,name), m_locationCode( location ), m_orientation( Horizontal )
{
m_font = KGlobalSettings::generalFont();
setBackgroundOrigin( AncestorOrigin );
initDock();
connect(m_button, SIGNAL( clicked() ), SIGNAL( buttonClicked() ));
connect(m_button, TQT_SIGNAL( clicked() ), TQT_SIGNAL( buttonClicked() ));
m_weatherService = new WeatherService_stub( "KWeatherService", "WeatherService" );
}
@ -46,7 +46,7 @@ dockwidget::~dockwidget()
delete m_weatherService;
}
void dockwidget::setLocationCode(const QString &locationCode)
void dockwidget::setLocationCode(const TQString &locationCode)
{
m_locationCode = locationCode;
showWeather();
@ -78,11 +78,11 @@ void dockwidget::setViewMode(int _mode)
void dockwidget::showWeather()
{
QString tip = "<qt>";
TQString tip = "<qt>";
QString temp = "?";
QString wind = "?";
QString pressure = "?";
TQString temp = "?";
TQString wind = "?";
TQString pressure = "?";
if ( !m_locationCode.isEmpty() )
{
@ -90,12 +90,12 @@ void dockwidget::showWeather()
wind = m_weatherService->wind( m_locationCode );
pressure = m_weatherService->pressure( m_locationCode );
QString dewPoint = m_weatherService->dewPoint( m_locationCode);
QString relHumidity = m_weatherService->relativeHumidity( m_locationCode );
QString heatIndex = m_weatherService->heatIndex( m_locationCode );
QString windChill = m_weatherService->windChill( m_locationCode );
QString sunRiseTime = m_weatherService->sunRiseTime( m_locationCode );
QString sunSetTime = m_weatherService->sunSetTime( m_locationCode );
TQString dewPoint = m_weatherService->dewPoint( m_locationCode);
TQString relHumidity = m_weatherService->relativeHumidity( m_locationCode );
TQString heatIndex = m_weatherService->heatIndex( m_locationCode );
TQString windChill = m_weatherService->windChill( m_locationCode );
TQString sunRiseTime = m_weatherService->sunRiseTime( m_locationCode );
TQString sunSetTime = m_weatherService->sunSetTime( m_locationCode );
tip += "<h3><center><nobr>" +
m_weatherService->stationName( m_locationCode ) + " (" +
@ -104,7 +104,7 @@ void dockwidget::showWeather()
if ( m_weatherService->currentIconString( m_locationCode ) == "dunno" ) // no data
tip += "<center><nobr>" + i18n("The network is currently offline...") + "</nobr></center>";
tip += QString("<br><table>"
tip += TQString("<br><table>"
"<tr><th><nobr>" + i18n( "Temperature:" ) + "</nobr></th><td><nobr>%1</nobr></td>"
"<th><nobr>" + i18n( "Dew Point:" ) + "</nobr></th><td><nobr>%2</nobr></td></nobr></tr>"
@ -115,14 +115,14 @@ void dockwidget::showWeather()
.arg(temp).arg(dewPoint).arg(pressure).arg(relHumidity).arg(wind);
if ( !heatIndex.isEmpty() )
tip += QString("<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>").arg(heatIndex);
else if ( !windChill.isEmpty() )
tip += QString("<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>").arg(windChill);
else
tip += "<td>&nbsp;</td><td>&nbsp;</td>";
tip += "</tr>";
tip += QString("<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>")
.arg(sunRiseTime).arg(sunSetTime);
@ -144,10 +144,10 @@ void dockwidget::showWeather()
tip += "</qt>";
// On null or empty location code, or if the station needs maintenance, this will return the dunno icon.
QPixmap icon = m_weatherService->icon( m_locationCode );
TQPixmap icon = m_weatherService->icon( m_locationCode );
QToolTip::remove(this);
QToolTip::add(this, tip);
TQToolTip::remove(this);
TQToolTip::add(this, tip);
kdDebug(12004) << "show weather: " << endl;
kdDebug(12004) << "location: " << m_locationCode << endl;
@ -167,9 +167,9 @@ void dockwidget::initDock()
m_button= new WeatherButton(this,"m_button");
m_lblTemp= new QLabel(this,"lblTemp");
m_lblWind= new QLabel(this,"lblWind");
m_lblPres= new QLabel(this,"lblPres");
m_lblTemp= new TQLabel(this,"lblTemp");
m_lblWind= new TQLabel(this,"lblWind");
m_lblPres= new TQLabel(this,"lblPres");
m_lblTemp->setBackgroundOrigin(AncestorOrigin);
m_lblWind->setBackgroundOrigin(AncestorOrigin);
@ -179,12 +179,12 @@ void dockwidget::initDock()
m_lblWind->setMargin(0);
m_lblPres->setMargin(0);
QBoxLayout *mainLayout = new QBoxLayout(this, QBoxLayout::TopToBottom);
TQBoxLayout *mainLayout = new TQBoxLayout(this, TQBoxLayout::TopToBottom);
mainLayout->setSpacing(0);
mainLayout->setMargin(0);
mainLayout->addWidget(m_button, 0, Qt::AlignCenter);
QBoxLayout *layout = new QBoxLayout(mainLayout, QBoxLayout::TopToBottom);
TQBoxLayout *layout = new TQBoxLayout(mainLayout, TQBoxLayout::TopToBottom);
layout->setSpacing(0);
layout->setMargin(0);
layout->addWidget(m_lblTemp);
@ -195,11 +195,11 @@ void dockwidget::initDock()
updateFont();
QTimer::singleShot( 0, this, SLOT( showWeather() ) );
TQTimer::singleShot( 0, this, TQT_SLOT( showWeather() ) );
}
/** resize the view **/
void dockwidget::resizeView( const QSize &size )
void dockwidget::resizeView( const TQSize &size )
{
kdDebug(12004) << "Changing to size " << size << endl;
resize(size);
@ -212,15 +212,15 @@ void dockwidget::resizeView( const QSize &size )
{
if ( h <= 128 ) // left to right layout
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
}
else // top to bottom
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
QFontMetrics fm(m_font);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
TQFontMetrics fm(m_font);
h = 128 - (3 * fm.height()); // 3 lines of text below the button
m_lblTemp->setAlignment(Qt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter);
@ -232,13 +232,13 @@ void dockwidget::resizeView( const QSize &size )
{
if ( h <= 32 ) // left to right
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
}
else // top to bottom
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
QFontMetrics fm(m_font);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
TQFontMetrics fm(m_font);
h = QMIN(128, h) - fm.height();
m_lblTemp->setAlignment(Qt::AlignCenter);
}
@ -259,18 +259,18 @@ void dockwidget::resizeView( const QSize &size )
{
if ( w <= 128 ) // top to bottom
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter);
m_lblPres->setAlignment(Qt::AlignCenter);
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
h = h - (3 * fm.height()); // 3 lines of text below the button
h = QMIN(w, h);
}
else // left to right layout
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
@ -281,14 +281,14 @@ void dockwidget::resizeView( const QSize &size )
{
if ( w <= 128 ) // top to bottom
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter);
h = w;
}
else // left to right layout
{
static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
h = static_cast<int>(w * 0.33);
@ -306,7 +306,7 @@ void dockwidget::resizeView( const QSize &size )
int dockwidget::widthForHeight(int h)
{
int w;
QFontInfo fi(KGlobalSettings::generalFont());
TQFontInfo fi(KGlobalSettings::generalFont());
if ( m_mode == ShowAll )
{
@ -315,7 +315,7 @@ int dockwidget::widthForHeight(int h)
int pixelSize = h/3 - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize);
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
w = h + QMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
}
else // top to bottom
@ -328,7 +328,7 @@ int dockwidget::widthForHeight(int h)
{
m_font.setPixelSize(h/2/3);
}
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
// size of icon
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;
@ -342,7 +342,7 @@ int dockwidget::widthForHeight(int h)
int pixelSize = h - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize);
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
w = h + fm.width(m_lblTemp->text()) + 1;
}
else // top to bottom
@ -355,7 +355,7 @@ int dockwidget::widthForHeight(int h)
{
m_font.setPixelSize(h/2);
}
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
// size of icon
h = QMIN(128, h) - fm.height();
w = fm.width(m_lblTemp->text()) + 1;
@ -377,7 +377,7 @@ int dockwidget::heightForWidth( int w )
if ( m_mode == ShowAll )
{
QFontMetrics fmg(KGlobalSettings::generalFont());
TQFontMetrics fmg(KGlobalSettings::generalFont());
int maxWidth = fmg.width("888 km/h NNWW"); // a good approximation
if ( w <= 128 ) // top to bottom
@ -391,7 +391,7 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * double(w) / maxWidth));
}
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
h = w + (3 * fm.height()); // 3 lines of text below the button
}
else
@ -405,14 +405,14 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * (w*0.66) / maxWidth));
}
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
h = 3 * fm.height(); // 3 lines of text
}
}
else if ( m_mode == ShowTempOnly )
{
QFontMetrics fmg(KGlobalSettings::generalFont());
TQFontMetrics fmg(KGlobalSettings::generalFont());
int maxWidth = fmg.width("888.88 CC"); // a good approximation
if ( w <= 128 ) // top to bottom
@ -426,7 +426,7 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * double(w) / maxWidth));
}
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
h = w + fm.height(); // text below the button
}
else
@ -440,7 +440,7 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * (w*0.66) / maxWidth));
}
QFontMetrics fm(m_font);
TQFontMetrics fm(m_font);
h = QMAX(fm.height(), static_cast<int>(w * 0.33));
}
}

@ -18,9 +18,9 @@
#ifndef DOCKWIDGET_H
#define DOCKWIDGET_H
#include <qfont.h>
#include <qpixmap.h>
#include <qwidget.h>
#include <tqfont.h>
#include <tqpixmap.h>
#include <tqwidget.h>
#include <dcopref.h>
@ -33,16 +33,16 @@ class dockwidget : public QWidget
Q_OBJECT
public:
dockwidget(const QString &location, QWidget *parent=0, const char *name=0);
dockwidget(const TQString &location, TQWidget *parent=0, const char *name=0);
~dockwidget();
enum {ShowIconOnly=1, ShowTempOnly=2, ShowAll=3 };
void setLocationCode(const QString &locationCode);
void setLocationCode(const TQString &locationCode);
void setViewMode(int);
void setOrientation(Orientation o) { m_orientation = o; }
/** resize the view **/
void resizeView(const QSize &size);
void resizeView(const TQSize &size);
int widthForHeight(int h);
int heightForWidth(int w);
@ -57,13 +57,13 @@ private:
void updateFont();
int m_mode;
QString m_locationCode;
QFont m_font;
QPixmap m_icon;
TQString m_locationCode;
TQFont m_font;
TQPixmap m_icon;
WeatherButton *m_button;
QLabel *m_lblTemp;
QLabel *m_lblWind;
QLabel *m_lblPres;
TQLabel *m_lblTemp;
TQLabel *m_lblWind;
TQLabel *m_lblPres;
Orientation m_orientation;
WeatherService_stub *m_weatherService;

@ -21,10 +21,10 @@
without including the source code for Qt in the source distribution.
*/
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <kaboutdata.h>
#include <kapplication.h>
@ -43,18 +43,18 @@
extern "C"
{
KDE_EXPORT KCModule *create_weather( QWidget *parent, const char * )
KDE_EXPORT KCModule *create_weather( TQWidget *parent, const char * )
{
return new KCMWeather( parent, "kweather" );
}
}
KCMWeather::KCMWeather( QWidget *parent, const char *name )
KCMWeather::KCMWeather( TQWidget *parent, const char *name )
: KCModule( parent, name )
{
mWeatherService = new WeatherService_stub( "KWeatherService",
"WeatherService" );
QVBoxLayout *layout = new QVBoxLayout( this );
TQVBoxLayout *layout = new TQVBoxLayout( this );
mWidget = new prefsDialogData( this );
mWidget->m_reportLocation->setFocus();
@ -63,14 +63,14 @@ KCMWeather::KCMWeather( QWidget *parent, const char *name )
fillStationList();
load();
connect( mWidget->m_enableLog, SIGNAL( toggled( bool ) ),
SLOT( enableLogWidgets( bool ) ) );
connect( mWidget->m_viewMode, SIGNAL( released( int ) ),
SLOT( changeViewMode( int ) ) );
connect( mWidget->m_reportLocation, SIGNAL( activated( const QString& ) ),
SLOT( reportLocationChanged() ) );
connect( mWidget->m_textColor, SIGNAL( changed(const QColor &) ),
SLOT( textColorChanged(const QColor &) ) );
connect( mWidget->m_enableLog, TQT_SIGNAL( toggled( bool ) ),
TQT_SLOT( enableLogWidgets( bool ) ) );
connect( mWidget->m_viewMode, TQT_SIGNAL( released( int ) ),
TQT_SLOT( changeViewMode( int ) ) );
connect( mWidget->m_reportLocation, TQT_SIGNAL( activated( const TQString& ) ),
TQT_SLOT( reportLocationChanged() ) );
connect( mWidget->m_textColor, TQT_SIGNAL( changed(const TQColor &) ),
TQT_SLOT( textColorChanged(const TQColor &) ) );
KAboutData *about = new KAboutData(
I18N_NOOP( "kcmweather" ),
@ -86,7 +86,7 @@ KCMWeather::~KCMWeather()
{
delete mWeatherService;
}
void KCMWeather::showEvent( QShowEvent * )
void KCMWeather::showEvent( TQShowEvent * )
{
fillStationList();
}
@ -94,12 +94,12 @@ void KCMWeather::showEvent( QShowEvent * )
void KCMWeather::fillStationList()
{
// store current selection
QString current = mWidget->m_reportLocation->currentText();
TQString current = mWidget->m_reportLocation->currentText();
mWidget->m_reportLocation->clear();
QStringList stationList = mWeatherService->listStations();
QStringList::Iterator idx = stationList.begin();
TQStringList stationList = mWeatherService->listStations();
TQStringList::Iterator idx = stationList.begin();
// get station name from station id for sorting afterwards
for(; idx != stationList.end(); ++idx)
@ -154,7 +154,7 @@ void KCMWeather::reportLocationChanged()
emit changed( true );
}
void KCMWeather::textColorChanged(const QColor &)
void KCMWeather::textColorChanged(const TQColor &)
{
emit changed( true );
}
@ -169,11 +169,11 @@ void KCMWeather::load()
mWidget->m_enableLog->setChecked( enabled );
enableLogWidgets( enabled );
static QColor black(Qt::black);
QColor textColor = config.readColorEntry("textColor", &black);
static TQColor black(Qt::black);
TQColor textColor = config.readColorEntry("textColor", &black);
mWidget->m_textColor->setColor(textColor);
QString loc = config.readEntry( "report_location" );
TQString loc = config.readEntry( "report_location" );
mWidget->m_logFile->setURL( config.readPathEntry( "log_file_name" ) );
@ -196,7 +196,7 @@ void KCMWeather::save()
config.writeEntry( "textColor", mWidget->m_textColor->color() );
// Station idx to local idx; if nothing selected yet, keep it empty
QString loc;
TQString loc;
if ( ! mWidget->m_reportLocation->currentText().isEmpty() )
loc = mWeatherService->stationCode( mWidget->m_reportLocation->currentText() );
config.writeEntry( "report_location", loc);

@ -32,7 +32,7 @@ class KCMWeather : public KCModule
Q_OBJECT
public:
KCMWeather( QWidget *parent = 0, const char *name = 0 );
KCMWeather( TQWidget *parent = 0, const char *name = 0 );
~KCMWeather();
virtual void load();
@ -41,13 +41,13 @@ class KCMWeather : public KCModule
protected:
void fillStationList();
virtual void showEvent( QShowEvent * );
virtual void showEvent( TQShowEvent * );
private slots:
void enableLogWidgets( bool value );
void changeViewMode( int mode );
void reportLocationChanged();
void textColorChanged(const QColor &);
void textColorChanged(const TQColor &);
private:
prefsDialogData *mWidget;

@ -21,7 +21,7 @@
without including the source code for Qt in the source distribution.
*/
#include <qlayout.h>
#include <tqlayout.h>
#include <kaboutdata.h>
#include <kdebug.h>
@ -33,19 +33,19 @@
extern "C"
{
KDE_EXPORT KCModule *create_weatherservice( QWidget *parent, const char * ) {
KDE_EXPORT KCModule *create_weatherservice( TQWidget *parent, const char * ) {
return new KCMWeatherService( parent, "kweather" );
}
}
KCMWeatherService::KCMWeatherService( QWidget *parent, const char *name )
KCMWeatherService::KCMWeatherService( TQWidget *parent, const char *name )
: KCModule( parent, name )
{
QVBoxLayout *layout = new QVBoxLayout( this );
TQVBoxLayout *layout = new TQVBoxLayout( this );
mWidget = new ServiceConfigWidget( this );
// not needed, as a change immediately changes the service
//connect(mWidget, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
//connect(mWidget, TQT_SIGNAL(changed(bool)), this, TQT_SIGNAL(changed(bool)));
layout->addWidget( mWidget );
KAboutData *about = new KAboutData( "kcmweatherservice",

@ -33,7 +33,7 @@ class KCMWeatherService : public KCModule
Q_OBJECT
public:
KCMWeatherService( QWidget *parent = 0, const char *name = 0 );
KCMWeatherService( TQWidget *parent = 0, const char *name = 0 );
virtual void load();
virtual void save();

@ -29,9 +29,9 @@
#include <ksettings/dispatcher.h>
#include <dcopclient.h>
#include <qfile.h>
#include <qtimer.h>
#include <qpalette.h>
#include <tqfile.h>
#include <tqtimer.h>
#include <tqpalette.h>
#include "kweather.h"
#include "reportview.h"
@ -40,7 +40,7 @@
extern "C"
{
KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile)
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kweather");
kweather *theApplet = new kweather(configFile, KPanelApplet::Normal,
@ -49,8 +49,8 @@ extern "C"
}
}
kweather::kweather(const QString& configFile, Type t, int actions,
QWidget *parent, const char *name):
kweather::kweather(const TQString& configFile, Type t, int actions,
TQWidget *parent, const char *name):
KPanelApplet(configFile, t, actions, parent, name), weatherIface(),
mFirstRun( false ), mReport( 0 ), mClient( 0 ),
mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), mTextColor(Qt::black)
@ -58,18 +58,18 @@ kweather::kweather(const QString& configFile, Type t, int actions,
kdDebug(12004) << "Constructor " << endl;
setObjId("weatherIface");
setBackgroundOrigin( QWidget::AncestorOrigin );
setBackgroundOrigin( TQWidget::AncestorOrigin );
loadPrefs();
initContextMenu();
initDCOP();
dockWidget = new dockwidget(reportLocation, this, "dockwidget");
connect(dockWidget, SIGNAL(buttonClicked()), SLOT(doReport()));
connect(dockWidget, TQT_SIGNAL(buttonClicked()), TQT_SLOT(doReport()));
dockWidget->setViewMode(mViewMode);
setLabelColor();
timeOut = new QTimer(this, "timeOut" );
connect(timeOut, SIGNAL(timeout()), SLOT(timeout()));
timeOut = new TQTimer(this, "timeOut" );
connect(timeOut, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()));
timeOut->start(10*60*1000);
if(mFirstRun)
@ -88,13 +88,13 @@ void kweather::initContextMenu()
mContextMenu = new KPopupMenu(this);
mContextMenu->insertTitle(i18n("KWeather - %1").arg( reportLocation ), -1, 0);
mContextMenu->insertItem(SmallIcon("viewmag"), i18n("Show &Report"),
this, SLOT(doReport()), 0, -1, 1);
this, TQT_SLOT(doReport()), 0, -1, 1);
mContextMenu->insertItem(SmallIcon("reload"), i18n("&Update Now"),
this, SLOT(slotUpdateNow()), 0, -1, 2);
this, TQT_SLOT(slotUpdateNow()), 0, -1, 2);
mContextMenu->insertSeparator();
mContextMenu->insertItem(SmallIcon("kweather"), i18n("&About KWeather"), this, SLOT(about()));
mContextMenu->insertItem(SmallIcon("kweather"), i18n("&About KWeather"), this, TQT_SLOT(about()));
mContextMenu->insertItem(SmallIcon("configure"),
i18n("&Configure KWeather..."), this, SLOT(preferences()));
i18n("&Configure KWeather..."), this, TQT_SLOT(preferences()));
setCustomMenu(mContextMenu);
}
@ -116,8 +116,8 @@ void kweather::initDCOP()
mWeatherService = new WeatherService_stub( "KWeatherService", "WeatherService" );
if (!connectDCOPSignal(0, 0, "fileUpdate(QString)",
"refresh(QString)",false))
if (!connectDCOPSignal(0, 0, "fileUpdate(TQString)",
"refresh(TQString)",false))
kdDebug(12004) << "Could not attach dcop signal..." << endl;
else
kdDebug(12004) << "attached dcop signals..." << endl;
@ -158,7 +158,7 @@ void kweather::preferences()
if ( settingsDialog == 0 )
{
settingsDialog = new KCMultiDialog( this );
connect( settingsDialog, SIGNAL( configCommitted() ), SLOT( slotPrefsAccepted() ) );
connect( settingsDialog, TQT_SIGNAL( configCommitted() ), TQT_SLOT( slotPrefsAccepted() ) );
settingsDialog->addModule( "kcmweather.desktop" );
settingsDialog->addModule( "kcmweatherservice.desktop" );
@ -171,7 +171,7 @@ void kweather::preferences()
/** The help handler */
void kweather::help()
{
kapp->invokeHelp(QString::null, QString::fromLatin1("kweather"));
kapp->invokeHelp(TQString::null, TQString::fromLatin1("kweather"));
}
/** Display the current weather report. */
@ -189,7 +189,7 @@ void kweather::doReport()
{
mReport = new reportView(reportLocation);
connect( mReport, SIGNAL( finished() ), SLOT( slotReportFinished() ) );
connect( mReport, TQT_SIGNAL( finished() ), TQT_SLOT( slotReportFinished() ) );
}
mReport->show();
@ -216,7 +216,7 @@ void kweather::loadPrefs(){
reportLocation = kcConfig->readEntry("report_location");
mViewMode = kcConfig->readNumEntry("smallview_mode", dockwidget::ShowAll);
static QColor black(Qt::black);
static TQColor black(Qt::black);
mTextColor = kcConfig->readColorEntry("textColor", &black);
}
@ -246,17 +246,17 @@ void kweather::writeLogEntry()
if (logOn && !fileName.isEmpty())
{
kdDebug(12004)<< "Try log file:" << fileName << endl;
QFile logFile(fileName);
QTextStream logFileStream(&logFile);
TQFile logFile(fileName);
TQTextStream logFileStream(&logFile);
if (logFile.open(IO_Append | IO_ReadWrite))
{
QString temperature = mWeatherService->temperature(reportLocation );
QString wind = mWeatherService->wind(reportLocation );
QString pressure = mWeatherService->pressure(reportLocation );
QString date = mWeatherService->date(reportLocation );
QStringList weather = mWeatherService->weather(reportLocation );
QStringList cover = mWeatherService->cover(reportLocation );
QString visibility = mWeatherService->visibility(reportLocation );
TQString temperature = mWeatherService->temperature(reportLocation );
TQString wind = mWeatherService->wind(reportLocation );
TQString pressure = mWeatherService->pressure(reportLocation );
TQString date = mWeatherService->date(reportLocation );
TQStringList weather = mWeatherService->weather(reportLocation );
TQStringList cover = mWeatherService->cover(reportLocation );
TQString visibility = mWeatherService->visibility(reportLocation );
logFileStream << date << ",";
logFileStream << wind << ",";
logFileStream << temperature << ",";
@ -312,7 +312,7 @@ int kweather::heightForWidth(int w) const
return h;
}
void kweather::refresh(QString stationID)
void kweather::refresh(TQString stationID)
{
kdDebug(12004) << "refresh " << stationID << endl;
if( stationID == reportLocation)
@ -335,14 +335,14 @@ void kweather::slotPrefsAccepted()
if (logOn && !fileName.isEmpty())
{
QFile logFile(fileName);
TQFile logFile(fileName);
// Open the file, create it if not already exists
if (logFile.open(IO_ReadWrite))
{
if (logFile.size() == 0)
{
// Empty file, put the header
QTextStream logFileStream(&logFile);
TQTextStream logFileStream(&logFile);
logFileStream << "Date,Wind Speed & Direction,Temperature,Pressure,Cover,Visibility,Current Weather" << endl;
}
logFile.close();
@ -361,7 +361,7 @@ void kweather::slotPrefsAccepted()
timeout();
}
void kweather::mousePressEvent(QMouseEvent *e)
void kweather::mousePressEvent(TQMouseEvent *e)
{
if ( e->button() != RightButton )
{
@ -382,14 +382,14 @@ void kweather::slotUpdateNow()
bool kweather::attach()
{
QString error;
TQString error;
kdDebug(12004) << "Looking for dcop service..." << endl;
if (!mClient->isApplicationRegistered("KWeatherService"))
{
kdDebug(12004) << "Could not find service so I am starting it..."
<< endl;
if (!KApplication::startServiceByDesktopName("kweatherservice",
QStringList(), &error))
TQStringList(), &error))
{
kdDebug(12004) << "Starting KWeatherService failed with message: "
<< error << endl;
@ -406,7 +406,7 @@ bool kweather::attach()
return true;
}
void kweather::resizeEvent(QResizeEvent *e)
void kweather::resizeEvent(TQResizeEvent *e)
{
kdDebug(12004) << "KWeather Resize event " << e->size() << endl;
dockWidget->resizeView(e->size());
@ -417,7 +417,7 @@ void kweather::setLabelColor()
setPaletteForegroundColor(mTextColor);
}
void kweather::paletteChange(const QPalette &)
void kweather::paletteChange(const TQPalette &)
{
setLabelColor();
}

@ -35,13 +35,13 @@ class kweather : public KPanelApplet, public weatherIface
Q_OBJECT
public:
kweather(const QString& configFile, Type t = Normal, int actions = 0, QWidget *parent = 0, const char *name = 0);
kweather(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *parent = 0, const char *name = 0);
~kweather();
void help();
void resizeEvent(QResizeEvent*);
void resizeEvent(TQResizeEvent*);
int heightForWidth(int i) const;
int widthForHeight(int i) const;
void refresh(QString);
void refresh(TQString);
void setBackground();
void setLabelColor();
@ -50,7 +50,7 @@ public slots: // Public slots
void about();
protected:
void paletteChange(const QPalette &);
void paletteChange(const TQPalette &);
protected slots:
void doReport();
@ -66,17 +66,17 @@ private: // Private methods
void savePrefs();
void showWeather();
void writeLogEntry();
void mousePressEvent(QMouseEvent *e);
void mousePressEvent(TQMouseEvent *e);
bool attach();
QString reportLocation;
QString fileName;
QString metarData;
TQString reportLocation;
TQString fileName;
TQString metarData;
bool logOn;
bool mFirstRun;
int mViewMode;
QTimer *timeOut;
TQTimer *timeOut;
dockwidget *dockWidget;
reportView *mReport;
DCOPClient *mClient;
@ -84,7 +84,7 @@ private: // Private methods
KPopupMenu *mContextMenu;
WeatherService_stub *mWeatherService;
KCMultiDialog *settingsDialog;
QColor mTextColor;
TQColor mTextColor;
};
#endif

@ -20,7 +20,7 @@ email : jratke@comcast.net
#include "config.h"
#include <qdatetime.h>
#include <tqdatetime.h>
#include <kdebug.h>
#include <math.h>
@ -34,27 +34,27 @@ email : jratke@comcast.net
MetarParser::MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units,
QDate date,
QTime time,
TQDate date,
TQTime time,
unsigned int localUTCOffset) :
m_stationDb(stationDB), m_units(units), m_date(date), m_time(time), m_localUTCOffset(localUTCOffset)
{
CoverRegExp = QRegExp("^(FEW|SCT|BKN|OVC|SKC|CLR|CAVOK)([0-9]{3})?(?:TCU|CB)?$");
CurrentRegExp = QRegExp("^(\\+|-|VC)?([A-Z]{2,4})$");
WindRegExp = QRegExp("^([0-9]{3}|VRB)([0-9]{2,3})(?:G([0-9]{2,3}))?(KT|KMH|MPS)$");
VisRegExp = QRegExp("^([0-9]{1,2})SM$");
VisFracRegExp = QRegExp("^1/(2|4)SM$");
TempRegExp = QRegExp("^(M)?([0-9]{2})/(?:(M)?([0-9]{2}))?$");
TimeRegExp = QRegExp("^([0-9]{2}:[0-9]{2})$");
DateRegExp = QRegExp("^([0-9]{4}/[0-9]{2}/[0-9]{2})$");
PressRegExp = QRegExp("^([AQ])([0-9]{4})$");
TempTenRegExp = QRegExp("^T([01][0-9]{3})([01][0-9]{3})$");
CoverRegExp = TQRegExp("^(FEW|SCT|BKN|OVC|SKC|CLR|CAVOK)([0-9]{3})?(?:TCU|CB)?$");
CurrentRegExp = TQRegExp("^(\\+|-|VC)?([A-Z]{2,4})$");
WindRegExp = TQRegExp("^([0-9]{3}|VRB)([0-9]{2,3})(?:G([0-9]{2,3}))?(KT|KMH|MPS)$");
VisRegExp = TQRegExp("^([0-9]{1,2})SM$");
VisFracRegExp = TQRegExp("^1/(2|4)SM$");
TempRegExp = TQRegExp("^(M)?([0-9]{2})/(?:(M)?([0-9]{2}))?$");
TimeRegExp = TQRegExp("^([0-9]{2}:[0-9]{2})$");
DateRegExp = TQRegExp("^([0-9]{4}/[0-9]{2}/[0-9]{2})$");
PressRegExp = TQRegExp("^([AQ])([0-9]{4})$");
TempTenRegExp = TQRegExp("^T([01][0-9]{3})([01][0-9]{3})$");
}
void MetarParser::reset()
{
// Initialize the WeatherInfo structure
weatherInfo.theWeather = QString::null;
weatherInfo.theWeather = TQString::null;
weatherInfo.clouds = 0;
weatherInfo.windMPH = 0;
weatherInfo.tempC = 0;
@ -64,19 +64,19 @@ void MetarParser::reset()
weatherInfo.qsCurrentList.clear();
weatherInfo.qsDate = m_date;
weatherInfo.qsTime = m_time;
weatherInfo.qsPressure = QString::null;
weatherInfo.qsTemperature = QString::null;
weatherInfo.qsDewPoint = QString::null;
weatherInfo.qsRelHumidity = QString::null;
weatherInfo.qsVisibility = QString::null;
weatherInfo.qsWindSpeed = QString::null;
weatherInfo.qsWindChill = QString::null;
weatherInfo.qsHeatIndex = QString::null;
weatherInfo.qsWindDirection = QString::null;
weatherInfo.qsPressure = TQString::null;
weatherInfo.qsTemperature = TQString::null;
weatherInfo.qsDewPoint = TQString::null;
weatherInfo.qsRelHumidity = TQString::null;
weatherInfo.qsVisibility = TQString::null;
weatherInfo.qsWindSpeed = TQString::null;
weatherInfo.qsWindChill = TQString::null;
weatherInfo.qsHeatIndex = TQString::null;
weatherInfo.qsWindDirection = TQString::null;
weatherInfo.stationNeedsMaintenance = false;
}
struct WeatherInfo MetarParser::processData(const QString &stationID, const QString &metar)
struct WeatherInfo MetarParser::processData(const TQString &stationID, const TQString &metar)
{
reset();
@ -85,11 +85,11 @@ struct WeatherInfo MetarParser::processData(const QString &stationID, const QStr
kdDebug(12006) << "Processing data: " << metar << endl;
// Split at whitespace into tokens
QStringList dataList = QStringList::split(QRegExp("\\s+"), metar);
TQStringList dataList = TQStringList::split(TQRegExp("\\s+"), metar);
bool found = false;
bool beforeRemark = true;
for (QStringList::ConstIterator it = dataList.begin();
for (TQStringList::ConstIterator it = dataList.begin();
it != dataList.end(); ++it)
{
// Don't try to parse the ICAO location code
@ -143,17 +143,17 @@ struct WeatherInfo MetarParser::processData(const QString &stationID, const QStr
}
/** Parse the current cover type */
bool MetarParser::parseCover(const QString &s)
bool MetarParser::parseCover(const TQString &s)
{
if (CoverRegExp.search(s) > -1)
{
kdDebug(12006) << "Cover: " << CoverRegExp.capturedTexts().join("-")
<< endl;
QString sCode = CoverRegExp.cap(1);
TQString sCode = CoverRegExp.cap(1);
float height = CoverRegExp.cap(2).toFloat(); // initially in 100's of feet
QString sClouds;
QString skycondition;
TQString sClouds;
TQString skycondition;
height *= 100;
if (m_units == KLocale::Metric)
@ -203,13 +203,13 @@ bool MetarParser::parseCover(const QString &s)
}
/** Parse the current weather conditions */
bool MetarParser::parseCurrent(const QString &s)
bool MetarParser::parseCurrent(const TQString &s)
{
if (CurrentRegExp.search(s) > -1)
{
QString sIntensity = CurrentRegExp.cap(1);
QString sCode = CurrentRegExp.cap(2);
QString intensity, descriptor, phenomena, currentWeather;
TQString sIntensity = CurrentRegExp.cap(1);
TQString sCode = CurrentRegExp.cap(2);
TQString intensity, descriptor, phenomena, currentWeather;
kdDebug(12006) << "Current: " << CurrentRegExp.capturedTexts().join("-") << endl;
@ -354,7 +354,7 @@ bool MetarParser::parseCurrent(const QString &s)
}
/** Parse out the current temperature */
bool MetarParser::parseTemperature(const QString &s)
bool MetarParser::parseTemperature(const TQString &s)
{
if (TempRegExp.search(s) > -1)
{
@ -375,7 +375,7 @@ bool MetarParser::parseTemperature(const QString &s)
return false;
}
bool MetarParser::parseTemperatureTenths(const QString &s)
bool MetarParser::parseTemperatureTenths(const TQString &s)
{
if (TempTenRegExp.search(s) > -1)
{
@ -432,7 +432,7 @@ void MetarParser::calcTemperatureVariables()
fHeatIndex = 0;
}
QString unit;
TQString unit;
if (m_units == KLocale::Metric)
{
unit = i18n("°C");
@ -460,7 +460,7 @@ void MetarParser::calcTemperatureVariables()
weatherInfo.qsHeatIndex += unit;
}
void MetarParser::removeTrailingDotZero(QString &string)
void MetarParser::removeTrailingDotZero(TQString &string)
{
if ( string.right( 2 ) == ".0" )
{
@ -469,20 +469,20 @@ void MetarParser::removeTrailingDotZero(QString &string)
}
/** Parse out the current date. */
bool MetarParser::parseDate(const QString &s)
bool MetarParser::parseDate(const TQString &s)
{
if (DateRegExp.search(s) > -1)
{
kdDebug(12006) << "Date: " << DateRegExp.capturedTexts().join("-")
<< endl;
QString dateString = DateRegExp.cap(1);
QString day, month, year;
TQString dateString = DateRegExp.cap(1);
TQString day, month, year;
day = dateString.mid(8,2);
month = dateString.mid(5,2);
year = dateString.mid(0,4);
QDate theDate(year.toInt(), month.toInt(), day.toInt());
TQDate theDate(year.toInt(), month.toInt(), day.toInt());
weatherInfo.qsDate = theDate;
@ -492,19 +492,19 @@ bool MetarParser::parseDate(const QString &s)
}
/** Parse out the current time. */
bool MetarParser::parseTime(const QString &s)
bool MetarParser::parseTime(const TQString &s)
{
if (TimeRegExp.search(s) > -1)
{
kdDebug(12006) << "Time: " << TimeRegExp.capturedTexts().join("-")
<< endl;
QString hour, minute, dateString;
TQString hour, minute, dateString;
dateString = TimeRegExp.cap(1);
hour = dateString.mid(0,2);
minute = dateString.mid(3,2);
QTime theTime(hour.toInt(), minute.toInt());
TQTime theTime(hour.toInt(), minute.toInt());
weatherInfo.qsTime = theTime;
return true;
@ -513,7 +513,7 @@ bool MetarParser::parseTime(const QString &s)
}
/** Parse out the current visibility */
bool MetarParser::parseVisibility(QStringList::ConstIterator it)
bool MetarParser::parseVisibility(TQStringList::ConstIterator it)
{
float fVisibility = 0;
@ -557,11 +557,11 @@ bool MetarParser::parseVisibility(QStringList::ConstIterator it)
}
/** Parse out the current pressure. */
bool MetarParser::parsePressure( const QString &s)
bool MetarParser::parsePressure( const TQString &s)
{
if (PressRegExp.search(s) > -1)
{
QString type = PressRegExp.cap(1);
TQString type = PressRegExp.cap(1);
float fPressure = PressRegExp.cap(2).toFloat();
kdDebug(12006) << "Pressure: " << PressRegExp.capturedTexts().join("-")
@ -591,7 +591,7 @@ bool MetarParser::parsePressure( const QString &s)
struct wind_info
{
unsigned int number;
QString name;
TQString name;
};
static const struct wind_info wind_direction[] =
@ -617,7 +617,7 @@ static const struct wind_info wind_direction[] =
};
QString MetarParser::parseWindDirection(const unsigned int direction)
TQString MetarParser::parseWindDirection(const unsigned int direction)
{
unsigned int i = 0;
@ -634,14 +634,14 @@ QString MetarParser::parseWindDirection(const unsigned int direction)
}
/** Parse the wind speed */
bool MetarParser::parseWindSpeed(const QString &s)
bool MetarParser::parseWindSpeed(const TQString &s)
{
if (WindRegExp.search(s) > -1)
{
unsigned int direction = WindRegExp.cap(1).toInt();
float windSpeed = WindRegExp.cap(2).toFloat();
float gustSpeed = WindRegExp.cap(3).toFloat();
QString sWindUnit = WindRegExp.cap(4);
TQString sWindUnit = WindRegExp.cap(4);
kdDebug(12006) << "Wind: " << WindRegExp.capturedTexts().join("-")
<< endl;
@ -705,7 +705,7 @@ bool MetarParser::parseWindSpeed(const QString &s)
return false;
}
bool MetarParser::parseStationNeedsMaintenance(const QString &s)
bool MetarParser::parseStationNeedsMaintenance(const TQString &s)
{
if (s == "$")
{
@ -815,11 +815,11 @@ void MetarParser::calcWindChill()
}
}
bool MetarParser::isNight(const QString &stationID) const
bool MetarParser::isNight(const TQString &stationID) const
{
QString upperStationID = stationID.upper();
QString latitude = m_stationDb->stationLatitudeFromID(upperStationID);
QString longitude = m_stationDb->stationLongitudeFromID(upperStationID);
TQString upperStationID = stationID.upper();
TQString latitude = m_stationDb->stationLatitudeFromID(upperStationID);
TQString longitude = m_stationDb->stationLongitudeFromID(upperStationID);
if ( latitude.compare( i18n("Unknown Station" ) ) == 0 ||
longitude.compare( i18n("Unknown Station" ) ) == 0 )
@ -830,10 +830,10 @@ bool MetarParser::isNight(const QString &stationID) const
{
Sun theSun( latitude, longitude , m_date, m_localUTCOffset );
QTime currently = m_time;
TQTime currently = m_time;
QTime civilStart = theSun.computeCivilTwilightStart();
QTime civilEnd = theSun.computeCivilTwilightEnd();
TQTime civilStart = theSun.computeCivilTwilightStart();
TQTime civilEnd = theSun.computeCivilTwilightEnd();
kdDebug (12006) << "station, current, lat, lon, start, end, offset: " <<
upperStationID << " " << currently << " " << latitude << " " <<
@ -859,9 +859,9 @@ bool MetarParser::isNight(const QString &stationID) const
}
}
QString MetarParser::iconName( const QString &icon ) const
TQString MetarParser::iconName( const TQString &icon ) const
{
QString _iconName = icon;
TQString _iconName = icon;
if ( isNight( weatherInfo.reportLocation ) )
_iconName += "_night";

@ -22,35 +22,35 @@ email : jratke@comcast.net
#include <klocale.h>
#include <krfcdate.h>
#include <qdatetime.h>
#include <qregexp.h>
#include <qstringlist.h>
#include <tqdatetime.h>
#include <tqregexp.h>
#include <tqstringlist.h>
class StationDatabase;
struct WeatherInfo
{
/** The current weather state outside */
QString theWeather;
TQString theWeather;
int clouds;
float windMPH;
float tempC;
float dewC;
bool heavy;
QStringList qsCoverList;
QStringList qsCurrentList;
QDate qsDate;
QString qsPressure;
QString qsTemperature;
QString qsDewPoint;
QString qsRelHumidity;
QTime qsTime;
QString qsVisibility;
QString qsWindSpeed;
QString qsWindChill;
QString qsHeatIndex;
QString qsWindDirection;
QString reportLocation;
TQStringList qsCoverList;
TQStringList qsCurrentList;
TQDate qsDate;
TQString qsPressure;
TQString qsTemperature;
TQString qsDewPoint;
TQString qsRelHumidity;
TQTime qsTime;
TQString qsVisibility;
TQString qsWindSpeed;
TQString qsWindChill;
TQString qsHeatIndex;
TQString qsWindDirection;
TQString reportLocation;
bool stationNeedsMaintenance;
};
@ -60,8 +60,8 @@ class MetarParser
public:
MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units = KLocale::Imperial,
QDate date = QDate::currentDate(),
QTime time = QTime::currentTime(),
TQDate date = TQDate::currentDate(),
TQTime time = TQTime::currentTime(),
unsigned int localUTCOffset = KRFCDate::localUTCOffset());
/*
@ -73,26 +73,26 @@ class MetarParser
* latitude and longitude to calculate the sunrise and sunset time to see if
* the day or night icon should be used.
*/
struct WeatherInfo processData(const QString &stationID, const QString &metar);
struct WeatherInfo processData(const TQString &stationID, const TQString &metar);
private:
bool parseCover(const QString &s);
bool parseCurrent(const QString &s);
bool parseTemperature(const QString &s);
bool parseTemperatureTenths(const QString &s);
bool parseCover(const TQString &s);
bool parseCurrent(const TQString &s);
bool parseTemperature(const TQString &s);
bool parseTemperatureTenths(const TQString &s);
void calcTemperatureVariables();
void removeTrailingDotZero(QString &string);
bool parseDate(const QString &s);
bool parseTime(const QString &s);
bool parseVisibility(QStringList::ConstIterator it);
bool parsePressure( const QString &s );
QString parseWindDirection(const unsigned int direction);
bool parseWindSpeed(const QString &s);
bool parseStationNeedsMaintenance(const QString &s);
void removeTrailingDotZero(TQString &string);
bool parseDate(const TQString &s);
bool parseTime(const TQString &s);
bool parseVisibility(TQStringList::ConstIterator it);
bool parsePressure( const TQString &s );
TQString parseWindDirection(const unsigned int direction);
bool parseWindSpeed(const TQString &s);
bool parseStationNeedsMaintenance(const TQString &s);
void calcCurrentIcon();
void calcWindChill();
bool isNight(const QString &stationID) const;
QString iconName( const QString &icon ) const;
bool isNight(const TQString &stationID) const;
TQString iconName( const TQString &icon ) const;
/*
* Reset the internal WeatherInfo struct of the class so that
@ -102,22 +102,22 @@ class MetarParser
StationDatabase* const m_stationDb;
const KLocale::MeasureSystem m_units;
const QDate m_date;
const QTime m_time;
const TQDate m_date;
const TQTime m_time;
const unsigned int m_localUTCOffset;
struct WeatherInfo weatherInfo;
QRegExp CoverRegExp;
QRegExp CurrentRegExp;
QRegExp WindRegExp;
QRegExp VisRegExp;
QRegExp VisFracRegExp;
QRegExp TempRegExp;
QRegExp TimeRegExp;
QRegExp DateRegExp;
QRegExp PressRegExp;
QRegExp TempTenRegExp;
TQRegExp CoverRegExp;
TQRegExp CurrentRegExp;
TQRegExp WindRegExp;
TQRegExp VisRegExp;
TQRegExp VisFracRegExp;
TQRegExp TempRegExp;
TQRegExp TimeRegExp;
TQRegExp DateRegExp;
TQRegExp PressRegExp;
TQRegExp TempTenRegExp;
};
#endif

@ -21,9 +21,9 @@
#include <iostream>
using namespace std;
#include <qdatetime.h>
#include <qfile.h>
#include <qstringlist.h>
#include <tqdatetime.h>
#include <tqfile.h>
#include <tqstringlist.h>
#include <krfcdate.h>
@ -34,7 +34,7 @@ void test1();
void test2();
void displayWeatherInfo(const struct WeatherInfo &wi);
const char *getString(const QString &str);
const char *getString(const TQString &str);
int localUTCOffset = -300;
@ -47,9 +47,9 @@ int main()
bool found = false;
// try the stations.dat file in the current directory first.
QString path("stations.dat");
TQString path("stations.dat");
if (QFile::exists(path))
if (TQFile::exists(path))
{
found = true;
}
@ -61,10 +61,10 @@ int main()
// means that make install would have had to be done first before calling
// make check so that the file will be there.
QString kdeDirs(getenv("KDEDIR"));
TQString kdeDirs(getenv("KDEDIR"));
path = kdeDirs + "/share/apps/kweatherservice/stations.dat";
if (QFile::exists(path))
if (TQFile::exists(path))
{
found = true;
}
@ -100,8 +100,8 @@ int main()
void test1()
{
QDate Date(2004, 6, 17); // June 17th.
QTime Time(21, 7); // hours, minutes, seconds and ms defaults to 0
TQDate Date(2004, 6, 17); // June 17th.
TQTime Time(21, 7); // hours, minutes, seconds and ms defaults to 0
// Construct a MetarParser object for our tests.
MetarParser parser( stationDb, KLocale::Imperial, Date, Time, localUTCOffset );
@ -134,8 +134,8 @@ void test1()
void test2()
{
QDate Date(2004, 6, 18); // June 18th.
QTime Time(18, 43); // hours, minutes, seconds and ms defaults to 0
TQDate Date(2004, 6, 18); // June 18th.
TQTime Time(18, 43); // hours, minutes, seconds and ms defaults to 0
// Construct a MetarParser object for our tests.
MetarParser parser( stationDb, KLocale::Imperial, Date, Time, localUTCOffset );
@ -176,13 +176,13 @@ void displayWeatherInfo(const struct WeatherInfo &wi)
cout << "heavy: " << wi.heavy << endl;
unsigned int i = 0;
for ( QStringList::ConstIterator it = wi.qsCoverList.begin();
for ( TQStringList::ConstIterator it = wi.qsCoverList.begin();
it != wi.qsCoverList.end();
++it, i++ ) {
cout << "qsCoverList[" << i << "]: " << (*it).latin1() << endl;
}
i = 0;
for ( QStringList::ConstIterator it = wi.qsCurrentList.begin();
for ( TQStringList::ConstIterator it = wi.qsCurrentList.begin();
it != wi.qsCurrentList.end();
++it, i++ ) {
cout << "qsCurrentList[" << i << "]: " << (*it).latin1() << endl;
@ -205,7 +205,7 @@ void displayWeatherInfo(const struct WeatherInfo &wi)
static const char *nullString = "[null]";
const char *getString(const QString &str)
const char *getString(const TQString &str)
{
if (str.isNull())
{

@ -41,18 +41,18 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
DCOPClient *client = app.dcopClient();
client->attach();
QString error;
TQString error;
if (!client->isApplicationRegistered("KWeatherService"))
{
if (KApplication::startServiceByDesktopName("kweatherservice",
QStringList(), &error))
TQStringList(), &error))
{
kdDebug() << "Starting kweatherservice failed: " << error << endl;
return -2;
}
}
QString reportLocation = args->arg( 0 );
TQString reportLocation = args->arg( 0 );
reportView *report = new reportView(reportLocation);
args->clear();
report->exec();

@ -23,30 +23,30 @@
#include <khtmlview.h>
#include <kglobalsettings.h>
#include <qvbox.h>
#include <qpixmap.h>
#include <qapplication.h>
#include <tqvbox.h>
#include <tqpixmap.h>
#include <tqapplication.h>
#include "reportview.h"
#include "weatherservice_stub.h"
reportView::reportView(const QString &reportLocation)
: KDialogBase( (QWidget *)0, "report", false, QString::null, Close ),
reportView::reportView(const TQString &reportLocation)
: KDialogBase( (TQWidget *)0, "report", false, TQString::null, Close ),
m_locationCode(reportLocation)
{
QVBox *vbox = makeVBoxMainWidget();
TQVBox *vbox = makeVBoxMainWidget();
m_reportView = new KHTMLPart(vbox, "m_reportView");
KConfig config( "weather_panelappletrc" );
config.setGroup( "General Options" );
QSize defaultSize( 450, 325 );
TQSize defaultSize( 450, 325 );
resize( config.readSizeEntry( "reportview_size", &defaultSize ) );
centerOnScreen( this );
m_weatherService = new WeatherService_stub( "KWeatherService", "WeatherService" );
QPixmap icon = m_weatherService->icon( m_locationCode );
TQPixmap icon = m_weatherService->icon( m_locationCode );
setIcon( icon );
render();
@ -55,7 +55,7 @@ reportView::reportView(const QString &reportLocation)
reportView::~reportView(){
delete m_weatherService;
// we do not have to delete m_reportView because this class is
// the parent of the QVBox, and that is the parent of the KHTMLPart.
// the parent of the TQVBox, and that is the parent of the KHTMLPart.
KConfig config( "weather_panelappletrc" );
config.setGroup( "General Options" );
@ -64,76 +64,76 @@ reportView::~reportView(){
/** Render the document */
void reportView::render(){
QFont generalFont = KGlobalSettings::generalFont();
QString fntFamily = generalFont.family();
TQFont generalFont = KGlobalSettings::generalFont();
TQString fntFamily = generalFont.family();
int fntSize = generalFont.pointSize();
if (fntSize == -1)
fntSize = QFontInfo(generalFont).pointSize();
QString textColor = KGlobalSettings::textColor().name();
QString baseColor = KGlobalSettings::baseColor().name();
QColorGroup cg = palette().active();
QString bgColor = cg.background().name();
QString hlColor = cg.highlight().name();
QString hlTextColor = cg.highlightedText().name();
QString locationName = m_weatherService->stationName(m_locationCode);
QString countryName = m_weatherService->stationCountry(m_locationCode);
QString temp = m_weatherService->temperature(m_locationCode);
QString dewPoint = m_weatherService->dewPoint( m_locationCode);
QString relHumidity = m_weatherService->relativeHumidity(m_locationCode );
QString heatIndex = m_weatherService->heatIndex(m_locationCode );
QString windChill = m_weatherService->windChill(m_locationCode );
QString pressure = m_weatherService->pressure(m_locationCode );
QString wind = m_weatherService->wind(m_locationCode );
QString sunRiseTime = m_weatherService->sunRiseTime(m_locationCode );
QString sunSetTime = m_weatherService->sunSetTime(m_locationCode );
QString date = m_weatherService->date(m_locationCode );
QString icon = m_weatherService->iconFileName(m_locationCode );
QStringList cover = m_weatherService->cover(m_locationCode );
QStringList weather = m_weatherService->weather(m_locationCode );
fntSize = TQFontInfo(generalFont).pointSize();
TQString textColor = KGlobalSettings::textColor().name();
TQString baseColor = KGlobalSettings::baseColor().name();
TQColorGroup cg = palette().active();
TQString bgColor = cg.background().name();
TQString hlColor = cg.highlight().name();
TQString hlTextColor = cg.highlightedText().name();
TQString locationName = m_weatherService->stationName(m_locationCode);
TQString countryName = m_weatherService->stationCountry(m_locationCode);
TQString temp = m_weatherService->temperature(m_locationCode);
TQString dewPoint = m_weatherService->dewPoint( m_locationCode);
TQString relHumidity = m_weatherService->relativeHumidity(m_locationCode );
TQString heatIndex = m_weatherService->heatIndex(m_locationCode );
TQString windChill = m_weatherService->windChill(m_locationCode );
TQString pressure = m_weatherService->pressure(m_locationCode );
TQString wind = m_weatherService->wind(m_locationCode );
TQString sunRiseTime = m_weatherService->sunRiseTime(m_locationCode );
TQString sunSetTime = m_weatherService->sunSetTime(m_locationCode );
TQString date = m_weatherService->date(m_locationCode );
TQString icon = m_weatherService->iconFileName(m_locationCode );
TQStringList cover = m_weatherService->cover(m_locationCode );
TQStringList weather = m_weatherService->weather(m_locationCode );
setCaption(i18n("Weather Report - %1").arg( locationName ) );
QString weatherText = "<ul>\n";
TQString weatherText = "<ul>\n";
if ( m_weatherService->stationNeedsMaintenance( m_locationCode ) )
{
weatherText += "<li>" + i18n( "Station reports that it needs maintenance" ) + " \n";
}
for (QStringList::const_iterator it = cover.begin();
for (TQStringList::const_iterator it = cover.begin();
it != cover.end(); ++it)
weatherText += "<li>" + *it + "\n";
for (QStringList::const_iterator it = weather.begin();
for (TQStringList::const_iterator it = weather.begin();
it != weather.end(); ++it)
weatherText += "<li>" + *it + "\n";
weatherText += "</ul>\n";
QString contents =
TQString contents =
"<html><head><style type=\"text/css\">" +
QString("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) +
QString("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) +
QString("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")
.arg(bgColor).arg(textColor).arg(textColor).arg(textColor).arg(textColor) +
QString("</style><title></title></head><body dir=\"%1\">").arg( QApplication::reverseLayout()?"rtl":"ltr") +
TQString("</style><title></title></head><body dir=\"%1\">").arg( TQApplication::reverseLayout()?"rtl":"ltr") +
"<div class=\"headerTitle\"><b>" + i18n( "Weather Report - %1 - %2" ).arg( locationName ).arg( countryName ) +
"</b></div>\n";
if ( ! date.isEmpty() )
contents += "<div class=\"headerMsg\"><b>" + i18n( "Latest data from %1" ).arg(date) + "</b></div>\n";
contents += QString(
contents += TQString(
"<table><tr><td width=\"60\" style=\"text-align: center; border: dotted %1 1px;\">"
"<img width=\"64\" height=\"64\" src=\"%2\" /></td>"
"<td style=\"vertical-align: top\">%3</td></tr>")
.arg(bgColor).arg(KURL(icon).url()).arg(weatherText) +
"</table><table>" +
QString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" )
TQString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" )
+ "</th><td>%1</td>"
"<td width=\"50\">&nbsp;</td>"
"<th style=\"text-align: right\">" + i18n( "Dew Point:" )
@ -149,16 +149,16 @@ void reportView::render(){
.arg(wind) + "<td width=\"50\">&nbsp;</td>";
if (!heatIndex.isEmpty())
contents += QString("<th style=\"text-align: right\">"
contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Heat Index:" ) + "</th><td>%1</td>").arg(heatIndex);
else if (!windChill.isEmpty())
contents += QString("<th style=\"text-align: right\">"
contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Wind Chill:" ) + "</th><td>%1</td>").arg(windChill);
else
contents += "<td>&nbsp;</td><td>&nbsp;</td>";
contents += "</tr>";
contents += QString("<tr><th style=\"text-align: right\">"
contents += TQString("<tr><th style=\"text-align: right\">"
+ i18n( "Sunrise:" ) + "</th><td>%1</td>" +
"<td width=\"50\">&nbsp;</td><th style=\"text-align: right\">"
+ i18n( "Sunset:" ) + "</th><td>%2</td>")
@ -170,7 +170,7 @@ void reportView::render(){
m_reportView->write( contents );
m_reportView->end();
QScrollView *view = m_reportView->view();
TQScrollView *view = m_reportView->view();
kdDebug() << "Size " << view->size().height() << "," << view->size().width() << endl;
kdDebug() << "Size " << view->visibleHeight() << "," << view->visibleWidth() << endl;

@ -19,7 +19,7 @@
#define REPORTVIEW_H
#include <kdialogbase.h>
#include <qstringlist.h>
#include <tqstringlist.h>
class KHTMLPart;
@ -33,7 +33,7 @@ class reportView : public KDialogBase {
Q_OBJECT
public:
reportView(const QString &reportLocation);
reportView(const TQString &reportLocation);
~reportView();
void render();
@ -41,7 +41,7 @@ public:
private:
WeatherService_stub *m_weatherService;
KHTMLPart *m_reportView;
QString m_locationCode;
TQString m_locationCode;
};
#endif

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <qimage.h>
#include <qheader.h>
#include <tqimage.h>
#include <tqheader.h>
#include <dcopclient.h>
#include <dcopref.h>
@ -37,30 +37,30 @@
class StationItem : public QListViewItem
{
public:
StationItem( QListView *view, const QString &name, const QString &uid )
: QListViewItem( view, name ), mUID( uid )
StationItem( TQListView *view, const TQString &name, const TQString &uid )
: TQListViewItem( view, name ), mUID( uid )
{
}
StationItem( QListViewItem *item, const QString &name, const QString &uid )
: QListViewItem( item, name ), mUID( uid )
StationItem( TQListViewItem *item, const TQString &name, const TQString &uid )
: TQListViewItem( item, name ), mUID( uid )
{
}
QString uid() const { return mUID; }
TQString uid() const { return mUID; }
private:
QString mUID;
TQString mUID;
};
static void parseStationEntry( const QString &line, QString &name, QString &uid );
static void parseStationEntry( const TQString &line, TQString &name, TQString &uid );
ServiceConfigWidget::ServiceConfigWidget( QWidget *parent, const char *name )
ServiceConfigWidget::ServiceConfigWidget( TQWidget *parent, const char *name )
: wsPrefs( parent, name ), mService(0)
{
mService = new WeatherService_stub( "KWeatherService", "WeatherService" );
connect( mAllStations, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), SLOT( addStation() ) );
connect( mSelectedStations, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), SLOT( removeStation() ) );
connect( mAllStations, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), TQT_SLOT( addStation() ) );
connect( mSelectedStations, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), TQT_SLOT( removeStation() ) );
initGUI();
loadLocations();
@ -125,16 +125,16 @@ void ServiceConfigWidget::scanStations()
if ( !dcopActive() )
return;
QStringList list = mService->listStations( );
TQStringList list = mService->listStations( );
mSelectedStations->clear();
for ( uint i = 0; i < list.count(); ++i ) {
QPixmap pm = mService->icon( list[ i ] );
QImage img = pm.convertToImage();
TQPixmap pm = mService->icon( list[ i ] );
TQImage img = pm.convertToImage();
img = img.smoothScale( 22, 22 );
pm.convertFromImage( img );
QString uid = list[ i ];
TQString uid = list[ i ];
if (mStationMap[ uid ].isEmpty())
{
mStationMap[ uid ] = uid;
@ -145,7 +145,7 @@ void ServiceConfigWidget::scanStations()
}
}
void ServiceConfigWidget::selectionChanged( QListViewItem *item )
void ServiceConfigWidget::selectionChanged( TQListViewItem *item )
{
mRemoveButton->setEnabled( item != 0 );
}
@ -166,34 +166,34 @@ void ServiceConfigWidget::loadLocations()
KConfig config( locate( "data", "kweatherservice/weather_stations.desktop" ) );
config.setGroup( "Main" );
QStringList regions = QStringList::split( ' ', config.readEntry( "regions" ) );
TQStringList regions = TQStringList::split( ' ', config.readEntry( "regions" ) );
QStringList::ConstIterator regionIt;
TQStringList::ConstIterator regionIt;
for ( regionIt = regions.begin(); regionIt != regions.end(); ++regionIt ) {
config.setGroup( *regionIt );
QString name = config.readEntry( "name" );
QStringList states = config.readListEntry( "states", ' ' );
TQString name = config.readEntry( "name" );
TQStringList states = config.readListEntry( "states", ' ' );
QListViewItem *regionItem = new QListViewItem( mAllStations, name );
TQListViewItem *regionItem = new TQListViewItem( mAllStations, name );
regionItem->setSelectable( false );
QStringList::ConstIterator stateIt;
TQStringList::ConstIterator stateIt;
for ( stateIt = states.begin(); stateIt != states.end(); ++stateIt ) {
config.setGroup( *regionIt + "_" + *stateIt );
QString name = config.readEntry( "name" );
TQString name = config.readEntry( "name" );
QListViewItem *stateItem = new QListViewItem( regionItem, name );
TQListViewItem *stateItem = new TQListViewItem( regionItem, name );
stateItem->setSelectable( false );
QMap<QString, QString> entries = config.entryMap( *regionIt + "_" + *stateIt );
QMap<QString, QString>::ConstIterator entryIt;
TQMap<TQString, TQString> entries = config.entryMap( *regionIt + "_" + *stateIt );
TQMap<TQString, TQString>::ConstIterator entryIt;
for ( entryIt = entries.begin(); entryIt != entries.end(); ++entryIt ) {
if ( entryIt.key() != "name" ) {
QString station, uid;
TQString station, uid;
// get station and uid from the data
parseStationEntry( entryIt.data(), station, uid );
new StationItem( stateItem, station, uid );
mStationMap.insert( uid, QString( "%1, %2" )
mStationMap.insert( uid, TQString( "%1, %2" )
.arg( station ).arg( *stateIt ) );
}
}
@ -203,21 +203,21 @@ void ServiceConfigWidget::loadLocations()
bool ServiceConfigWidget::dcopActive()
{
QString error;
QCString appID;
TQString error;
TQCString appID;
bool isGood = true;
DCOPClient *client = kapp->dcopClient();
if ( !client->isApplicationRegistered( "KWeatherService" ) ) {
if ( KApplication::startServiceByDesktopName( "kweatherservice", QStringList(), &error, &appID ) )
if ( KApplication::startServiceByDesktopName( "kweatherservice", TQStringList(), &error, &appID ) )
isGood = false;
}
return isGood;
}
void parseStationEntry( const QString &line, QString &name, QString &uid )
void parseStationEntry( const TQString &line, TQString &name, TQString &uid )
{
QStringList list = QStringList::split( ' ', line );
TQStringList list = TQStringList::split( ' ', line );
bool inName = true;

@ -30,7 +30,7 @@ class ServiceConfigWidget : public wsPrefs
Q_OBJECT
public:
ServiceConfigWidget( QWidget *parent, const char *name = 0 );
ServiceConfigWidget( TQWidget *parent, const char *name = 0 );
virtual ~ServiceConfigWidget();
signals:
@ -42,7 +42,7 @@ class ServiceConfigWidget : public wsPrefs
void updateStations();
void exitWeatherService();
void selectionChanged( QListViewItem* );
void selectionChanged( TQListViewItem* );
void modified();
private:
@ -51,7 +51,7 @@ class ServiceConfigWidget : public wsPrefs
bool dcopActive();
void scanStations();
QMap<QString, QString> mStationMap;
TQMap<TQString, TQString> mStationMap;
WeatherService_stub *mService;
};

@ -20,14 +20,14 @@
*/
#include "sidebarwidget.h"
#include <qscrollview.h>
#include <tqscrollview.h>
sidebarwidget::sidebarwidget(QWidget* parent, const char* name) :
sidebarwidget::sidebarwidget(TQWidget* parent, const char* name) :
sidebarwidgetbase(parent,name)
{
view = new QVBox(reportGrid->viewport());
view = new TQVBox(reportGrid->viewport());
reportGrid->addChild(view);
reportGrid->setResizePolicy(QScrollView::AutoOneFit);
reportGrid->setResizePolicy(TQScrollView::AutoOneFit);
}
sidebarwidget::~sidebarwidget()
@ -35,12 +35,12 @@
}
void sidebarwidget::addWidget(QWidget *w, const QString &s)
void sidebarwidget::addWidget(TQWidget *w, const TQString &s)
{
w->setFixedWidth(reportGrid->visibleWidth ());
}
QWidget *sidebarwidget::viewport()
TQWidget *sidebarwidget::viewport()
{
return view;
}

@ -24,17 +24,17 @@
#include <sidebarwidgetbase.h>
#include <qvbox.h>
#include <tqvbox.h>
class sidebarwidget : public sidebarwidgetbase
{
Q_OBJECT
public:
sidebarwidget(QWidget* parent, const char* name = 0);
sidebarwidget(TQWidget* parent, const char* name = 0);
virtual ~sidebarwidget();
void addWidget(QWidget *w, const QString &s);
QWidget *viewport();
QVBox *view;
void addWidget(TQWidget *w, const TQString &s);
TQWidget *viewport();
TQVBox *view;
};

@ -12,21 +12,21 @@
//
#include "stationdatabase.h"
#include <qstringlist.h>
#include <qfile.h>
#include <tqstringlist.h>
#include <tqfile.h>
#include <kdebug.h>
class StationInfo
{
public:
QString cityName;
QString country;
QString longitude;
QString latitude;
TQString cityName;
TQString country;
TQString longitude;
TQString latitude;
StationInfo () {}
};
StationDatabase::StationDatabase(const QString path) : mPath(path)
StationDatabase::StationDatabase(const TQString path) : mPath(path)
{
}
@ -35,21 +35,21 @@ StationDatabase::~StationDatabase()
{
}
bool StationDatabase::loadStation( const QString & stationID )
bool StationDatabase::loadStation( const TQString & stationID )
{
QFile file( mPath );
TQFile file( mPath );
bool found = FALSE;
if ( !file.open( IO_ReadOnly ) )
return false;
QTextStream stream( &file );
stream.setEncoding( QTextStream::UnicodeUTF8 );
QString line;
TQTextStream stream( &file );
stream.setEncoding( TQTextStream::UnicodeUTF8 );
TQString line;
while ( !stream.eof() )
{
line = stream.readLine(); // line of text excluding '\n'
QStringList data = QStringList::split( ";", line, true );
TQStringList data = TQStringList::split( ";", line, true );
if ( data[ 0 ].stripWhiteSpace() == stationID )
{
@ -70,11 +70,11 @@ bool StationDatabase::loadStation( const QString & stationID )
}
/*!
\fn StationDatabase::stationNameFromID(const QString& id)
\fn StationDatabase::stationNameFromID(const TQString& id)
*/
QString StationDatabase::stationNameFromID( const QString & stationID )
TQString StationDatabase::stationNameFromID( const TQString & stationID )
{
QString result;
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@ -92,11 +92,11 @@ QString StationDatabase::stationNameFromID( const QString & stationID )
}
/*!
\fn StationDatabase::stationLongitudeFromID( const QString &stationID)
\fn StationDatabase::stationLongitudeFromID( const TQString &stationID)
*/
QString StationDatabase::stationLongitudeFromID( const QString & stationID )
TQString StationDatabase::stationLongitudeFromID( const TQString & stationID )
{
QString result;
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@ -114,11 +114,11 @@ QString StationDatabase::stationLongitudeFromID( const QString & stationID )
}
/*!
\fn StationDatabase::stationLatitudeFromID(const QString &stationID)
\fn StationDatabase::stationLatitudeFromID(const TQString &stationID)
*/
QString StationDatabase::stationLatitudeFromID( const QString & stationID )
TQString StationDatabase::stationLatitudeFromID( const TQString & stationID )
{
QString result;
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@ -136,11 +136,11 @@ QString StationDatabase::stationLatitudeFromID( const QString & stationID )
}
/*!
\fn StationDatabase::stationCountryFromID( const QString &stationID)
\fn StationDatabase::stationCountryFromID( const TQString &stationID)
*/
QString StationDatabase::stationCountryFromID( const QString &stationID )
TQString StationDatabase::stationCountryFromID( const TQString &stationID )
{
QString result;
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@ -157,9 +157,9 @@ QString StationDatabase::stationCountryFromID( const QString &stationID )
return result;
}
QString StationDatabase::stationIDfromName( const QString &name )
TQString StationDatabase::stationIDfromName( const TQString &name )
{
QMap<QString,StationInfo>::Iterator itr = theDB.begin();
TQMap<TQString,StationInfo>::Iterator itr = theDB.begin();
for( ; itr != theDB.end(); ++itr)
{
kdDebug() << "Checking " << itr.data().cityName << endl;

@ -13,8 +13,8 @@
#ifndef STATIONDATABASE_H
#define STATIONDATABASE_H
#include <qmap.h>
#include <qstring.h>
#include <tqmap.h>
#include <tqstring.h>
#include <klocale.h>
#include <kstandarddirs.h>
@ -30,25 +30,25 @@ class StationInfo;
class StationDatabase
{
public:
StationDatabase(const QString path = locate("data", "kweatherservice/stations.dat"));
StationDatabase(const TQString path = locate("data", "kweatherservice/stations.dat"));
~StationDatabase();
QString stationNameFromID(const QString& id);
TQString stationNameFromID(const TQString& id);
QString stationLongitudeFromID( const QString &stationID);
TQString stationLongitudeFromID( const TQString &stationID);
QString stationLatitudeFromID(const QString &stationID);
TQString stationLatitudeFromID(const TQString &stationID);
QString stationCountryFromID( const QString &stationID);
TQString stationCountryFromID( const TQString &stationID);
QString stationIDfromName( const QString &name );
TQString stationIDfromName( const TQString &name );
private:
QMap<QString, StationInfo> theDB;
TQMap<TQString, StationInfo> theDB;
bool loadStation( const QString & stationID );
bool loadStation( const TQString & stationID );
const QString mPath;
const TQString mPath;
};
#endif

@ -19,9 +19,9 @@
#include <cstdlib>
using namespace std;
#include <qfile.h>
#include <qstring.h>
#include <qdatetime.h>
#include <tqfile.h>
#include <tqstring.h>
#include <tqdatetime.h>
#include <krfcdate.h>
#include "stationdatabase.h"
@ -33,9 +33,9 @@ int main()
bool found = false;
// try the stations.dat file in the current directory first.
QString path("stations.dat");
TQString path("stations.dat");
if (QFile::exists(path))
if (TQFile::exists(path))
{
found = true;
}
@ -47,10 +47,10 @@ int main()
// means that make install would have had to be done first before calling
// make check so that the file will be there.
QString kdeDirs(getenv("KDEDIR"));
TQString kdeDirs(getenv("KDEDIR"));
path = kdeDirs + "/share/apps/kweatherservice/stations.dat";
if (QFile::exists(path))
if (TQFile::exists(path))
{
found = true;
}

@ -54,8 +54,8 @@ static inline double acosd(double x) { return RADEG * acos(x); }
static inline double atan2d(double y, double x) { return RADEG * atan2(y, x); }
/* Other local functions */
static double latitudeToDouble( const QString &latitude );
static double longitudeToDouble( const QString &longitude );
static double latitudeToDouble( const TQString &latitude );
static double longitudeToDouble( const TQString &longitude );
static int __sunriset__( int year, int month, int day, double lon, double lat,
double altit, int upper_limb, double &trise, double &tset );
static void sunpos( double d, double &lon, double &r );
@ -87,7 +87,7 @@ static inline int civil_twilight(int year, int month, int day, double lon, doubl
}
Sun::Sun(const QString &latitude, const QString &longitude, QDate date, const int localUTCOffset) :
Sun::Sun(const TQString &latitude, const TQString &longitude, TQDate date, const int localUTCOffset) :
m_date(date),
m_lat(latitudeToDouble(latitude)), m_lon(longitudeToDouble(longitude)),
m_localUTCOffset(localUTCOffset)
@ -95,14 +95,14 @@ Sun::Sun(const QString &latitude, const QString &longitude, QDate date, const in
}
QTime Sun::computeRiseTime()
TQTime Sun::computeRiseTime()
{
double riseTime;
double setTime;
sun_rise_set( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, riseTime, setTime );
QTime result = convertDoubleToLocalTime( riseTime );
TQTime result = convertDoubleToLocalTime( riseTime );
if ( ! result.isValid() )
result.setHMS( 6, 0, 0 );
@ -111,14 +111,14 @@ QTime Sun::computeRiseTime()
}
QTime Sun::computeSetTime()
TQTime Sun::computeSetTime()
{
double riseTime;
double setTime;
sun_rise_set( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, riseTime, setTime );
QTime result = convertDoubleToLocalTime( setTime );
TQTime result = convertDoubleToLocalTime( setTime );
if ( ! result.isValid() )
result.setHMS( 19, 0, 0 );
@ -127,14 +127,14 @@ QTime Sun::computeSetTime()
}
QTime Sun::computeCivilTwilightStart()
TQTime Sun::computeCivilTwilightStart()
{
double start;
double end;
civil_twilight( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, start, end );
QTime result = convertDoubleToLocalTime( start );
TQTime result = convertDoubleToLocalTime( start );
if ( ! result.isValid() )
result.setHMS( 6, 0, 0 );
@ -143,14 +143,14 @@ QTime Sun::computeCivilTwilightStart()
}
QTime Sun::computeCivilTwilightEnd()
TQTime Sun::computeCivilTwilightEnd()
{
double start;
double end;
civil_twilight( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, start, end );
QTime result = convertDoubleToLocalTime( end );
TQTime result = convertDoubleToLocalTime( end );
if ( ! result.isValid() )
result.setHMS( 19, 0, 0 );
@ -167,7 +167,7 @@ QTime Sun::computeCivilTwilightEnd()
*
* Does not currently handle seconds.
*/
static double latitudeToDouble( const QString &latitude )
static double latitudeToDouble( const TQString &latitude )
{
double result;
@ -183,7 +183,7 @@ static double latitudeToDouble( const QString &latitude )
}
static double longitudeToDouble( const QString &longitude )
static double longitudeToDouble( const TQString &longitude )
{
double result;
@ -199,9 +199,9 @@ static double longitudeToDouble( const QString &longitude )
}
QTime Sun::convertDoubleToLocalTime( const double time )
TQTime Sun::convertDoubleToLocalTime( const double time )
{
QTime result;
TQTime result;
// Example: say time is 17.7543 Then hours = 17 and minutes = 0.7543 * 60 = 45.258
// We need to convert the time to CORRECT local hours

@ -18,8 +18,8 @@
#ifndef SUN_H
#define SUN_H
#include <qstring.h>
#include <qdatetime.h>
#include <tqstring.h>
#include <tqdatetime.h>
#include <krfcdate.h>
class Sun
@ -35,20 +35,20 @@ class Sun
* to the local time zone.
*
*/
Sun( const QString &latitude,
const QString &longitude,
QDate date = QDate::currentDate(),
Sun( const TQString &latitude,
const TQString &longitude,
TQDate date = TQDate::currentDate(),
const int localUTCOffset = KRFCDate::localUTCOffset() );
QTime computeRiseTime();
QTime computeSetTime();
QTime computeCivilTwilightStart();
QTime computeCivilTwilightEnd();
TQTime computeRiseTime();
TQTime computeSetTime();
TQTime computeCivilTwilightStart();
TQTime computeCivilTwilightEnd();
private:
QTime convertDoubleToLocalTime( const double time );
TQTime convertDoubleToLocalTime( const double time );
const QDate m_date;
const TQDate m_date;
const double m_lat;
const double m_lon;
const int m_localUTCOffset;

@ -18,8 +18,8 @@
#include <iostream>
using namespace std;
#include <qstring.h>
#include <qdatetime.h>
#include <tqstring.h>
#include <tqdatetime.h>
#include <krfcdate.h>
#include "sun.h"
@ -29,16 +29,16 @@ int main()
{
bool anyFailed = false;
QString KUGN_Latitude("42-25N");
QString KUGN_Longitude("087-52W");
QDate Date(2004, 6, 1); // June 1st.
TQString KUGN_Latitude("42-25N");
TQString KUGN_Longitude("087-52W");
TQDate Date(2004, 6, 1); // June 1st.
int localUTCOffset = -300;
// Construct a sun object for our tests.
Sun theSun( KUGN_Latitude, KUGN_Longitude, Date, localUTCOffset );
QTime civilStart = theSun.computeCivilTwilightStart();
QTime civilEnd = theSun.computeCivilTwilightEnd();
TQTime civilStart = theSun.computeCivilTwilightStart();
TQTime civilEnd = theSun.computeCivilTwilightEnd();
cout << "Testing Civil Twilight Calculations...";
// Start should be 04:42:39 End should be 20:56:06
@ -55,8 +55,8 @@ int main()
cout << "Testing Rise and Set Time Calculations...";
QTime rise = theSun.computeRiseTime();
QTime set = theSun.computeSetTime();
TQTime rise = theSun.computeRiseTime();
TQTime set = theSun.computeSetTime();
// Rise should be 05:16:35 Set should be 20:22:10
if (rise.hour() == 5 && rise.minute() == 16 && rise.second() == 35 &&

@ -9,7 +9,7 @@ public:
k_dcop:
/** Cause KWeather to refrsh it's data **/
virtual void refresh(QString) = 0;
virtual void refresh(TQString) = 0;
};
#endif

@ -23,11 +23,11 @@
#include "dockwidget.h"
#include "sidebarwidget.h"
#include <qlabel.h>
#include <qfont.h>
#include <qlayout.h>
#include <qscrollview.h>
#include <qgroupbox.h>
#include <tqlabel.h>
#include <tqfont.h>
#include <tqlayout.h>
#include <tqscrollview.h>
#include <tqgroupbox.h>
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
@ -36,9 +36,9 @@
#include <dcopref.h>
KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
QWidget* widgetParent,
QString& desktopName, const char* name)
KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, TQObject* parent,
TQWidget* widgetParent,
TQString& desktopName, const char* name)
: KonqSidebarPlugin(inst, parent, widgetParent, desktopName, name),
DCOPObject(name)
@ -51,8 +51,8 @@ KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
kdDebug() << "Get weatherstation list... " << endl;
if (!connectDCOPSignal(0,0,
"fileUpdate(QString)",
"refresh(QString)",false))
"fileUpdate(TQString)",
"refresh(TQString)",false))
kdDebug() << "Could not attach signal..." << endl;
else
kdDebug() << "attached dcop signals..." << endl;
@ -60,7 +60,7 @@ KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
DCOPReply reply = dcopCall.call("listStations()", true );
if ( reply.isValid() ) {
QStringList replyList = reply;
TQStringList replyList = reply;
for(int i = 0; i < replyList.size(); i++)
{
dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1());
@ -68,13 +68,13 @@ KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
d->resizeView(80,48);
d->show();
m_widgets.insert(replyList[i], d);
dcopCall.send("update(QString)", replyList[i]);
dcopCall.send("update(TQString)", replyList[i]);
}
}
timeOut = new QTimer(this, "timeOut" );
timeOut = new TQTimer(this, "timeOut" );
timeOut->changeInterval(15*60000);
connect(timeOut, SIGNAL(timeout()), this, SLOT(update()));
connect(timeOut, TQT_SIGNAL(timeout()), this, TQT_SLOT(update()));
// m_widgets.append(new dockwidget(widgetParent));
}
@ -83,30 +83,30 @@ KonqSidebarWeather::~KonqSidebarWeather()
{
}
void* KonqSidebarWeather::provides(const QString&)
void* KonqSidebarWeather::provides(const TQString&)
{
return 0;
}
void KonqSidebarWeather::emitStatusBarText(const QString& s)
void KonqSidebarWeather::emitStatusBarText(const TQString& s)
{
}
QWidget* KonqSidebarWeather::getWidget()
TQWidget* KonqSidebarWeather::getWidget()
{
return m_container;
}
void KonqSidebarWeather::refresh(QString stationID)
void KonqSidebarWeather::refresh(TQString stationID)
{
kdDebug() << "refresh " << stationID << endl;
if(m_widgets.find(stationID))
{
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
m_widgets[stationID]->setWeatherIcon(dcopCall.call("currentIcon(QString)", stationID ,true ));
m_widgets[stationID]->setTemperature(dcopCall.call("temperature(QString)", stationID,true ));
m_widgets[stationID]->setPressure(dcopCall.call("pressure(QString)", stationID,true ));
m_widgets[stationID]->setWind(dcopCall.call("wind(QString)", stationID,true ));
m_widgets[stationID]->setWeatherIcon(dcopCall.call("currentIcon(TQString)", stationID ,true ));
m_widgets[stationID]->setTemperature(dcopCall.call("temperature(TQString)", stationID,true ));
m_widgets[stationID]->setPressure(dcopCall.call("pressure(TQString)", stationID,true ));
m_widgets[stationID]->setWind(dcopCall.call("wind(TQString)", stationID,true ));
m_widgets[stationID]->showWeather();
}
else
@ -131,7 +131,7 @@ void KonqSidebarWeather::update()
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
DCOPReply reply = dcopCall.call("listStations()", true );
if ( reply.isValid() ) {
QStringList replyList = reply;
TQStringList replyList = reply;
for(int i = 0; i < replyList.size(); i++)
{
if(!m_widgets.find(replyList[i]))
@ -141,7 +141,7 @@ void KonqSidebarWeather::update()
d->show();
m_widgets.insert(replyList[i], d);
}
dcopCall.send("update(QString)", replyList[i]);
dcopCall.send("update(TQString)", replyList[i]);
}
}
timeOut->start(15*60000);
@ -149,14 +149,14 @@ void KonqSidebarWeather::update()
extern "C"
{
KDE_EXPORT void* create_weather_sidebar(KInstance* inst, QObject* par, QWidget*widp,
QString& desktopname, const char* name)
KDE_EXPORT void* create_weather_sidebar(KInstance* inst, TQObject* par, TQWidget*widp,
TQString& desktopname, const char* name)
{
return new KonqSidebarWeather(inst, par, widp, desktopname, name);
}
KDE_EXPORT bool add_weather_sidebar(QString* fn, QString* /*param*/,
QMap<QString, QString>* map)
KDE_EXPORT bool add_weather_sidebar(TQString* fn, TQString* /*param*/,
TQMap<TQString, TQString>* map)
{
map->insert("Type","Link");
map->insert("Icon","weather_sidebar");

@ -26,10 +26,10 @@
#include <kparts/part.h>
#include <kparts/factory.h>
#include <kparts/browserextension.h>
#include <qdict.h>
#include <tqdict.h>
#include <dcopobject.h>
#include <qlayout.h>
#include <qtimer.h>
#include <tqlayout.h>
#include <tqtimer.h>
class dockwidget;
class sidebarwidget;
@ -39,16 +39,16 @@ class KonqSidebarWeather: public KonqSidebarPlugin, virtual public DCOPObject
Q_OBJECT
K_DCOP
public:
KonqSidebarWeather(KInstance* inst, QObject* parent, QWidget* widgetParent,
QString& desktopName_, const char* name = 0);
KonqSidebarWeather(KInstance* inst, TQObject* parent, TQWidget* widgetParent,
TQString& desktopName_, const char* name = 0);
~KonqSidebarWeather();
virtual void* provides(const QString&);
void emitStatusBarText(const QString&);
virtual QWidget *getWidget();
virtual void* provides(const TQString&);
void emitStatusBarText(const TQString&);
virtual TQWidget *getWidget();
k_dcop:
virtual void refresh(QString);
virtual void refresh(TQString);
protected:
virtual void handleURL(const KURL &url);
@ -59,9 +59,9 @@ private slots:
void update();
private:
QDict <dockwidget> m_widgets;
TQDict <dockwidget> m_widgets;
sidebarwidget *m_container;
QTimer *timeOut;
TQTimer *timeOut;
};
#endif

@ -19,7 +19,7 @@
#include "weatherbutton.h"
#include <qpainter.h>
#include <tqpainter.h>
#include <kapplication.h>
#include <kcursor.h>
@ -29,15 +29,15 @@
#include <kipc.h>
#include <kstandarddirs.h>
WeatherButton::WeatherButton( QWidget *parent, const char *name )
: QButton( parent, name ), m_highlight( false )
WeatherButton::WeatherButton( TQWidget *parent, const char *name )
: TQButton( parent, name ), m_highlight( false )
{
setBackgroundOrigin( AncestorOrigin );
connect( kapp, SIGNAL( settingsChanged( int ) ),
SLOT( slotSettingsChanged( int ) ) );
connect( kapp, SIGNAL( iconChanged( int ) ),
SLOT( slotIconChanged( int ) ) );
connect( kapp, TQT_SIGNAL( settingsChanged( int ) ),
TQT_SLOT( slotSettingsChanged( int ) ) );
connect( kapp, TQT_SIGNAL( iconChanged( int ) ),
TQT_SLOT( slotIconChanged( int ) ) );
kapp->addKipcEventMask( KIPC::SettingsChanged );
kapp->addKipcEventMask( KIPC::IconChanged );
@ -45,19 +45,19 @@ WeatherButton::WeatherButton( QWidget *parent, const char *name )
slotSettingsChanged( KApplication::SETTINGS_MOUSE );
}
void WeatherButton::drawButton( QPainter *p )
void WeatherButton::drawButton( TQPainter *p )
{
drawButtonLabel(p);
}
void WeatherButton::drawButtonLabel( QPainter *p )
void WeatherButton::drawButtonLabel( TQPainter *p )
{
if (!pixmap())
{
return;
}
QPixmap pix = m_highlight? m_activeIcon : m_normalIcon;
TQPixmap pix = m_highlight? m_activeIcon : m_normalIcon;
if (isOn() || isDown())
{
@ -70,7 +70,7 @@ void WeatherButton::drawButtonLabel( QPainter *p )
int ph = pix.height();
int pw = pix.width();
int margin = 3;
QPoint origin(margin / 2, margin / 2);
TQPoint origin(margin / 2, margin / 2);
if (ph < (h - margin))
{
@ -86,9 +86,9 @@ void WeatherButton::drawButtonLabel( QPainter *p )
}
void WeatherButton::setPixmap( const QPixmap &pix )
void WeatherButton::setPixmap( const TQPixmap &pix )
{
QButton::setPixmap( pix );
TQButton::setPixmap( pix );
generateIcons();
}
@ -97,8 +97,8 @@ void WeatherButton::generateIcons()
if ( !pixmap() )
return;
QImage image = pixmap()->convertToImage();
image = image.smoothScale( pixmapSize(), QImage::ScaleMin );
TQImage image = pixmap()->convertToImage();
image = image.smoothScale( pixmapSize(), TQImage::ScaleMin );
KIconEffect effect;
@ -127,31 +127,31 @@ void WeatherButton::slotIconChanged( int group )
repaint( false );
}
void WeatherButton::enterEvent( QEvent *e )
void WeatherButton::enterEvent( TQEvent *e )
{
m_highlight = true;
repaint( false );
QButton::enterEvent( e );
TQButton::enterEvent( e );
}
void WeatherButton::leaveEvent( QEvent *e )
void WeatherButton::leaveEvent( TQEvent *e )
{
m_highlight = false;
repaint( false );
QButton::enterEvent( e );
TQButton::enterEvent( e );
}
void WeatherButton::resizeEvent( QResizeEvent * )
void WeatherButton::resizeEvent( TQResizeEvent * )
{
generateIcons();
}
QPoint WeatherButton::pixmapOrigin() const
TQPoint WeatherButton::pixmapOrigin() const
{
QSize point = margin()/2;
QPoint origin( point.width(), point.height() );
TQSize point = margin()/2;
TQPoint origin( point.width(), point.height() );
return origin;
}

@ -20,32 +20,32 @@
#ifndef WEATHERBUTTON_H
#define WEATHERBUTTON_H
#include <qbutton.h>
#include <qpixmap.h>
#include <tqbutton.h>
#include <tqpixmap.h>
class WeatherButton : public QButton
{
Q_OBJECT
public:
WeatherButton( QWidget *parent, const char *name );
void setPixmap( const QPixmap &pix );
WeatherButton( TQWidget *parent, const char *name );
void setPixmap( const TQPixmap &pix );
protected:
void drawButton( QPainter *p );
void drawButtonLabel( QPainter *p );
QSize margin() const { return QSize( 3, 3 ); }
QSize pixmapSize() const { return size() - margin()*2; }
QPoint pixmapOrigin() const;
void drawButton( TQPainter *p );
void drawButtonLabel( TQPainter *p );
TQSize margin() const { return TQSize( 3, 3 ); }
TQSize pixmapSize() const { return size() - margin()*2; }
TQPoint pixmapOrigin() const;
void generateIcons();
void enterEvent( QEvent *e );
void leaveEvent( QEvent *e );
void resizeEvent( QResizeEvent *e );
void enterEvent( TQEvent *e );
void leaveEvent( TQEvent *e );
void resizeEvent( TQResizeEvent *e );
bool m_highlight;
QPixmap m_normalIcon;
QPixmap m_activeIcon;
TQPixmap m_normalIcon;
TQPixmap m_activeIcon;
protected slots:
void slotSettingsChanged( int category );

@ -16,9 +16,9 @@ email : geiseri@msoe.edu
***************************************************************************/
#include "config.h"
#include <qfile.h>
#include <qdatetime.h>
#include <qtextstream.h>
#include <tqfile.h>
#include <tqdatetime.h>
#include <tqtextstream.h>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
@ -50,7 +50,7 @@ class WeatherLib::Data
/** The current weather state outside */
struct WeatherInfo wi;
QDateTime age;
TQDateTime age;
KTempFile *target;
bool downloading;
bool updated;
@ -65,7 +65,7 @@ WeatherLib::Data::Data()
void WeatherLib::Data::clear()
{
age = QDateTime::currentDateTime();
age = TQDateTime::currentDateTime();
downloading = false;
updated = false;
job = 0;
@ -77,8 +77,8 @@ void WeatherLib::Data::clear()
}
}
WeatherLib::WeatherLib(StationDatabase *stationDB, QObject *parent, const char *name)
: QObject (parent, name)
WeatherLib::WeatherLib(StationDatabase *stationDB, TQObject *parent, const char *name)
: TQObject (parent, name)
{
KGlobal::locale()->insertCatalogue("kweather");
@ -106,7 +106,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
}
}
// Find the job
QDictIterator<Data> it( data );
TQDictIterator<Data> it( data );
Data *d = 0L;
for( ; it.current(); ++it )
{
@ -118,13 +118,13 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
if( !job->error() )
{
kdDebug( 12006) << "Reading: " << d->target->name() << endl;
QFile file( d->target->name() );
TQFile file( d->target->name() );
file.open( IO_ReadOnly );
QTextStream *t = new QTextStream( &file );
//QTextStream *t = d->target->textStream();
TQTextStream *t = new TQTextStream( &file );
//TQTextStream *t = d->target->textStream();
if( t )
{
QString s = QString::null;
TQString s = TQString::null;
while ( !t->eof() )
{
s += " " + t->readLine();
@ -135,7 +135,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
kdDebug( 12006 ) << "Parse: " << s << endl;
MetarParser parser(m_StationDb, KGlobal::locale()->measureSystem());
d->wi = parser.processData(d->wi.reportLocation, s);
d->age = QDateTime::currentDateTime().addSecs(1800);
d->age = TQDateTime::currentDateTime().addSecs(1800);
emit fileUpdate(d->wi.reportLocation);
d->updated = true;
}
@ -193,11 +193,11 @@ void WeatherLib::getData(Data *d, bool force /* try even if host was down last t
{
d->downloading = true;
d->updated = false;
QString u = "http://weather.noaa.gov/pub/data/observations/metar/stations/";
TQString u = "http://weather.noaa.gov/pub/data/observations/metar/stations/";
u += d->wi.reportLocation.upper().stripWhiteSpace();
u += ".TXT";
d->target = new KTempFile(QString::null, "-weather");
d->target = new KTempFile(TQString::null, "-weather");
d->target->setAutoDelete(true);
d->target->file();
@ -206,15 +206,15 @@ void WeatherLib::getData(Data *d, bool force /* try even if host was down last t
d->job = KIO::file_copy( url, local, -1, true, false, false);
d->job->addMetaData("cache", "reload"); // Make sure to get fresh info
connect( d->job, SIGNAL( result( KIO::Job *)),
SLOT(slotCopyDone(KIO::Job *)));
connect( d->job, TQT_SIGNAL( result( KIO::Job *)),
TQT_SLOT(slotCopyDone(KIO::Job *)));
kdDebug( 12006 ) << "Copying " << url.prettyURL() << " to "
<< local.prettyURL() << endl;
emit fileUpdating(d->wi.reportLocation);
}
}
WeatherLib::Data* WeatherLib::findData(const QString &stationID)
WeatherLib::Data* WeatherLib::findData(const TQString &stationID)
{
Data *d = data[stationID];
if (!d)
@ -230,45 +230,45 @@ WeatherLib::Data* WeatherLib::findData(const QString &stationID)
return d;
}
QString WeatherLib::temperature(const QString &stationID){
TQString WeatherLib::temperature(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsTemperature;
}
QString WeatherLib::pressure(const QString &stationID){
TQString WeatherLib::pressure(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsPressure;
}
QString WeatherLib::wind(const QString &stationID){
TQString WeatherLib::wind(const TQString &stationID){
Data *d = findData(stationID);
return (d->wi.qsWindSpeed + " " + d->wi.qsWindDirection);
}
/** */
QString WeatherLib::dewPoint(const QString &stationID){
TQString WeatherLib::dewPoint(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsDewPoint;
}
QString WeatherLib::relHumidity(const QString &stationID){
TQString WeatherLib::relHumidity(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsRelHumidity;
}
QString WeatherLib::heatIndex(const QString &stationID){
TQString WeatherLib::heatIndex(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsHeatIndex;
}
QString WeatherLib::windChill(const QString &stationID){
TQString WeatherLib::windChill(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsWindChill;
}
QString WeatherLib::iconName(const QString &stationID){
TQString WeatherLib::iconName(const TQString &stationID){
QString result("dunno");
TQString result("dunno");
// isEmpty is true for null or 0 length strings
if ( !stationID.isEmpty() )
@ -280,49 +280,49 @@ QString WeatherLib::iconName(const QString &stationID){
return result;
}
QString WeatherLib::date(const QString &stationID){
TQString WeatherLib::date(const TQString &stationID){
Data *d = findData(stationID);
if ( ! d->wi.qsDate.isValid() )
return "";
else
{
QDateTime gmtDateTime(d->wi.qsDate, d->wi.qsTime);
QDateTime localDateTime = gmtDateTime.addSecs(KRFCDate::localUTCOffset() * 60);
TQDateTime gmtDateTime(d->wi.qsDate, d->wi.qsTime);
TQDateTime localDateTime = gmtDateTime.addSecs(KRFCDate::localUTCOffset() * 60);
return KGlobal::locale()->formatDateTime(localDateTime, false, false);
}
}
/** Returns the current cover */
QStringList WeatherLib::cover(const QString &stationID){
TQStringList WeatherLib::cover(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsCoverList;
}
/** return the visibility */
QString WeatherLib::visibility(const QString &stationID){
TQString WeatherLib::visibility(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsVisibility;
}
/** return the weather text */
QStringList WeatherLib::weather(const QString &stationID){
TQStringList WeatherLib::weather(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsCurrentList;
}
bool WeatherLib::stationNeedsMaintenance(const QString &stationID)
bool WeatherLib::stationNeedsMaintenance(const TQString &stationID)
{
Data *d = findData(stationID);
return d->wi.stationNeedsMaintenance;
}
void WeatherLib::update(const QString &stationID)
void WeatherLib::update(const TQString &stationID)
{
// Only grab new data if its more than 50 minutes old
Data *d = findData(stationID);
QDateTime timeout = QDateTime::currentDateTime();
TQDateTime timeout = TQDateTime::currentDateTime();
kdDebug (12006) << "Current Time: " << KGlobal::locale()->formatDateTime(timeout, false, false) <<
" Update at: " << KGlobal::locale()->formatDateTime(d->age, false, false) << endl;
@ -332,23 +332,23 @@ void WeatherLib::update(const QString &stationID)
emit fileUpdate(d->wi.reportLocation);
}
QStringList WeatherLib::stations()
TQStringList WeatherLib::stations()
{
QStringList l;
QDictIterator<Data> it( data );
TQStringList l;
TQDictIterator<Data> it( data );
for( ; it.current(); ++it )
l += it.currentKey();
return l;
}
void WeatherLib::forceUpdate(const QString &stationID)
void WeatherLib::forceUpdate(const TQString &stationID)
{
hostDown = false; // we want to show error message if host is still down
Data *d = findData(stationID);
getData( d );
}
void WeatherLib::remove(const QString &stationID)
void WeatherLib::remove(const TQString &stationID)
{
data.remove(stationID);
emit stationRemoved(stationID);

@ -17,10 +17,10 @@
#ifndef WEATHERLIB_H
#define WEATHERLIB_H
#include <qobject.h>
#include <qstring.h>
#include <qregexp.h>
#include <qdict.h>
#include <tqobject.h>
#include <tqstring.h>
#include <tqregexp.h>
#include <tqdict.h>
namespace KIO
{
@ -36,47 +36,47 @@ class WeatherLib : public QObject
public:
class Data;
WeatherLib(StationDatabase *stationDB, QObject *parent =0L, const char *name =0L);
WeatherLib(StationDatabase *stationDB, TQObject *parent =0L, const char *name =0L);
virtual ~WeatherLib();
QString temperature(const QString &stationID);
QString dewPoint(const QString &stationID);
QString relHumidity(const QString &stationID);
QString heatIndex(const QString &stationID);
QString windChill(const QString &stationID);
QString wind(const QString &stationID);
QString pressure(const QString &stationID);
QString iconName(const QString &stationID);
QString date(const QString &stationID);
QStringList weather(const QString &stationID);
QString visibility(const QString &stationID);
QStringList cover(const QString &stationID);
bool stationNeedsMaintenance(const QString &stationID);
TQString temperature(const TQString &stationID);
TQString dewPoint(const TQString &stationID);
TQString relHumidity(const TQString &stationID);
TQString heatIndex(const TQString &stationID);
TQString windChill(const TQString &stationID);
TQString wind(const TQString &stationID);
TQString pressure(const TQString &stationID);
TQString iconName(const TQString &stationID);
TQString date(const TQString &stationID);
TQStringList weather(const TQString &stationID);
TQString visibility(const TQString &stationID);
TQStringList cover(const TQString &stationID);
bool stationNeedsMaintenance(const TQString &stationID);
QStringList stations();
bool isNight(const QString &stationID) const;
TQStringList stations();
bool isNight(const TQString &stationID) const;
void update(const QString &stationID);
void forceUpdate(const QString &stationID);
void remove(const QString &stationID);
void update(const TQString &stationID);
void forceUpdate(const TQString &stationID);
void remove(const TQString &stationID);
signals:
void fileUpdating(const QString &stationID);
void fileUpdate(const QString &stationID);
void stationRemoved(const QString &stationID);
void fileUpdating(const TQString &stationID);
void fileUpdate(const TQString &stationID);
void stationRemoved(const TQString &stationID);
private slots:
void slotCopyDone(KIO::Job*);
private:
Data* findData(const QString &stationID);
Data* findData(const TQString &stationID);
void clearData(Data *d);
void getData(Data *d, bool force = false);
void processData(const QString &metar, Data *d);
void processData(const TQString &metar, Data *d);
StationDatabase *m_StationDb;
QDict<Data> data;
TQDict<Data> data;
bool fileDownloaded;
bool hostDown;
};

@ -31,25 +31,25 @@
#include "stationdatabase.h"
#include "sun.h"
WeatherService::WeatherService(QObject *parent, const char *name) : QObject (parent, name), DCOPObject("WeatherService")
WeatherService::WeatherService(TQObject *parent, const char *name) : TQObject (parent, name), DCOPObject("WeatherService")
{
kdDebug(12006) << "Starting new service... " << endl;
stationDB = new StationDatabase();
m_weatherLib = new WeatherLib(stationDB, this, "WeatherLib");
connect(m_weatherLib, SIGNAL(fileUpdating( const QString&)),
SLOT(updating( const QString&)));
connect(m_weatherLib, SIGNAL(fileUpdate( const QString&)),
SLOT(updated( const QString&)));
connect(m_weatherLib, SIGNAL(stationRemoved(const QString&)),
SLOT(slotStationRemoved(const QString&)));
connect(m_weatherLib, TQT_SIGNAL(fileUpdating( const TQString&)),
TQT_SLOT(updating( const TQString&)));
connect(m_weatherLib, TQT_SIGNAL(fileUpdate( const TQString&)),
TQT_SLOT(updated( const TQString&)));
connect(m_weatherLib, TQT_SIGNAL(stationRemoved(const TQString&)),
TQT_SLOT(slotStationRemoved(const TQString&)));
KConfig *conf = kapp->config();
conf->setGroup("WEATHERSTATIONS");
QStringList stations =conf->readListEntry("stations");
QStringList::Iterator it = stations.begin();
TQStringList stations =conf->readListEntry("stations");
TQStringList::Iterator it = stations.begin();
for ( ; it != stations.end(); ++it )
m_weatherLib->update(*it);
}
@ -63,7 +63,7 @@ WeatherService::~WeatherService()
delete stationDB;
}
void WeatherService::updated(const QString &stationID)
void WeatherService::updated(const TQString &stationID)
{
kdDebug(12006) << "Sending update for " << stationID << endl;
emit fileUpdate( stationID );
@ -72,129 +72,129 @@ void WeatherService::updated(const QString &stationID)
void WeatherService::updateAll()
{
kdDebug(12006) << "Sending for all" << endl;
QStringList stations = m_weatherLib->stations();
QStringList::ConstIterator end(stations.end());
for ( QStringList::ConstIterator it = stations.begin(); it != end; ++it ) {
TQStringList stations = m_weatherLib->stations();
TQStringList::ConstIterator end(stations.end());
for ( TQStringList::ConstIterator it = stations.begin(); it != end; ++it ) {
update(*it);
}
}
void WeatherService::updating(const QString &stationID)
void WeatherService::updating(const TQString &stationID)
{
kdDebug(12006) << "Sending updating for " << stationID << endl;
emit fileUpdating( stationID );
}
void WeatherService::slotStationRemoved(const QString &stationID)
void WeatherService::slotStationRemoved(const TQString &stationID)
{
kdDebug(12006) << "Sending stationRemoved for " << stationID << endl;
emit stationRemoved( stationID );
}
QString WeatherService::temperature(const QString &stationID)
TQString WeatherService::temperature(const TQString &stationID)
{
kdDebug (12006) << "Returning " << stationID << endl;
return m_weatherLib->temperature(stationID);
}
QString WeatherService::dewPoint(const QString &stationID)
TQString WeatherService::dewPoint(const TQString &stationID)
{
return m_weatherLib->dewPoint(stationID);
}
QString WeatherService::relativeHumidity(const QString &stationID)
TQString WeatherService::relativeHumidity(const TQString &stationID)
{
return m_weatherLib->relHumidity(stationID);
}
QString WeatherService::heatIndex(const QString &stationID)
TQString WeatherService::heatIndex(const TQString &stationID)
{
return m_weatherLib->heatIndex(stationID);
}
QString WeatherService::windChill(const QString &stationID)
TQString WeatherService::windChill(const TQString &stationID)
{
return m_weatherLib->windChill(stationID);
}
QString WeatherService::wind(const QString &stationID)
TQString WeatherService::wind(const TQString &stationID)
{
return m_weatherLib->wind(stationID);
}
QString WeatherService::pressure(const QString &stationID)
TQString WeatherService::pressure(const TQString &stationID)
{
return m_weatherLib->pressure(stationID);
}
QPixmap WeatherService::currentIcon(const QString &stationID)
TQPixmap WeatherService::currentIcon(const TQString &stationID)
{
return icon( stationID );
}
QPixmap WeatherService::icon(const QString &stationID)
TQPixmap WeatherService::icon(const TQString &stationID)
{
kdDebug(12006) << "Get the current weather icon.." << endl;
QString icon = iconFileName(stationID);
QPixmap theIcon = QPixmap(icon);
TQString icon = iconFileName(stationID);
TQPixmap theIcon = TQPixmap(icon);
return theIcon;
}
QString WeatherService::currentIconString(const QString &stationID)
TQString WeatherService::currentIconString(const TQString &stationID)
{
return m_weatherLib->iconName(stationID);
}
QString WeatherService::iconFileName(const QString &stationID)
TQString WeatherService::iconFileName(const TQString &stationID)
{
QString icon = m_weatherLib->iconName(stationID);
TQString icon = m_weatherLib->iconName(stationID);
icon = locate( "data", "kweather/" + icon + ".png" );
return icon;
}
QString WeatherService::date(const QString &stationID)
TQString WeatherService::date(const TQString &stationID)
{
return m_weatherLib->date(stationID);
}
QString WeatherService::visibility(const QString &stationID)
TQString WeatherService::visibility(const TQString &stationID)
{
return m_weatherLib->visibility(stationID);
}
QStringList WeatherService::cover(const QString &stationID)
TQStringList WeatherService::cover(const TQString &stationID)
{
return m_weatherLib->cover(stationID);
}
QStringList WeatherService::weather(const QString &stationID)
TQStringList WeatherService::weather(const TQString &stationID)
{
return m_weatherLib->weather(stationID);
}
bool WeatherService::stationNeedsMaintenance(const QString &stationID)
bool WeatherService::stationNeedsMaintenance(const TQString &stationID)
{
return m_weatherLib->stationNeedsMaintenance(stationID);
}
void WeatherService::update(const QString &stationID)
void WeatherService::update(const TQString &stationID)
{
m_weatherLib->update(stationID);
}
void WeatherService::forceUpdate(const QString &stationID)
void WeatherService::forceUpdate(const TQString &stationID)
{
m_weatherLib->forceUpdate(stationID);
}
void WeatherService::removeStation(const QString &stationID)
void WeatherService::removeStation(const TQString &stationID)
{
m_weatherLib->remove(stationID);
saveSettings();
}
void WeatherService::addStation(const QString &stationID)
void WeatherService::addStation(const TQString &stationID)
{
m_weatherLib->update(stationID);
saveSettings();
@ -206,7 +206,7 @@ void WeatherService::exit()
kapp->quit();
}
QStringList WeatherService::listStations()
TQStringList WeatherService::listStations()
{
return m_weatherLib->stations();
}
@ -219,17 +219,17 @@ void WeatherService::saveSettings()
conf->sync();
}
QString WeatherService::stationName(const QString &stationID)
TQString WeatherService::stationName(const TQString &stationID)
{
if ( stationDB )
{
QString upperStationID = stationID.upper();
TQString upperStationID = stationID.upper();
return stationDB->stationNameFromID(upperStationID);
}
else
return stationID;
}
QString WeatherService::stationCode( const QString &stationName )
TQString WeatherService::stationCode( const TQString &stationName )
{
if ( stationDB )
{
@ -239,51 +239,51 @@ QString WeatherService::stationCode( const QString &stationName )
return stationName;
}
QString WeatherService::stationCountry(const QString &stationID)
TQString WeatherService::stationCountry(const TQString &stationID)
{
if ( stationDB )
{
QString upperStationID = stationID.upper();
TQString upperStationID = stationID.upper();
return stationDB->stationCountryFromID(upperStationID);
}
else
return stationID;
}
QString WeatherService::longitude(const QString &stationID)
TQString WeatherService::longitude(const TQString &stationID)
{
if ( stationDB )
{
QString upperStationID = stationID.upper();
TQString upperStationID = stationID.upper();
return stationDB->stationLongitudeFromID(upperStationID);
}
else
return "None";
}
QString WeatherService::latitude(const QString &stationID)
TQString WeatherService::latitude(const TQString &stationID)
{
if ( stationDB )
{
QString upperStationID = stationID.upper();
TQString upperStationID = stationID.upper();
return stationDB->stationLatitudeFromID(upperStationID);
}
else
return "None";
}
QStringList WeatherService::findStations(float /*lon*/, float /*lat*/)
TQStringList WeatherService::findStations(float /*lon*/, float /*lat*/)
{
QStringList stationList;
TQStringList stationList;
stationList << "KMKE" << "KPNE" << "KTPW";
return stationList;
}
QString WeatherService::getTime(const QString &stationID, TimeType timeType)
TQString WeatherService::getTime(const TQString &stationID, TimeType timeType)
{
QString upperStationID = stationID.upper();
TQString upperStationID = stationID.upper();
QString latitude = stationDB->stationLatitudeFromID(upperStationID);
QString longitude = stationDB->stationLongitudeFromID(upperStationID);
TQString latitude = stationDB->stationLatitudeFromID(upperStationID);
TQString longitude = stationDB->stationLongitudeFromID(upperStationID);
if ( latitude.compare( i18n("Unknown Station" ) ) == 0 ||
longitude.compare( i18n("Unknown Station" ) ) == 0 )
@ -294,7 +294,7 @@ QString WeatherService::getTime(const QString &stationID, TimeType timeType)
{
Sun theSun( latitude, longitude );
QTime time;
TQTime time;
switch ( timeType )
{
case RISE:
@ -318,22 +318,22 @@ QString WeatherService::getTime(const QString &stationID, TimeType timeType)
}
}
QString WeatherService::sunRiseTime(const QString &stationID)
TQString WeatherService::sunRiseTime(const TQString &stationID)
{
return getTime(stationID, RISE);
}
QString WeatherService::sunSetTime(const QString &stationID)
TQString WeatherService::sunSetTime(const TQString &stationID)
{
return getTime(stationID, SET);
}
QString WeatherService::civilTwilightStart(const QString &stationID)
TQString WeatherService::civilTwilightStart(const TQString &stationID)
{
return getTime(stationID, CIVIL_START);
}
QString WeatherService::civilTwilightEnd(const QString &stationID)
TQString WeatherService::civilTwilightEnd(const TQString &stationID)
{
return getTime(stationID, CIVIL_END);
}

@ -22,14 +22,14 @@
#ifndef _WEATHER_SERVICE
#define _WEATHER_SERVICE
#include <qstringlist.h>
#include <tqstringlist.h>
#include <dcopobject.h>
#include <qpixmap.h>
#include <tqpixmap.h>
class WeatherLib;
class StationDatabase;
class WeatherService : public QObject, public DCOPObject
class WeatherService : public TQObject, public DCOPObject
{
Q_OBJECT
K_DCOP
@ -38,56 +38,56 @@ class WeatherService : public QObject, public DCOPObject
WeatherLib *m_weatherLib;
private slots:
void updated(const QString &stationID);
void updating(const QString &stationID);
void slotStationRemoved(const QString &stationID);
void updated(const TQString &stationID);
void updating(const TQString &stationID);
void slotStationRemoved(const TQString &stationID);
public:
WeatherService(QObject *parent, const char *name);
WeatherService(TQObject *parent, const char *name);
~WeatherService();
k_dcop_signals:
void fileUpdating(QString);
void fileUpdate(QString);
void stationRemoved(QString);
void fileUpdating(TQString);
void fileUpdate(TQString);
void stationRemoved(TQString);
k_dcop:
QString temperature(const QString &stationID);
QString dewPoint(const QString &stationID);
QString relativeHumidity(const QString &stationID);
QString heatIndex(const QString &stationID);
QString windChill(const QString &stationID);
QString wind(const QString &stationID);
QString pressure(const QString &stationID);
QPixmap currentIcon(const QString &stationID);
QPixmap icon(const QString &stationID);
QString currentIconString(const QString &stationID);
QString iconFileName(const QString &stationID);
QString date(const QString &stationID);
QString visibility(const QString &stationID);
QStringList cover(const QString &stationID);
QStringList weather(const QString &stationID);
bool stationNeedsMaintenance(const QString &stationID);
QString stationName(const QString &stationID);
QString stationCountry(const QString &stationID);
QString longitude(const QString &stationID);
QString latitude(const QString &stationID);
QStringList findStations(float lon, float lat);
QString sunRiseTime(const QString &stationID);
QString sunSetTime(const QString &stationID);
QString civilTwilightStart(const QString &stationID);
QString civilTwilightEnd(const QString &stationID);
void update(const QString &stationID);
TQString temperature(const TQString &stationID);
TQString dewPoint(const TQString &stationID);
TQString relativeHumidity(const TQString &stationID);
TQString heatIndex(const TQString &stationID);
TQString windChill(const TQString &stationID);
TQString wind(const TQString &stationID);
TQString pressure(const TQString &stationID);
TQPixmap currentIcon(const TQString &stationID);
TQPixmap icon(const TQString &stationID);
TQString currentIconString(const TQString &stationID);
TQString iconFileName(const TQString &stationID);
TQString date(const TQString &stationID);
TQString visibility(const TQString &stationID);
TQStringList cover(const TQString &stationID);
TQStringList weather(const TQString &stationID);
bool stationNeedsMaintenance(const TQString &stationID);
TQString stationName(const TQString &stationID);
TQString stationCountry(const TQString &stationID);
TQString longitude(const TQString &stationID);
TQString latitude(const TQString &stationID);
TQStringList findStations(float lon, float lat);
TQString sunRiseTime(const TQString &stationID);
TQString sunSetTime(const TQString &stationID);
TQString civilTwilightStart(const TQString &stationID);
TQString civilTwilightEnd(const TQString &stationID);
void update(const TQString &stationID);
void updateAll();
void forceUpdate(const QString &stationID);
void removeStation(const QString &stationID);
void addStation(const QString &stationID);
QStringList listStations();
QString stationCode( const QString &stationName );
void forceUpdate(const TQString &stationID);
void removeStation(const TQString &stationID);
void addStation(const TQString &stationID);
TQStringList listStations();
TQString stationCode( const TQString &stationName );
void exit();
@ -101,7 +101,7 @@ class WeatherService : public QObject, public DCOPObject
};
void saveSettings();
QString getTime(const QString &stationID, TimeType timeType);
TQString getTime(const TQString &stationID, TimeType timeType);
StationDatabase *stationDB;
};
#endif

@ -25,7 +25,7 @@
/*
** Bug reports and questions can be sent to kde-devel@kde.org
*/
#include <qlayout.h>
#include <tqlayout.h>
#include <kapplication.h>
@ -42,7 +42,7 @@
extern "C"
{
KDE_EXPORT KPanelApplet *init(QWidget *parent, const QString& configFile)
KDE_EXPORT KPanelApplet *init(TQWidget *parent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kworldclock");
KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation
@ -53,14 +53,14 @@ extern "C"
}
KWWApplet::KWWApplet(const QString& configFile, Type type, int actions,
QWidget *parent, const char *name)
KWWApplet::KWWApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name)
{
// make use of the icons installed for ksaferppp
KGlobal::iconLoader()->addAppDir("kworldwatch");
QVBoxLayout *vbox = new QVBoxLayout(this, 0,0);
TQVBoxLayout *vbox = new TQVBoxLayout(this, 0,0);
map = new MapWidget(true, true, this);
map->load(config());
@ -90,11 +90,11 @@ int KWWApplet::heightForWidth(int width) const
// catch the mouse clicks of our child widgets
bool KWWApplet::eventFilter( QObject *o, QEvent *e )
bool KWWApplet::eventFilter( TQObject *o, TQEvent *e )
{
if ((e->type() == QEvent::MouseButtonPress) || (e->type() == QEvent::MouseButtonDblClick))
if ((e->type() == TQEvent::MouseButtonPress) || (e->type() == TQEvent::MouseButtonDblClick))
{
mousePressEvent(static_cast<QMouseEvent*>(e));
mousePressEvent(static_cast<TQMouseEvent*>(e));
return true;
}
@ -102,20 +102,20 @@ bool KWWApplet::eventFilter( QObject *o, QEvent *e )
}
void KWWApplet::mousePressEvent(QMouseEvent *e)
void KWWApplet::mousePressEvent(TQMouseEvent *e)
{
bool clicked = false;
if (KGlobalSettings::singleClick())
{
clicked = e->type() == QMouseEvent::MouseButtonPress;
clicked = e->type() == TQMouseEvent::MouseButtonPress;
}
else
{
clicked = e->type() == QMouseEvent::MouseButtonDblClick;
clicked = e->type() == TQMouseEvent::MouseButtonDblClick;
}
if (clicked && e->button() == QMouseEvent::LeftButton)
if (clicked && e->button() == TQMouseEvent::LeftButton)
{
KRun::run("kworldclock", KURL::List());
}

@ -29,8 +29,8 @@
#define KWW_applet_h
#include <qstring.h>
#include <qpixmap.h>
#include <tqstring.h>
#include <tqpixmap.h>
#include <kpanelapplet.h>
@ -45,8 +45,8 @@ class KWWApplet : public KPanelApplet
public:
KWWApplet(const QString& configFile, Type t = Normal, int actions = 0,
QWidget *parent = 0, const char *name = 0);
KWWApplet(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
~KWWApplet();
int widthForHeight(int height) const;
@ -55,8 +55,8 @@ public:
protected:
void mousePressEvent(QMouseEvent *ev);
bool eventFilter(QObject *, QEvent *);
void mousePressEvent(TQMouseEvent *ev);
bool eventFilter(TQObject *, TQEvent *);
private:

@ -25,10 +25,10 @@
/*
** Bug reports and questions can be sent to kde-devel@kde.org
*/
#include <qfile.h>
#include <qtextstream.h>
#include <qregexp.h>
#include <qpainter.h>
#include <tqfile.h>
#include <tqtextstream.h>
#include <tqregexp.h>
#include <tqpainter.h>
#include <kglobal.h>
@ -51,13 +51,13 @@ CityList::~CityList()
void CityList::readCityLists()
{
QStringList lists = KGlobal::dirs()->findAllResources("data", "kworldclock/*.tab");
for (QStringList::Iterator it = lists.begin(); it != lists.end(); ++it)
TQStringList lists = KGlobal::dirs()->findAllResources("data", "kworldclock/*.tab");
for (TQStringList::Iterator it = lists.begin(); it != lists.end(); ++it)
readCityList(*it);
}
double coordinate(QString c)
double coordinate(TQString c)
{
int neg;
int d=0, m=0, s=0;
@ -96,18 +96,18 @@ double coordinate(QString c)
}
void CityList::readCityList(const QString &fname)
void CityList::readCityList(const TQString &fname)
{
QFile f(fname);
TQFile f(fname);
if (f.open(IO_ReadOnly))
{
QTextStream is(&f);
TQTextStream is(&f);
QString line;
QStringList tags;
QRegExp coord("[+-]\\d+[+-]\\d+");
QRegExp name("[^\\s]+/[^\\s]+");
TQString line;
TQStringList tags;
TQRegExp coord("[+-]\\d+[+-]\\d+");
TQRegExp name("[^\\s]+/[^\\s]+");
int pos;
while (!is.eof())
{
@ -115,7 +115,7 @@ void CityList::readCityList(const QString &fname)
if (line.isEmpty() || line.left(1) == "#")
continue;
QString c, n;
TQString c, n;
pos = coord.search(line, 0);
if (pos >= 0)
@ -145,24 +145,24 @@ void CityList::readCityList(const QString &fname)
}
QPoint CityList::getPosition(double la, double lo, int w, int h, int offset)
TQPoint CityList::getPosition(double la, double lo, int w, int h, int offset)
{
int x = (int)((double)w * (180.0 + lo) / 360.0);
int y = (int)((double)h * (90.0 - la) / 180.0);
x = (x + offset + w/2) % w;
return QPoint(x,y);
return TQPoint(x,y);
}
void CityList::paint(QPainter *p, int width, int height, int offset)
void CityList::paint(TQPainter *p, int width, int height, int offset)
{
p->setPen(Qt::black);
QPtrListIterator<City> it(_cities);
TQPtrListIterator<City> it(_cities);
for ( ; it.current(); ++it)
{
QPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), width, height, offset);
TQPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), width, height, offset);
if (width > 100)
p->drawEllipse(pos.x(), pos.y(), 3,3);
@ -172,15 +172,15 @@ void CityList::paint(QPainter *p, int width, int height, int offset)
}
City *CityList::getNearestCity(int w, int h, int offset, int x, int y, QPoint &where)
City *CityList::getNearestCity(int w, int h, int offset, int x, int y, TQPoint &where)
{
City *result = 0;
double dist = 1.0e10;
QPtrListIterator<City> it(_cities);
TQPtrListIterator<City> it(_cities);
for ( ; it.current(); ++it)
{
QPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), w, h, offset);
TQPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), w, h, offset);
double d = (pos.x()-x)*(pos.x()-x) + (pos.y()-y)*(pos.y()-y);
if (d < dist)
@ -195,11 +195,11 @@ City *CityList::getNearestCity(int w, int h, int offset, int x, int y, QPoint &w
}
QStringList CityList::timezones()
TQStringList CityList::timezones()
{
QStringList r;
TQStringList r;
QPtrListIterator<City> it(_cities);
TQPtrListIterator<City> it(_cities);
for ( ; it.current(); ++it)
r << it.current()->name();
r.sort();

@ -29,9 +29,9 @@
#define CITIES_H
#include <qstring.h>
#include <qstringlist.h>
#include <qptrlist.h>
#include <tqstring.h>
#include <tqstringlist.h>
#include <tqptrlist.h>
class QPainter;
@ -41,8 +41,8 @@ class City
{
public:
City(const QString &n, double la, double lo) : _name(n), _latitude(la), _longitude(lo) {};
QString name() { return _name; };
City(const TQString &n, double la, double lo) : _name(n), _latitude(la), _longitude(lo) {};
TQString name() { return _name; };
double latitude() { return _latitude; };
double longitude() { return _longitude; };
@ -50,7 +50,7 @@ public:
private:
QString _name;
TQString _name;
double _latitude, _longitude;
};
@ -62,24 +62,24 @@ public:
CityList();
~CityList();
void paint(QPainter *p, int width, int height, int offset);
void paint(TQPainter *p, int width, int height, int offset);
City *getNearestCity(int w, int h, int offset, int x, int y, QPoint &where);
City *getNearestCity(int w, int h, int offset, int x, int y, TQPoint &where);
QStringList timezones();
TQStringList timezones();
private:
void readCityLists();
void readCityList(const QString &fname);
void readCityList(const TQString &fname);
QPoint getPosition(double la, double lo, int w, int h, int offset);
TQPoint getPosition(double la, double lo, int w, int h, int offset);
private:
QPtrList<City> _cities;
TQPtrList<City> _cities;
};

@ -38,8 +38,8 @@ FlagList::FlagList()
{
_flags.setAutoDelete(true);
_flagPixmap = QPixmap(locate("data", "kworldclock/pics/flag.png"));
_flagMask = QPixmap(locate("data", "kworldclock/pics/flag-mask.xpm"), 0, QPixmap::ThresholdDither);
_flagPixmap = TQPixmap(locate("data", "kworldclock/pics/flag.png"));
_flagMask = TQPixmap(locate("data", "kworldclock/pics/flag-mask.xpm"), 0, TQPixmap::ThresholdDither);
_flagMask.setMask(_flagMask.createHeuristicMask());
}
@ -50,31 +50,31 @@ void FlagList::addFlag(Flag *f)
}
QPoint FlagList::getPosition(double la, double lo, int w, int h, int offset)
TQPoint FlagList::getPosition(double la, double lo, int w, int h, int offset)
{
int x = (int)((double)w * (180.0 + lo) / 360.0);
int y = (int)((double)h * (90.0 - la) / 180.0);
x = (x + offset + w/2) % w;
return QPoint(x,y);
return TQPoint(x,y);
}
void FlagList::paint(QPainter *p, int width, int height, int offset)
void FlagList::paint(TQPainter *p, int width, int height, int offset)
{
p->setPen(Qt::black);
QPtrListIterator<Flag> it(_flags);
TQPtrListIterator<Flag> it(_flags);
for ( ; it.current(); ++it)
{
QPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), width, height, offset);
TQPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), width, height, offset);
p->setPen(it.current()->color());
p->setBrush(it.current()->color());
if (width > 100)
{
pos -= QPoint(5,15);
pos -= TQPoint(5,15);
p->drawPixmap(pos,_flagMask);
p->drawPixmap(pos,_flagPixmap);
@ -85,14 +85,14 @@ void FlagList::paint(QPainter *p, int width, int height, int offset)
}
void FlagList::removeNearestFlag(const QPoint &target, int w, int h, int offset)
void FlagList::removeNearestFlag(const TQPoint &target, int w, int h, int offset)
{
Flag *flag = 0;
QPoint diff;
TQPoint diff;
int dist = INT_MAX;
QPtrListIterator<Flag> it(_flags);
TQPtrListIterator<Flag> it(_flags);
for ( ; it.current(); ++it)
{
diff = getPosition(it.current()->latitude(), it.current()->longitude(), w, h, offset);
@ -117,13 +117,13 @@ void FlagList::save(KConfig *config)
{
config->writeEntry("Flags", _flags.count());
QPtrListIterator<Flag> it(_flags);
TQPtrListIterator<Flag> it(_flags);
int cnt=0;
for ( ; it.current(); ++it)
{
config->writeEntry(QString("Flag_%1_Color").arg(cnt), it.current()->color());
config->writeEntry(QString("Flag_%1_Latitude").arg(cnt), it.current()->latitude());
config->writeEntry(QString("Flag_%1_Longitude").arg(cnt), it.current()->longitude());
config->writeEntry(TQString("Flag_%1_Color").arg(cnt), it.current()->color());
config->writeEntry(TQString("Flag_%1_Latitude").arg(cnt), it.current()->latitude());
config->writeEntry(TQString("Flag_%1_Longitude").arg(cnt), it.current()->longitude());
cnt++;
}
}
@ -136,9 +136,9 @@ void FlagList::load(KConfig *config)
for (int i=0; i<num; ++i)
{
addFlag(new Flag(config->readDoubleNumEntry(QString("Flag_%1_Longitude").arg(i)),
config->readDoubleNumEntry(QString("Flag_%1_Latitude").arg(i)),
config->readColorEntry(QString("Flag_%1_Color").arg(i))));
addFlag(new Flag(config->readDoubleNumEntry(TQString("Flag_%1_Longitude").arg(i)),
config->readDoubleNumEntry(TQString("Flag_%1_Latitude").arg(i)),
config->readColorEntry(TQString("Flag_%1_Color").arg(i))));
}
}

@ -29,13 +29,13 @@
#define FLAGS_H
#include <qstring.h>
#include <qcolor.h>
#include <qptrlist.h>
#include <qpoint.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qbitmap.h>
#include <tqstring.h>
#include <tqcolor.h>
#include <tqptrlist.h>
#include <tqpoint.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqbitmap.h>
#include <kconfig.h>
@ -45,25 +45,25 @@ class Flag
{
public:
Flag(double lo, double la, const QColor &col)
Flag(double lo, double la, const TQColor &col)
: _lo(lo), _la(la), _col(col) {};
double longitude() const { return _lo; };
double latitude() const { return _la; };
QColor color() const { return _col; };
TQColor color() const { return _col; };
QString annotation() const { return _ann; };
void setAnnotation(const QString &ann) { _ann = ann; };
TQString annotation() const { return _ann; };
void setAnnotation(const TQString &ann) { _ann = ann; };
private:
double _lo, _la;
QColor _col;
TQColor _col;
QString _ann;
TQString _ann;
};
@ -74,11 +74,11 @@ public:
FlagList();
void paint(QPainter *p, int w, int h, int offset);
void paint(TQPainter *p, int w, int h, int offset);
void addFlag(Flag *f);
void removeNearestFlag(const QPoint &target, int w, int h, int offset);
void removeNearestFlag(const TQPoint &target, int w, int h, int offset);
void removeAllFlags();
void save(KConfig *config);
@ -87,12 +87,12 @@ public:
private:
QPoint getPosition(double la, double lo, int w, int h, int offset);
TQPoint getPosition(double la, double lo, int w, int h, int offset);
QPtrList<Flag> _flags;
TQPtrList<Flag> _flags;
QPixmap _flagPixmap;
QBitmap _flagMask;
TQPixmap _flagPixmap;
TQBitmap _flagMask;
};

@ -15,15 +15,15 @@
class SimpleFlowIterator :public QGLayoutIterator
{
public:
SimpleFlowIterator( QPtrList<QLayoutItem> *l ) :idx(0), list(l) {}
SimpleFlowIterator( TQPtrList<TQLayoutItem> *l ) :idx(0), list(l) {}
uint count() const;
QLayoutItem *current();
QLayoutItem *next();
QLayoutItem *takeCurrent();
TQLayoutItem *current();
TQLayoutItem *next();
TQLayoutItem *takeCurrent();
private:
int idx;
QPtrList<QLayoutItem> *list;
TQPtrList<TQLayoutItem> *list;
};
@ -32,17 +32,17 @@ uint SimpleFlowIterator::count() const
return list->count();
}
QLayoutItem *SimpleFlowIterator::current()
TQLayoutItem *SimpleFlowIterator::current()
{
return idx < int(count()) ? list->at(idx) : 0;
}
QLayoutItem *SimpleFlowIterator::next()
TQLayoutItem *SimpleFlowIterator::next()
{
idx++; return current();
}
QLayoutItem *SimpleFlowIterator::takeCurrent()
TQLayoutItem *SimpleFlowIterator::takeCurrent()
{
return idx < int(count()) ? list->take( idx ) : 0;
}
@ -58,7 +58,7 @@ int SimpleFlow::heightForWidth( int w ) const
if ( cached_width != w ) {
//Not all C++ compilers support "mutable" yet:
SimpleFlow * mthis = (SimpleFlow*)this;
int h = mthis->doLayout( QRect(0,0,w,0), TRUE );
int h = mthis->doLayout( TQRect(0,0,w,0), TRUE );
mthis->cached_hfw = h;
mthis->cached_width = w;
return h;
@ -66,7 +66,7 @@ int SimpleFlow::heightForWidth( int w ) const
return cached_hfw;
}
void SimpleFlow::addItem( QLayoutItem *item)
void SimpleFlow::addItem( TQLayoutItem *item)
{
list.append( item );
}
@ -76,34 +76,34 @@ bool SimpleFlow::hasHeightForWidth() const
return TRUE;
}
QSize SimpleFlow::sizeHint() const
TQSize SimpleFlow::sizeHint() const
{
return minimumSize();
}
QSizePolicy::ExpandData SimpleFlow::expanding() const
TQSizePolicy::ExpandData SimpleFlow::expanding() const
{
return QSizePolicy::NoDirection;
return TQSizePolicy::NoDirection;
}
QLayoutIterator SimpleFlow::iterator()
TQLayoutIterator SimpleFlow::iterator()
{
return QLayoutIterator( new SimpleFlowIterator( &list ) );
return TQLayoutIterator( new SimpleFlowIterator( &list ) );
}
void SimpleFlow::setGeometry( const QRect &r )
void SimpleFlow::setGeometry( const TQRect &r )
{
QLayout::setGeometry( r );
TQLayout::setGeometry( r );
doLayout( r );
}
int SimpleFlow::doLayout( const QRect &r, bool testonly )
int SimpleFlow::doLayout( const TQRect &r, bool testonly )
{
int x = r.x();
int y = r.y();
int h = 0; //height of this line so far.
QPtrListIterator<QLayoutItem> it(list);
QLayoutItem *o;
TQPtrListIterator<TQLayoutItem> it(list);
TQLayoutItem *o;
while ( (o=it.current()) != 0 ) {
++it;
int nextX = x + o->sizeHint().width() + spacing();
@ -114,18 +114,18 @@ int SimpleFlow::doLayout( const QRect &r, bool testonly )
h = 0;
}
if ( !testonly )
o->setGeometry( QRect( QPoint( x, y ), o->sizeHint() ) );
o->setGeometry( TQRect( TQPoint( x, y ), o->sizeHint() ) );
x = nextX;
h = QMAX( h, o->sizeHint().height() );
}
return y + h - r.y();
}
QSize SimpleFlow::minimumSize() const
TQSize SimpleFlow::minimumSize() const
{
QSize s(0,0);
QPtrListIterator<QLayoutItem> it(list);
QLayoutItem *o;
TQSize s(0,0);
TQPtrListIterator<TQLayoutItem> it(list);
TQLayoutItem *o;
while ( (o=it.current()) != 0 ) {
++it;
s = s.expandedTo( o->minimumSize() );

@ -15,39 +15,39 @@
#ifndef FLOW_H
#define FLOW_H
#include <qlayout.h>
#include <qptrlist.h>
#include <tqlayout.h>
#include <tqptrlist.h>
class SimpleFlow : public QLayout
{
public:
SimpleFlow( QWidget *parent, int border=0, int space=-1,
SimpleFlow( TQWidget *parent, int border=0, int space=-1,
const char *name=0 )
: QLayout( parent, border, space, name ),
: TQLayout( parent, border, space, name ),
cached_width(0), cached_hfw(0) {}
SimpleFlow( QLayout* parent, int space=-1, const char *name=0 )
: QLayout( parent, space, name ),
SimpleFlow( TQLayout* parent, int space=-1, const char *name=0 )
: TQLayout( parent, space, name ),
cached_width(0), cached_hfw(0) {}
SimpleFlow( int space=-1, const char *name=0 )
: QLayout( space, name ),
: TQLayout( space, name ),
cached_width(0), cached_hfw(0) {}
~SimpleFlow();
void addItem( QLayoutItem *item);
void addItem( TQLayoutItem *item);
bool hasHeightForWidth() const;
int heightForWidth( int ) const;
QSize sizeHint() const;
QSize minimumSize() const;
QLayoutIterator iterator();
QSizePolicy::ExpandData expanding() const;
TQSize sizeHint() const;
TQSize minimumSize() const;
TQLayoutIterator iterator();
TQSizePolicy::ExpandData expanding() const;
protected:
void setGeometry( const QRect& );
void setGeometry( const TQRect& );
private:
int doLayout( const QRect&, bool testonly = FALSE );
QPtrList<QLayoutItem> list;
int doLayout( const TQRect&, bool testonly = FALSE );
TQPtrList<TQLayoutItem> list;
int cached_width;
int cached_hfw;
};

@ -28,11 +28,11 @@
#include <stdlib.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qwidget.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqwidget.h>
#include <kapplication.h>
@ -48,17 +48,17 @@
#include "zoneclock.h"
WorldWideWatch::WorldWideWatch(bool restore, QWidget *parent, const char *name)
WorldWideWatch::WorldWideWatch(bool restore, TQWidget *parent, const char *name)
: KMainWindow(parent, name)
{
KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation
QWidget *w = new QWidget(this);
TQWidget *w = new TQWidget(this);
setCentralWidget(w);
setPlainCaption(i18n("KDE World Clock"));
QVBoxLayout *vbox = new QVBoxLayout(w, 0,0);
TQVBoxLayout *vbox = new TQVBoxLayout(w, 0,0);
_map = new MapWidget(false, restore, w);
vbox->addWidget(_map,1);
@ -66,8 +66,8 @@ WorldWideWatch::WorldWideWatch(bool restore, QWidget *parent, const char *name)
_clocks = new ZoneClockPanel(w);
vbox->addWidget(_clocks);
connect(_map, SIGNAL(addClockClicked(const QString &)), _clocks, SLOT(addClock(const QString &)));
connect(_map, SIGNAL(saveSettings()), this, SLOT(doSave()));
connect(_map, TQT_SIGNAL(addClockClicked(const TQString &)), _clocks, TQT_SLOT(addClock(const TQString &)));
connect(_map, TQT_SIGNAL(saveSettings()), this, TQT_SLOT(doSave()));
if (restore)
load(kapp->config());
@ -103,19 +103,19 @@ void WorldWideWatch::doSave()
void WatchApplication::dumpMap()
{
// guess some default parameters
QSize mapSize(kapp->desktop()->size());
TQSize mapSize(kapp->desktop()->size());
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QCString themeName = args->getOption("theme");
QCString outName = args->getOption("o");
TQCString themeName = args->getOption("theme");
TQCString outName = args->getOption("o");
QCString ssize = args->getOption("size");
TQCString ssize = args->getOption("size");
if (!ssize.isEmpty())
{
int w,h;
if (sscanf(ssize.data(), "%dx%d", &w, &h) == 2)
mapSize = QSize(w,h);
mapSize = TQSize(w,h);
}
kdDebug() << "theme=" << themeName << " out=" << outName << " size=" << mapSize.width() << "x" << mapSize.height() << endl;
@ -124,8 +124,8 @@ void WatchApplication::dumpMap()
w->setTheme(themeName);
w->setSize(mapSize.width(), mapSize.height());
QPixmap pm = w->calculatePixmap();
QPainter p(&pm);
TQPixmap pm = w->calculatePixmap();
TQPainter p(&pm);
w->paintContents(&p);
pm.save(outName, "PPM");
@ -154,8 +154,8 @@ int WatchApplication::newInstance()
static void listThemes()
{
QPtrList<MapTheme> _themes = MapLoader::themes();
QPtrListIterator<MapTheme> it(_themes);
TQPtrList<MapTheme> _themes = MapLoader::themes();
TQPtrListIterator<MapTheme> it(_themes);
for ( ; it.current(); ++it)
{
printf("%s\n", it.current()->tag().local8Bit().data());

@ -43,7 +43,7 @@ class WorldWideWatch : public KMainWindow
public:
WorldWideWatch(bool restore=false, QWidget *parent=0, const char *name=0);
WorldWideWatch(bool restore=false, TQWidget *parent=0, const char *name=0);
void save(KConfig *config);
void load(KConfig *load);

@ -27,12 +27,12 @@
*/
#include <time.h>
#include <qvaluelist.h>
#include <qdir.h>
#include <qimage.h>
#include <qpainter.h>
#include <qtl.h>
#include <qstringlist.h>
#include <tqvaluelist.h>
#include <tqdir.h>
#include <tqimage.h>
#include <tqpainter.h>
#include <tqtl.h>
#include <tqstringlist.h>
#include <kglobal.h>
@ -45,12 +45,12 @@
#include "maploader.h"
QPtrList<MapTheme> MapLoader::themes()
TQPtrList<MapTheme> MapLoader::themes()
{
QPtrList<MapTheme> result;
TQPtrList<MapTheme> result;
QStringList files = KGlobal::dirs()->findAllResources("data", "kworldclock/maps/*/*.desktop");
for (QStringList::Iterator it=files.begin(); it != files.end(); ++it)
TQStringList files = KGlobal::dirs()->findAllResources("data", "kworldclock/maps/*/*.desktop");
for (TQStringList::Iterator it=files.begin(); it != files.end(); ++it)
{
KDesktopFile conf(*it);
conf.setGroup("Theme");
@ -61,20 +61,20 @@ QPtrList<MapTheme> MapLoader::themes()
}
QStringList MapLoader::maps(const QString &theme)
TQStringList MapLoader::maps(const TQString &theme)
{
return KGlobal::dirs()->findAllResources("data", QString("kworldclock/maps/%1/*.jpg").arg(theme));
return KGlobal::dirs()->findAllResources("data", TQString("kworldclock/maps/%1/*.jpg").arg(theme));
}
void MapLoader::load(unsigned int width, const QString &theme, unsigned int height, float opacity)
void MapLoader::load(unsigned int width, const TQString &theme, unsigned int height, float opacity)
{
// find the maps available
QValueList<uint> sizes;
QStringList files = maps(theme);
TQValueList<uint> sizes;
TQStringList files = maps(theme);
for (uint i=0; i<files.count(); ++i)
{
QString f = files[i];
TQString f = files[i];
int pos = f.findRev("/");
if (pos >= 0)
f = f.mid(pos+1);
@ -94,14 +94,14 @@ void MapLoader::load(unsigned int width, const QString &theme, unsigned int heig
break;
}
QImage image;
TQImage image;
if (size == 0)
{
image = QImage(locate("data", "kworldclock/maps/depths/800.jpg"));
image = TQImage(locate("data", "kworldclock/maps/depths/800.jpg"));
size = 800;
}
else
image = QImage(locate("data", QString("kworldclock/maps/%1/%2.jpg").arg(theme).arg(size)));
image = TQImage(locate("data", TQString("kworldclock/maps/%1/%2.jpg").arg(theme).arg(size)));
if (height == 0)
height = width/2;
@ -117,14 +117,14 @@ void MapLoader::load(unsigned int width, const QString &theme, unsigned int heig
}
QBitmap MapLoader::darkMask(int width, int height)
TQBitmap MapLoader::darkMask(int width, int height)
{
time_t t;
struct tm *tmp;
double jt, sunra, sundec, sunrv, sunlong;
short *wtab;
QBitmap illuMask(width, height);
TQBitmap illuMask(width, height);
// calculate the position of the sun
t = time(NULL);
@ -141,7 +141,7 @@ QBitmap MapLoader::darkMask(int width, int height)
// draw illumination
illuMask.fill(Qt::black);
QPainter p;
TQPainter p;
p.begin(&illuMask);
int start, stop;

@ -28,9 +28,9 @@
#ifndef MAP_LOADER_H
#define MAP_LOADER_H
#include <qpixmap.h>
#include <qbitmap.h>
#include <qptrlist.h>
#include <tqpixmap.h>
#include <tqbitmap.h>
#include <tqptrlist.h>
class MapTheme
@ -38,10 +38,10 @@ class MapTheme
public:
MapTheme() : _name(""), _tag(""), _id(0) {};
MapTheme(const QString &name, const QString &tag) : _name(name), _tag(tag), _id(0) {};
MapTheme(const TQString &name, const TQString &tag) : _name(name), _tag(tag), _id(0) {};
QString tag() { return _tag; };
QString name() { return _name; };
TQString tag() { return _tag; };
TQString name() { return _name; };
void setID(int i) { _id = i; };
int ID() { return _id; };
@ -49,7 +49,7 @@ public:
private:
QString _name, _tag;
TQString _name, _tag;
int _id;
};
@ -59,21 +59,21 @@ class MapLoader
{
public:
static QPtrList<MapTheme> themes();
static TQPtrList<MapTheme> themes();
void load(unsigned int width=400, const QString &theme = "earth", unsigned int height=0, float opacity=0.5);
void load(unsigned int width=400, const TQString &theme = "earth", unsigned int height=0, float opacity=0.5);
QPixmap lightMap() { return _light; };
QPixmap darkMap() { return _dark; };
TQPixmap lightMap() { return _light; };
TQPixmap darkMap() { return _dark; };
QBitmap darkMask(int width, int height);
TQBitmap darkMask(int width, int height);
private:
QStringList maps(const QString &theme);
TQStringList maps(const TQString &theme);
QPixmap _light, _dark;
TQPixmap _light, _dark;
};

@ -30,7 +30,7 @@
#include <time.h>
#include <stdlib.h>
#include <qdatetime.h>
#include <tqdatetime.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
@ -42,12 +42,12 @@
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <qcursor.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qregexp.h>
#include <qiconset.h>
#include <qtooltip.h>
#include <tqcursor.h>
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqregexp.h>
#include <tqiconset.h>
#include <tqtooltip.h>
#include "cities.h"
@ -56,8 +56,8 @@
#include "mapwidget.moc"
MapWidget::MapWidget(bool applet, bool restore, QWidget *parent, const char *name)
: QWidget(parent, name), _loader(), _illumination(true), _cities(true), _flags(true), _cityList(0),
MapWidget::MapWidget(bool applet, bool restore, TQWidget *parent, const char *name)
: TQWidget(parent, name), _loader(), _illumination(true), _cities(true), _flags(true), _cityList(0),
_applet(applet), _width(0), _height(0)
{
// this ugly construction is necessary so we don't load
@ -74,7 +74,7 @@ MapWidget::MapWidget(bool applet, bool restore, QWidget *parent, const char *nam
delete config;
}
setBackgroundMode(QWidget::NoBackground);
setBackgroundMode(TQWidget::NoBackground);
gmt_position = 0;
time_t t = time(NULL);
@ -83,37 +83,37 @@ MapWidget::MapWidget(bool applet, bool restore, QWidget *parent, const char *nam
_flagList = new FlagList;
int id;
_flagPopup = new QPopupMenu(this);
QPixmap flag = QPixmap(locate("data", "kworldclock/pics/flag-red.png"));
id = _flagPopup->insertItem(QIconSet(flag), i18n("Add &Red"), this, SLOT(addFlag(int)));
_flagPopup = new TQPopupMenu(this);
TQPixmap flag = TQPixmap(locate("data", "kworldclock/pics/flag-red.png"));
id = _flagPopup->insertItem(TQIconSet(flag), i18n("Add &Red"), this, TQT_SLOT(addFlag(int)));
_flagPopup->setItemParameter(id, 0);
flag = QPixmap(locate("data", "kworldclock/pics/flag-green.png"));
id = _flagPopup->insertItem(QIconSet(flag), i18n("Add &Green"), this, SLOT(addFlag(int)));
flag = TQPixmap(locate("data", "kworldclock/pics/flag-green.png"));
id = _flagPopup->insertItem(TQIconSet(flag), i18n("Add &Green"), this, TQT_SLOT(addFlag(int)));
_flagPopup->setItemParameter(id, 1);
flag = QPixmap(locate("data", "kworldclock/pics/flag-blue.png"));
id = _flagPopup->insertItem(QIconSet(flag), i18n("Add &Blue"), this, SLOT(addFlag(int)));
flag = TQPixmap(locate("data", "kworldclock/pics/flag-blue.png"));
id = _flagPopup->insertItem(TQIconSet(flag), i18n("Add &Blue"), this, TQT_SLOT(addFlag(int)));
_flagPopup->setItemParameter(id, 2);
id = _flagPopup->insertItem(i18n("Add &Custom..."), this, SLOT(addFlag(int)));
id = _flagPopup->insertItem(i18n("Add &Custom..."), this, TQT_SLOT(addFlag(int)));
_flagPopup->setItemParameter(id, 3);
_flagPopup->insertSeparator();
_flagPopup->insertItem(i18n("&Remove Flag"), this, SLOT(removeFlag()));
_flagPopup->insertItem(i18n("&Remove All Flags"), this, SLOT(removeAllFlags()));
_flagPopup->insertItem(i18n("&Remove Flag"), this, TQT_SLOT(removeFlag()));
_flagPopup->insertItem(i18n("&Remove All Flags"), this, TQT_SLOT(removeAllFlags()));
_themePopup = new QPopupMenu(this);
_themePopup = new TQPopupMenu(this);
_themes = MapLoader::themes();
int cnt=0;
QPtrListIterator<MapTheme> it(_themes);
TQPtrListIterator<MapTheme> it(_themes);
for ( ; it.current(); ++it)
{
int id = _themePopup->insertItem(it.current()->name(), this, SLOT(themeSelected(int)));
int id = _themePopup->insertItem(it.current()->name(), this, TQT_SLOT(themeSelected(int)));
_themePopup->setItemParameter(id, cnt++);
it.current()->setID(id);
}
QPopupMenu *_clocksPopup = new QPopupMenu(this);
_clocksPopup->insertItem(i18n("&Add..."), this, SLOT(addClock()));
TQPopupMenu *_clocksPopup = new TQPopupMenu(this);
_clocksPopup->insertItem(i18n("&Add..."), this, TQT_SLOT(addClock()));
_popup = new QPopupMenu(this);
_popup = new TQPopupMenu(this);
_popup->insertItem(i18n("&Flags"), _flagPopup);
if (!applet)
@ -121,37 +121,37 @@ MapWidget::MapWidget(bool applet, bool restore, QWidget *parent, const char *nam
_popup->insertSeparator();
_popup->insertItem(i18n("&Map Theme"), _themePopup);
_illuminationID = _popup->insertItem(i18n("Show &Daylight"), this, SLOT(toggleIllumination()));
_citiesID = _popup->insertItem(i18n("Show &Cities"), this, SLOT(toggleCities()));
_flagsID = _popup->insertItem(i18n("Show F&lags"), this, SLOT(toggleFlags()));
_illuminationID = _popup->insertItem(i18n("Show &Daylight"), this, TQT_SLOT(toggleIllumination()));
_citiesID = _popup->insertItem(i18n("Show &Cities"), this, TQT_SLOT(toggleCities()));
_flagsID = _popup->insertItem(i18n("Show F&lags"), this, TQT_SLOT(toggleFlags()));
if (!applet)
{
_popup->insertSeparator();
_popup->insertItem(i18n("&Save Settings"), this, SLOT(slotSaveSettings()));
_popup->insertItem(i18n("&Save Settings"), this, TQT_SLOT(slotSaveSettings()));
}
_popup->insertSeparator();
_popup->insertItem(i18n("&About"), this, SLOT(about()));
_popup->insertItem(i18n("&About"), this, TQT_SLOT(about()));
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(timeout()));
TQTimer *timer = new TQTimer(this);
connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout()));
timer->start(1000);
_cityIndicator = new QLabel(0,0, WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM );
_cityIndicator = new TQLabel(0,0, WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM );
_cityIndicator->setMargin(1);
_cityIndicator->setIndent(0);
_cityIndicator->setAutoMask(false);
_cityIndicator->setLineWidth(1);
_cityIndicator->setAlignment(QLabel::AlignAuto | QLabel::AlignTop);
_cityIndicator->setAlignment(TQLabel::AlignAuto | TQLabel::AlignTop);
_cityIndicator->setAutoResize(true);
_cityIndicator->setFrameStyle(QFrame::Box | QFrame::Plain);
_cityIndicator->setPalette(QToolTip::palette());
_cityIndicator->setFrameStyle(TQFrame::Box | TQFrame::Plain);
_cityIndicator->setPalette(TQToolTip::palette());
if (restore && !applet)
load(kapp->config());
connect(&m_timer, SIGNAL(timeout()), this, SLOT(updateCityIndicator()));
connect(&m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateCityIndicator()));
}
@ -178,7 +178,7 @@ void MapWidget::load(KConfig *config)
{
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->isSet("theme"))
setTheme(QString::fromLocal8Bit(args->getOption("theme")));
setTheme(TQString::fromLocal8Bit(args->getOption("theme")));
else
setTheme(config->readEntry("Theme", "depths"));
@ -210,10 +210,10 @@ void MapWidget::addClock()
if (!_cityList)
_cityList = new CityList;
QPoint where;
TQPoint where;
City *c = _cityList->getNearestCity(_width, _height, gmt_position, _flagPos.x(), _flagPos.y(), where);
QString zone = "";
TQString zone = "";
if (c)
zone = c->name();
@ -223,7 +223,7 @@ void MapWidget::addClock()
void MapWidget::addFlag(int index)
{
QColor col = Qt::red;
TQColor col = Qt::red;
switch (index)
{
@ -262,7 +262,7 @@ void MapWidget::removeFlag()
void MapWidget::removeAllFlags()
{
if ( KMessageBox::warningContinueCancel( this, i18n( "Do you really want to remove all flags?" ), QString::null, KStdGuiItem::del() ) == KMessageBox::Continue )
if ( KMessageBox::warningContinueCancel( this, i18n( "Do you really want to remove all flags?" ), TQString::null, KStdGuiItem::del() ) == KMessageBox::Continue )
_flagList->removeAllFlags();
update();
@ -325,7 +325,7 @@ void MapWidget::updateBackground()
}
QPixmap MapWidget::getPixmap()
TQPixmap MapWidget::getPixmap()
{
return _pixmap;
}
@ -350,13 +350,13 @@ void MapWidget::timeout()
}
QString MapWidget::cityTime(const QString &city)
TQString MapWidget::cityTime(const TQString &city)
{
QString result = i18n(city.latin1()); // Time zone translation
TQString result = i18n(city.latin1()); // Time zone translation
int pos = result.find("/");
if (pos >= 0)
result = result.mid(pos+1);
result.replace(QRegExp("_"), " ");
result.replace(TQRegExp("_"), " ");
result.append(": ");
char *initial_TZ = getenv("TZ");
@ -364,9 +364,9 @@ QString MapWidget::cityTime(const QString &city)
tzset();
time_t t = time(NULL);
QDateTime dt;
TQDateTime dt;
dt.setTime_t(t);
result.append(QString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true)));
result.append(TQString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true)));
if (initial_TZ != 0)
setenv("TZ", initial_TZ, 1);
@ -377,13 +377,13 @@ QString MapWidget::cityTime(const QString &city)
}
void MapWidget::enterEvent(QEvent *)
void MapWidget::enterEvent(TQEvent *)
{
if ( _cities )
updateCityIndicator();
}
void MapWidget::leaveEvent(QEvent *)
void MapWidget::leaveEvent(TQEvent *)
{
_cityIndicator->hide();
m_timer.stop();
@ -399,15 +399,15 @@ void MapWidget::about()
void MapWidget::themeSelected(int index)
{
QString t = _themes.at(index)->tag();
TQString t = _themes.at(index)->tag();
if (!t.isEmpty())
setTheme(t);
}
void MapWidget::mousePressEvent(QMouseEvent *ev)
void MapWidget::mousePressEvent(TQMouseEvent *ev)
{
if (ev->button() == QMouseEvent::RightButton)
if (ev->button() == TQMouseEvent::RightButton)
{
_flagPos = ev->pos();
_popup->exec(ev->globalPos());
@ -415,7 +415,7 @@ void MapWidget::mousePressEvent(QMouseEvent *ev)
}
void MapWidget::mouseMoveEvent(QMouseEvent *)
void MapWidget::mouseMoveEvent(TQMouseEvent *)
{
if (!_cities)
return;
@ -426,8 +426,8 @@ void MapWidget::mouseMoveEvent(QMouseEvent *)
void MapWidget::updateCityIndicator()
{
QPoint where;
QPoint pos = mapFromGlobal(QCursor::pos());
TQPoint where;
TQPoint pos = mapFromGlobal(TQCursor::pos());
if (!_cityList)
_cityList = new CityList;
@ -436,23 +436,23 @@ void MapWidget::updateCityIndicator()
if (c)
{
_currentCity = c->name();
showIndicator(QCursor::pos());
showIndicator(TQCursor::pos());
}
else
_cityIndicator->hide();
}
void MapWidget::showIndicator(const QPoint &pos)
void MapWidget::showIndicator(const TQPoint &pos)
{
_cityIndicator->setText(cityTime(_currentCity));
int w = _cityIndicator->width();
int h = _cityIndicator->height();
QRect desk = KGlobalSettings::desktopGeometry(pos);
TQRect desk = KGlobalSettings::desktopGeometry(pos);
QPoint newPos;
TQPoint newPos;
if (pos.x()+w+10 > desk.right())
newPos.setX(pos.x()-w-5);
@ -471,11 +471,11 @@ void MapWidget::showIndicator(const QPoint &pos)
}
void MapWidget::setTheme(const QString &theme)
void MapWidget::setTheme(const TQString &theme)
{
_theme = theme;
QPtrListIterator<MapTheme> it(_themes);
TQPtrListIterator<MapTheme> it(_themes);
for ( ; it.current(); ++it)
_themePopup->setItemChecked(it.current()->ID(), theme == it.current()->tag());
@ -509,13 +509,13 @@ void MapWidget::setSize(int w, int h)
updateBackground();
}
void MapWidget::resizeEvent(QResizeEvent *ev)
void MapWidget::resizeEvent(TQResizeEvent *ev)
{
setSize(width(), height());
QWidget::resizeEvent(ev);
TQWidget::resizeEvent(ev);
}
void MapWidget::paintContents(QPainter *p)
void MapWidget::paintContents(TQPainter *p)
{
if (_cities)
_cityList->paint(p, _width, _height, gmt_position);
@ -523,13 +523,13 @@ void MapWidget::paintContents(QPainter *p)
_flagList->paint(p, _width, _height, gmt_position);
}
void MapWidget::paintEvent(QPaintEvent *ev)
void MapWidget::paintEvent(TQPaintEvent *ev)
{
QWidget::paintEvent(ev);
TQWidget::paintEvent(ev);
if (_cities || _flags)
{
QPainter p(this);
TQPainter p(this);
p.setClipping(true);
p.setClipRegion(ev->region());
@ -539,16 +539,16 @@ void MapWidget::paintEvent(QPaintEvent *ev)
}
QPixmap MapWidget::calculatePixmap()
TQPixmap MapWidget::calculatePixmap()
{
QPixmap map;
TQPixmap map;
if (_illumination)
{
map = _loader.darkMap();
QPixmap clean = _loader.lightMap();
TQPixmap clean = _loader.lightMap();
QPainter mp(&map);
TQPainter mp(&map);
clean.setMask(_loader.darkMask(map.width(), map.height()));
mp.drawPixmap(0,0, clean);
}
@ -557,8 +557,8 @@ QPixmap MapWidget::calculatePixmap()
int greenwich = map.width()/2;
QPixmap pm(_width, _height);
QPainter p;
TQPixmap pm(_width, _height);
TQPainter p;
p.begin(&pm);
if (gmt_position >= greenwich)

@ -32,12 +32,12 @@
#include <time.h>
#include <qwidget.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <qlabel.h>
#include <qpoint.h>
#include <qtimer.h>
#include <tqwidget.h>
#include <tqpixmap.h>
#include <tqstringlist.h>
#include <tqlabel.h>
#include <tqpoint.h>
#include <tqtimer.h>
class QPopupMenu;
@ -59,10 +59,10 @@ class MapWidget : public QWidget
public:
MapWidget(bool applet=false, bool restore=false, QWidget *parent=0, const char *name=0);
MapWidget(bool applet=false, bool restore=false, TQWidget *parent=0, const char *name=0);
~MapWidget();
void setTheme(const QString &theme);
void setTheme(const TQString &theme);
void setTime(struct tm *time);
void setIllumination(bool i);
void setCities(bool c);
@ -74,15 +74,15 @@ public:
void updateBackground();
QPixmap getPixmap();
QPopupMenu* contextMenu() const { return _popup; }
TQPixmap getPixmap();
TQPopupMenu* contextMenu() const { return _popup; }
void paintContents(QPainter *p);
QPixmap calculatePixmap();
void paintContents(TQPainter *p);
TQPixmap calculatePixmap();
signals:
void addClockClicked(const QString &zone);
void addClockClicked(const TQString &zone);
void saveSettings();
@ -107,12 +107,12 @@ public slots:
protected:
void resizeEvent(QResizeEvent *ev);
void paintEvent(QPaintEvent *ev);
void mousePressEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);
void enterEvent(QEvent *ev);
void leaveEvent(QEvent *ev);
void resizeEvent(TQResizeEvent *ev);
void paintEvent(TQPaintEvent *ev);
void mousePressEvent(TQMouseEvent *ev);
void mouseMoveEvent(TQMouseEvent *ev);
void enterEvent(TQEvent *ev);
void leaveEvent(TQEvent *ev);
private slots:
@ -125,34 +125,34 @@ private slots:
private:
void updateMap();
QString cityTime(const QString &city);
void showIndicator(const QPoint &pos);
TQString cityTime(const TQString &city);
void showIndicator(const TQPoint &pos);
MapLoader _loader;
QString _theme;
TQString _theme;
QPixmap _pixmap;
TQPixmap _pixmap;
int gmt_position;
time_t sec;
QPopupMenu *_popup, *_themePopup, *_flagPopup;
QPtrList<MapTheme> _themes;
TQPopupMenu *_popup, *_themePopup, *_flagPopup;
TQPtrList<MapTheme> _themes;
bool _illumination, _cities, _flags;
int _illuminationID, _citiesID, _flagsID;
CityList *_cityList;
QLabel *_cityIndicator;
QString _currentCity;
TQLabel *_cityIndicator;
TQString _currentCity;
FlagList *_flagList;
QPoint _flagPos;
TQPoint _flagPos;
bool _applet;
QTimer m_timer;
TQTimer m_timer;
int _width, _height;
};

@ -31,13 +31,13 @@
#include <time.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qdatetime.h>
#include <qtimer.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qpopupmenu.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqdatetime.h>
#include <tqtimer.h>
#include <tqcombobox.h>
#include <tqlineedit.h>
#include <tqpopupmenu.h>
#include <kglobal.h>
@ -51,24 +51,24 @@
#include "zoneclock.moc"
#include <kdebug.h>
ZoneClock::ZoneClock(const QString &zone, const QString &name, QWidget *parent, const char *n)
: QFrame(parent, n), _zone(zone), _name(name)
ZoneClock::ZoneClock(const TQString &zone, const TQString &name, TQWidget *parent, const char *n)
: TQFrame(parent, n), _zone(zone), _name(name)
{
setFrameStyle(QFrame::Panel | QFrame::Raised);
QHBoxLayout *hbox = new QHBoxLayout(this, 2,2);
setFrameStyle(TQFrame::Panel | TQFrame::Raised);
TQHBoxLayout *hbox = new TQHBoxLayout(this, 2,2);
_name.append(":");
_nameLabel = new QLabel(_name, this);
_nameLabel = new TQLabel(_name, this);
hbox->addWidget(_nameLabel, 1);
hbox->addSpacing(4);
_timeLabel = new QLabel(this);
_timeLabel = new TQLabel(this);
hbox->addWidget(_timeLabel, 0, Qt::AlignRight);
_popup = new QPopupMenu(this);
_popup->insertItem(i18n("&Edit..."), this, SLOT(editClock()));
_popup->insertItem(i18n("&Add..."), this, SLOT(slotAddClock()));
_popup->insertItem(i18n("&Remove"), this, SLOT(slotRemoveClock()));
_popup = new TQPopupMenu(this);
_popup->insertItem(i18n("&Edit..."), this, TQT_SLOT(editClock()));
_popup->insertItem(i18n("&Add..."), this, TQT_SLOT(slotAddClock()));
_popup->insertItem(i18n("&Remove"), this, TQT_SLOT(slotRemoveClock()));
_nameLabel->installEventFilter(this);
_timeLabel->installEventFilter(this);
@ -84,7 +84,7 @@ void ZoneClock::slotRemoveClock()
// So instead we fire up an idle event triggering the delete
// after the return.
QTimer::singleShot(0, this, SLOT(removeTimeout()));
TQTimer::singleShot(0, this, TQT_SLOT(removeTimeout()));
}
@ -104,8 +104,8 @@ void ZoneClock::editClock()
{
ClockDialog *_dlg = new ClockDialog(this, 0, true);
CityList cities;
QStringList timezones = cities.timezones();
for (QStringList::iterator it = timezones.begin(); it != timezones.end(); ++it)
TQStringList timezones = cities.timezones();
for (TQStringList::iterator it = timezones.begin(); it != timezones.end(); ++it)
_dlg->ClockZone->insertItem(i18n((*it).utf8()));
_dlg->ClockCaption->setText(_nameLabel->text().left(_nameLabel->text().length()-1));
@ -116,7 +116,7 @@ void ZoneClock::editClock()
break;
}
if (_dlg->exec() == QDialog::Accepted)
if (_dlg->exec() == TQDialog::Accepted)
{
_zone = timezones[_dlg->ClockZone->currentItem()];
_name = _dlg->ClockCaption->text().append(":");
@ -130,16 +130,16 @@ void ZoneClock::editClock()
}
bool ZoneClock::eventFilter(QObject *obj, QEvent *ev)
bool ZoneClock::eventFilter(TQObject *obj, TQEvent *ev)
{
if (ev->type() == QEvent::MouseButtonPress)
if (ev->type() == TQEvent::MouseButtonPress)
{
QMouseEvent *e = (QMouseEvent*)ev;
if (e->button() == QMouseEvent::RightButton)
TQMouseEvent *e = (TQMouseEvent*)ev;
if (e->button() == TQMouseEvent::RightButton)
_popup->exec(e->globalPos());
}
return QFrame::eventFilter(obj, ev);
return TQFrame::eventFilter(obj, ev);
}
@ -150,9 +150,9 @@ void ZoneClock::updateTime()
tzset();
time_t t = time(NULL);
QDateTime dt;
TQDateTime dt;
dt.setTime_t(t);
_timeLabel->setText(QString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true)));
_timeLabel->setText(TQString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true)));
if (initial_TZ != 0)
setenv("TZ", initial_TZ, 1);
@ -162,14 +162,14 @@ void ZoneClock::updateTime()
}
ZoneClockPanel::ZoneClockPanel(QWidget *parent, const char *name)
: QFrame(parent, name), _dlg(0)
ZoneClockPanel::ZoneClockPanel(TQWidget *parent, const char *name)
: TQFrame(parent, name), _dlg(0)
{
_flow = new SimpleFlow(this,1,1);
QTimer *t = new QTimer(this);
TQTimer *t = new TQTimer(this);
connect(t, SIGNAL(timeout()), this, SLOT(updateTimer()));
connect(t, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateTimer()));
t->start(500);
_clocks.setAutoDelete(true);
@ -182,14 +182,14 @@ void ZoneClockPanel::createDialog()
{
_dlg = new ClockDialog(this, 0, true);
CityList cities;
QStringList timezones = cities.timezones();
for (QStringList::iterator it = timezones.begin(); it != timezones.end(); ++it)
TQStringList timezones = cities.timezones();
for (TQStringList::iterator it = timezones.begin(); it != timezones.end(); ++it)
_dlg->ClockZone->insertItem(i18n((*it).utf8()));
}
}
void ZoneClockPanel::addClock(const QString &zone, const QString &name)
void ZoneClockPanel::addClock(const TQString &zone, const TQString &name)
{
// add the clocks
ZoneClock *zc = new ZoneClock(zone, name, this);
@ -199,9 +199,9 @@ void ZoneClockPanel::addClock(const QString &zone, const QString &name)
realign();
connect(zc, SIGNAL(addClock(const QString &)), this, SLOT(addClock(const QString &)));
connect(zc, SIGNAL(changed()), this, SLOT(realign()));
connect(zc, SIGNAL(removeMe(ZoneClock *)), this, SLOT(removeClock(ZoneClock *)));
connect(zc, TQT_SIGNAL(addClock(const TQString &)), this, TQT_SLOT(addClock(const TQString &)));
connect(zc, TQT_SIGNAL(changed()), this, TQT_SLOT(realign()));
connect(zc, TQT_SIGNAL(removeMe(ZoneClock *)), this, TQT_SLOT(removeClock(ZoneClock *)));
}
@ -216,7 +216,7 @@ void ZoneClockPanel::realign()
{
// realign the labels
int w = 0;
QPtrListIterator<ZoneClock> it(_clocks);
TQPtrListIterator<ZoneClock> it(_clocks);
for ( ; it.current(); ++it)
if (it.current()->sizeHint().width() > w)
w = it.current()->sizeHint().width();
@ -228,12 +228,12 @@ void ZoneClockPanel::realign()
void ZoneClockPanel::updateTimer()
{
QPtrListIterator<ZoneClock> it(_clocks);
TQPtrListIterator<ZoneClock> it(_clocks);
for ( ; it.current(); ++it)
it.current()->updateTime();
}
void ZoneClockPanel::addClock(const QString &zone)
void ZoneClockPanel::addClock(const TQString &zone)
{
createDialog();
@ -245,11 +245,11 @@ void ZoneClockPanel::addClock(const QString &zone)
break;
}
if (_dlg->exec() == QDialog::Accepted)
if (_dlg->exec() == TQDialog::Accepted)
{
CityList cities;
QStringList timezones = cities.timezones();
QString newzone = timezones[_dlg->ClockZone->currentItem()];
TQStringList timezones = cities.timezones();
TQString newzone = timezones[_dlg->ClockZone->currentItem()];
addClock(newzone, _dlg->ClockCaption->text());
update();
}
@ -260,14 +260,14 @@ void ZoneClockPanel::save(KConfig *config)
{
config->writeEntry("Clocks", _clocks.count());
QPtrListIterator<ZoneClock> it(_clocks);
TQPtrListIterator<ZoneClock> it(_clocks);
int cnt=0;
for ( ; it.current(); ++it)
{
QString n = it.current()->name();
TQString n = it.current()->name();
n = n.left(n.length()-1);
config->writeEntry(QString("Clock_%1_Name").arg(cnt), n);
config->writeEntry(QString("Clock_%1_Zone").arg(cnt), it.current()->zone());
config->writeEntry(TQString("Clock_%1_Name").arg(cnt), n);
config->writeEntry(TQString("Clock_%1_Zone").arg(cnt), it.current()->zone());
cnt++;
}
}
@ -281,7 +281,7 @@ void ZoneClockPanel::load(KConfig *config)
for (int i=0; i<num; ++i)
{
addClock(config->readEntry(QString("Clock_%1_Zone").arg(i)), config->readEntry(QString("Clock_%1_Name").arg(i)));
addClock(config->readEntry(TQString("Clock_%1_Zone").arg(i)), config->readEntry(TQString("Clock_%1_Name").arg(i)));
}
}

@ -29,10 +29,10 @@
#define ZONECLOCK_H
#include <qwidget.h>
#include <qstring.h>
#include <qframe.h>
#include <qptrlist.h>
#include <tqwidget.h>
#include <tqstring.h>
#include <tqframe.h>
#include <tqptrlist.h>
class QLabel;
@ -49,20 +49,20 @@ class ZoneClock : public QFrame
public:
ZoneClock(const QString &zone, const QString &name, QWidget *parent=0, const char *n=0);
ZoneClock(const TQString &zone, const TQString &name, TQWidget *parent=0, const char *n=0);
QString zone() const { return _zone; };
void setZone(const QString &z) { _zone = z; updateTime(); };
TQString zone() const { return _zone; };
void setZone(const TQString &z) { _zone = z; updateTime(); };
QString name() const { return _name; };
void setName( const QString &n) { _name = n; updateTime(); };
TQString name() const { return _name; };
void setName( const TQString &n) { _name = n; updateTime(); };
signals:
void removeMe(ZoneClock *t);
void addClock(const QString &zone);
void addClock(const TQString &zone);
void changed();
@ -73,7 +73,7 @@ public slots:
protected:
virtual bool eventFilter(QObject *, QEvent *);
virtual bool eventFilter(TQObject *, TQEvent *);
private slots:
@ -86,10 +86,10 @@ private slots:
private:
QString _zone;
QString _name;
QLabel *_timeLabel, *_nameLabel;
QPopupMenu *_popup;
TQString _zone;
TQString _name;
TQLabel *_timeLabel, *_nameLabel;
TQPopupMenu *_popup;
};
@ -100,9 +100,9 @@ class ZoneClockPanel : public QFrame
public:
ZoneClockPanel(QWidget *parent=0, const char *name=0);
ZoneClockPanel(TQWidget *parent=0, const char *name=0);
void addClock(const QString &zone, const QString &name);
void addClock(const TQString &zone, const TQString &name);
void save(KConfig *config);
void load(KConfig *config);
@ -110,7 +110,7 @@ public:
public slots:
void addClock(const QString &zone);
void addClock(const TQString &zone);
private slots:
@ -125,7 +125,7 @@ private:
void createDialog();
SimpleFlow *_flow;
QPtrList<ZoneClock> _clocks;
TQPtrList<ZoneClock> _clocks;
ClockDialog *_dlg;
};

Loading…
Cancel
Save