From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- wifi/kwireless/kwireless.cpp | 8 ++-- wifi/kwireless/kwireless.h | 8 ++-- wifi/kwireless/kwirelesswidget.cpp | 76 +++++++++++++++++----------------- wifi/kwireless/kwirelesswidget.h | 48 ++++++++++----------- wifi/kwireless/linuxwirelesswidget.cpp | 18 ++++---- wifi/kwireless/linuxwirelesswidget.h | 4 +- wifi/kwireless/propertytable.cpp | 30 +++++++------- wifi/kwireless/propertytable.h | 12 +++--- 8 files changed, 102 insertions(+), 102 deletions(-) (limited to 'wifi/kwireless') diff --git a/wifi/kwireless/kwireless.cpp b/wifi/kwireless/kwireless.cpp index ff584603..39b66a76 100644 --- a/wifi/kwireless/kwireless.cpp +++ b/wifi/kwireless/kwireless.cpp @@ -17,8 +17,8 @@ #include "kwirelesswidget.h" -KWireLess::KWireLess(const QString& configFile, Type type, - int actions, QWidget *parent, const char *name) +KWireLess::KWireLess(const TQString& configFile, Type type, + int actions, TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name) { ksConfig = config(); @@ -68,7 +68,7 @@ int KWireLess::heightForWidth(int) const return widget->preferredHeight(); } -void KWireLess::resizeEvent(QResizeEvent *) +void KWireLess::resizeEvent(TQResizeEvent *) { widget->setGeometry(0, 0, width(), height()); } @@ -76,7 +76,7 @@ void KWireLess::resizeEvent(QResizeEvent *) extern "C" { - KDE_EXPORT KPanelApplet* init( QWidget *parent, const QString configFile) + KDE_EXPORT KPanelApplet* init( TQWidget *parent, const TQString configFile) { KGlobal::locale()->insertCatalogue("kwireless"); return new KWireLess(configFile, KPanelApplet::Normal, diff --git a/wifi/kwireless/kwireless.h b/wifi/kwireless/kwireless.h index 5a4597af..828ad184 100644 --- a/wifi/kwireless/kwireless.h +++ b/wifi/kwireless/kwireless.h @@ -15,7 +15,7 @@ #endif #include -#include +#include #include class KWireLessWidget; @@ -25,8 +25,8 @@ class KWireLess : public KPanelApplet Q_OBJECT public: - KWireLess(const QString& configFile, Type t = Normal, int actions = 0, - QWidget *parent = 0, const char *name = 0); + KWireLess(const TQString& configFile, Type t = Normal, int actions = 0, + TQWidget *parent = 0, const char *name = 0); ~KWireLess(); virtual int widthForHeight(int height) const; @@ -36,7 +36,7 @@ public: virtual void preferences(); protected: - void resizeEvent(QResizeEvent *); + void resizeEvent(TQResizeEvent *); private: KConfig *ksConfig; diff --git a/wifi/kwireless/kwirelesswidget.cpp b/wifi/kwireless/kwirelesswidget.cpp index 3ae2ff8c..08f4336b 100644 --- a/wifi/kwireless/kwirelesswidget.cpp +++ b/wifi/kwireless/kwirelesswidget.cpp @@ -7,11 +7,11 @@ http://www.hackerbuero.org $ */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -25,12 +25,12 @@ extern "C" { #include } -QPtrList KWireLessWidget::deviceInfo; -QMutex KWireLessWidget::mutex; -QTimer *KWireLessWidget::timer; +TQPtrList KWireLessWidget::deviceInfo; +TQMutex KWireLessWidget::mutex; +TQTimer *KWireLessWidget::timer; int KWireLessWidget::m_instances; -DeviceInfo::DeviceInfo(QString _device, QString _essid, QString _encr, +DeviceInfo::DeviceInfo(TQString _device, TQString _essid, TQString _encr, float _quality, float _signal, float _noise, int _bitrate) : m_device(_device), @@ -48,9 +48,9 @@ float DeviceInfo::quality() return m_quality; } -QString DeviceInfo::qualityString() +TQString DeviceInfo::qualityString() { - return i18n("%1%").arg(QString::number(m_quality*100, 'f', 0)); + return i18n("%1%").arg(TQString::number(m_quality*100, 'f', 0)); } float DeviceInfo::signal() @@ -58,9 +58,9 @@ float DeviceInfo::signal() return m_signal; } -QString DeviceInfo::signalString() +TQString DeviceInfo::signalString() { - return i18n("%1%").arg(QString::number(m_signal*100, 'f', 0)); + return i18n("%1%").arg(TQString::number(m_signal*100, 'f', 0)); } float DeviceInfo::noise() @@ -68,26 +68,26 @@ float DeviceInfo::noise() return m_noise ; } -QString DeviceInfo::noiseString() +TQString DeviceInfo::noiseString() { - return i18n("%1%").arg(QString::number(m_noise*100, 'f', 0)); + return i18n("%1%").arg(TQString::number(m_noise*100, 'f', 0)); } -const QString& DeviceInfo::device() +const TQString& DeviceInfo::device() { return m_device; } -const QString& DeviceInfo::essid() +const TQString& DeviceInfo::essid() { return m_essid; } -QString DeviceInfo::bitrateString() +TQString DeviceInfo::bitrateString() { - QString bitrate; - QTextOStream b(&bitrate); + TQString bitrate; + TQTextOStream b(&bitrate); b.precision(2); switch((int)log10(m_bitrate)) @@ -123,7 +123,7 @@ bool DeviceInfo::usesEncryption() return !m_encr.isEmpty(); } -QString DeviceInfo::encrString() +TQString DeviceInfo::encrString() { if(m_encr.isEmpty()) { @@ -135,8 +135,8 @@ QString DeviceInfo::encrString() } } -KWireLessWidget::KWireLessWidget(QWidget *parent, const char* name) - : QWidget(parent, name), +KWireLessWidget::KWireLessWidget(TQWidget *parent, const char* name) + : TQWidget(parent, name), mode(Horizontal), frameWidth(1), qualityBarWidth(6), @@ -149,8 +149,8 @@ KWireLessWidget::KWireLessWidget(QWidget *parent, const char* name) if(timer == 0) { // this way, only the poll() method of the first instance will // ever be called (intended behaviour): - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), SLOT(poll())); + timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), TQT_SLOT(poll())); // single shot, will be restartet at the end of poll () timer->start(100, true); } @@ -181,26 +181,26 @@ void KWireLessWidget::setMode(KWireLessWidget::Mode _mode) mode = _mode; } -void KWireLessWidget::mousePressEvent(QMouseEvent *e) +void KWireLessWidget::mousePressEvent(TQMouseEvent *e) { - if( e->button() == QMouseEvent::LeftButton) + if( e->button() == TQMouseEvent::LeftButton) { PropertiesDialog dialog(this); - connect(this, SIGNAL(updateDeviceInfo(QPtrList *)), - &dialog, SLOT(update(QPtrList *))); + connect(this, TQT_SIGNAL(updateDeviceInfo(TQPtrList *)), + &dialog, TQT_SLOT(update(TQPtrList *))); dialog.exec(); } } -void KWireLessWidget::paintEvent(QPaintEvent*) +void KWireLessWidget::paintEvent(TQPaintEvent*) { // WORK_TO_DO: paint other devices, too: // for quick repaints, we need a buffered painter! int w, h, space; const int bevel = qualityBarWidth/2; - QPainter painter(this); - QPointArray points; - QColor color, brush; + TQPainter painter(this); + TQPointArray points; + TQColor color, brush; // do stuff that does not rely on device being valid (e.g., // non-nil): @@ -216,7 +216,7 @@ void KWireLessWidget::paintEvent(QPaintEvent*) w = space; } - painter.setPen(QPen(Qt::black, frameWidth)); + painter.setPen(TQPen(Qt::black, frameWidth)); painter.setBrush(KGlobalSettings::baseColor()); painter.drawRect(0, 0, w, h); @@ -267,12 +267,12 @@ void KWireLessWidget::paintEvent(QPaintEvent*) QMIN(position + bevel/2, w-frameWidth), frameWidth+qualityBarWidth-1, frameWidth, frameWidth+qualityBarWidth-1); } - painter.setPen(QPen(color)); + painter.setPen(TQPen(color)); painter.setBrush(brush); painter.drawPolygon(points); // draw the signal bar: - painter.setPen(QPen(Qt::darkRed)); + painter.setPen(TQPen(Qt::darkRed)); painter.setBrush(Qt::red); if(mode == Vertical) @@ -289,7 +289,7 @@ void KWireLessWidget::paintEvent(QPaintEvent*) painter.drawRect(x, y, w1, signalBarWidth); } // draw the noise bar: - painter.setPen(QPen(Qt::gray)); + painter.setPen(TQPen(Qt::gray)); painter.setBrush(Qt::lightGray); if(mode == Vertical) @@ -308,7 +308,7 @@ void KWireLessWidget::paintEvent(QPaintEvent*) } } -KWireLessWidget* KWireLessWidget::makeWireLessWidget(QWidget *parent, +KWireLessWidget* KWireLessWidget::makeWireLessWidget(TQWidget *parent, const char *name) { #if 1 diff --git a/wifi/kwireless/kwirelesswidget.h b/wifi/kwireless/kwirelesswidget.h index 5a374d07..3321b583 100644 --- a/wifi/kwireless/kwirelesswidget.h +++ b/wifi/kwireless/kwirelesswidget.h @@ -10,32 +10,32 @@ #ifndef KWIRELESS_WIDGET_H #define KWIRELESS_WIDGET_H -#include -#include -#include -#include +#include +#include +#include +#include class DeviceInfo { public: - DeviceInfo(QString _device=QString::null, QString _essid=QString::null, - QString _encr=QString::null, + DeviceInfo(TQString _device=TQString::null, TQString _essid=TQString::null, + TQString _encr=TQString::null, float _quality=0, float _signal=0, float _noise=0, int _bitrate=0); - QString bitrateString(); + TQString bitrateString(); float quality(); - QString qualityString(); + TQString qualityString(); float signal(); - QString signalString(); + TQString signalString(); float noise(); - QString noiseString(); - const QString& device(); - const QString& essid(); + TQString noiseString(); + const TQString& device(); + const TQString& essid(); bool usesEncryption(); - QString encrString(); + TQString encrString(); protected: - QString m_device; // the device name (e.g., eth1) - QString m_essid; // the network name + TQString m_device; // the device name (e.g., eth1) + TQString m_essid; // the network name // all this values are coefficients (values between 0 and 1): float m_quality; // link quality level @@ -43,7 +43,7 @@ protected: float m_signal; // the signal level // all these values are absolut, e.g., 11000000 = 11MBit/sec: int m_bitrate; // bit rate - QString m_encr; + TQString m_encr; }; /** This wigdet displays the information about one wireless device. @@ -58,10 +58,10 @@ public: Horizontal, Vertical }; - static KWireLessWidget* makeWireLessWidget(QWidget *parent = 0, + static KWireLessWidget* makeWireLessWidget(TQWidget *parent = 0, const char *name = 0); protected: - KWireLessWidget(QWidget *parent=0, const char* name=0); + KWireLessWidget(TQWidget *parent=0, const char* name=0); public: ~KWireLessWidget(); void setMode(Mode); @@ -70,8 +70,8 @@ public: int preferredWidth(); int instances(); protected: - void paintEvent(QPaintEvent*); - void mousePressEvent(QMouseEvent *e); + void paintEvent(TQPaintEvent*); + void mousePressEvent(TQMouseEvent *e); protected: Mode mode; int frameWidth; @@ -81,12 +81,12 @@ protected: // some static device information // a list of DeviceInfo objects, this needs to be filled by the // poll method: - static QPtrList deviceInfo; - static QTimer *timer; // the poll timer - static QMutex mutex; + static TQPtrList deviceInfo; + static TQTimer *timer; // the poll timer + static TQMutex mutex; static int m_instances; signals: - void updateDeviceInfo(QPtrList *); + void updateDeviceInfo(TQPtrList *); protected slots: /** poll() is system dependent and needs to be implemented by deriving classes. diff --git a/wifi/kwireless/linuxwirelesswidget.cpp b/wifi/kwireless/linuxwirelesswidget.cpp index de35b84b..3efdbf98 100644 --- a/wifi/kwireless/linuxwirelesswidget.cpp +++ b/wifi/kwireless/linuxwirelesswidget.cpp @@ -7,8 +7,8 @@ http://www.hackerbuero.org $ */ -#include -#include +#include +#include #include #include #include // for ::close @@ -21,9 +21,9 @@ extern "C" { } int LinuxWireLessWidget::socketFD; -QStringList LinuxWireLessWidget::deviceNames; +TQStringList LinuxWireLessWidget::deviceNames; -LinuxWireLessWidget::LinuxWireLessWidget(QWidget *parent, const char* name) +LinuxWireLessWidget::LinuxWireLessWidget(TQWidget *parent, const char* name) : KWireLessWidget(parent, name), m_number (-1) { @@ -37,7 +37,7 @@ LinuxWireLessWidget::~LinuxWireLessWidget() { kdDebug() << "KWireLessWidget dtor: closing FD, over and out." << endl; - ::close(socketFD); // prevent from using QWidget::close + ::close(socketFD); // prevent from using TQWidget::close socketFD = 0; } } @@ -91,7 +91,7 @@ void LinuxWireLessWidget::poll() } // ----- get the device information: - QStringList::Iterator it; + TQStringList::Iterator it; deviceInfo.clear(); for(it=deviceNames.begin(); it!=deviceNames.end(); ++it) @@ -110,7 +110,7 @@ void LinuxWireLessWidget::poll() } else { // WORK_TO_DO: decide whether updates are needed or not // create a DeviceInfo object and fill it: - QString dev, essid, encr; + TQString dev, essid, encr; float quality=0, signal=0, noise=0; int bitrate; @@ -192,7 +192,7 @@ void LinuxWireLessWidget::poll() if(updateToolTip) { DeviceInfo *info; - QString text; + TQString text; for(info=deviceInfo.first(); info; info=deviceInfo.next()) { @@ -203,7 +203,7 @@ void LinuxWireLessWidget::poll() .arg(info->qualityString()) .arg(info->bitrateString()); } - QToolTip::add(this, text); + TQToolTip::add(this, text); updateToolTip = false; } diff --git a/wifi/kwireless/linuxwirelesswidget.h b/wifi/kwireless/linuxwirelesswidget.h index 3bbd085c..fe695d68 100644 --- a/wifi/kwireless/linuxwirelesswidget.h +++ b/wifi/kwireless/linuxwirelesswidget.h @@ -16,7 +16,7 @@ class LinuxWireLessWidget : public KWireLessWidget { Q_OBJECT public: - LinuxWireLessWidget(QWidget *parent=0, const char* name=0); + LinuxWireLessWidget(TQWidget *parent=0, const char* name=0); ~LinuxWireLessWidget(); protected: /** poll() is supposed to read the information from @@ -24,7 +24,7 @@ protected: void poll(); static int socketFD; // the socket file descriptor to talk to the // driver - static QStringList deviceNames; + static TQStringList deviceNames; static int devEnumHandler(int skfd, char * ifname, char * args[], diff --git a/wifi/kwireless/propertytable.cpp b/wifi/kwireless/propertytable.cpp index 7011c691..7c73b1c2 100644 --- a/wifi/kwireless/propertytable.cpp +++ b/wifi/kwireless/propertytable.cpp @@ -7,11 +7,11 @@ http://www.hackerbuero.org $ */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include "propertytable.h" @@ -21,7 +21,7 @@ extern "C" { #include } -PropertyTable::PropertyTable(QWidget *parent, const char* name) +PropertyTable::PropertyTable(TQWidget *parent, const char* name) : PropertyTableBase(parent, name) { } @@ -30,7 +30,7 @@ PropertyTable::~PropertyTable() { } -PropertiesDialog::PropertiesDialog(QWidget *parent, const char *name) +PropertiesDialog::PropertiesDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Wireless Network Device Properties"), KDialogBase::Ok, KDialogBase::Ok, true), @@ -42,14 +42,14 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, const char *name) table->table->setSorting(false); table->table->setReadOnly(true); adjustSize(); - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), SLOT(timeout())); + timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); timer->start(3000, false); - connect(table->cbDeviceSelector, SIGNAL(activated(int)), - SLOT(selected(int))); + connect(table->cbDeviceSelector, TQT_SIGNAL(activated(int)), + TQT_SLOT(selected(int))); } -void PropertiesDialog::update(QPtrList *_info) +void PropertiesDialog::update(TQPtrList *_info) { int selection = table->cbDeviceSelector->currentItem(); @@ -57,7 +57,7 @@ void PropertiesDialog::update(QPtrList *_info) info = _info; DeviceInfo *device; - QPtrListIterator it(*info); + TQPtrListIterator it(*info); table->cbDeviceSelector->clear(); @@ -102,7 +102,7 @@ void PropertiesDialog::selected(int index) device = info->at(index); } - QString fields[] = + TQString fields[] = { i18n("Device:"), i18n("ESSID (network name):"), @@ -114,7 +114,7 @@ void PropertiesDialog::selected(int index) }; const int NoOfFields = sizeof(fields)/sizeof(fields[0]); - QString values[] = + TQString values[] = { device->device(), device->essid(), diff --git a/wifi/kwireless/propertytable.h b/wifi/kwireless/propertytable.h index 4eadc78a..b8b7f004 100644 --- a/wifi/kwireless/propertytable.h +++ b/wifi/kwireless/propertytable.h @@ -11,7 +11,7 @@ #define KWIRELESS_PROPERTYTABLE_H #include -#include +#include #include "propertytablebase.h" class DeviceInfo; @@ -21,7 +21,7 @@ class PropertyTable : public PropertyTableBase { Q_OBJECT public: - PropertyTable(QWidget *parent = 0, const char* name = 0); + PropertyTable(TQWidget *parent = 0, const char* name = 0); ~PropertyTable(); }; @@ -30,14 +30,14 @@ class PropertiesDialog : public KDialogBase { Q_OBJECT public: - PropertiesDialog(QWidget *parent = 0, const char *name = 0); + PropertiesDialog(TQWidget *parent = 0, const char *name = 0); protected: PropertyTable *table; - QPtrList *info; + TQPtrList *info; bool wait; - QTimer *timer; + TQTimer *timer; public slots: - void update(QPtrList *); + void update(TQPtrList *); void timeout(); void selected(int); }; -- cgit v1.2.1