diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kppp/pppstatdlg.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kppp/pppstatdlg.cpp')
-rw-r--r-- | kppp/pppstatdlg.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/kppp/pppstatdlg.cpp b/kppp/pppstatdlg.cpp index 8f3910a1..b991da27 100644 --- a/kppp/pppstatdlg.cpp +++ b/kppp/pppstatdlg.cpp @@ -23,17 +23,17 @@ */ -#include <qlayout.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqpainter.h> #include <kwin.h> #include <kiconloader.h> #include <kapplication.h> #include <klocale.h> -#include <qlabel.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qlineedit.h> -#include <qtimer.h> +#include <tqlabel.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqlineedit.h> +#include <tqtimer.h> #include <kpushbutton.h> #include <kstdguiitem.h> @@ -44,9 +44,9 @@ extern PPPData gpppdata; -PPPStatsDlg::PPPStatsDlg(QWidget *parent, const char *name, QWidget *, +PPPStatsDlg::PPPStatsDlg(TQWidget *parent, const char *name, TQWidget *, PPPStats *st) - : QWidget(parent, name, 0), + : TQWidget(parent, name, 0), stats(st) { int i; @@ -55,21 +55,21 @@ PPPStatsDlg::PPPStatsDlg(QWidget *parent, const char *name, QWidget *, setCaption(i18n("kppp Statistics")); KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); - QVBoxLayout *tl = new QVBoxLayout(this, 10); - QGridLayout *l1 = new QGridLayout(4, 4); + TQVBoxLayout *tl = new TQVBoxLayout(this, 10); + TQGridLayout *l1 = new TQGridLayout(4, 4); tl->addLayout(l1, 1); - box = new QGroupBox(i18n("Statistics"), this); + box = new TQGroupBox(i18n("Statistics"), this); l1->addMultiCellWidget(box, 0, 3, 0, 3); l1->addRowSpacing(0, fontMetrics().lineSpacing() - 10); l1->setRowStretch(1, 1); l1->setColStretch(1, 1); // inner part of the grid - QVBoxLayout *l11 = new QVBoxLayout; + TQVBoxLayout *l11 = new QVBoxLayout; l1->addLayout(l11, 1, 1); // modem pixmap and IP labels - QHBoxLayout *l111 = new QHBoxLayout; + TQHBoxLayout *l111 = new QHBoxLayout; l11->addLayout(l111); big_modem_both_pixmap = UserIcon("modemboth"); @@ -77,25 +77,25 @@ PPPStatsDlg::PPPStatsDlg(QWidget *parent, const char *name, QWidget *, big_modem_right_pixmap = UserIcon("modemright"); big_modem_none_pixmap = UserIcon("modemnone"); - pixmap_l = new QLabel(this); + pixmap_l = new TQLabel(this); pixmap_l->setMinimumSize(big_modem_both_pixmap.size()); l111->addWidget(pixmap_l, 1); pixmap_l->setAlignment(AlignVCenter|AlignLeft); - QGridLayout *l1112 = new QGridLayout(3, 2); + TQGridLayout *l1112 = new TQGridLayout(3, 2); l111->addLayout(l1112); - ip_address_label1 = new QLabel(this); + ip_address_label1 = new TQLabel(this); ip_address_label1->setText(i18n("Local Addr:")); ip_address_label2 = new IPLineEdit(this); - ip_address_label2->setFocusPolicy(QWidget::NoFocus); + ip_address_label2->setFocusPolicy(TQWidget::NoFocus); - ip_address_label3 = new QLabel(this); + ip_address_label3 = new TQLabel(this); ip_address_label3->setText(i18n("Remote Addr:")); ip_address_label4 = new IPLineEdit(this); - ip_address_label4->setFocusPolicy(QWidget::NoFocus); + ip_address_label4->setFocusPolicy(TQWidget::NoFocus); l1112->addWidget(ip_address_label1, 0, 0); l1112->addWidget(ip_address_label2, 0, 1); @@ -105,18 +105,18 @@ PPPStatsDlg::PPPStatsDlg(QWidget *parent, const char *name, QWidget *, // consumes space on bottom l1112->setRowStretch(2, 1); - QGridLayout *l112 = new QGridLayout(5, 4); + TQGridLayout *l112 = new TQGridLayout(5, 4); l11->addLayout(l112); for(i =0 ; i < 5; i++) { - labela1[i] = new QLabel(this); + labela1[i] = new TQLabel(this); - labela2[i] = new QLabel(this); - labela2[i]->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + labela2[i] = new TQLabel(this); + labela2[i]->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); - labelb1[i] = new QLabel(this); + labelb1[i] = new TQLabel(this); - labelb2[i] = new QLabel(this); - labelb2[i]->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + labelb2[i] = new TQLabel(this); + labelb2[i]->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); } labela1[0]->setText(i18n("bytes in")); @@ -155,7 +155,7 @@ PPPStatsDlg::PPPStatsDlg(QWidget *parent, const char *name, QWidget *, l112->setColStretch(3, 1); tl->addSpacing(5); - QHBoxLayout *l12 = new QHBoxLayout; + TQHBoxLayout *l12 = new QHBoxLayout; tl->addLayout(l12); l12->addStretch(1); @@ -164,8 +164,8 @@ PPPStatsDlg::PPPStatsDlg(QWidget *parent, const char *name, QWidget *, gpppdata.graphingOptions(dummy, bg, text, in, out); - graph = new QFrame(this); - graph->setFrameStyle(QFrame::Box | QFrame::Sunken); + graph = new TQFrame(this); + graph->setFrameStyle(TQFrame::Box | TQFrame::Sunken); l1->addMultiCellWidget(graph, 2, 2, 1, 2); graph->setMinimumWidth(300); graph->setFixedHeight(76+4); @@ -174,19 +174,19 @@ PPPStatsDlg::PPPStatsDlg(QWidget *parent, const char *name, QWidget *, cancelbutton = new KPushButton(KStdGuiItem::close(),this, "cancelbutton"); cancelbutton->setFocus(); - connect(cancelbutton, SIGNAL(clicked()), this,SLOT(cancel())); + connect(cancelbutton, TQT_SIGNAL(clicked()), this,TQT_SLOT(cancel())); cancelbutton->setFixedHeight(cancelbutton->sizeHint().height()); cancelbutton->setMinimumWidth(QMAX(cancelbutton->sizeHint().width(), 70)); l12->addWidget(cancelbutton); if(gpppdata.graphingEnabled()) { - graphTimer = new QTimer(this); - connect(graphTimer, SIGNAL(timeout()), SLOT(updateGraph())); + graphTimer = new TQTimer(this); + connect(graphTimer, TQT_SIGNAL(timeout()), TQT_SLOT(updateGraph())); } setFixedSize(sizeHint()); - connect(stats, SIGNAL(statsChanged(int)), SLOT(paintIcon(int))); + connect(stats, TQT_SIGNAL(statsChanged(int)), TQT_SLOT(paintIcon(int))); // read window position from config file int p_x, p_y; @@ -200,14 +200,14 @@ PPPStatsDlg::~PPPStatsDlg() { // save window position when window was closed -bool PPPStatsDlg::event(QEvent *e) { - if (e->type() == QEvent::Hide) +bool PPPStatsDlg::event(TQEvent *e) { + if (e->type() == TQEvent::Hide) { gpppdata.setWinPosStatWin(x(), y()); return true; } else - return QWidget::event(e); + return TQWidget::event(e); } void PPPStatsDlg::cancel() { @@ -244,8 +244,8 @@ void PPPStatsDlg::paintGraph() { if(!isVisible()) return; - QPixmap pm(graph->width() - 4, graph->height() - 4); - QPainter p; + TQPixmap pm(graph->width() - 4, graph->height() - 4); + TQPainter p; pm.fill(graph->backgroundColor()); p.begin(&pm); @@ -286,10 +286,10 @@ void PPPStatsDlg::paintGraph() { // plot scale line p.setPen(text); - p.setFont(QFont(KGlobalSettings::fixedFont().family(), 8)); + p.setFont(TQFont(KGlobalSettings::fixedFont().family(), 8)); - QRect r; - QString s = i18n("%1 (max. %2) kb/sec") + TQRect r; + TQString s = i18n("%1 (max. %2) kb/sec") .arg(KGlobal::locale()->formatNumber((float)last_max / 1024.0, 1)) .arg(KGlobal::locale()->formatNumber((float)max / 1024.0, 1)); p.drawText(0, 0, pm.width(), 2*8, AlignRight|AlignVCenter, s, -1, &r); @@ -315,7 +315,7 @@ void PPPStatsDlg::updateGraph() { } -void PPPStatsDlg::paintEvent (QPaintEvent *) { +void PPPStatsDlg::paintEvent (TQPaintEvent *) { paintIcon(PPPStats::BytesNone); // correct ? if(gpppdata.graphingEnabled()) paintGraph(); @@ -324,7 +324,7 @@ void PPPStatsDlg::paintEvent (QPaintEvent *) { void PPPStatsDlg::paintIcon(int status) { - const QPixmap *pixmap; + const TQPixmap *pixmap; switch(status) { @@ -370,7 +370,7 @@ void PPPStatsDlg::timeclick() { } -void PPPStatsDlg::closeEvent(QCloseEvent *) { +void PPPStatsDlg::closeEvent(TQCloseEvent *) { emit cancel(); } @@ -404,14 +404,14 @@ void PPPStatsDlg::update_data() { // if I don't resort to this trick it is imposible to // copy/paste the ip out of the lineedits due to // reset of cursor position on setText() - QString local_addr = ( stats->local_ip_address.isEmpty() ? + TQString local_addr = ( stats->local_ip_address.isEmpty() ? i18n("unavailable") : stats->local_ip_address ); if( ip_address_label2->text() != local_addr ) ip_address_label2->setText(local_addr); - QString remote_addr = ( stats->remote_ip_address.isEmpty() ? + TQString remote_addr = ( stats->remote_ip_address.isEmpty() ? i18n("unavailable") : stats->remote_ip_address ); |