From cfc42a28c327b96c6a2afee92af3bac1a479eb8a Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:49:52 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1157650 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kworldwatch/applet.cpp | 24 ++++---- kworldwatch/applet.h | 12 ++-- kworldwatch/cities.cpp | 52 ++++++++-------- kworldwatch/cities.h | 24 ++++---- kworldwatch/flags.cpp | 36 +++++------ kworldwatch/flags.h | 38 ++++++------ kworldwatch/flow.cpp | 50 ++++++++-------- kworldwatch/flow.h | 30 +++++----- kworldwatch/main.cpp | 38 ++++++------ kworldwatch/main.h | 2 +- kworldwatch/maploader.cpp | 44 +++++++------- kworldwatch/maploader.h | 28 ++++----- kworldwatch/mapwidget.cpp | 150 +++++++++++++++++++++++----------------------- kworldwatch/mapwidget.h | 58 +++++++++--------- kworldwatch/zoneclock.cpp | 98 +++++++++++++++--------------- kworldwatch/zoneclock.h | 38 ++++++------ 16 files changed, 361 insertions(+), 361 deletions(-) (limited to 'kworldwatch') diff --git a/kworldwatch/applet.cpp b/kworldwatch/applet.cpp index a12a987..09b67c0 100644 --- a/kworldwatch/applet.cpp +++ b/kworldwatch/applet.cpp @@ -25,7 +25,7 @@ /* ** Bug reports and questions can be sent to kde-devel@kde.org */ -#include +#include #include @@ -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(e)); + mousePressEvent(static_cast(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()); } diff --git a/kworldwatch/applet.h b/kworldwatch/applet.h index 7965b8f..8d8f90e 100644 --- a/kworldwatch/applet.h +++ b/kworldwatch/applet.h @@ -29,8 +29,8 @@ #define KWW_applet_h -#include -#include +#include +#include #include @@ -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: diff --git a/kworldwatch/cities.cpp b/kworldwatch/cities.cpp index 624c814..f723e97 100644 --- a/kworldwatch/cities.cpp +++ b/kworldwatch/cities.cpp @@ -25,10 +25,10 @@ /* ** Bug reports and questions can be sent to kde-devel@kde.org */ -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -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 it(_cities); + TQPtrListIterator 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 it(_cities); + TQPtrListIterator 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 it(_cities); + TQPtrListIterator it(_cities); for ( ; it.current(); ++it) r << it.current()->name(); r.sort(); diff --git a/kworldwatch/cities.h b/kworldwatch/cities.h index 9c55c37..6f08f24 100644 --- a/kworldwatch/cities.h +++ b/kworldwatch/cities.h @@ -29,9 +29,9 @@ #define CITIES_H -#include -#include -#include +#include +#include +#include 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 _cities; + TQPtrList _cities; }; diff --git a/kworldwatch/flags.cpp b/kworldwatch/flags.cpp index dd60330..273f8a0 100644 --- a/kworldwatch/flags.cpp +++ b/kworldwatch/flags.cpp @@ -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 it(_flags); + TQPtrListIterator 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 it(_flags); + TQPtrListIterator 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 it(_flags); + TQPtrListIterator 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; ireadDoubleNumEntry(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)))); } } diff --git a/kworldwatch/flags.h b/kworldwatch/flags.h index 7a444db..dcfa335 100644 --- a/kworldwatch/flags.h +++ b/kworldwatch/flags.h @@ -29,13 +29,13 @@ #define FLAGS_H -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -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 _flags; + TQPtrList _flags; - QPixmap _flagPixmap; - QBitmap _flagMask; + TQPixmap _flagPixmap; + TQBitmap _flagMask; }; diff --git a/kworldwatch/flow.cpp b/kworldwatch/flow.cpp index ca06d16..adce999 100644 --- a/kworldwatch/flow.cpp +++ b/kworldwatch/flow.cpp @@ -15,15 +15,15 @@ class SimpleFlowIterator :public QGLayoutIterator { public: - SimpleFlowIterator( QPtrList *l ) :idx(0), list(l) {} + SimpleFlowIterator( TQPtrList *l ) :idx(0), list(l) {} uint count() const; - QLayoutItem *current(); - QLayoutItem *next(); - QLayoutItem *takeCurrent(); + TQLayoutItem *current(); + TQLayoutItem *next(); + TQLayoutItem *takeCurrent(); private: int idx; - QPtrList *list; + TQPtrList *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 it(list); - QLayoutItem *o; + TQPtrListIterator 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 it(list); - QLayoutItem *o; + TQSize s(0,0); + TQPtrListIterator it(list); + TQLayoutItem *o; while ( (o=it.current()) != 0 ) { ++it; s = s.expandedTo( o->minimumSize() ); diff --git a/kworldwatch/flow.h b/kworldwatch/flow.h index 950c7e5..dd0930e 100644 --- a/kworldwatch/flow.h +++ b/kworldwatch/flow.h @@ -15,39 +15,39 @@ #ifndef FLOW_H #define FLOW_H -#include -#include +#include +#include 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 list; + int doLayout( const TQRect&, bool testonly = FALSE ); + TQPtrList list; int cached_width; int cached_hfw; }; diff --git a/kworldwatch/main.cpp b/kworldwatch/main.cpp index 622dc73..346a97b 100644 --- a/kworldwatch/main.cpp +++ b/kworldwatch/main.cpp @@ -28,11 +28,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -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 _themes = MapLoader::themes(); - QPtrListIterator it(_themes); + TQPtrList _themes = MapLoader::themes(); + TQPtrListIterator it(_themes); for ( ; it.current(); ++it) { printf("%s\n", it.current()->tag().local8Bit().data()); diff --git a/kworldwatch/main.h b/kworldwatch/main.h index 7b4c3c6..48b8860 100644 --- a/kworldwatch/main.h +++ b/kworldwatch/main.h @@ -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); diff --git a/kworldwatch/maploader.cpp b/kworldwatch/maploader.cpp index 236abd3..c1e3896 100644 --- a/kworldwatch/maploader.cpp +++ b/kworldwatch/maploader.cpp @@ -27,12 +27,12 @@ */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -45,12 +45,12 @@ #include "maploader.h" -QPtrList MapLoader::themes() +TQPtrList MapLoader::themes() { - QPtrList result; + TQPtrList 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 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 sizes; - QStringList files = maps(theme); + TQValueList sizes; + TQStringList files = maps(theme); for (uint i=0; i= 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; diff --git a/kworldwatch/maploader.h b/kworldwatch/maploader.h index efce45f..a1f7abb 100644 --- a/kworldwatch/maploader.h +++ b/kworldwatch/maploader.h @@ -28,9 +28,9 @@ #ifndef MAP_LOADER_H #define MAP_LOADER_H -#include -#include -#include +#include +#include +#include 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 themes(); + static TQPtrList 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; }; diff --git a/kworldwatch/mapwidget.cpp b/kworldwatch/mapwidget.cpp index 2dac883..73a8739 100644 --- a/kworldwatch/mapwidget.cpp +++ b/kworldwatch/mapwidget.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -42,12 +42,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #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 it(_themes); + TQPtrListIterator 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 it(_themes); + TQPtrListIterator 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) diff --git a/kworldwatch/mapwidget.h b/kworldwatch/mapwidget.h index 54e4f58..d23b5c7 100644 --- a/kworldwatch/mapwidget.h +++ b/kworldwatch/mapwidget.h @@ -32,12 +32,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include 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 _themes; + TQPopupMenu *_popup, *_themePopup, *_flagPopup; + TQPtrList _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; }; diff --git a/kworldwatch/zoneclock.cpp b/kworldwatch/zoneclock.cpp index 7b15fbc..a09e6e4 100644 --- a/kworldwatch/zoneclock.cpp +++ b/kworldwatch/zoneclock.cpp @@ -31,13 +31,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -51,24 +51,24 @@ #include "zoneclock.moc" #include -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 it(_clocks); + TQPtrListIterator 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 it(_clocks); + TQPtrListIterator 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 it(_clocks); + TQPtrListIterator 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; ireadEntry(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))); } } diff --git a/kworldwatch/zoneclock.h b/kworldwatch/zoneclock.h index 50a6768..403256e 100644 --- a/kworldwatch/zoneclock.h +++ b/kworldwatch/zoneclock.h @@ -29,10 +29,10 @@ #define ZONECLOCK_H -#include -#include -#include -#include +#include +#include +#include +#include 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 _clocks; + TQPtrList _clocks; ClockDialog *_dlg; }; -- cgit v1.2.1