From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksysguard/gui/ksgrd/HostConnector.cc | 96 ++++++------- ksysguard/gui/ksgrd/HostConnector.h | 30 ++-- ksysguard/gui/ksgrd/SensorAgent.cc | 22 +-- ksysguard/gui/ksgrd/SensorAgent.h | 36 ++--- ksysguard/gui/ksgrd/SensorClient.h | 30 ++-- ksysguard/gui/ksgrd/SensorManager.cc | 238 +++++++++++++++---------------- ksysguard/gui/ksgrd/SensorManager.h | 54 +++---- ksysguard/gui/ksgrd/SensorShellAgent.cc | 28 ++-- ksysguard/gui/ksgrd/SensorShellAgent.h | 18 +-- ksysguard/gui/ksgrd/SensorSocketAgent.cc | 22 +-- ksysguard/gui/ksgrd/SensorSocketAgent.h | 8 +- ksysguard/gui/ksgrd/StyleEngine.cc | 48 +++---- ksysguard/gui/ksgrd/StyleEngine.h | 26 ++-- ksysguard/gui/ksgrd/StyleSettings.cc | 84 +++++------ ksysguard/gui/ksgrd/StyleSettings.h | 32 ++--- ksysguard/gui/ksgrd/TimerSettings.cc | 28 ++-- ksysguard/gui/ksgrd/TimerSettings.h | 8 +- 17 files changed, 404 insertions(+), 404 deletions(-) (limited to 'ksysguard/gui/ksgrd') diff --git a/ksysguard/gui/ksgrd/HostConnector.cc b/ksysguard/gui/ksgrd/HostConnector.cc index 5762d08b3..3885a9518 100644 --- a/ksysguard/gui/ksgrd/HostConnector.cc +++ b/ksysguard/gui/ksgrd/HostConnector.cc @@ -23,100 +23,100 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "HostConnector.h" -HostConnector::HostConnector( QWidget *parent, const char *name ) +HostConnector::HostConnector( TQWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Connect Host" ), Help | Ok | Cancel, Ok, parent, name, true, true ) { - QFrame *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 2, 2, 0, spacingHint() ); + TQFrame *page = plainPage(); + TQGridLayout *layout = new TQGridLayout( page, 2, 2, 0, spacingHint() ); layout->setColStretch( 1, 1 ); - QLabel *label = new QLabel( i18n( "Host:" ), page ); + TQLabel *label = new TQLabel( i18n( "Host:" ), page ); layout->addWidget( label, 0, 0 ); mHostNames = new KComboBox( true, page ); mHostNames->setMaxCount( 20 ); - mHostNames->setInsertionPolicy( QComboBox::AtTop ); + mHostNames->setInsertionPolicy( TQComboBox::AtTop ); mHostNames->setAutoCompletion( true ); mHostNames->setDuplicatesEnabled( false ); layout->addWidget( mHostNames, 0, 1 ); label->setBuddy( mHostNames ); - QWhatsThis::add( mHostNames, i18n( "Enter the name of the host you want to connect to." ) ); + TQWhatsThis::add( mHostNames, i18n( "Enter the name of the host you want to connect to." ) ); - mHostNameLabel = new QLabel( page ); + mHostNameLabel = new TQLabel( page ); mHostNameLabel->hide(); layout->addWidget( mHostNameLabel, 0, 1 ); - QButtonGroup *group = new QButtonGroup( 0, Qt::Vertical, + TQButtonGroup *group = new TQButtonGroup( 0, Qt::Vertical, i18n( "Connection Type" ), page ); - QGridLayout *groupLayout = new QGridLayout( group->layout(), 4, 4, + TQGridLayout *groupLayout = new TQGridLayout( group->layout(), 4, 4, spacingHint() ); groupLayout->setAlignment( Qt::AlignTop ); - mUseSsh = new QRadioButton( i18n( "ssh" ), group ); + mUseSsh = new TQRadioButton( i18n( "ssh" ), group ); mUseSsh->setEnabled( true ); mUseSsh->setChecked( true ); - QWhatsThis::add( mUseSsh, i18n( "Select this to use the secure shell to login to the remote host." ) ); + TQWhatsThis::add( mUseSsh, i18n( "Select this to use the secure shell to login to the remote host." ) ); groupLayout->addWidget( mUseSsh, 0, 0 ); - mUseRsh = new QRadioButton( i18n( "rsh" ), group ); - QWhatsThis::add( mUseRsh, i18n( "Select this to use the remote shell to login to the remote host." ) ); + mUseRsh = new TQRadioButton( i18n( "rsh" ), group ); + TQWhatsThis::add( mUseRsh, i18n( "Select this to use the remote shell to login to the remote host." ) ); groupLayout->addWidget( mUseRsh, 0, 1 ); - mUseDaemon = new QRadioButton( i18n( "Daemon" ), group ); - QWhatsThis::add( mUseDaemon, i18n( "Select this if you want to connect to a ksysguard daemon that is running on the machine you want to connect to, and is listening for client requests." ) ); + mUseDaemon = new TQRadioButton( i18n( "Daemon" ), group ); + TQWhatsThis::add( mUseDaemon, i18n( "Select this if you want to connect to a ksysguard daemon that is running on the machine you want to connect to, and is listening for client requests." ) ); groupLayout->addWidget( mUseDaemon, 0, 2 ); - mUseCustom = new QRadioButton( i18n( "Custom command" ), group ); - QWhatsThis::add( mUseCustom, i18n( "Select this to use the command you entered below to start ksysguardd on the remote host." ) ); + mUseCustom = new TQRadioButton( i18n( "Custom command" ), group ); + TQWhatsThis::add( mUseCustom, i18n( "Select this to use the command you entered below to start ksysguardd on the remote host." ) ); groupLayout->addWidget( mUseCustom, 0, 3 ); - label = new QLabel( i18n( "Port:" ), group ); + label = new TQLabel( i18n( "Port:" ), group ); groupLayout->addWidget( label, 1, 0 ); - mPort = new QSpinBox( 1, 65535, 1, group ); + mPort = new TQSpinBox( 1, 65535, 1, group ); mPort->setEnabled( false ); mPort->setValue( 3112 ); - QToolTip::add( mPort, i18n( "Enter the port number on which the ksysguard daemon is listening for connections." ) ); + TQToolTip::add( mPort, i18n( "Enter the port number on which the ksysguard daemon is listening for connections." ) ); groupLayout->addWidget( mPort, 1, 2 ); - label = new QLabel( i18n( "e.g. 3112" ), group ); + label = new TQLabel( i18n( "e.g. 3112" ), group ); groupLayout->addWidget( label, 1, 3 ); - label = new QLabel( i18n( "Command:" ), group ); + label = new TQLabel( i18n( "Command:" ), group ); groupLayout->addWidget( label, 2, 0 ); mCommands = new KComboBox( true, group ); mCommands->setEnabled( false ); mCommands->setMaxCount( 20 ); - mCommands->setInsertionPolicy( QComboBox::AtTop ); + mCommands->setInsertionPolicy( TQComboBox::AtTop ); mCommands->setAutoCompletion( true ); mCommands->setDuplicatesEnabled( false ); - QWhatsThis::add( mCommands, i18n( "Enter the command that runs ksysguardd on the host you want to monitor." ) ); + TQWhatsThis::add( mCommands, i18n( "Enter the command that runs ksysguardd on the host you want to monitor." ) ); groupLayout->addMultiCellWidget( mCommands, 2, 2, 2, 3 ); label->setBuddy( mCommands ); - label = new QLabel( i18n( "e.g. ssh -l root remote.host.org ksysguardd" ), group ); + label = new TQLabel( i18n( "e.g. ssh -l root remote.host.org ksysguardd" ), group ); groupLayout->addMultiCellWidget( label, 3, 3, 2, 3 ); layout->addMultiCellWidget( group, 1, 1, 0, 1 ); - connect( mUseCustom, SIGNAL( toggled( bool ) ), - mCommands, SLOT( setEnabled( bool ) ) ); - connect( mUseDaemon, SIGNAL( toggled( bool ) ), - mPort, SLOT( setEnabled( bool ) ) ); - connect( mHostNames->lineEdit(), SIGNAL( textChanged ( const QString & ) ), - this, SLOT( slotHostNameChanged( const QString & ) ) ); + connect( mUseCustom, TQT_SIGNAL( toggled( bool ) ), + mCommands, TQT_SLOT( setEnabled( bool ) ) ); + connect( mUseDaemon, TQT_SIGNAL( toggled( bool ) ), + mPort, TQT_SLOT( setEnabled( bool ) ) ); + connect( mHostNames->lineEdit(), TQT_SIGNAL( textChanged ( const TQString & ) ), + this, TQT_SLOT( slotHostNameChanged( const TQString & ) ) ); enableButtonOK( !mHostNames->lineEdit()->text().isEmpty() ); KAcceleratorManager::manage( this ); } @@ -125,19 +125,19 @@ HostConnector::~HostConnector() { } -void HostConnector::slotHostNameChanged( const QString &_text ) +void HostConnector::slotHostNameChanged( const TQString &_text ) { enableButtonOK( !_text.isEmpty() ); } -void HostConnector::setHostNames( const QStringList &list ) +void HostConnector::setHostNames( const TQStringList &list ) { mHostNames->insertStringList( list ); } -QStringList HostConnector::hostNames() const +TQStringList HostConnector::hostNames() const { - QStringList list; + TQStringList list; for ( int i = 0; i < mHostNames->count(); ++i ) list.append( mHostNames->text( i ) ); @@ -145,14 +145,14 @@ QStringList HostConnector::hostNames() const return list; } -void HostConnector::setCommands( const QStringList &list ) +void HostConnector::setCommands( const TQStringList &list ) { mCommands->insertStringList( list ); } -QStringList HostConnector::commands() const +TQStringList HostConnector::commands() const { - QStringList list; + TQStringList list; for ( int i = 0; i < mCommands->count(); ++i ) list.append( mCommands->text( i ) ); @@ -160,7 +160,7 @@ QStringList HostConnector::commands() const return list; } -void HostConnector::setCurrentHostName( const QString &hostName ) +void HostConnector::setCurrentHostName( const TQString &hostName ) { if ( !hostName.isEmpty() ) { mHostNames->hide(); @@ -174,12 +174,12 @@ void HostConnector::setCurrentHostName( const QString &hostName ) } } -QString HostConnector::currentHostName() const +TQString HostConnector::currentHostName() const { return mHostNames->currentText(); } -QString HostConnector::currentCommand() const +TQString HostConnector::currentCommand() const { return mCommands->currentText(); } diff --git a/ksysguard/gui/ksgrd/HostConnector.h b/ksysguard/gui/ksgrd/HostConnector.h index eadf728cd..12893ff08 100644 --- a/ksysguard/gui/ksgrd/HostConnector.h +++ b/ksysguard/gui/ksgrd/HostConnector.h @@ -34,19 +34,19 @@ class HostConnector : public KDialogBase Q_OBJECT public: - HostConnector( QWidget *parent, const char *name = 0 ); + HostConnector( TQWidget *parent, const char *name = 0 ); ~HostConnector(); - void setHostNames( const QStringList &list ); - QStringList hostNames() const; + void setHostNames( const TQStringList &list ); + TQStringList hostNames() const; - void setCommands( const QStringList &list ); - QStringList commands() const; + void setCommands( const TQStringList &list ); + TQStringList commands() const; - void setCurrentHostName( const QString &hostName ); + void setCurrentHostName( const TQString &hostName ); - QString currentHostName() const; - QString currentCommand() const; + TQString currentHostName() const; + TQString currentCommand() const; int port() const; bool useSsh() const; @@ -56,19 +56,19 @@ class HostConnector : public KDialogBase protected slots: virtual void slotHelp(); - void slotHostNameChanged( const QString &_text ); + void slotHostNameChanged( const TQString &_text ); private: KComboBox *mCommands; KComboBox *mHostNames; - QLabel *mHostNameLabel; + TQLabel *mHostNameLabel; - QRadioButton *mUseSsh; - QRadioButton *mUseRsh; - QRadioButton *mUseDaemon; - QRadioButton *mUseCustom; + TQRadioButton *mUseSsh; + TQRadioButton *mUseRsh; + TQRadioButton *mUseDaemon; + TQRadioButton *mUseCustom; - QSpinBox *mPort; + TQSpinBox *mPort; }; #endif diff --git a/ksysguard/gui/ksgrd/SensorAgent.cc b/ksysguard/gui/ksgrd/SensorAgent.cc index a24bf5594..5fcb14a9c 100644 --- a/ksysguard/gui/ksgrd/SensorAgent.cc +++ b/ksysguard/gui/ksgrd/SensorAgent.cc @@ -55,7 +55,7 @@ SensorAgent::~SensorAgent() { } -bool SensorAgent::sendRequest( const QString &req, SensorClient *client, int id ) +bool SensorAgent::sendRequest( const TQString &req, SensorClient *client, int id ) { /* The request is registered with the FIFO so that the answer can be * routed back to the requesting client. */ @@ -70,7 +70,7 @@ bool SensorAgent::sendRequest( const QString &req, SensorClient *client, int id return false; } -void SensorAgent::processAnswer( const QString &buffer ) +void SensorAgent::processAnswer( const TQString &buffer ) { #if SA_TRACE kdDebug(1215) << "<- " << buffer << endl; @@ -89,7 +89,7 @@ void SensorAgent::processAnswer( const QString &buffer ) .arg( mHostName ) .arg( mErrorBuffer ) ); } - mErrorBuffer = QString::null; + mErrorBuffer = TQString::null; } } else if ( mState == 0 ) // receiving to answerBuffer mAnswerBuffer += buffer[ i ]; @@ -112,7 +112,7 @@ void SensorAgent::processAnswer( const QString &buffer ) #if SA_TRACE kdDebug(1215) << "Daemon now online!" << endl; #endif - mAnswerBuffer = QString::null; + mAnswerBuffer = TQString::null; break; } @@ -121,7 +121,7 @@ void SensorAgent::processAnswer( const QString &buffer ) if ( !req ) { kdDebug(1215) << "ERROR: Received answer but have no pending " << "request! : " << mAnswerBuffer.left( end ) << endl; - mAnswerBuffer = QString::null; + mAnswerBuffer = TQString::null; } else { if ( !req->client() ) { /* The client has disappeared before receiving the answer @@ -161,7 +161,7 @@ void SensorAgent::executeCommand() << "/" << mProcessingFIFO.count() << ")" << endl; #endif // send request to daemon - QString cmdWithNL = req->request() + "\n"; + TQString cmdWithNL = req->request() + "\n"; if ( writeMsg( cmdWithNL.ascii(), cmdWithNL.length() ) ) mTransmitting = true; else @@ -207,18 +207,18 @@ bool SensorAgent::transmitting() const return mTransmitting; } -void SensorAgent::setHostName( const QString &hostName ) +void SensorAgent::setHostName( const TQString &hostName ) { mHostName = hostName; } -const QString &SensorAgent::hostName() const +const TQString &SensorAgent::hostName() const { return mHostName; } -SensorRequest::SensorRequest( const QString &request, SensorClient *client, int id ) +SensorRequest::SensorRequest( const TQString &request, SensorClient *client, int id ) : mRequest( request ), mClient( client ), mId( id ) { } @@ -227,12 +227,12 @@ SensorRequest::~SensorRequest() { } -void SensorRequest::setRequest( const QString &request ) +void SensorRequest::setRequest( const TQString &request ) { mRequest = request; } -QString SensorRequest::request() const +TQString SensorRequest::request() const { return mRequest; } diff --git a/ksysguard/gui/ksgrd/SensorAgent.h b/ksysguard/gui/ksgrd/SensorAgent.h index e30deb510..0bf776547 100644 --- a/ksysguard/gui/ksgrd/SensorAgent.h +++ b/ksysguard/gui/ksgrd/SensorAgent.h @@ -21,8 +21,8 @@ #ifndef KSG_SENSORAGENT_H #define KSG_SENSORAGENT_H -#include -#include +#include +#include class KProcess; class KShellProcess; @@ -51,8 +51,8 @@ class KDE_EXPORT SensorAgent : public QObject SensorAgent( SensorManager *sm ); virtual ~SensorAgent(); - virtual bool start( const QString &host, const QString &shell, - const QString &command = "", int port = -1 ) = 0; + virtual bool start( const TQString &host, const TQString &shell, + const TQString &command = "", int port = -1 ) = 0; /** This function should only be used by the the SensorManager and @@ -66,19 +66,19 @@ class KDE_EXPORT SensorAgent : public QObject used by the SensorAgent. So it can be any value the client suits to use. */ - bool sendRequest( const QString &req, SensorClient *client, int id = 0 ); + bool sendRequest( const TQString &req, SensorClient *client, int id = 0 ); - virtual void hostInfo( QString &sh, QString &cmd, int &port ) const = 0; + virtual void hostInfo( TQString &sh, TQString &cmd, int &port ) const = 0; void disconnectClient( SensorClient *client ); - const QString &hostName() const; + const TQString &hostName() const; signals: void reconfigure( const SensorAgent* ); protected: - void processAnswer( const QString &buffer ); + void processAnswer( const TQString &buffer ); void executeCommand(); SensorManager *sensorManager(); @@ -89,23 +89,23 @@ class KDE_EXPORT SensorAgent : public QObject void setTransmitting( bool value ); bool transmitting() const; - void setHostName( const QString &hostName ); + void setHostName( const TQString &hostName ); private: virtual bool writeMsg( const char *msg, int len ) = 0; virtual bool txReady() = 0; int mState; - QPtrList mInputFIFO; - QPtrList mProcessingFIFO; - QString mAnswerBuffer; - QString mErrorBuffer; + TQPtrList mInputFIFO; + TQPtrList mProcessingFIFO; + TQString mAnswerBuffer; + TQString mErrorBuffer; SensorManager *mSensorManager; bool mDaemonOnLine; bool mTransmitting; - QString mHostName; + TQString mHostName; }; /** @@ -114,11 +114,11 @@ class KDE_EXPORT SensorAgent : public QObject class SensorRequest { public: - SensorRequest( const QString &request, SensorClient *client, int id ); + SensorRequest( const TQString &request, SensorClient *client, int id ); ~SensorRequest(); - void setRequest( const QString& ); - QString request() const; + void setRequest( const TQString& ); + TQString request() const; void setClient( SensorClient* ); SensorClient *client(); @@ -127,7 +127,7 @@ class SensorRequest int id(); private: - QString mRequest; + TQString mRequest; SensorClient *mClient; int mId; }; diff --git a/ksysguard/gui/ksgrd/SensorClient.h b/ksysguard/gui/ksgrd/SensorClient.h index 30586a8a2..d4e286cb1 100644 --- a/ksysguard/gui/ksgrd/SensorClient.h +++ b/ksysguard/gui/ksgrd/SensorClient.h @@ -24,8 +24,8 @@ #ifndef KSG_SENSORCLIENT_H #define KSG_SENSORCLIENT_H -#include -#include +#include +#include namespace KSGRD { @@ -46,7 +46,7 @@ class SensorClient been received by the sensor agent. This function must be reimplemented by the sensor client to receive and process this information. */ - virtual void answerReceived( int, const QString& ) { } + virtual void answerReceived( int, const TQString& ) { } /** In case of an unexpected fatal problem with the sensor the sensor @@ -81,14 +81,14 @@ class SensorBoard class SensorTokenizer { public: - SensorTokenizer( const QString &info, QChar separator ) + SensorTokenizer( const TQString &info, TQChar separator ) { - mTokens = QStringList::split( separator, info ); + mTokens = TQStringList::split( separator, info ); } ~SensorTokenizer() { } - const QString& operator[]( unsigned idx ) + const TQString& operator[]( unsigned idx ) { return mTokens[ idx ]; } @@ -99,7 +99,7 @@ class SensorTokenizer } private: - QStringList mTokens; + TQStringList mTokens; }; /** @@ -110,12 +110,12 @@ class SensorTokenizer class SensorIntegerInfo : public SensorTokenizer { public: - SensorIntegerInfo( const QString &info ) + SensorIntegerInfo( const TQString &info ) : SensorTokenizer( info, '\t' ) { } ~SensorIntegerInfo() { } - const QString &name() + const TQString &name() { return (*this)[ 0 ]; } @@ -130,7 +130,7 @@ class SensorIntegerInfo : public SensorTokenizer return (*this)[ 2 ].toLong(); } - const QString &unit() + const TQString &unit() { return (*this)[ 3 ]; } @@ -144,12 +144,12 @@ class SensorIntegerInfo : public SensorTokenizer class SensorFloatInfo : public SensorTokenizer { public: - SensorFloatInfo( const QString &info ) + SensorFloatInfo( const TQString &info ) : SensorTokenizer( info, '\t' ) { } ~SensorFloatInfo() { } - const QString &name() + const TQString &name() { return (*this)[ 0 ]; } @@ -164,7 +164,7 @@ class SensorFloatInfo : public SensorTokenizer return (*this)[ 2 ].toDouble(); } - const QString &unit() + const TQString &unit() { return (*this)[ 3 ]; } @@ -178,12 +178,12 @@ class SensorFloatInfo : public SensorTokenizer class SensorPSLine : public SensorTokenizer { public: - SensorPSLine( const QString &line ) + SensorPSLine( const TQString &line ) : SensorTokenizer( line, '\t' ) { } ~SensorPSLine() { } - const QString& name() + const TQString& name() { return (*this)[ 0 ]; } diff --git a/ksysguard/gui/ksgrd/SensorManager.cc b/ksysguard/gui/ksgrd/SensorManager.cc index 065da717a..43f878cda 100644 --- a/ksysguard/gui/ksgrd/SensorManager.cc +++ b/ksysguard/gui/ksgrd/SensorManager.cc @@ -21,11 +21,11 @@ */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -47,106 +47,106 @@ SensorManager::SensorManager() mDict.setAutoDelete( true ); // Fill the sensor description dictionary. - mDict.insert( "cpu", new QString( i18n( "CPU Load" ) ) ); - mDict.insert( "idle", new QString( i18n( "Idle Load" ) ) ); - mDict.insert( "sys", new QString( i18n( "System Load" ) ) ); - mDict.insert( "nice", new QString( i18n( "Nice Load" ) ) ); - mDict.insert( "user", new QString( i18n( "User Load" ) ) ); - mDict.insert( "mem", new QString( i18n( "Memory" ) ) ); - mDict.insert( "physical", new QString( i18n( "Physical Memory" ) ) ); - mDict.insert( "swap", new QString( i18n( "Swap Memory" ) ) ); - mDict.insert( "cached", new QString( i18n( "Cached Memory" ) ) ); - mDict.insert( "buf", new QString( i18n( "Buffered Memory" ) ) ); - mDict.insert( "used", new QString( i18n( "Used Memory" ) ) ); - mDict.insert( "application", new QString( i18n( "Application Memory" ) ) ); - mDict.insert( "free", new QString( i18n( "Free Memory" ) ) ); - mDict.insert( "pscount", new QString( i18n( "Process Count" ) ) ); - mDict.insert( "ps", new QString( i18n( "Process Controller" ) ) ); - mDict.insert( "disk", new QString( i18n( "Disk Throughput" ) ) ); - mDict.insert( "load", new QString( i18n( "CPU Load", "Load" ) ) ); - mDict.insert( "total", new QString( i18n( "Total Accesses" ) ) ); - mDict.insert( "rio", new QString( i18n( "Read Accesses" ) ) ); - mDict.insert( "wio", new QString( i18n( "Write Accesses" ) ) ); - mDict.insert( "rblk", new QString( i18n( "Read Data" ) ) ); - mDict.insert( "wblk", new QString( i18n( "Write Data" ) ) ); - mDict.insert( "pageIn", new QString( i18n( "Pages In" ) ) ); - mDict.insert( "pageOut", new QString( i18n( "Pages Out" ) ) ); - mDict.insert( "context", new QString( i18n( "Context Switches" ) ) ); - mDict.insert( "network", new QString( i18n( "Network" ) ) ); - mDict.insert( "interfaces", new QString( i18n( "Interfaces" ) ) ); - mDict.insert( "receiver", new QString( i18n( "Receiver" ) ) ); - mDict.insert( "transmitter", new QString( i18n( "Transmitter" ) ) ); - mDict.insert( "data", new QString( i18n( "Data" ) ) ); - mDict.insert( "compressed", new QString( i18n( "Compressed Packets" ) ) ); - mDict.insert( "drops", new QString( i18n( "Dropped Packets" ) ) ); - mDict.insert( "errors", new QString( i18n( "Errors" ) ) ); - mDict.insert( "fifo", new QString( i18n( "FIFO Overruns" ) ) ); - mDict.insert( "frame", new QString( i18n( "Frame Errors" ) ) ); - mDict.insert( "multicast", new QString( i18n( "Multicast" ) ) ); - mDict.insert( "packets", new QString( i18n( "Packets" ) ) ); - mDict.insert( "carrier", new QString( i18n( "Carrier" ) ) ); - mDict.insert( "collisions", new QString( i18n( "Collisions" ) ) ); - mDict.insert( "sockets", new QString( i18n( "Sockets" ) ) ); - mDict.insert( "count", new QString( i18n( "Total Number" ) ) ); - mDict.insert( "list", new QString( i18n( "Table" ) ) ); - mDict.insert( "apm", new QString( i18n( "Advanced Power Management" ) ) ); - mDict.insert( "acpi", new QString( i18n( "ACPI" ) ) ); - mDict.insert( "thermal_zone", new QString( i18n( "Thermal Zone" ) ) ); - mDict.insert( "temperature", new QString( i18n( "Temperature" ) ) ); - mDict.insert( "fan", new QString( i18n( "Fan" ) ) ); - mDict.insert( "state", new QString( i18n( "State" ) ) ); - mDict.insert( "battery", new QString( i18n( "Battery" ) ) ); - mDict.insert( "batterycharge", new QString( i18n( "Battery Charge" ) ) ); - mDict.insert( "batteryusage", new QString( i18n( "Battery Usage" ) ) ); - mDict.insert( "remainingtime", new QString( i18n( "Remaining Time" ) ) ); - mDict.insert( "interrupts", new QString( i18n( "Interrupts" ) ) ); - mDict.insert( "loadavg1", new QString( i18n( "Load Average (1 min)" ) ) ); - mDict.insert( "loadavg5", new QString( i18n( "Load Average (5 min)" ) ) ); - mDict.insert( "loadavg15", new QString( i18n( "Load Average (15 min)" ) ) ); - mDict.insert( "clock", new QString( i18n( "Clock Frequency" ) ) ); - mDict.insert( "lmsensors", new QString( i18n( "Hardware Sensors" ) ) ); - mDict.insert( "partitions", new QString( i18n( "Partition Usage" ) ) ); - mDict.insert( "usedspace", new QString( i18n( "Used Space" ) ) ); - mDict.insert( "freespace", new QString( i18n( "Free Space" ) ) ); - mDict.insert( "filllevel", new QString( i18n( "Fill Level" ) ) ); + mDict.insert( "cpu", new TQString( i18n( "CPU Load" ) ) ); + mDict.insert( "idle", new TQString( i18n( "Idle Load" ) ) ); + mDict.insert( "sys", new TQString( i18n( "System Load" ) ) ); + mDict.insert( "nice", new TQString( i18n( "Nice Load" ) ) ); + mDict.insert( "user", new TQString( i18n( "User Load" ) ) ); + mDict.insert( "mem", new TQString( i18n( "Memory" ) ) ); + mDict.insert( "physical", new TQString( i18n( "Physical Memory" ) ) ); + mDict.insert( "swap", new TQString( i18n( "Swap Memory" ) ) ); + mDict.insert( "cached", new TQString( i18n( "Cached Memory" ) ) ); + mDict.insert( "buf", new TQString( i18n( "Buffered Memory" ) ) ); + mDict.insert( "used", new TQString( i18n( "Used Memory" ) ) ); + mDict.insert( "application", new TQString( i18n( "Application Memory" ) ) ); + mDict.insert( "free", new TQString( i18n( "Free Memory" ) ) ); + mDict.insert( "pscount", new TQString( i18n( "Process Count" ) ) ); + mDict.insert( "ps", new TQString( i18n( "Process Controller" ) ) ); + mDict.insert( "disk", new TQString( i18n( "Disk Throughput" ) ) ); + mDict.insert( "load", new TQString( i18n( "CPU Load", "Load" ) ) ); + mDict.insert( "total", new TQString( i18n( "Total Accesses" ) ) ); + mDict.insert( "rio", new TQString( i18n( "Read Accesses" ) ) ); + mDict.insert( "wio", new TQString( i18n( "Write Accesses" ) ) ); + mDict.insert( "rblk", new TQString( i18n( "Read Data" ) ) ); + mDict.insert( "wblk", new TQString( i18n( "Write Data" ) ) ); + mDict.insert( "pageIn", new TQString( i18n( "Pages In" ) ) ); + mDict.insert( "pageOut", new TQString( i18n( "Pages Out" ) ) ); + mDict.insert( "context", new TQString( i18n( "Context Switches" ) ) ); + mDict.insert( "network", new TQString( i18n( "Network" ) ) ); + mDict.insert( "interfaces", new TQString( i18n( "Interfaces" ) ) ); + mDict.insert( "receiver", new TQString( i18n( "Receiver" ) ) ); + mDict.insert( "transmitter", new TQString( i18n( "Transmitter" ) ) ); + mDict.insert( "data", new TQString( i18n( "Data" ) ) ); + mDict.insert( "compressed", new TQString( i18n( "Compressed Packets" ) ) ); + mDict.insert( "drops", new TQString( i18n( "Dropped Packets" ) ) ); + mDict.insert( "errors", new TQString( i18n( "Errors" ) ) ); + mDict.insert( "fifo", new TQString( i18n( "FIFO Overruns" ) ) ); + mDict.insert( "frame", new TQString( i18n( "Frame Errors" ) ) ); + mDict.insert( "multicast", new TQString( i18n( "Multicast" ) ) ); + mDict.insert( "packets", new TQString( i18n( "Packets" ) ) ); + mDict.insert( "carrier", new TQString( i18n( "Carrier" ) ) ); + mDict.insert( "collisions", new TQString( i18n( "Collisions" ) ) ); + mDict.insert( "sockets", new TQString( i18n( "Sockets" ) ) ); + mDict.insert( "count", new TQString( i18n( "Total Number" ) ) ); + mDict.insert( "list", new TQString( i18n( "Table" ) ) ); + mDict.insert( "apm", new TQString( i18n( "Advanced Power Management" ) ) ); + mDict.insert( "acpi", new TQString( i18n( "ACPI" ) ) ); + mDict.insert( "thermal_zone", new TQString( i18n( "Thermal Zone" ) ) ); + mDict.insert( "temperature", new TQString( i18n( "Temperature" ) ) ); + mDict.insert( "fan", new TQString( i18n( "Fan" ) ) ); + mDict.insert( "state", new TQString( i18n( "State" ) ) ); + mDict.insert( "battery", new TQString( i18n( "Battery" ) ) ); + mDict.insert( "batterycharge", new TQString( i18n( "Battery Charge" ) ) ); + mDict.insert( "batteryusage", new TQString( i18n( "Battery Usage" ) ) ); + mDict.insert( "remainingtime", new TQString( i18n( "Remaining Time" ) ) ); + mDict.insert( "interrupts", new TQString( i18n( "Interrupts" ) ) ); + mDict.insert( "loadavg1", new TQString( i18n( "Load Average (1 min)" ) ) ); + mDict.insert( "loadavg5", new TQString( i18n( "Load Average (5 min)" ) ) ); + mDict.insert( "loadavg15", new TQString( i18n( "Load Average (15 min)" ) ) ); + mDict.insert( "clock", new TQString( i18n( "Clock Frequency" ) ) ); + mDict.insert( "lmsensors", new TQString( i18n( "Hardware Sensors" ) ) ); + mDict.insert( "partitions", new TQString( i18n( "Partition Usage" ) ) ); + mDict.insert( "usedspace", new TQString( i18n( "Used Space" ) ) ); + mDict.insert( "freespace", new TQString( i18n( "Free Space" ) ) ); + mDict.insert( "filllevel", new TQString( i18n( "Fill Level" ) ) ); for ( int i = 0; i < 32; i++ ) { - mDict.insert( "cpu" + QString::number( i ), - new QString( QString( i18n( "CPU%1" ) ).arg( i ) ) ); - mDict.insert( "disk" + QString::number( i ), - new QString( QString( i18n( "Disk%1" ) ).arg( i ) ) ); + mDict.insert( "cpu" + TQString::number( i ), + new TQString( TQString( i18n( "CPU%1" ) ).arg( i ) ) ); + mDict.insert( "disk" + TQString::number( i ), + new TQString( TQString( i18n( "Disk%1" ) ).arg( i ) ) ); } for ( int i = 0; i < 6; i++) { - mDict.insert( "fan" + QString::number( i ), - new QString( QString( i18n( "Fan%1" ) ).arg( i ) ) ); - mDict.insert( "temp" + QString::number( i ), - new QString( QString( i18n( "Temperature%1" ) ).arg( i ) ) ); + mDict.insert( "fan" + TQString::number( i ), + new TQString( TQString( i18n( "Fan%1" ) ).arg( i ) ) ); + mDict.insert( "temp" + TQString::number( i ), + new TQString( TQString( i18n( "Temperature%1" ) ).arg( i ) ) ); } - mDict.insert( "int00", new QString( i18n( "Total" ) ) ); + mDict.insert( "int00", new TQString( i18n( "Total" ) ) ); - QString num; + TQString num; for ( int i = 1; i < 25; i++ ) { num.sprintf( "%.2d", i ); mDict.insert( "int" + num, - new QString( QString( i18n( "Int%1" ) ).arg( i - 1, 3 ) ) ); + new TQString( TQString( i18n( "Int%1" ) ).arg( i - 1, 3 ) ) ); } mDescriptions.setAutoDelete( true ); // TODO: translated descriptions not yet implemented. mUnits.setAutoDelete( true ); - mUnits.insert( "1/s", new QString( i18n( "the unit 1 per second", "1/s" ) ) ); - mUnits.insert( "kBytes", new QString( i18n( "kBytes" ) ) ); - mUnits.insert( "min", new QString( i18n( "the unit minutes", "min" ) ) ); - mUnits.insert( "MHz", new QString( i18n( "the frequency unit", "MHz" ) ) ); + mUnits.insert( "1/s", new TQString( i18n( "the unit 1 per second", "1/s" ) ) ); + mUnits.insert( "kBytes", new TQString( i18n( "kBytes" ) ) ); + mUnits.insert( "min", new TQString( i18n( "the unit minutes", "min" ) ) ); + mUnits.insert( "MHz", new TQString( i18n( "the frequency unit", "MHz" ) ) ); mTypes.setAutoDelete( true ); - mTypes.insert( "integer", new QString( i18n( "Integer Value" ) ) ); - mTypes.insert( "float", new QString( i18n( "Floating Point Value" ) ) ); - mTypes.insert( "table", new QString( i18n( "Process Controller" ) ) ); - mTypes.insert( "listview", new QString( i18n( "Table" ) ) ); + mTypes.insert( "integer", new TQString( i18n( "Integer Value" ) ) ); + mTypes.insert( "float", new TQString( i18n( "Floating Point Value" ) ) ); + mTypes.insert( "table", new TQString( i18n( "Process Controller" ) ) ); + mTypes.insert( "listview", new TQString( i18n( "Table" ) ) ); mBroadcaster = 0; @@ -158,7 +158,7 @@ SensorManager::~SensorManager() delete mHostConnector; } -bool SensorManager::engageHost( const QString &hostName ) +bool SensorManager::engageHost( const TQString &hostName ) { bool retVal = true; @@ -171,8 +171,8 @@ bool SensorManager::engageHost( const QString &hostName ) mHostConnector->setCurrentHostName( hostName ); if ( mHostConnector->exec() ) { - QString shell = ""; - QString command = ""; + TQString shell = ""; + TQString command = ""; int port = -1; /* Check which radio button is selected and set parameters @@ -197,8 +197,8 @@ bool SensorManager::engageHost( const QString &hostName ) return retVal; } -bool SensorManager::engage( const QString &hostName, const QString &shell, - const QString &command, int port ) +bool SensorManager::engage( const TQString &hostName, const TQString &shell, + const TQString &command, int port ) { SensorAgent *agent; @@ -214,8 +214,8 @@ bool SensorManager::engage( const QString &hostName, const QString &shell, } mAgents.insert( hostName, agent ); - connect( agent, SIGNAL( reconfigure( const SensorAgent* ) ), - SLOT( reconfigure( const SensorAgent* ) ) ); + connect( agent, TQT_SIGNAL( reconfigure( const SensorAgent* ) ), + TQT_SLOT( reconfigure( const SensorAgent* ) ) ); emit update(); return true; @@ -232,13 +232,13 @@ void SensorManager::requestDisengage( const SensorAgent *agent ) * while we are still in a SensorAgent member function. * So we have to post an event which is later caught by * SensorManger::customEvent(). */ - QCustomEvent* event = new QCustomEvent( QEvent::User, (void*)agent ); + TQCustomEvent* event = new TQCustomEvent( TQEvent::User, (void*)agent ); kapp->postEvent( this, event ); } bool SensorManager::disengage( const SensorAgent *agent ) { - QDictIterator it( mAgents ); + TQDictIterator it( mAgents ); for ( ; it.current(); ++it ) if ( it.current() == agent ) { @@ -250,7 +250,7 @@ bool SensorManager::disengage( const SensorAgent *agent ) return false; } -bool SensorManager::disengage( const QString &hostName ) +bool SensorManager::disengage( const TQString &hostName ) { SensorAgent *agent; if ( ( agent = mAgents.find( hostName ) ) != 0 ) { @@ -262,14 +262,14 @@ bool SensorManager::disengage( const QString &hostName ) return false; } -bool SensorManager::resynchronize( const QString &hostName ) +bool SensorManager::resynchronize( const TQString &hostName ) { SensorAgent *agent; if ( ( agent = mAgents.find( hostName ) ) == 0 ) return false; - QString shell, command; + TQString shell, command; int port; hostInfo( hostName, shell, command, port ); @@ -285,26 +285,26 @@ void SensorManager::hostLost( const SensorAgent *agent ) emit hostConnectionLost( agent->hostName() ); if ( mBroadcaster ) { - QCustomEvent *event = new QCustomEvent( QEvent::User ); - event->setData( new QString( i18n( "Connection to %1 has been lost." ) + TQCustomEvent *event = new TQCustomEvent( TQEvent::User ); + event->setData( new TQString( i18n( "Connection to %1 has been lost." ) .arg( agent->hostName() ) ) ); kapp->postEvent( mBroadcaster, event ); } } -void SensorManager::notify( const QString &msg ) const +void SensorManager::notify( const TQString &msg ) const { /* This function relays text messages to the toplevel widget that * displays the message in a pop-up box. It must be used for objects * that might have been deleted before the pop-up box is closed. */ if ( mBroadcaster ) { - QCustomEvent *event = new QCustomEvent( QEvent::User ); - event->setData( new QString( msg ) ); + TQCustomEvent *event = new TQCustomEvent( TQEvent::User ); + event->setData( new TQString( msg ) ); kapp->postEvent( mBroadcaster, event ); } } -void SensorManager::setBroadcaster( QWidget *wdg ) +void SensorManager::setBroadcaster( TQWidget *wdg ) { mBroadcaster = wdg; } @@ -314,17 +314,17 @@ void SensorManager::reconfigure( const SensorAgent* ) emit update(); } -bool SensorManager::event( QEvent *event ) +bool SensorManager::event( TQEvent *event ) { - if ( event->type() == QEvent::User ) { - disengage( (const SensorAgent*)((QCustomEvent*)event)->data() ); + if ( event->type() == TQEvent::User ) { + disengage( (const SensorAgent*)((TQCustomEvent*)event)->data() ); return true; } return false; } -bool SensorManager::sendRequest( const QString &hostName, const QString &req, +bool SensorManager::sendRequest( const TQString &hostName, const TQString &req, SensorClient *client, int id ) { SensorAgent *agent = mAgents.find( hostName ); @@ -341,9 +341,9 @@ bool SensorManager::sendRequest( const QString &hostName, const QString &req, return false; } -const QString SensorManager::hostName( const SensorAgent *agent) const +const TQString SensorManager::hostName( const SensorAgent *agent) const { - QDictIterator it( mAgents ); + TQDictIterator it( mAgents ); while ( it.current() ) { if ( it.current() == agent ) @@ -351,11 +351,11 @@ const QString SensorManager::hostName( const SensorAgent *agent) const ++it; } - return QString::null; + return TQString::null; } -bool SensorManager::hostInfo( const QString &hostName, QString &shell, - QString &command, int &port ) +bool SensorManager::hostInfo( const TQString &hostName, TQString &shell, + TQString &command, int &port ) { SensorAgent *agent; if ( ( agent = mAgents.find( hostName ) ) != 0 ) { @@ -366,7 +366,7 @@ bool SensorManager::hostInfo( const QString &hostName, QString &shell, return false; } -const QString &SensorManager::translateUnit( const QString &unit ) const +const TQString &SensorManager::translateUnit( const TQString &unit ) const { if ( !unit.isEmpty() && mUnits[ unit ] ) return *mUnits[ unit ]; @@ -374,7 +374,7 @@ const QString &SensorManager::translateUnit( const QString &unit ) const return unit; } -const QString &SensorManager::translateSensorPath( const QString &path ) const +const TQString &SensorManager::translateSensorPath( const TQString &path ) const { if ( !path.isEmpty() && mDict[ path ] ) return *mDict[ path ]; @@ -382,7 +382,7 @@ const QString &SensorManager::translateSensorPath( const QString &path ) const return path; } -const QString &SensorManager::translateSensorType( const QString &type ) const +const TQString &SensorManager::translateSensorType( const TQString &type ) const { if ( !type.isEmpty() && mTypes[ type ] ) return *mTypes[ type ]; @@ -390,9 +390,9 @@ const QString &SensorManager::translateSensorType( const QString &type ) const return type; } -QString SensorManager::translateSensor( const QString &sensor ) const +TQString SensorManager::translateSensor( const TQString &sensor ) const { - QString token, out; + TQString token, out; int start = 0, end = 0; for ( ; ; ) { end = sensor.find( '/', start ); @@ -423,7 +423,7 @@ SensorManager::saveProperties( KConfig *cfg ) void SensorManager::disconnectClient( SensorClient *client ) { - QDictIterator it( mAgents ); + TQDictIterator it( mAgents ); for ( ; it.current(); ++it) it.current()->disconnectClient( client ); diff --git a/ksysguard/gui/ksgrd/SensorManager.h b/ksysguard/gui/ksgrd/SensorManager.h index 8eb778009..7f4e85da7 100644 --- a/ksysguard/gui/ksgrd/SensorManager.h +++ b/ksysguard/gui/ksgrd/SensorManager.h @@ -23,8 +23,8 @@ #include -#include -#include +#include +#include #include @@ -53,32 +53,32 @@ class KDE_EXPORT SensorManager : public QObject SensorManager(); ~SensorManager(); - bool engageHost( const QString &hostName ); - bool engage( const QString &hostName, const QString &shell = "ssh", - const QString &command = "", int port = -1 ); + bool engageHost( const TQString &hostName ); + bool engage( const TQString &hostName, const TQString &shell = "ssh", + const TQString &command = "", int port = -1 ); void requestDisengage( const SensorAgent *agent ); bool disengage( const SensorAgent *agent ); - bool disengage( const QString &hostName ); - bool resynchronize( const QString &hostName ); + bool disengage( const TQString &hostName ); + bool resynchronize( const TQString &hostName ); void hostLost( const SensorAgent *agent ); - void notify( const QString &msg ) const; + void notify( const TQString &msg ) const; - void setBroadcaster( QWidget *wdg ); + void setBroadcaster( TQWidget *wdg ); - virtual bool event( QEvent *event ); + virtual bool event( TQEvent *event ); - bool sendRequest( const QString &hostName, const QString &request, + bool sendRequest( const TQString &hostName, const TQString &request, SensorClient *client, int id = 0 ); - const QString hostName( const SensorAgent *sensor ) const; - bool hostInfo( const QString &host, QString &shell, - QString &command, int &port ); + const TQString hostName( const SensorAgent *sensor ) const; + bool hostInfo( const TQString &host, TQString &shell, + TQString &command, int &port ); - const QString& translateUnit( const QString &unit ) const; - const QString& translateSensorPath( const QString &path ) const; - const QString& translateSensorType( const QString &type ) const; - QString translateSensor(const QString& u) const; + const TQString& translateUnit( const TQString &unit ) const; + const TQString& translateSensorPath( const TQString &path ) const; + const TQString& translateSensorType( const TQString &type ) const; + TQString translateSensor(const TQString& u) const; void readProperties( KConfig *cfg ); void saveProperties( KConfig *cfg ); @@ -90,33 +90,33 @@ class KDE_EXPORT SensorManager : public QObject signals: void update(); - void hostConnectionLost( const QString &hostName ); + void hostConnectionLost( const TQString &hostName ); protected: - QDict mAgents; + TQDict mAgents; private: /** These dictionary stores the localized versions of the sensor descriptions and units. */ - QDict mDescriptions; - QDict mUnits; - QDict mDict; - QDict mTypes; + TQDict mDescriptions; + TQDict mUnits; + TQDict mDict; + TQDict mTypes; - QWidget* mBroadcaster; + TQWidget* mBroadcaster; HostConnector* mHostConnector; }; KDE_EXPORT extern SensorManager* SensorMgr; -class KDE_EXPORT SensorManagerIterator : public QDictIterator +class KDE_EXPORT SensorManagerIterator : public TQDictIterator { public: SensorManagerIterator( const SensorManager *sm ) - : QDictIterator( sm->mAgents ) { } + : TQDictIterator( sm->mAgents ) { } ~SensorManagerIterator() { } }; diff --git a/ksysguard/gui/ksgrd/SensorShellAgent.cc b/ksysguard/gui/ksgrd/SensorShellAgent.cc index 0f06e88fe..8081aa49d 100644 --- a/ksysguard/gui/ksgrd/SensorShellAgent.cc +++ b/ksysguard/gui/ksgrd/SensorShellAgent.cc @@ -45,8 +45,8 @@ SensorShellAgent::~SensorShellAgent() } } -bool SensorShellAgent::start( const QString &host, const QString &shell, - const QString &command, int ) +bool SensorShellAgent::start( const TQString &host, const TQString &shell, + const TQString &command, int ) { mRetryCount = 3; mDaemon = new KProcess; @@ -55,16 +55,16 @@ bool SensorShellAgent::start( const QString &host, const QString &shell, mShell = shell; mCommand = command; - connect( mDaemon, SIGNAL( processExited( KProcess* ) ), - SLOT( daemonExited( KProcess* ) ) ); - connect( mDaemon, SIGNAL( receivedStdout( KProcess*, char*, int ) ), - SLOT( msgRcvd( KProcess*, char*, int ) ) ); - connect( mDaemon, SIGNAL( receivedStderr( KProcess*, char*, int ) ), - SLOT( errMsgRcvd( KProcess*, char*, int ) ) ); - connect( mDaemon, SIGNAL( wroteStdin( KProcess* ) ), - SLOT( msgSent( KProcess* ) ) ); + connect( mDaemon, TQT_SIGNAL( processExited( KProcess* ) ), + TQT_SLOT( daemonExited( KProcess* ) ) ); + connect( mDaemon, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), + TQT_SLOT( msgRcvd( KProcess*, char*, int ) ) ); + connect( mDaemon, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ), + TQT_SLOT( errMsgRcvd( KProcess*, char*, int ) ) ); + connect( mDaemon, TQT_SIGNAL( wroteStdin( KProcess* ) ), + TQT_SLOT( msgSent( KProcess* ) ) ); - QString cmd; + TQString cmd; if ( !command.isEmpty() ) cmd = command; else @@ -80,7 +80,7 @@ bool SensorShellAgent::start( const QString &host, const QString &shell, return true; } -void SensorShellAgent::hostInfo( QString &shell, QString &command, +void SensorShellAgent::hostInfo( TQString &shell, TQString &command, int &port) const { shell = mShell; @@ -101,7 +101,7 @@ void SensorShellAgent::msgRcvd( KProcess*, char *buffer, int buflen ) if ( !buffer || buflen == 0 ) return; mRetryCount = 3; //we recieved an answer, so reset our retry count back to 3 - QString aux = QString::fromLocal8Bit( buffer, buflen ); + TQString aux = TQString::fromLocal8Bit( buffer, buflen ); processAnswer( aux ); } @@ -111,7 +111,7 @@ void SensorShellAgent::errMsgRcvd( KProcess*, char *buffer, int buflen ) if ( !buffer || buflen == 0 ) return; - QString buf = QString::fromLocal8Bit( buffer, buflen ); + TQString buf = TQString::fromLocal8Bit( buffer, buflen ); kdDebug(1215) << "SensorShellAgent: Warning, received text over stderr!" << endl << buf << endl; diff --git a/ksysguard/gui/ksgrd/SensorShellAgent.h b/ksysguard/gui/ksgrd/SensorShellAgent.h index e13413d55..7b588c7e1 100644 --- a/ksysguard/gui/ksgrd/SensorShellAgent.h +++ b/ksysguard/gui/ksgrd/SensorShellAgent.h @@ -21,9 +21,9 @@ #ifndef KSG_SENSORSHELLAGENT_H #define KSG_SENSORSHELLAGENT_H -#include -#include -#include +#include +#include +#include #include @@ -51,10 +51,10 @@ class SensorShellAgent : public SensorAgent SensorShellAgent( SensorManager *sm ); ~SensorShellAgent(); - bool start( const QString &host, const QString &shell, - const QString &command = "", int port = -1 ); + bool start( const TQString &host, const TQString &shell, + const TQString &command = "", int port = -1 ); - void hostInfo( QString &shell, QString &command, int &port) const; + void hostInfo( TQString &shell, TQString &command, int &port) const; private slots: void msgSent( KProcess* ); @@ -66,9 +66,9 @@ class SensorShellAgent : public SensorAgent bool writeMsg( const char *msg, int len ); bool txReady(); - QGuardedPtr mDaemon; - QString mShell; - QString mCommand; + TQGuardedPtr mDaemon; + TQString mShell; + TQString mCommand; int mRetryCount; }; diff --git a/ksysguard/gui/ksgrd/SensorSocketAgent.cc b/ksysguard/gui/ksgrd/SensorSocketAgent.cc index dcb5b7f3b..0fee27c95 100644 --- a/ksysguard/gui/ksgrd/SensorSocketAgent.cc +++ b/ksysguard/gui/ksgrd/SensorSocketAgent.cc @@ -34,10 +34,10 @@ using namespace KSGRD; SensorSocketAgent::SensorSocketAgent( SensorManager *sm ) : SensorAgent( sm ) { - connect( &mSocket, SIGNAL( gotError( int ) ), SLOT( error( int ) ) ); - connect( &mSocket, SIGNAL( bytesWritten( int ) ), SLOT( msgSent( int ) ) ); - connect( &mSocket, SIGNAL( readyRead() ), SLOT( msgRcvd() ) ); - connect( &mSocket, SIGNAL( closed() ), SLOT( connectionClosed() ) ); + connect( &mSocket, TQT_SIGNAL( gotError( int ) ), TQT_SLOT( error( int ) ) ); + connect( &mSocket, TQT_SIGNAL( bytesWritten( int ) ), TQT_SLOT( msgSent( int ) ) ); + connect( &mSocket, TQT_SIGNAL( readyRead() ), TQT_SLOT( msgRcvd() ) ); + connect( &mSocket, TQT_SIGNAL( closed() ), TQT_SLOT( connectionClosed() ) ); } SensorSocketAgent::~SensorSocketAgent() @@ -46,8 +46,8 @@ SensorSocketAgent::~SensorSocketAgent() mSocket.flush(); } -bool SensorSocketAgent::start( const QString &host, const QString&, - const QString&, int port ) +bool SensorSocketAgent::start( const TQString &host, const TQString&, + const TQString&, int port ) { if ( port <= 0 ) kdDebug(1215) << "SensorSocketAgent::start: Illegal port " << port << endl; @@ -55,15 +55,15 @@ bool SensorSocketAgent::start( const QString &host, const QString&, setHostName( host ); mPort = port; - mSocket.connect( hostName(), QString::number(mPort) ); + mSocket.connect( hostName(), TQString::number(mPort) ); return true; } -void SensorSocketAgent::hostInfo( QString &shell, QString &command, int &port ) const +void SensorSocketAgent::hostInfo( TQString &shell, TQString &command, int &port ) const { - shell = QString::null; - command = QString::null; + shell = TQString::null; + command = TQString::null; port = mPort; } @@ -84,7 +84,7 @@ void SensorSocketAgent::msgRcvd() char* buffer = new char[ buflen ]; mSocket.readBlock( buffer, buflen ); - QString buf = QString::fromLocal8Bit( buffer, buflen ); + TQString buf = TQString::fromLocal8Bit( buffer, buflen ); delete [] buffer; processAnswer( buf ); diff --git a/ksysguard/gui/ksgrd/SensorSocketAgent.h b/ksysguard/gui/ksgrd/SensorSocketAgent.h index b422d3a9b..183b6d122 100644 --- a/ksysguard/gui/ksgrd/SensorSocketAgent.h +++ b/ksysguard/gui/ksgrd/SensorSocketAgent.h @@ -21,7 +21,7 @@ #ifndef KSG_SENSORSOCKETAGENT_H #define KSG_SENSORSOCKETAGENT_H -#include +#include #include #include @@ -47,10 +47,10 @@ class SensorSocketAgent : public SensorAgent SensorSocketAgent( SensorManager *sm ); ~SensorSocketAgent(); - bool start( const QString &host, const QString &shell, - const QString &command = "", int port = -1 ); + bool start( const TQString &host, const TQString &shell, + const TQString &command = "", int port = -1 ); - void hostInfo( QString &shell, QString &command, int &port ) const; + void hostInfo( TQString &shell, TQString &command, int &port ) const; private slots: void connectionClosed(); diff --git a/ksysguard/gui/ksgrd/StyleEngine.cc b/ksysguard/gui/ksgrd/StyleEngine.cc index ccea0a7c2..d05af4ec8 100644 --- a/ksysguard/gui/ksgrd/StyleEngine.cc +++ b/ksysguard/gui/ksgrd/StyleEngine.cc @@ -21,9 +21,9 @@ */ -#include -#include -#include +#include +#include +#include #include #include @@ -38,20 +38,20 @@ StyleEngine* KSGRD::Style; StyleEngine::StyleEngine() { - mFirstForegroundColor = QColor( 0x6894c9 ); // light blue - mSecondForegroundColor = QColor( 0x6894c9 ); // light blue - mAlarmColor = QColor( 255, 0, 0 ); - mBackgroundColor = QColor( 0x313031 ); // almost black + mFirstForegroundColor = TQColor( 0x6894c9 ); // light blue + mSecondForegroundColor = TQColor( 0x6894c9 ); // light blue + mAlarmColor = TQColor( 255, 0, 0 ); + mBackgroundColor = TQColor( 0x313031 ); // almost black mFontSize = 9; - mSensorColors.append( QColor( 0x1889ff ) ); // soft blue - mSensorColors.append( QColor( 0xff7f08 ) ); // reddish - mSensorColors.append( QColor( 0xffeb14 ) ); // bright yellow + mSensorColors.append( TQColor( 0x1889ff ) ); // soft blue + mSensorColors.append( TQColor( 0xff7f08 ) ); // reddish + mSensorColors.append( TQColor( 0xffeb14 ) ); // bright yellow uint v = 0x00ff00; for ( uint i = mSensorColors.count(); i < 32; ++i ) { v = ( ( ( v + 82 ) & 0xff ) << 23 ) | ( v >> 8 ); - mSensorColors.append( QColor( v & 0xff, ( v >> 16 ) & 0xff, ( v >> 8 ) & 0xff ) ); + mSensorColors.append( TQColor( v & 0xff, ( v >> 16 ) & 0xff, ( v >> 8 ) & 0xff ) ); } } @@ -67,12 +67,12 @@ void StyleEngine::readProperties( KConfig *cfg ) mBackgroundColor = cfg->readColorEntry( "backgroundColor", &mBackgroundColor ); mFontSize = cfg->readNumEntry( "fontSize", mFontSize ); - QStringList list = cfg->readListEntry( "sensorColors" ); + TQStringList list = cfg->readListEntry( "sensorColors" ); if ( !list.isEmpty() ) { mSensorColors.clear(); - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) - mSensorColors.append( QColor( *it ) ); + mSensorColors.append( TQColor( *it ) ); } } @@ -84,30 +84,30 @@ void StyleEngine::saveProperties( KConfig *cfg ) cfg->writeEntry( "backgroundColor", mBackgroundColor ); cfg->writeEntry( "fontSize", mFontSize ); - QStringList list; - QValueList::Iterator it; + TQStringList list; + TQValueList::Iterator it; for ( it = mSensorColors.begin(); it != mSensorColors.end(); ++it ) list.append( (*it).name() ); cfg->writeEntry( "sensorColors", list ); } -const QColor &StyleEngine::firstForegroundColor() const +const TQColor &StyleEngine::firstForegroundColor() const { return mFirstForegroundColor; } -const QColor &StyleEngine::secondForegroundColor() const +const TQColor &StyleEngine::secondForegroundColor() const { return mSecondForegroundColor; } -const QColor &StyleEngine::alarmColor() const +const TQColor &StyleEngine::alarmColor() const { return mAlarmColor; } -const QColor &StyleEngine::backgroundColor() const +const TQColor &StyleEngine::backgroundColor() const { return mBackgroundColor; } @@ -117,9 +117,9 @@ uint StyleEngine::fontSize() const return mFontSize; } -const QColor& StyleEngine::sensorColor( uint pos ) +const TQColor& StyleEngine::sensorColor( uint pos ) { - static QColor dummy; + static TQColor dummy; if ( pos < mSensorColors.count() ) return *mSensorColors.at( pos ); @@ -143,8 +143,8 @@ void StyleEngine::configure() mSettingsDialog->setFontSize( mFontSize ); mSettingsDialog->setSensorColors( mSensorColors ); - connect( mSettingsDialog, SIGNAL( applyClicked() ), - this, SLOT( applyToWorksheet() ) ); + connect( mSettingsDialog, TQT_SIGNAL( applyClicked() ), + this, TQT_SLOT( applyToWorksheet() ) ); if ( mSettingsDialog->exec() ) apply(); diff --git a/ksysguard/gui/ksgrd/StyleEngine.h b/ksysguard/gui/ksgrd/StyleEngine.h index d896a2422..8056bd52f 100644 --- a/ksysguard/gui/ksgrd/StyleEngine.h +++ b/ksysguard/gui/ksgrd/StyleEngine.h @@ -24,9 +24,9 @@ #ifndef KSG_STYLEENGINE_H #define KSG_STYLEENGINE_H -#include -#include -#include +#include +#include +#include #include @@ -49,14 +49,14 @@ class KDE_EXPORT StyleEngine : public QObject void readProperties( KConfig* ); void saveProperties( KConfig* ); - const QColor& firstForegroundColor() const; - const QColor& secondForegroundColor() const; - const QColor& alarmColor() const; - const QColor& backgroundColor() const; + const TQColor& firstForegroundColor() const; + const TQColor& secondForegroundColor() const; + const TQColor& alarmColor() const; + const TQColor& backgroundColor() const; uint fontSize() const; - const QColor& sensorColor( uint pos ); + const TQColor& sensorColor( uint pos ); uint numSensorColors() const; public slots: @@ -69,12 +69,12 @@ class KDE_EXPORT StyleEngine : public QObject private: void apply(); - QColor mFirstForegroundColor; - QColor mSecondForegroundColor; - QColor mAlarmColor; - QColor mBackgroundColor; + TQColor mFirstForegroundColor; + TQColor mSecondForegroundColor; + TQColor mAlarmColor; + TQColor mBackgroundColor; uint mFontSize; - QValueList mSensorColors; + TQValueList mSensorColors; StyleSettings *mSettingsDialog; }; diff --git a/ksysguard/gui/ksgrd/StyleSettings.cc b/ksysguard/gui/ksgrd/StyleSettings.cc index 19a924cbe..6c7faf771 100644 --- a/ksysguard/gui/ksgrd/StyleSettings.cc +++ b/ksysguard/gui/ksgrd/StyleSettings.cc @@ -21,14 +21,14 @@ */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -37,45 +37,45 @@ #include "StyleSettings.h" -StyleSettings::StyleSettings( QWidget *parent, const char *name ) +StyleSettings::StyleSettings( TQWidget *parent, const char *name ) : KDialogBase( Tabbed, i18n( "Global Style Settings" ), Help | Ok | Apply | Cancel, Ok, parent, name, true, true ) { - QFrame *page = addPage( i18n( "Display Style" ) ); - QGridLayout *layout = new QGridLayout( page, 6, 2, 0, spacingHint() ); + TQFrame *page = addPage( i18n( "Display Style" ) ); + TQGridLayout *layout = new TQGridLayout( page, 6, 2, 0, spacingHint() ); - QLabel *label = new QLabel( i18n( "First foreground color:" ), page ); + TQLabel *label = new TQLabel( i18n( "First foreground color:" ), page ); layout->addWidget( label, 0, 0 ); mFirstForegroundColor = new KColorButton( page ); layout->addWidget( mFirstForegroundColor, 0, 1 ); label->setBuddy( mFirstForegroundColor ); - label = new QLabel( i18n( "Second foreground color:" ), page ); + label = new TQLabel( i18n( "Second foreground color:" ), page ); layout->addWidget( label, 1, 0 ); mSecondForegroundColor = new KColorButton( page ); layout->addWidget( mSecondForegroundColor, 1, 1 ); label->setBuddy( mSecondForegroundColor ); - label = new QLabel( i18n( "Alarm color:" ), page ); + label = new TQLabel( i18n( "Alarm color:" ), page ); layout->addWidget( label, 2, 0 ); mAlarmColor = new KColorButton( page ); layout->addWidget( mAlarmColor, 2, 1 ); label->setBuddy( mAlarmColor ); - label = new QLabel( i18n( "Background color:" ), page ); + label = new TQLabel( i18n( "Background color:" ), page ); layout->addWidget( label, 3, 0 ); mBackgroundColor = new KColorButton( page ); layout->addWidget( mBackgroundColor, 3, 1 ); label->setBuddy( mBackgroundColor ); - label = new QLabel( i18n( "Font size:" ), page ); + label = new TQLabel( i18n( "Font size:" ), page ); layout->addWidget( label, 4, 0 ); - mFontSize = new QSpinBox( 7, 48, 1, page ); + mFontSize = new TQSpinBox( 7, 48, 1, page ); mFontSize->setValue( 8 ); layout->addWidget( mFontSize, 4, 1 ); label->setBuddy( mFontSize ); @@ -83,21 +83,21 @@ StyleSettings::StyleSettings( QWidget *parent, const char *name ) layout->setRowStretch( 5, 1 ); page = addPage( i18n( "Sensor Colors" ) ); - layout = new QGridLayout( page, 1, 2, 0, spacingHint() ); + layout = new TQGridLayout( page, 1, 2, 0, spacingHint() ); - mColorListBox = new QListBox( page ); + mColorListBox = new TQListBox( page ); layout->addWidget( mColorListBox, 0, 0 ); - mEditColorButton = new QPushButton( i18n( "Change Color..." ), page ); + mEditColorButton = new TQPushButton( i18n( "Change Color..." ), page ); mEditColorButton->setEnabled( false ); layout->addWidget( mEditColorButton, 0, 1, Qt::AlignTop ); - connect( mColorListBox, SIGNAL( selectionChanged( QListBoxItem* ) ), - SLOT( selectionChanged( QListBoxItem* ) ) ); - connect( mColorListBox, SIGNAL( doubleClicked( QListBoxItem* ) ), - SLOT( editSensorColor() ) ); - connect( mEditColorButton, SIGNAL( clicked() ), - SLOT( editSensorColor() ) ); + connect( mColorListBox, TQT_SIGNAL( selectionChanged( TQListBoxItem* ) ), + TQT_SLOT( selectionChanged( TQListBoxItem* ) ) ); + connect( mColorListBox, TQT_SIGNAL( doubleClicked( TQListBoxItem* ) ), + TQT_SLOT( editSensorColor() ) ); + connect( mEditColorButton, TQT_SIGNAL( clicked() ), + TQT_SLOT( editSensorColor() ) ); KAcceleratorManager::manage( this ); } @@ -106,42 +106,42 @@ StyleSettings::~StyleSettings() { } -void StyleSettings::setFirstForegroundColor( const QColor &color ) +void StyleSettings::setFirstForegroundColor( const TQColor &color ) { mFirstForegroundColor->setColor( color ); } -QColor StyleSettings::firstForegroundColor() const +TQColor StyleSettings::firstForegroundColor() const { return mFirstForegroundColor->color(); } -void StyleSettings::setSecondForegroundColor( const QColor &color ) +void StyleSettings::setSecondForegroundColor( const TQColor &color ) { mSecondForegroundColor->setColor( color ); } -QColor StyleSettings::secondForegroundColor() const +TQColor StyleSettings::secondForegroundColor() const { return mSecondForegroundColor->color(); } -void StyleSettings::setAlarmColor( const QColor &color ) +void StyleSettings::setAlarmColor( const TQColor &color ) { mAlarmColor->setColor( color ); } -QColor StyleSettings::alarmColor() const +TQColor StyleSettings::alarmColor() const { return mAlarmColor->color(); } -void StyleSettings::setBackgroundColor( const QColor &color ) +void StyleSettings::setBackgroundColor( const TQColor &color ) { mBackgroundColor->setColor( color ); } -QColor StyleSettings::backgroundColor() const +TQColor StyleSettings::backgroundColor() const { return mBackgroundColor->color(); } @@ -156,23 +156,23 @@ uint StyleSettings::fontSize() const return mFontSize->value(); } -void StyleSettings::setSensorColors( const QValueList &list ) +void StyleSettings::setSensorColors( const TQValueList &list ) { mColorListBox->clear(); for ( uint i = 0; i < list.count(); ++i ) { - QPixmap pm( 12, 12 ); + TQPixmap pm( 12, 12 ); pm.fill( *list.at( i ) ); mColorListBox->insertItem( pm, i18n( "Color %1" ).arg( i ) ); } } -QValueList StyleSettings::sensorColors() +TQValueList StyleSettings::sensorColors() { - QValueList list; + TQValueList list; for ( uint i = 0; i < mColorListBox->count(); ++i ) - list.append( QColor( mColorListBox->pixmap( i )->convertToImage().pixel( 1, 1 ) ) ); + list.append( TQColor( mColorListBox->pixmap( i )->convertToImage().pixel( 1, 1 ) ) ); return list; } @@ -184,16 +184,16 @@ void StyleSettings::editSensorColor() if ( pos < 0 ) return; - QColor color = mColorListBox->pixmap( pos )->convertToImage().pixel( 1, 1 ); + TQColor color = mColorListBox->pixmap( pos )->convertToImage().pixel( 1, 1 ); if ( KColorDialog::getColor( color ) == KColorDialog::Accepted ) { - QPixmap pm( 12, 12 ); + TQPixmap pm( 12, 12 ); pm.fill( color ); mColorListBox->changeItem( pm, mColorListBox->text( pos ), pos ); } } -void StyleSettings::selectionChanged( QListBoxItem *item ) +void StyleSettings::selectionChanged( TQListBoxItem *item ) { mEditColorButton->setEnabled( item != 0 ); } diff --git a/ksysguard/gui/ksgrd/StyleSettings.h b/ksysguard/gui/ksgrd/StyleSettings.h index d16b5e723..0f662f20f 100644 --- a/ksysguard/gui/ksgrd/StyleSettings.h +++ b/ksysguard/gui/ksgrd/StyleSettings.h @@ -26,7 +26,7 @@ #include -#include +#include class KColorButton; @@ -38,30 +38,30 @@ class StyleSettings : public KDialogBase Q_OBJECT public: - StyleSettings( QWidget *parent = 0, const char *name = 0 ); + StyleSettings( TQWidget *parent = 0, const char *name = 0 ); ~StyleSettings(); - void setFirstForegroundColor( const QColor &color ); - QColor firstForegroundColor() const; + void setFirstForegroundColor( const TQColor &color ); + TQColor firstForegroundColor() const; - void setSecondForegroundColor( const QColor &color ); - QColor secondForegroundColor() const; + void setSecondForegroundColor( const TQColor &color ); + TQColor secondForegroundColor() const; - void setAlarmColor( const QColor &color ); - QColor alarmColor() const; + void setAlarmColor( const TQColor &color ); + TQColor alarmColor() const; - void setBackgroundColor( const QColor &color ); - QColor backgroundColor() const; + void setBackgroundColor( const TQColor &color ); + TQColor backgroundColor() const; void setFontSize( uint size ); uint fontSize() const; - void setSensorColors( const QValueList &list ); - QValueList sensorColors(); + void setSensorColors( const TQValueList &list ); + TQValueList sensorColors(); private slots: void editSensorColor(); - void selectionChanged( QListBoxItem* ); + void selectionChanged( TQListBoxItem* ); private: KColorButton *mFirstForegroundColor; @@ -69,10 +69,10 @@ class StyleSettings : public KDialogBase KColorButton *mAlarmColor; KColorButton *mBackgroundColor; - QSpinBox *mFontSize; + TQSpinBox *mFontSize; - QListBox *mColorListBox; - QPushButton *mEditColorButton; + TQListBox *mColorListBox; + TQPushButton *mEditColorButton; }; #endif diff --git a/ksysguard/gui/ksgrd/TimerSettings.cc b/ksysguard/gui/ksgrd/TimerSettings.cc index 4806f7d8a..5e1d8d8b2 100644 --- a/ksysguard/gui/ksgrd/TimerSettings.cc +++ b/ksysguard/gui/ksgrd/TimerSettings.cc @@ -24,37 +24,37 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "TimerSettings.h" -TimerSettings::TimerSettings( QWidget *parent, const char *name ) +TimerSettings::TimerSettings( TQWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Timer Settings" ), Ok | Cancel, Ok, parent, name, true, true ) { - QFrame *page = plainPage(); + TQFrame *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 2, 2, 0, spacingHint() ); + TQGridLayout *layout = new TQGridLayout( page, 2, 2, 0, spacingHint() ); - mUseGlobalUpdate = new QCheckBox( i18n( "Use update interval of worksheet" ), page ); + mUseGlobalUpdate = new TQCheckBox( i18n( "Use update interval of worksheet" ), page ); layout->addMultiCellWidget( mUseGlobalUpdate, 0, 0, 0, 1 ); - mLabel = new QLabel( i18n( "Update interval:" ), page ); + mLabel = new TQLabel( i18n( "Update interval:" ), page ); layout->addWidget( mLabel, 1, 0 ); - mInterval = new QSpinBox( 1, 300, 1, page ); + mInterval = new TQSpinBox( 1, 300, 1, page ); mInterval->setValue( 2 ); mInterval->setSuffix( i18n( " sec" ) ); layout->addWidget( mInterval, 1, 1 ); mLabel->setBuddy( mInterval ); - QWhatsThis::add( mInterval, i18n( "All displays of the sheet are updated at the rate specified here." ) ); + TQWhatsThis::add( mInterval, i18n( "All displays of the sheet are updated at the rate specified here." ) ); - connect( mUseGlobalUpdate, SIGNAL( toggled( bool ) ), - SLOT( globalUpdateChanged( bool ) ) ); + connect( mUseGlobalUpdate, TQT_SIGNAL( toggled( bool ) ), + TQT_SLOT( globalUpdateChanged( bool ) ) ); mUseGlobalUpdate->setChecked( true ); diff --git a/ksysguard/gui/ksgrd/TimerSettings.h b/ksysguard/gui/ksgrd/TimerSettings.h index daf2eda6f..73c43c8b4 100644 --- a/ksysguard/gui/ksgrd/TimerSettings.h +++ b/ksysguard/gui/ksgrd/TimerSettings.h @@ -35,7 +35,7 @@ class KDE_EXPORT TimerSettings : public KDialogBase Q_OBJECT public: - TimerSettings( QWidget *parent, const char *name = 0 ); + TimerSettings( TQWidget *parent, const char *name = 0 ); ~TimerSettings(); void setUseGlobalUpdate( bool value ); @@ -48,9 +48,9 @@ class KDE_EXPORT TimerSettings : public KDialogBase void globalUpdateChanged( bool ); private: - QCheckBox* mUseGlobalUpdate; - QLabel* mLabel; - QSpinBox* mInterval; + TQCheckBox* mUseGlobalUpdate; + TQLabel* mLabel; + TQSpinBox* mInterval; }; #endif -- cgit v1.2.3