diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 18:16:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 18:16:06 +0000 |
commit | 02a6c8f36311eb6225066df35adf8d00f9cd942b (patch) | |
tree | ceb91c373877f7a69209e184c81b53dc6f9402d7 /src/knemod/interfacestatusdialog.cpp | |
parent | 09e6e27fe85b2efb28072f1c81f6581fa6837d92 (diff) | |
download | knemo-02a6c8f36311eb6225066df35adf8d00f9cd942b.tar.gz knemo-02a6c8f36311eb6225066df35adf8d00f9cd942b.zip |
TQt4 port knemo
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knemo@1238869 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/knemod/interfacestatusdialog.cpp')
-rw-r--r-- | src/knemod/interfacestatusdialog.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/knemod/interfacestatusdialog.cpp b/src/knemod/interfacestatusdialog.cpp index 87260af..72f5e16 100644 --- a/src/knemod/interfacestatusdialog.cpp +++ b/src/knemod/interfacestatusdialog.cpp @@ -17,12 +17,12 @@ Boston, MA 02110-1301, USA. */ -#include <qtimer.h> -#include <qlabel.h> -#include <qstring.h> -#include <qgroupbox.h> -#include <qdatetime.h> -#include <qtabwidget.h> +#include <tqtimer.h> +#include <tqlabel.h> +#include <tqstring.h> +#include <tqgroupbox.h> +#include <tqdatetime.h> +#include <tqtabwidget.h> #include <kdebug.h> #include <kconfig.h> @@ -37,13 +37,13 @@ #include "interfacestatistics.h" #include "interfacestatusdialog.h" -InterfaceStatusDialog::InterfaceStatusDialog( Interface* interface, QWidget* parent, const char* name ) - : InterfaceStatusDlg( parent, name ), +InterfaceStatusDialog::InterfaceStatusDialog( Interface* interface, TQWidget* tqparent, const char* name ) + : InterfaceStatusDlg( tqparent, name ), mPosInitialized( false ), mInterface( interface ) { setIcon( SmallIcon( "knemo" ) ); - setCaption( interface->getName() + " " + i18n( "Interface Status" ) ); + setCaption( interface->getName() + " " + i18n( "Interface tqStatus" ) ); updateDialog(); if ( interface->getData().available ) { @@ -55,7 +55,7 @@ InterfaceStatusDialog::InterfaceStatusDialog( Interface* interface, QWidget* par } if ( !interface->getData().wirelessDevice ) { - QWidget* wirelessTab = tabWidget->page( 2 ); + TQWidget* wirelessTab = tabWidget->page( 2 ); tabWidget->removePage( wirelessTab ); delete wirelessTab; } @@ -84,8 +84,8 @@ InterfaceStatusDialog::InterfaceStatusDialog( Interface* interface, QWidget* par statisticsChanged(); - mTimer = new QTimer(); - connect( mTimer, SIGNAL( timeout() ), this, SLOT( updateDialog() ) ); + mTimer = new TQTimer(); + connect( mTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( updateDialog() ) ); mTimer->start( 1000 ); } @@ -112,12 +112,12 @@ void InterfaceStatusDialog::hide() { mPos = pos(); mPosInitialized = true; - QDialog::hide(); + TQDialog::hide(); } void InterfaceStatusDialog::show() { - QDialog::show(); + TQDialog::show(); /** * mPosInitialized should always be true, except when * starting KNemo for the very first time. @@ -141,34 +141,34 @@ void InterfaceStatusDialog::updateDialog() textLabelAlias->setText( settings.alias ); if ( data.available ) { - textLabelStatus->setText( i18n( "Connection established." ) ); - int upsecs = mInterface->getStartTime().secsTo( QDateTime::currentDateTime() ); - int updays = upsecs / 86400; // don't use QDateTime::daysTo() because + textLabeltqStatus->setText( i18n( "Connection established." ) ); + int upsecs = mInterface->getStartTime().secsTo( TQDateTime::tqcurrentDateTime() ); + int updays = upsecs / 86400; // don't use TQDateTime::daysTo() because // we only want complete days - QString uptime; + TQString uptime; if ( updays == 1 ) uptime = "1 day, "; else if ( updays > 1 ) - uptime = QString( "%1 days, " ).arg( updays ); + uptime = TQString( "%1 days, " ).tqarg( updays ); upsecs -= 86400 * updays; // we only want the seconds of today int hrs = upsecs / 3600; int mins = ( upsecs - hrs * 3600 ) / 60; int secs = upsecs - hrs * 3600 - mins * 60; - QString time; + TQString time; time.sprintf( "%02d:%02d:%02d", hrs, mins, secs ); uptime += time; textLabelUptime->setText( uptime ); } else if ( data.existing ) { - textLabelStatus->setText( i18n( "Not connected." ) ); + textLabeltqStatus->setText( i18n( "Not connected." ) ); textLabelUptime->setText( "00:00:00" ); } else { - textLabelStatus->setText( i18n( "Not existing." ) ); + textLabeltqStatus->setText( i18n( "Not existing." ) ); textLabelUptime->setText( "00:00:00" ); } @@ -190,25 +190,25 @@ void InterfaceStatusDialog::updateDialog() { variableLabel1->setText( i18n( "PtP-Address:" ) ); variableText1->setText( data.ptpAddress ); - variableLabel2->setText( QString::null ); - variableText2->setText( QString::null ); - variableLabel3->setText( QString::null ); - variableText3->setText( QString::null ); + variableLabel2->setText( TQString() ); + variableText2->setText( TQString() ); + variableLabel3->setText( TQString() ); + variableText3->setText( TQString() ); } else { // shouldn't happen - variableLabel1->setText( QString::null ); - variableText1->setText( QString::null ); - variableLabel2->setText( QString::null ); - variableText2->setText( QString::null ); - variableLabel3->setText( QString::null ); - variableText3->setText( QString::null ); + variableLabel1->setText( TQString() ); + variableText1->setText( TQString() ); + variableLabel2->setText( TQString() ); + variableText2->setText( TQString() ); + variableLabel3->setText( TQString() ); + variableText3->setText( TQString() ); } // traffic tab - textLabelPacketsSend->setText( QString::number( data.txPackets ) ); - textLabelPacketsReceived->setText( QString::number( data.rxPackets ) ); + textLabelPacketsSend->setText( TQString::number( data.txPackets ) ); + textLabelPacketsReceived->setText( TQString::number( data.rxPackets ) ); textLabelBytesSend->setText( data.txString ); textLabelBytesReceived->setText( data.rxString ); unsigned long bytesPerSecond = data.outgoingBytes / mInterface->getGeneralData().pollInterval; @@ -252,31 +252,31 @@ void InterfaceStatusDialog::disableNetworkGroups( int ) groupBoxCurrentConnection->setEnabled( false ); // clear IP group - textLabelIP->setText( QString::null ); - textLabelSubnet->setText( QString::null ); - variableText1->setText( QString::null ); - variableText2->setText( QString::null ); - variableText3->setText( QString::null ); + textLabelIP->setText( TQString() ); + textLabelSubnet->setText( TQString() ); + variableText1->setText( TQString() ); + variableText2->setText( TQString() ); + variableText3->setText( TQString() ); // clear current connection group - textLabelPacketsSend->setText( QString::null ); - textLabelPacketsReceived->setText( QString::null ); - textLabelBytesSend->setText( QString::null ); - textLabelBytesReceived->setText( QString::null ); - textLabelSpeedSend->setText( QString::null ); - textLabelSpeedReceived->setText( QString::null ); + textLabelPacketsSend->setText( TQString() ); + textLabelPacketsReceived->setText( TQString() ); + textLabelBytesSend->setText( TQString() ); + textLabelBytesReceived->setText( TQString() ); + textLabelSpeedSend->setText( TQString() ); + textLabelSpeedReceived->setText( TQString() ); // clear wireless tab if ( mInterface->getData().wirelessDevice ) { - textLabelESSID->setText( QString::null ); - textLabelAccessPoint->setText( QString::null ); - textLabelNickName->setText( QString::null ); - textLabelMode->setText( QString::null ); - textLabelFreqChannel->setText( QString::null ); - textLabelBitRate->setText( QString::null ); - textLabelLinkQuality->setText( QString::null ); - textLabelEncryption->setText( QString::null ); + textLabelESSID->setText( TQString() ); + textLabelAccessPoint->setText( TQString() ); + textLabelNickName->setText( TQString() ); + textLabelMode->setText( TQString() ); + textLabelFreqChannel->setText( TQString() ); + textLabelBitRate->setText( TQString() ); + textLabelLinkQuality->setText( TQString() ); + textLabelEncryption->setText( TQString() ); } } |