diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /ksysguard/gui/SensorDisplayLib | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksysguard/gui/SensorDisplayLib')
42 files changed, 1214 insertions, 1214 deletions
diff --git a/ksysguard/gui/SensorDisplayLib/BarGraph.cc b/ksysguard/gui/SensorDisplayLib/BarGraph.cc index f6dc741cb..8d2b5e302 100644 --- a/ksysguard/gui/SensorDisplayLib/BarGraph.cc +++ b/ksysguard/gui/SensorDisplayLib/BarGraph.cc @@ -24,7 +24,7 @@ #include <assert.h> #include <string.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> #include <kiconloader.h> @@ -33,8 +33,8 @@ #include "BarGraph.h" -BarGraph::BarGraph( QWidget *parent, const char *name ) - : QWidget( parent, name ) +BarGraph::BarGraph( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { // paintEvent covers whole widget so we use no background to avoid flicker setBackgroundMode( NoBackground ); @@ -52,15 +52,15 @@ BarGraph::BarGraph( QWidget *parent, const char *name ) // Anything smaller than this does not make sense. setMinimumSize( 16, 16 ); - setSizePolicy( QSizePolicy( QSizePolicy::Expanding, - QSizePolicy::Expanding, false ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, + TQSizePolicy::Expanding, false ) ); } BarGraph::~BarGraph() { } -bool BarGraph::addBar( const QString &footer ) +bool BarGraph::addBar( const TQString &footer ) { samples.resize( bars + 1 ); samples[ bars++ ] = 0.0; @@ -84,7 +84,7 @@ bool BarGraph::removeBar( uint idx ) return true; } -void BarGraph::updateSamples( const QMemArray<double> &newSamples ) +void BarGraph::updateSamples( const TQMemArray<double> &newSamples ) { samples = newSamples; update(); @@ -96,22 +96,22 @@ void BarGraph::changeRange( double min, double max ) maxValue = max; } -void BarGraph::paintEvent( QPaintEvent* ) +void BarGraph::paintEvent( TQPaintEvent* ) { int w = width(); int h = height(); - QPixmap pm( w, h ); - QPainter p; + TQPixmap pm( w, h ); + TQPainter p; p.begin( &pm, this ); - p.setFont( QFont( p.font().family(), fontSize ) ); - QFontMetrics fm( p.font() ); + p.setFont( TQFont( p.font().family(), fontSize ) ); + TQFontMetrics fm( p.font() ); pm.fill( backgroundColor ); /* Draw white line along the bottom and the right side of the * widget to create a 3D like look. */ - p.setPen( QColor( colorGroup().light() ) ); + p.setPen( TQColor( colorGroup().light() ) ); p.drawLine( 0, h - 1, w - 1, h - 1 ); p.drawLine( w - 1, 0, w - 1, h - 1 ); @@ -165,7 +165,7 @@ void BarGraph::paintEvent( QPaintEvent* ) footers[ b ] ); p.drawText( b * barWidth + 3, h - fm.lineSpacing() - 2, barWidth - 2 * 3, fm.lineSpacing(), Qt::AlignCenter, - QString( "%1" ).arg( samples[ b ] ) ); + TQString( "%1" ).arg( samples[ b ] ) ); } } } diff --git a/ksysguard/gui/SensorDisplayLib/BarGraph.h b/ksysguard/gui/SensorDisplayLib/BarGraph.h index aca20c629..744faf777 100644 --- a/ksysguard/gui/SensorDisplayLib/BarGraph.h +++ b/ksysguard/gui/SensorDisplayLib/BarGraph.h @@ -24,9 +24,9 @@ #ifndef KSG_BARGRAPH_H #define KSG_BARGRAPH_H -#include <qmemarray.h> -#include <qptrvector.h> -#include <qwidget.h> +#include <tqmemarray.h> +#include <tqptrvector.h> +#include <tqwidget.h> class BarGraph : public QWidget { @@ -35,13 +35,13 @@ class BarGraph : public QWidget friend class DancingBars; public: - BarGraph( QWidget *parent, const char *name = 0 ); + BarGraph( TQWidget *parent, const char *name = 0 ); ~BarGraph(); - bool addBar( const QString &footer ); + bool addBar( const TQString &footer ); bool removeBar( uint idx ); - void updateSamples( const QMemArray<double> &newSamples ); + void updateSamples( const TQMemArray<double> &newSamples ); double getMin() const { @@ -72,7 +72,7 @@ class BarGraph : public QWidget void changeRange( double min, double max ); protected: - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); private: double minValue; @@ -82,12 +82,12 @@ class BarGraph : public QWidget double upperLimit; bool upperLimitActive; bool autoRange; - QMemArray<double> samples; - QStringList footers; + TQMemArray<double> samples; + TQStringList footers; uint bars; - QColor normalColor; - QColor alarmColor; - QColor backgroundColor; + TQColor normalColor; + TQColor alarmColor; + TQColor backgroundColor; int fontSize; }; diff --git a/ksysguard/gui/SensorDisplayLib/DancingBars.cc b/ksysguard/gui/SensorDisplayLib/DancingBars.cc index 48c360713..3917fc86b 100644 --- a/ksysguard/gui/SensorDisplayLib/DancingBars.cc +++ b/ksysguard/gui/SensorDisplayLib/DancingBars.cc @@ -21,13 +21,13 @@ */ -#include <qcheckbox.h> -#include <qdom.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qpushbutton.h> -#include <qspinbox.h> -#include <qtooltip.h> +#include <tqcheckbox.h> +#include <tqdom.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqtooltip.h> #include <kdebug.h> #include <klocale.h> @@ -40,12 +40,12 @@ #include "DancingBars.h" -DancingBars::DancingBars( QWidget *parent, const char *name, const QString &title, +DancingBars::DancingBars( TQWidget *parent, const char *name, const TQString &title, int, int, bool noFrame_, bool isApplet ) : KSGRD::SensorDisplay( parent, name, title, noFrame_, isApplet ) { mBars = 0; - mFlags = QBitArray(100); + mFlags = TQBitArray(100); mFlags.fill( false ); if ( noFrame() ) @@ -91,9 +91,9 @@ void DancingBars::configureSettings() mSettingsDialog->setBackgroundColor( mPlotter->backgroundColor ); mSettingsDialog->setFontSize( mPlotter->fontSize ); - QValueList< QStringList > list; + TQValueList< TQStringList > list; for ( uint i = mBars - 1; i < mBars; i-- ) { - QStringList entry; + TQStringList entry; entry << sensors().at( i )->hostName(); entry << KSGRD::SensorMgr->translateSensor( sensors().at( i )->name() ); entry << mPlotter->footers[ i ]; @@ -104,7 +104,7 @@ void DancingBars::configureSettings() } mSettingsDialog->setSensors( list ); - connect( mSettingsDialog, SIGNAL( applyClicked() ), SLOT( applySettings() ) ); + connect( mSettingsDialog, TQT_SIGNAL( applyClicked() ), TQT_SLOT( applySettings() ) ); if ( mSettingsDialog->exec() ) applySettings(); @@ -129,8 +129,8 @@ void DancingBars::applySettings() mPlotter->backgroundColor = mSettingsDialog->backgroundColor(); mPlotter->fontSize = mSettingsDialog->fontSize(); - QValueList< QStringList > list = mSettingsDialog->sensors(); - QValueList< QStringList >::Iterator it; + TQValueList< TQStringList > list = mSettingsDialog->sensors(); + TQValueList< TQStringList >::Iterator it; for ( uint i = 0; i < sensors().count(); i++ ) { bool found = false; @@ -162,8 +162,8 @@ void DancingBars::applyStyle() setModified( true ); } -bool DancingBars::addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &title ) +bool DancingBars::addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &title ) { if ( type != "integer" && type != "float" ) return false; @@ -182,14 +182,14 @@ bool DancingBars::addSensor( const QString &hostName, const QString &name, ++mBars; mSampleBuffer.resize( mBars ); - QString tooltip; + TQString tooltip; for ( uint i = 0; i < mBars; ++i ) { - tooltip += QString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) + tooltip += TQString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) .arg( sensors().at( i )->hostName() ) .arg( sensors().at( i )->name() ); } - QToolTip::remove( mPlotter ); - QToolTip::add( mPlotter, tooltip ); + TQToolTip::remove( mPlotter ); + TQToolTip::add( mPlotter, tooltip ); return true; } @@ -206,24 +206,24 @@ bool DancingBars::removeSensor( uint pos ) mBars--; KSGRD::SensorDisplay::removeSensor( pos ); - QString tooltip; + TQString tooltip; for ( uint i = 0; i < mBars; ++i ) { - tooltip += QString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) + tooltip += TQString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) .arg( sensors().at( i )->hostName() ) .arg( sensors().at( i )->name() ); } - QToolTip::remove( mPlotter ); - QToolTip::add( mPlotter, tooltip ); + TQToolTip::remove( mPlotter ); + TQToolTip::add( mPlotter, tooltip ); return true; } -void DancingBars::updateSamples( const QMemArray<double> &samples ) +void DancingBars::updateSamples( const TQMemArray<double> &samples ) { mPlotter->updateSamples( samples ); } -void DancingBars::resizeEvent( QResizeEvent* ) +void DancingBars::resizeEvent( TQResizeEvent* ) { if ( noFrame() ) mPlotter->setGeometry( 0, 0, width(), height() ); @@ -231,7 +231,7 @@ void DancingBars::resizeEvent( QResizeEvent* ) frame()->setGeometry( 0, 0, width(), height() ); } -QSize DancingBars::sizeHint() +TQSize DancingBars::sizeHint() { if ( noFrame() ) return ( mPlotter->sizeHint() ); @@ -239,7 +239,7 @@ QSize DancingBars::sizeHint() return ( frame()->sizeHint() ); } -void DancingBars::answerReceived( int id, const QString &answer ) +void DancingBars::answerReceived( int id, const TQString &answer ) { /* We received something, so the sensor is probably ok. */ sensorError( id, false ); @@ -276,7 +276,7 @@ void DancingBars::answerReceived( int id, const QString &answer ) } } -bool DancingBars::restoreSettings( QDomElement &element ) +bool DancingBars::restoreSettings( TQDomElement &element ) { SensorDisplay::restoreSettings( element ); @@ -294,12 +294,12 @@ bool DancingBars::restoreSettings( QDomElement &element ) KSGRD::Style->alarmColor() ); mPlotter->backgroundColor = restoreColor( element, "backgroundColor", KSGRD::Style->backgroundColor() ); - mPlotter->fontSize = element.attribute( "fontSize", QString( "%1" ).arg( + mPlotter->fontSize = element.attribute( "fontSize", TQString( "%1" ).arg( KSGRD::Style->fontSize() ) ).toInt(); - QDomNodeList dnList = element.elementsByTagName( "beam" ); + TQDomNodeList dnList = element.elementsByTagName( "beam" ); for ( uint i = 0; i < dnList.count(); ++i ) { - QDomElement el = dnList.item( i ).toElement(); + TQDomElement el = dnList.item( i ).toElement(); addSensor( el.attribute( "hostName" ), el.attribute( "sensorName" ), ( el.attribute( "sensorType" ).isEmpty() ? "integer" : el.attribute( "sensorType" ) ), el.attribute( "sensorDescr" ) ); @@ -310,7 +310,7 @@ bool DancingBars::restoreSettings( QDomElement &element ) return true; } -bool DancingBars::saveSettings( QDomDocument &doc, QDomElement &element, +bool DancingBars::saveSettings( TQDomDocument &doc, TQDomElement &element, bool save ) { element.setAttribute( "min", mPlotter->getMin() ); @@ -329,7 +329,7 @@ bool DancingBars::saveSettings( QDomDocument &doc, QDomElement &element, element.setAttribute( "fontSize", mPlotter->fontSize ); for ( uint i = 0; i < mBars; ++i ) { - QDomElement beam = doc.createElement( "beam" ); + TQDomElement beam = doc.createElement( "beam" ); element.appendChild( beam ); beam.setAttribute( "hostName", sensors().at( i )->hostName() ); beam.setAttribute( "sensorName", sensors().at( i )->name() ); diff --git a/ksysguard/gui/SensorDisplayLib/DancingBars.h b/ksysguard/gui/SensorDisplayLib/DancingBars.h index ad671dfe7..7fa2c7456 100644 --- a/ksysguard/gui/SensorDisplayLib/DancingBars.h +++ b/ksysguard/gui/SensorDisplayLib/DancingBars.h @@ -25,7 +25,7 @@ #define KSG_DANCINGBARS_H #include <SensorDisplay.h> -#include <qbitarray.h> +#include <tqbitarray.h> class KIntNumInput; @@ -41,25 +41,25 @@ class DancingBars : public KSGRD::SensorDisplay Q_OBJECT public: - DancingBars( QWidget *parent = 0, const char *name = 0, - const QString &title = QString::null, int min = 0, + DancingBars( TQWidget *parent = 0, const char *name = 0, + const TQString &title = TQString::null, int min = 0, int max = 100, bool noFrame = false, bool isApplet = false ); virtual ~DancingBars(); void configureSettings(); - bool addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &title ); + bool addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &title ); bool removeSensor( uint pos ); - void updateSamples( const QMemArray<double> &samples ); + void updateSamples( const TQMemArray<double> &samples ); - virtual QSize sizeHint(); + virtual TQSize sizeHint(); - virtual void answerReceived( int id, const QString &answer ); + virtual void answerReceived( int id, const TQString &answer ); - bool restoreSettings( QDomElement& ); - bool saveSettings( QDomDocument&, QDomElement&, bool save = true ); + bool restoreSettings( TQDomElement& ); + bool saveSettings( TQDomDocument&, TQDomElement&, bool save = true ); virtual bool hasSettingsDialog() const; @@ -68,7 +68,7 @@ class DancingBars : public KSGRD::SensorDisplay virtual void applyStyle(); protected: - virtual void resizeEvent( QResizeEvent* ); + virtual void resizeEvent( TQResizeEvent* ); private: uint mBars; @@ -83,8 +83,8 @@ class DancingBars : public KSGRD::SensorDisplay received. The flags variable is used to ensure that all samples have been received. */ - QMemArray<double> mSampleBuffer; - QBitArray mFlags; + TQMemArray<double> mSampleBuffer; + TQBitArray mFlags; }; #endif diff --git a/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.cc b/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.cc index 15e6b6ec3..1b97cc25f 100644 --- a/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.cc +++ b/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.cc @@ -29,50 +29,50 @@ #include <klocale.h> #include <knuminput.h> -#include <qcheckbox.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qwhatsthis.h> +#include <tqcheckbox.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> #include "DancingBarsSettings.h" -DancingBarsSettings::DancingBarsSettings( QWidget* parent, const char* name ) +DancingBarsSettings::DancingBarsSettings( TQWidget* parent, const char* name ) : KDialogBase( Tabbed, i18n( "Edit BarGraph Preferences" ), Ok | Apply | Cancel, Ok, parent, name, true, true ) { // Range page - QFrame *page = addPage( i18n( "Range" ) ); - QGridLayout *pageLayout = new QGridLayout( page, 3, 1, 0, spacingHint() ); + TQFrame *page = addPage( i18n( "Range" ) ); + TQGridLayout *pageLayout = new TQGridLayout( page, 3, 1, 0, spacingHint() ); - QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Title" ), page ); - QGridLayout *boxLayout = new QGridLayout( groupBox->layout(), 1, 1 ); + TQGroupBox *groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Title" ), page ); + TQGridLayout *boxLayout = new TQGridLayout( groupBox->layout(), 1, 1 ); mTitle = new KLineEdit( groupBox ); - QWhatsThis::add( mTitle, i18n( "Enter the title of the display here." ) ); + TQWhatsThis::add( mTitle, i18n( "Enter the title of the display here." ) ); boxLayout->addWidget( mTitle, 0, 0 ); pageLayout->addWidget( groupBox, 0, 0 ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Display Range" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 1, 5 ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Display Range" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 1, 5 ); boxLayout->setColStretch( 2, 1 ); - QLabel *label = new QLabel( i18n( "Minimum value:" ), groupBox ); + TQLabel *label = new TQLabel( i18n( "Minimum value:" ), groupBox ); boxLayout->addWidget( label, 0, 0 ); mMinValue = new KDoubleSpinBox( 0, 100, 0.5, 0, 2, groupBox ); - QWhatsThis::add( mMinValue, i18n( "Enter the minimum value for the display here. If both values are 0, automatic range detection is enabled." ) ); + TQWhatsThis::add( mMinValue, i18n( "Enter the minimum value for the display here. If both values are 0, automatic range detection is enabled." ) ); boxLayout->addWidget( mMinValue, 0, 1 ); label->setBuddy( mMinValue ); - label = new QLabel( i18n( "Maximum value:" ), groupBox ); + label = new TQLabel( i18n( "Maximum value:" ), groupBox ); boxLayout->addWidget( label, 0, 3 ); mMaxValue = new KDoubleSpinBox( 0, 10000, 0.5, 100, 2, groupBox ); - QWhatsThis::add( mMaxValue, i18n( "Enter the maximum value for the display here. If both values are 0, automatic range detection is enabled." ) ); + TQWhatsThis::add( mMaxValue, i18n( "Enter the maximum value for the display here. If both values are 0, automatic range detection is enabled." ) ); boxLayout->addWidget( mMaxValue, 0, 4 ); label->setBuddy( mMaxValue ); @@ -82,17 +82,17 @@ DancingBarsSettings::DancingBarsSettings( QWidget* parent, const char* name ) // Alarm page page = addPage( i18n( "Alarms" ) ); - pageLayout = new QGridLayout( page, 3, 1, 0, spacingHint() ); + pageLayout = new TQGridLayout( page, 3, 1, 0, spacingHint() ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Alarm for Minimum Value" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 1, 4 ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Alarm for Minimum Value" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 1, 4 ); boxLayout->setColStretch( 1, 1 ); - mUseLowerLimit = new QCheckBox( i18n( "Enable alarm" ), groupBox ); - QWhatsThis::add( mUseLowerLimit, i18n( "Enable the minimum value alarm." ) ); + mUseLowerLimit = new TQCheckBox( i18n( "Enable alarm" ), groupBox ); + TQWhatsThis::add( mUseLowerLimit, i18n( "Enable the minimum value alarm." ) ); boxLayout->addWidget( mUseLowerLimit, 0, 0 ); - label = new QLabel( i18n( "Lower limit:" ), groupBox ); + label = new TQLabel( i18n( "Lower limit:" ), groupBox ); boxLayout->addWidget( label, 0, 2 ); mLowerLimit = new KDoubleSpinBox( 0, 100, 0.5, 0, 2, groupBox ); @@ -102,15 +102,15 @@ DancingBarsSettings::DancingBarsSettings( QWidget* parent, const char* name ) pageLayout->addWidget( groupBox, 0, 0 ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Alarm for Maximum Value" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 1, 4 ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Alarm for Maximum Value" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 1, 4 ); boxLayout->setColStretch( 1, 1 ); - mUseUpperLimit = new QCheckBox( i18n( "Enable alarm" ), groupBox ); - QWhatsThis::add( mUseUpperLimit, i18n( "Enable the maximum value alarm." ) ); + mUseUpperLimit = new TQCheckBox( i18n( "Enable alarm" ), groupBox ); + TQWhatsThis::add( mUseUpperLimit, i18n( "Enable the maximum value alarm." ) ); boxLayout->addWidget( mUseUpperLimit, 0, 0 ); - label = new QLabel( i18n( "Upper limit:" ), groupBox ); + label = new TQLabel( i18n( "Upper limit:" ), groupBox ); boxLayout->addWidget( label, 0, 2 ); mUpperLimit = new KDoubleSpinBox( 0, 100, 0.5, 0, 2, groupBox ); @@ -124,34 +124,34 @@ DancingBarsSettings::DancingBarsSettings( QWidget* parent, const char* name ) // Look page page = addPage( i18n( "Look" ) ); - pageLayout = new QGridLayout( page, 5, 2, 0, spacingHint() ); + pageLayout = new TQGridLayout( page, 5, 2, 0, spacingHint() ); - label = new QLabel( i18n( "Normal bar color:" ), page ); + label = new TQLabel( i18n( "Normal bar color:" ), page ); pageLayout->addWidget( label, 0, 0 ); mForegroundColor = new KColorButton( page ); pageLayout->addWidget( mForegroundColor, 0, 1 ); label->setBuddy( mForegroundColor ); - label = new QLabel( i18n( "Out-of-range color:" ), page ); + label = new TQLabel( i18n( "Out-of-range color:" ), page ); pageLayout->addWidget( label, 1, 0 ); mAlarmColor = new KColorButton( page ); pageLayout->addWidget( mAlarmColor, 1, 1 ); label->setBuddy( mAlarmColor ); - label = new QLabel( i18n( "Background color:" ), page ); + label = new TQLabel( i18n( "Background color:" ), page ); pageLayout->addWidget( label, 2, 0 ); mBackgroundColor = new KColorButton( page ); pageLayout->addWidget( mBackgroundColor, 2, 1 ); label->setBuddy( mBackgroundColor ); - label = new QLabel( i18n( "Font size:" ), page ); + label = new TQLabel( i18n( "Font size:" ), page ); pageLayout->addWidget( label, 3, 0 ); mFontSize = new KIntNumInput( 9, page ); - QWhatsThis::add( mFontSize, i18n( "This determines the size of the font used to print a label underneath the bars. Bars are automatically suppressed if text becomes too large, so it is advisable to use a small font size here." ) ); + TQWhatsThis::add( mFontSize, i18n( "This determines the size of the font used to print a label underneath the bars. Bars are automatically suppressed if text becomes too large, so it is advisable to use a small font size here." ) ); pageLayout->addWidget( mFontSize, 3, 1 ); label->setBuddy( mFontSize ); @@ -159,7 +159,7 @@ DancingBarsSettings::DancingBarsSettings( QWidget* parent, const char* name ) // Sensor page page = addPage( i18n( "Sensors" ) ); - pageLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); + pageLayout = new TQGridLayout( page, 3, 2, 0, spacingHint() ); pageLayout->setRowStretch( 2, 1 ); mSensorView = new KListView( page ); @@ -171,25 +171,25 @@ DancingBarsSettings::DancingBarsSettings( QWidget* parent, const char* name ) mSensorView->setAllColumnsShowFocus( true ); pageLayout->addMultiCellWidget( mSensorView, 0, 2, 0, 0 ); - mEditButton = new QPushButton( i18n( "Edit..." ), page ); + mEditButton = new TQPushButton( i18n( "Edit..." ), page ); mEditButton->setEnabled( false ); - QWhatsThis::add( mEditButton, i18n( "Push this button to configure the label." ) ); + TQWhatsThis::add( mEditButton, i18n( "Push this button to configure the label." ) ); pageLayout->addWidget( mEditButton, 0, 1 ); - mRemoveButton = new QPushButton( i18n( "Delete" ), page ); + mRemoveButton = new TQPushButton( i18n( "Delete" ), page ); mRemoveButton->setEnabled( false ); - QWhatsThis::add( mRemoveButton, i18n( "Push this button to delete the sensor." ) ); + TQWhatsThis::add( mRemoveButton, i18n( "Push this button to delete the sensor." ) ); pageLayout->addWidget( mRemoveButton, 1, 1 ); - connect( mUseLowerLimit, SIGNAL( toggled( bool ) ), - mLowerLimit, SLOT( setEnabled( bool ) ) ); - connect( mUseUpperLimit, SIGNAL( toggled( bool ) ), - mUpperLimit, SLOT( setEnabled( bool ) ) ); + connect( mUseLowerLimit, TQT_SIGNAL( toggled( bool ) ), + mLowerLimit, TQT_SLOT( setEnabled( bool ) ) ); + connect( mUseUpperLimit, TQT_SIGNAL( toggled( bool ) ), + mUpperLimit, TQT_SLOT( setEnabled( bool ) ) ); - connect( mSensorView, SIGNAL( selectionChanged( QListViewItem* ) ), - SLOT( selectionChanged( QListViewItem* ) ) ); - connect( mEditButton, SIGNAL( clicked() ), SLOT( editSensor() ) ); - connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeSensor() ) ); + connect( mSensorView, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ), + TQT_SLOT( selectionChanged( TQListViewItem* ) ) ); + connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editSensor() ) ); + connect( mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeSensor() ) ); KAcceleratorManager::manage( this ); @@ -200,12 +200,12 @@ DancingBarsSettings::~DancingBarsSettings() { } -void DancingBarsSettings::setTitle( const QString& title ) +void DancingBarsSettings::setTitle( const TQString& title ) { mTitle->setText( title ); } -QString DancingBarsSettings::title() const +TQString DancingBarsSettings::title() const { return mTitle->text(); } @@ -270,32 +270,32 @@ double DancingBarsSettings::upperLimit() const return mUpperLimit->value(); } -void DancingBarsSettings::setForegroundColor( const QColor &color ) +void DancingBarsSettings::setForegroundColor( const TQColor &color ) { mForegroundColor->setColor( color ); } -QColor DancingBarsSettings::foregroundColor() const +TQColor DancingBarsSettings::foregroundColor() const { return mForegroundColor->color(); } -void DancingBarsSettings::setAlarmColor( const QColor &color ) +void DancingBarsSettings::setAlarmColor( const TQColor &color ) { mAlarmColor->setColor( color ); } -QColor DancingBarsSettings::alarmColor() const +TQColor DancingBarsSettings::alarmColor() const { return mAlarmColor->color(); } -void DancingBarsSettings::setBackgroundColor( const QColor &color ) +void DancingBarsSettings::setBackgroundColor( const TQColor &color ) { mBackgroundColor->setColor( color ); } -QColor DancingBarsSettings::backgroundColor() const +TQColor DancingBarsSettings::backgroundColor() const { return mBackgroundColor->color(); } @@ -310,13 +310,13 @@ int DancingBarsSettings::fontSize() const return mFontSize->value(); } -void DancingBarsSettings::setSensors( const QValueList< QStringList > &list ) +void DancingBarsSettings::setSensors( const TQValueList< TQStringList > &list ) { mSensorView->clear(); - QValueList< QStringList >::ConstIterator it; + TQValueList< TQStringList >::ConstIterator it; for ( it = list.begin(); it != list.end(); ++it ) { - new QListViewItem( mSensorView, + new TQListViewItem( mSensorView, (*it)[ 0 ], // host name (*it)[ 1 ], // sensor name (*it)[ 2 ], // footer title @@ -325,13 +325,13 @@ void DancingBarsSettings::setSensors( const QValueList< QStringList > &list ) } } -QValueList< QStringList > DancingBarsSettings::sensors() const +TQValueList< TQStringList > DancingBarsSettings::sensors() const { - QValueList< QStringList > list; + TQValueList< TQStringList > list; - QListViewItemIterator it( mSensorView ); + TQListViewItemIterator it( mSensorView ); while ( it.current() && !it.current()->text( 0 ).isEmpty() ) { - QStringList entry; + TQStringList entry; entry << it.current()->text( 0 ); entry << it.current()->text( 1 ); entry << it.current()->text( 2 ); @@ -347,13 +347,13 @@ QValueList< QStringList > DancingBarsSettings::sensors() const void DancingBarsSettings::editSensor() { - QListViewItem *lvi = mSensorView->currentItem(); + TQListViewItem *lvi = mSensorView->currentItem(); if ( !lvi ) return; bool ok; - QString str = KInputDialog::getText( i18n( "Label of Bar Graph" ), + TQString str = KInputDialog::getText( i18n( "Label of Bar Graph" ), i18n( "Enter new label:" ), lvi->text( 2 ), &ok, this ); if ( ok ) lvi->setText( 2, str ); @@ -361,7 +361,7 @@ void DancingBarsSettings::editSensor() void DancingBarsSettings::removeSensor() { - QListViewItem *lvi = mSensorView->currentItem(); + TQListViewItem *lvi = mSensorView->currentItem(); if ( lvi ) { /* Before we delete the currently selected item, we determine a @@ -369,7 +369,7 @@ void DancingBarsSettings::removeSensor() * items can be deleted without forcing the user to select a new * item between the deletes. If all items are deleted, the buttons * are disabled again. */ - QListViewItem* newSelected = 0; + TQListViewItem* newSelected = 0; if ( lvi->itemBelow() ) { lvi->itemBelow()->setSelected( true ); newSelected = lvi->itemBelow(); @@ -386,7 +386,7 @@ void DancingBarsSettings::removeSensor() } } -void DancingBarsSettings::selectionChanged( QListViewItem* lvi ) +void DancingBarsSettings::selectionChanged( TQListViewItem* lvi ) { bool state = ( lvi != 0 ); diff --git a/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.h b/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.h index 12e559dc0..996413535 100644 --- a/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.h +++ b/ksysguard/gui/SensorDisplayLib/DancingBarsSettings.h @@ -41,11 +41,11 @@ class DancingBarsSettings : public KDialogBase Q_OBJECT public: - DancingBarsSettings( QWidget* parent = 0, const char* name = 0 ); + DancingBarsSettings( TQWidget* parent = 0, const char* name = 0 ); ~DancingBarsSettings(); - void setTitle( const QString& title ); - QString title() const; + void setTitle( const TQString& title ); + TQString title() const; void setMinValue( double min ); double minValue() const; @@ -65,25 +65,25 @@ class DancingBarsSettings : public KDialogBase void setUpperLimit( double limit ); double upperLimit() const; - void setForegroundColor( const QColor &color ); - QColor foregroundColor() const; + void setForegroundColor( const TQColor &color ); + TQColor foregroundColor() 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( int size ); int fontSize() const; - void setSensors( const QValueList< QStringList > &list ); - QValueList< QStringList > sensors() const; + void setSensors( const TQValueList< TQStringList > &list ); + TQValueList< TQStringList > sensors() const; private slots: void editSensor(); void removeSensor(); - void selectionChanged( QListViewItem* ); + void selectionChanged( TQListViewItem* ); private: KColorButton *mForegroundColor; @@ -97,10 +97,10 @@ class DancingBarsSettings : public KDialogBase KListView *mSensorView; KIntNumInput *mFontSize; - QCheckBox *mUseLowerLimit; - QCheckBox *mUseUpperLimit; - QPushButton *mEditButton; - QPushButton *mRemoveButton; + TQCheckBox *mUseLowerLimit; + TQCheckBox *mUseUpperLimit; + TQPushButton *mEditButton; + TQPushButton *mRemoveButton; }; #endif diff --git a/ksysguard/gui/SensorDisplayLib/DummyDisplay.cc b/ksysguard/gui/SensorDisplayLib/DummyDisplay.cc index a4ea6afb4..2e499e852 100644 --- a/ksysguard/gui/SensorDisplayLib/DummyDisplay.cc +++ b/ksysguard/gui/SensorDisplayLib/DummyDisplay.cc @@ -24,35 +24,35 @@ #include <klocale.h> #include <ksgrd/SensorManager.h> -#include <qwhatsthis.h> +#include <tqwhatsthis.h> #include "DummyDisplay.h" -DummyDisplay::DummyDisplay( QWidget* parent, const char* name, - const QString&, double, double ) +DummyDisplay::DummyDisplay( TQWidget* parent, const char* name, + const TQString&, double, double ) : KSGRD::SensorDisplay( parent, name, i18n( "Drop Sensor Here" ) ) { setMinimumSize( 16, 16 ); - QWhatsThis::add( this, i18n( + TQWhatsThis::add( this, i18n( "This is an empty space in a worksheet. Drag a sensor from " "the Sensor Browser and drop it here. A sensor display will " "appear that allows you to monitor the values of the sensor " "over time." ) ); } -void DummyDisplay::resizeEvent( QResizeEvent* ) +void DummyDisplay::resizeEvent( TQResizeEvent* ) { frame()->setGeometry( 0, 0, width(), height() ); } -bool DummyDisplay::eventFilter( QObject* object, QEvent* event ) +bool DummyDisplay::eventFilter( TQObject* object, TQEvent* event ) { - if ( event->type() == QEvent::MouseButtonRelease && - ( (QMouseEvent*)event)->button() == LeftButton ) + if ( event->type() == TQEvent::MouseButtonRelease && + ( (TQMouseEvent*)event)->button() == LeftButton ) setFocus(); - return QWidget::eventFilter( object, event ); + return TQWidget::eventFilter( object, event ); } #include "DummyDisplay.moc" diff --git a/ksysguard/gui/SensorDisplayLib/DummyDisplay.h b/ksysguard/gui/SensorDisplayLib/DummyDisplay.h index 53098fa0c..cd00a6fd6 100644 --- a/ksysguard/gui/SensorDisplayLib/DummyDisplay.h +++ b/ksysguard/gui/SensorDisplayLib/DummyDisplay.h @@ -31,14 +31,14 @@ class DummyDisplay : public KSGRD::SensorDisplay Q_OBJECT public: - DummyDisplay( QWidget* parent = 0, const char* name = 0, - const QString& = QString::null, double min = 0, + DummyDisplay( TQWidget* parent = 0, const char* name = 0, + const TQString& = TQString::null, double min = 0, double max = 0 ); virtual ~DummyDisplay() {} - void resizeEvent( QResizeEvent* ); + void resizeEvent( TQResizeEvent* ); - virtual bool eventFilter( QObject*, QEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); }; #endif diff --git a/ksysguard/gui/SensorDisplayLib/FancyPlotter.cc b/ksysguard/gui/SensorDisplayLib/FancyPlotter.cc index 361ce16e7..0434877bb 100644 --- a/ksysguard/gui/SensorDisplayLib/FancyPlotter.cc +++ b/ksysguard/gui/SensorDisplayLib/FancyPlotter.cc @@ -21,9 +21,9 @@ */ -#include <qdom.h> -#include <qimage.h> -#include <qtooltip.h> +#include <tqdom.h> +#include <tqimage.h> +#include <tqtooltip.h> #include <kdebug.h> #include <klocale.h> @@ -36,8 +36,8 @@ #include "FancyPlotter.h" -FancyPlotter::FancyPlotter( QWidget* parent, const char* name, - const QString &title, double, double, +FancyPlotter::FancyPlotter( TQWidget* parent, const char* name, + const TQString &title, double, double, bool nf, bool isApplet) : KSGRD::SensorDisplay( parent, name, title, nf, isApplet ) { @@ -97,10 +97,10 @@ void FancyPlotter::configureSettings() mSettingsDialog->setBackgroundColor( mPlotter->backgroundColor() ); - QValueList< QStringList > list; + TQValueList< TQStringList > list; for ( uint i = 0; i < mBeams; ++i ) { - QStringList entry; - entry << QString::number(i); + TQStringList entry; + entry << TQString::number(i); entry << sensors().at( i )->hostName(); entry << KSGRD::SensorMgr->translateSensor( sensors().at( i )->name() ); entry << KSGRD::SensorMgr->translateUnit( sensors().at( i )->unit() ); @@ -111,9 +111,9 @@ void FancyPlotter::configureSettings() } mSettingsDialog->setSensors( list ); - connect( mSettingsDialog, SIGNAL( applyClicked() ), SLOT( applySettings() ) ); - connect( mSettingsDialog, SIGNAL( okClicked() ), SLOT( applySettings() ) ); - connect( mSettingsDialog, SIGNAL( finished() ), SLOT( killDialog() ) ); + connect( mSettingsDialog, TQT_SIGNAL( applyClicked() ), TQT_SLOT( applySettings() ) ); + connect( mSettingsDialog, TQT_SIGNAL( okClicked() ), TQT_SLOT( applySettings() ) ); + connect( mSettingsDialog, TQT_SIGNAL( finished() ), TQT_SLOT( killDialog() ) ); mSettingsDialog->show(); } @@ -143,7 +143,7 @@ void FancyPlotter::applySettings() if ( mPlotter->horizontalScale() != mSettingsDialog->horizontalScale() ) { mPlotter->setHorizontalScale( mSettingsDialog->horizontalScale() ); - // Can someone think of a useful QResizeEvent to pass? + // Can someone think of a useful TQResizeEvent to pass? // It doesn't really matter anyway because it's not used. emit resizeEvent( 0 ); } @@ -164,23 +164,23 @@ void FancyPlotter::applySettings() mPlotter->setBackgroundColor( mSettingsDialog->backgroundColor() ); - QValueList<int> orderOfSensors = mSettingsDialog->order(); - QValueList<int> deletedSensors = mSettingsDialog->deleted(); + TQValueList<int> orderOfSensors = mSettingsDialog->order(); + TQValueList<int> deletedSensors = mSettingsDialog->deleted(); mSettingsDialog->clearDeleted(); mSettingsDialog->resetOrder(); - QValueList< int >::Iterator itDelete; + TQValueList< int >::Iterator itDelete; for ( itDelete = deletedSensors.begin(); itDelete != deletedSensors.end(); ++itDelete ) removeSensor(*itDelete); - QValueList< int >::Iterator itOrder; + TQValueList< int >::Iterator itOrder; mPlotter->reorderBeams(orderOfSensors); reorderSensors(orderOfSensors); - QValueList< QStringList > list = mSettingsDialog->sensors(); - QValueList< QStringList >::Iterator it; + TQValueList< TQStringList > list = mSettingsDialog->sensors(); + TQValueList< TQStringList >::Iterator it; for ( uint i = 0; i < sensors().count(); ++i ) - mPlotter->beamColors()[ i ] = QColor( list[i][ 5 ] ); + mPlotter->beamColors()[ i ] = TQColor( list[i][ 5 ] ); mPlotter->repaint(); setModified( true ); @@ -200,22 +200,22 @@ void FancyPlotter::applyStyle() setModified( true ); } -bool FancyPlotter::addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &title ) +bool FancyPlotter::addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &title ) { return addSensor( hostName, name, type, title, KSGRD::Style->sensorColor( mBeams ) ); } -bool FancyPlotter::addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &title, - const QColor &color ) +bool FancyPlotter::addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &title, + const TQColor &color ) { if ( type != "integer" && type != "float" ) return false; if ( mBeams > 0 && hostName != sensors().at( 0 )->hostName() ) { - KMessageBox::sorry( this, QString( "All sensors of this display need " + KMessageBox::sorry( this, TQString( "All sensors of this display need " "to be from the host %1!" ) .arg( sensors().at( 0 )->hostName() ) ); @@ -235,15 +235,15 @@ bool FancyPlotter::addSensor( const QString &hostName, const QString &name, ++mBeams; - QString tooltip; + TQString tooltip; for ( uint i = 0; i < mBeams; ++i ) { - tooltip += QString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) + tooltip += TQString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) .arg( sensors().at( mBeams - i - 1 )->hostName() ) .arg( sensors().at( mBeams - i - 1 )->name() ); } - QToolTip::remove( mPlotter ); - QToolTip::add( mPlotter, tooltip ); + TQToolTip::remove( mPlotter ); + TQToolTip::add( mPlotter, tooltip ); return true; } @@ -260,20 +260,20 @@ bool FancyPlotter::removeSensor( uint pos ) mBeams--; KSGRD::SensorDisplay::removeSensor( pos ); - QString tooltip; + TQString tooltip; for ( uint i = 0; i < mBeams; ++i ) { - tooltip += QString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) + tooltip += TQString( "%1%2:%3" ).arg( i != 0 ? "\n" : "" ) .arg( sensors().at( mBeams - i - 1 )->hostName() ) .arg( sensors().at( mBeams - i - 1 )->name() ); } - QToolTip::remove( mPlotter ); - QToolTip::add( mPlotter, tooltip ); + TQToolTip::remove( mPlotter ); + TQToolTip::add( mPlotter, tooltip ); return true; } -void FancyPlotter::resizeEvent( QResizeEvent* ) +void FancyPlotter::resizeEvent( TQResizeEvent* ) { if ( noFrame() ) mPlotter->setGeometry( 0, 0, width(), height() ); @@ -281,7 +281,7 @@ void FancyPlotter::resizeEvent( QResizeEvent* ) frame()->setGeometry( 0, 0, width(), height() ); } -QSize FancyPlotter::sizeHint() +TQSize FancyPlotter::sizeHint() { if ( noFrame() ) return mPlotter->sizeHint(); @@ -289,7 +289,7 @@ QSize FancyPlotter::sizeHint() return frame()->sizeHint(); } -void FancyPlotter::answerReceived( int id, const QString &answer ) +void FancyPlotter::answerReceived( int id, const TQString &answer ) { if ( (uint)id < mBeams ) { if ( id != (int)mSampleBuf.count() ) { @@ -323,7 +323,7 @@ void FancyPlotter::answerReceived( int id, const QString &answer ) } } -bool FancyPlotter::restoreSettings( QDomElement &element ) +bool FancyPlotter::restoreSettings( TQDomElement &element ) { /* autoRage was added after KDE 2.x and was brokenly emulated by * min == 0.0 and max == 0.0. Since we have to be able to read old @@ -354,14 +354,14 @@ bool FancyPlotter::restoreSettings( QDomElement &element ) mPlotter->setShowLabels( element.attribute( "labels", "1" ).toUInt() ); mPlotter->setShowTopBar( element.attribute( "topBar", "0" ).toUInt() ); mPlotter->setFontSize( element.attribute( "fontSize", - QString( "%1" ).arg( KSGRD::Style->fontSize() ) ).toUInt() ); + TQString( "%1" ).arg( KSGRD::Style->fontSize() ) ).toUInt() ); mPlotter->setBackgroundColor( restoreColor( element, "bColor", KSGRD::Style->backgroundColor() ) ); - QDomNodeList dnList = element.elementsByTagName( "beam" ); + TQDomNodeList dnList = element.elementsByTagName( "beam" ); for ( uint i = 0; i < dnList.count(); ++i ) { - QDomElement el = dnList.item( i ).toElement(); + TQDomElement el = dnList.item( i ).toElement(); addSensor( el.attribute( "hostName" ), el.attribute( "sensorName" ), ( el.attribute( "sensorType" ).isEmpty() ? "integer" : el.attribute( "sensorType" ) ), "", restoreColor( el, "color", @@ -378,7 +378,7 @@ bool FancyPlotter::restoreSettings( QDomElement &element ) return true; } -bool FancyPlotter::saveSettings( QDomDocument &doc, QDomElement &element, +bool FancyPlotter::saveSettings( TQDomDocument &doc, TQDomElement &element, bool save ) { element.setAttribute( "min", mPlotter->minValue() ); @@ -403,7 +403,7 @@ bool FancyPlotter::saveSettings( QDomDocument &doc, QDomElement &element, saveColor( element, "bColor", mPlotter->backgroundColor() ); for ( uint i = 0; i < mBeams; ++i ) { - QDomElement beam = doc.createElement( "beam" ); + TQDomElement beam = doc.createElement( "beam" ); element.appendChild( beam ); beam.setAttribute( "hostName", sensors().at( i )->hostName() ); beam.setAttribute( "sensorName", sensors().at( i )->name() ); @@ -430,11 +430,11 @@ FPSensorProperties::FPSensorProperties() { } -FPSensorProperties::FPSensorProperties( const QString &hostName, - const QString &name, - const QString &type, - const QString &description, - const QColor &color ) +FPSensorProperties::FPSensorProperties( const TQString &hostName, + const TQString &name, + const TQString &type, + const TQString &description, + const TQColor &color ) : KSGRD::SensorProperties( hostName, name, type, description ), mColor( color ) { @@ -444,12 +444,12 @@ FPSensorProperties::~FPSensorProperties() { } -void FPSensorProperties::setColor( const QColor &color ) +void FPSensorProperties::setColor( const TQColor &color ) { mColor = color; } -QColor FPSensorProperties::color() const +TQColor FPSensorProperties::color() const { return mColor; } diff --git a/ksysguard/gui/SensorDisplayLib/FancyPlotter.h b/ksysguard/gui/SensorDisplayLib/FancyPlotter.h index d19c28760..ddb5f7328 100644 --- a/ksysguard/gui/SensorDisplayLib/FancyPlotter.h +++ b/ksysguard/gui/SensorDisplayLib/FancyPlotter.h @@ -34,16 +34,16 @@ class FPSensorProperties : public KSGRD::SensorProperties { public: FPSensorProperties(); - FPSensorProperties( const QString &hostName, const QString &name, - const QString &type, const QString &description, - const QColor &color ); + FPSensorProperties( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &description, + const TQColor &color ); ~FPSensorProperties(); - void setColor( const QColor &color ); - QColor color() const; + void setColor( const TQColor &color ); + TQColor color() const; private: - QColor mColor; + TQColor mColor; }; class FancyPlotter : public KSGRD::SensorDisplay @@ -51,27 +51,27 @@ class FancyPlotter : public KSGRD::SensorDisplay Q_OBJECT public: - FancyPlotter( QWidget* parent = 0, const char* name = 0, - const QString& title = QString::null, double min = 0, + FancyPlotter( TQWidget* parent = 0, const char* name = 0, + const TQString& title = TQString::null, double min = 0, double max = 100, bool noFrame = false, bool isApplet = false ); virtual ~FancyPlotter(); void configureSettings(); - bool addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &title ); - bool addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &title, - const QColor &color ); + bool addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &title ); + bool addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &title, + const TQColor &color ); bool removeSensor( uint pos ); - virtual QSize sizeHint(void); + virtual TQSize sizeHint(void); - virtual void answerReceived( int id, const QString &answer ); + virtual void answerReceived( int id, const TQString &answer ); - virtual bool restoreSettings( QDomElement &element ); - virtual bool saveSettings( QDomDocument &doc, QDomElement &element, + virtual bool restoreSettings( TQDomElement &element ); + virtual bool saveSettings( TQDomDocument &doc, TQDomElement &element, bool save = true ); virtual bool hasSettingsDialog() const; @@ -82,7 +82,7 @@ class FancyPlotter : public KSGRD::SensorDisplay void killDialog(); protected: - virtual void resizeEvent( QResizeEvent* ); + virtual void resizeEvent( TQResizeEvent* ); private: uint mBeams; @@ -97,7 +97,7 @@ class FancyPlotter : public KSGRD::SensorDisplay received. The flags variable is used to ensure that all samples have been received. */ - QValueList<double> mSampleBuf; + TQValueList<double> mSampleBuf; }; #endif diff --git a/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.cc b/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.cc index 9d4114bd3..de345e7b8 100644 --- a/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.cc +++ b/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.cc @@ -29,87 +29,87 @@ #include <klocale.h> #include <knuminput.h> -#include <qcheckbox.h> -#include <qbuttongroup.h> -#include <qgroupbox.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qwhatsthis.h> -#include <qheader.h> +#include <tqcheckbox.h> +#include <tqbuttongroup.h> +#include <tqgroupbox.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqwhatsthis.h> +#include <tqheader.h> #include "FancyPlotterSettings.h" -FancyPlotterSettings::FancyPlotterSettings( QWidget* parent, const char* name ) +FancyPlotterSettings::FancyPlotterSettings( TQWidget* parent, const char* name ) : KDialogBase( Tabbed, i18n( "Signal Plotter Settings" ), Ok | Apply | Cancel, Ok, parent, name, false, true ) { - QFrame *page = 0; - QGridLayout *pageLayout = 0; - QGridLayout *boxLayout = 0; - QGroupBox *groupBox = 0; - QLabel *label = 0; + TQFrame *page = 0; + TQGridLayout *pageLayout = 0; + TQGridLayout *boxLayout = 0; + TQGroupBox *groupBox = 0; + TQLabel *label = 0; // Style page page = addPage( i18n( "Style" ) ); - pageLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); + pageLayout = new TQGridLayout( page, 3, 2, 0, spacingHint() ); - label = new QLabel( i18n( "Title:" ), page ); + label = new TQLabel( i18n( "Title:" ), page ); pageLayout->addWidget( label, 0, 0 ); mTitle = new KLineEdit( page ); - QWhatsThis::add( mTitle, i18n( "Enter the title of the display here." ) ); + TQWhatsThis::add( mTitle, i18n( "Enter the title of the display here." ) ); pageLayout->addWidget( mTitle, 0, 1 ); label->setBuddy( mTitle ); - QButtonGroup *buttonBox = new QButtonGroup( 2, Qt::Vertical, + TQButtonGroup *buttonBox = new TQButtonGroup( 2, Qt::Vertical, i18n( "Graph Drawing Style" ), page ); - mUsePolygonStyle = new QRadioButton( i18n( "Basic polygons" ), buttonBox ); + mUsePolygonStyle = new TQRadioButton( i18n( "Basic polygons" ), buttonBox ); mUsePolygonStyle->setChecked( true ); - mUseOriginalStyle = new QRadioButton( i18n( "Original - single line per data point" ), buttonBox ); + mUseOriginalStyle = new TQRadioButton( i18n( "Original - single line per data point" ), buttonBox ); pageLayout->addMultiCellWidget( buttonBox, 1, 1, 0, 1 ); // Scales page page = addPage( i18n( "Scales" ) ); - pageLayout = new QGridLayout( page, 2, 1, 0, spacingHint() ); + pageLayout = new TQGridLayout( page, 2, 1, 0, spacingHint() ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Vertical Scale" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 2, 5, spacingHint() ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Vertical Scale" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 2, 5, spacingHint() ); boxLayout->setColStretch( 2, 1 ); - mUseAutoRange = new QCheckBox( i18n( "Automatic range detection" ), groupBox ); - QWhatsThis::add( mUseAutoRange, i18n( "Check this box if you want the display range to adapt dynamically to the currently displayed values; if you do not check this, you have to specify the range you want in the fields below." ) ); + mUseAutoRange = new TQCheckBox( i18n( "Automatic range detection" ), groupBox ); + TQWhatsThis::add( mUseAutoRange, i18n( "Check this box if you want the display range to adapt dynamically to the currently displayed values; if you do not check this, you have to specify the range you want in the fields below." ) ); boxLayout->addMultiCellWidget( mUseAutoRange, 0, 0, 0, 4 ); - label = new QLabel( i18n( "Minimum value:" ), groupBox ); + label = new TQLabel( i18n( "Minimum value:" ), groupBox ); boxLayout->addWidget( label, 1, 0 ); mMinValue = new KLineEdit( groupBox ); mMinValue->setAlignment( AlignRight ); mMinValue->setEnabled( false ); - QWhatsThis::add( mMinValue, i18n( "Enter the minimum value for the display here. If both values are 0, automatic range detection is enabled." ) ); + TQWhatsThis::add( mMinValue, i18n( "Enter the minimum value for the display here. If both values are 0, automatic range detection is enabled." ) ); boxLayout->addWidget( mMinValue, 1, 1 ); label->setBuddy( mMinValue ); - label = new QLabel( i18n( "Maximum value:" ), groupBox ); + label = new TQLabel( i18n( "Maximum value:" ), groupBox ); boxLayout->addWidget( label, 1, 3 ); mMaxValue = new KLineEdit( groupBox ); mMaxValue->setAlignment( AlignRight ); mMaxValue->setEnabled( false ); - QWhatsThis::add( mMaxValue, i18n( "Enter the maximum value for the display here. If both values are 0, automatic range detection is enabled." ) ); + TQWhatsThis::add( mMaxValue, i18n( "Enter the maximum value for the display here. If both values are 0, automatic range detection is enabled." ) ); boxLayout->addWidget( mMaxValue, 1, 4 ); label->setBuddy( mMaxValue ); pageLayout->addWidget( groupBox, 0, 0 ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Horizontal Scale" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 2, 2, spacingHint() ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Horizontal Scale" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 2, 2, spacingHint() ); boxLayout->setRowStretch( 1, 1 ); mHorizontalScale = new KIntNumInput( 1, groupBox ); @@ -117,47 +117,47 @@ FancyPlotterSettings::FancyPlotterSettings( QWidget* parent, const char* name ) mHorizontalScale->setMaxValue( 50 ); boxLayout->addWidget( mHorizontalScale, 0, 0 ); - label = new QLabel( i18n( "pixel(s) per time period" ), groupBox ); + label = new TQLabel( i18n( "pixel(s) per time period" ), groupBox ); boxLayout->addWidget( label, 0, 1 ); pageLayout->addWidget( groupBox, 1, 0 ); // Grid page page = addPage( i18n( "Grid" ) ); - pageLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); + pageLayout = new TQGridLayout( page, 3, 2, 0, spacingHint() ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Lines" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 2, 5, spacingHint() ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Lines" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 2, 5, spacingHint() ); boxLayout->setColStretch( 1, 1 ); - mShowVerticalLines = new QCheckBox( i18n( "Vertical lines" ), groupBox ); - QWhatsThis::add( mShowVerticalLines, i18n( "Check this to activate the vertical lines if display is large enough." ) ); + mShowVerticalLines = new TQCheckBox( i18n( "Vertical lines" ), groupBox ); + TQWhatsThis::add( mShowVerticalLines, i18n( "Check this to activate the vertical lines if display is large enough." ) ); boxLayout->addWidget( mShowVerticalLines, 0, 0 ); - label = new QLabel( i18n( "Distance:" ), groupBox ); + label = new TQLabel( i18n( "Distance:" ), groupBox ); boxLayout->addWidget( label, 0, 2 ); mVerticalLinesDistance = new KIntNumInput( 0, groupBox ); mVerticalLinesDistance->setMinValue( 10 ); mVerticalLinesDistance->setMaxValue( 120 ); - QWhatsThis::add( mVerticalLinesDistance, i18n( "Enter the distance between two vertical lines here." ) ); + TQWhatsThis::add( mVerticalLinesDistance, i18n( "Enter the distance between two vertical lines here." ) ); boxLayout->addWidget( mVerticalLinesDistance , 0, 3 ); label->setBuddy( mVerticalLinesDistance ); - mVerticalLinesScroll = new QCheckBox( i18n( "Vertical lines scroll" ), groupBox ); + mVerticalLinesScroll = new TQCheckBox( i18n( "Vertical lines scroll" ), groupBox ); boxLayout->addWidget( mVerticalLinesScroll, 0, 4 ); - mShowHorizontalLines = new QCheckBox( i18n( "Horizontal lines" ), groupBox ); - QWhatsThis::add( mShowHorizontalLines, i18n( "Check this to enable horizontal lines if display is large enough." ) ); + mShowHorizontalLines = new TQCheckBox( i18n( "Horizontal lines" ), groupBox ); + TQWhatsThis::add( mShowHorizontalLines, i18n( "Check this to enable horizontal lines if display is large enough." ) ); boxLayout->addWidget( mShowHorizontalLines, 1, 0 ); - label = new QLabel( i18n( "Count:" ), groupBox ); + label = new TQLabel( i18n( "Count:" ), groupBox ); boxLayout->addWidget( label, 1, 2 ); mHorizontalLinesCount = new KIntNumInput( 0, groupBox ); mHorizontalLinesCount->setMinValue( 1 ); mHorizontalLinesCount->setMaxValue( 100 ); - QWhatsThis::add( mHorizontalLinesCount, i18n( "Enter the number of horizontal lines here." ) ); + TQWhatsThis::add( mHorizontalLinesCount, i18n( "Enter the number of horizontal lines here." ) ); boxLayout->addWidget( mHorizontalLinesCount , 1, 3 ); label->setBuddy( mHorizontalLinesCount ); @@ -165,15 +165,15 @@ FancyPlotterSettings::FancyPlotterSettings( QWidget* parent, const char* name ) pageLayout->addMultiCellWidget( groupBox, 0, 0, 0, 1 ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Text" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 3, 4, spacingHint() ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Text" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 3, 4, spacingHint() ); boxLayout->setColStretch( 1, 1 ); - mShowLabels = new QCheckBox( i18n( "Labels" ), groupBox ); - QWhatsThis::add( mShowLabels, i18n( "Check this box if horizontal lines should be decorated with the values they mark." ) ); + mShowLabels = new TQCheckBox( i18n( "Labels" ), groupBox ); + TQWhatsThis::add( mShowLabels, i18n( "Check this box if horizontal lines should be decorated with the values they mark." ) ); boxLayout->addWidget( mShowLabels, 0, 0 ); - label = new QLabel( i18n( "Font size:" ), groupBox ); + label = new TQLabel( i18n( "Font size:" ), groupBox ); boxLayout->addWidget( label, 0, 2 ); mFontSize = new KIntNumInput( 9, groupBox ); @@ -182,32 +182,32 @@ FancyPlotterSettings::FancyPlotterSettings( QWidget* parent, const char* name ) boxLayout->addWidget( mFontSize, 0, 3 ); label->setBuddy( mFontSize ); - mShowTopBar = new QCheckBox( i18n( "Top bar" ), groupBox ); - QWhatsThis::add( mShowTopBar, i18n( "Check this to active the display title bar. This is probably only useful for applet displays. The bar is only visible if the display is large enough." ) ); + mShowTopBar = new TQCheckBox( i18n( "Top bar" ), groupBox ); + TQWhatsThis::add( mShowTopBar, i18n( "Check this to active the display title bar. This is probably only useful for applet displays. The bar is only visible if the display is large enough." ) ); boxLayout->addWidget( mShowTopBar, 1, 0 ); boxLayout->setRowStretch( 2, 1 ); pageLayout->addWidget( groupBox, 1, 0 ); - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Colors" ), page ); - boxLayout = new QGridLayout( groupBox->layout(), 4, 2, spacingHint() ); + groupBox = new TQGroupBox( 0, Qt::Vertical, i18n( "Colors" ), page ); + boxLayout = new TQGridLayout( groupBox->layout(), 4, 2, spacingHint() ); - label = new QLabel( i18n( "Vertical lines:" ), groupBox ); + label = new TQLabel( i18n( "Vertical lines:" ), groupBox ); boxLayout->addWidget( label, 0, 0 ); mVerticalLinesColor = new KColorButton( groupBox ); boxLayout->addWidget( mVerticalLinesColor, 0, 1 ); label->setBuddy( mVerticalLinesColor ); - label = new QLabel( i18n( "Horizontal lines:" ), groupBox ); + label = new TQLabel( i18n( "Horizontal lines:" ), groupBox ); boxLayout->addWidget( label, 1, 0 ); mHorizontalLinesColor = new KColorButton( groupBox ); boxLayout->addWidget( mHorizontalLinesColor, 1, 1 ); label->setBuddy( mHorizontalLinesColor ); - label = new QLabel( i18n( "Background:" ), groupBox ); + label = new TQLabel( i18n( "Background:" ), groupBox ); boxLayout->addWidget( label, 2, 0 ); mBackgroundColor = new KColorButton( groupBox ); @@ -222,7 +222,7 @@ FancyPlotterSettings::FancyPlotterSettings( QWidget* parent, const char* name ) // Sensors page page = addPage( i18n( "Sensors" ) ); - pageLayout = new QGridLayout( page, 6, 2, 0, spacingHint() ); + pageLayout = new TQGridLayout( page, 6, 2, 0, spacingHint() ); pageLayout->setRowStretch( 2, 1 ); pageLayout->setRowStretch( 5, 1 ); @@ -232,55 +232,55 @@ FancyPlotterSettings::FancyPlotterSettings( QWidget* parent, const char* name ) mSensorView->addColumn( i18n( "Sensor" ) ); mSensorView->addColumn( i18n( "Unit" ) ); mSensorView->addColumn( i18n( "Status" ) ); - mSensorView->setResizeMode(QListView::LastColumn); + mSensorView->setResizeMode(TQListView::LastColumn); mSensorView->header()->setResizeEnabled(false, 0); mSensorView->hideColumn(0); mSensorView->header()->resizeSection(0, 0); mSensorView->setAllColumnsShowFocus( true ); pageLayout->addMultiCellWidget( mSensorView, 0, 5, 0, 0 ); mSensorView->setSortColumn ( -1 ); - mEditButton = new QPushButton( i18n( "Set Color..." ), page ); + mEditButton = new TQPushButton( i18n( "Set Color..." ), page ); mEditButton->setEnabled( false ); - QWhatsThis::add( mEditButton, i18n( "Push this button to configure the color of the sensor in the diagram." ) ); + TQWhatsThis::add( mEditButton, i18n( "Push this button to configure the color of the sensor in the diagram." ) ); pageLayout->addWidget( mEditButton, 0, 1 ); - mRemoveButton = new QPushButton( i18n( "Delete" ), page ); + mRemoveButton = new TQPushButton( i18n( "Delete" ), page ); mRemoveButton->setEnabled( false ); - QWhatsThis::add( mRemoveButton, i18n( "Push this button to delete the sensor." ) ); + TQWhatsThis::add( mRemoveButton, i18n( "Push this button to delete the sensor." ) ); pageLayout->addWidget( mRemoveButton, 1, 1 ); - mMoveUpButton = new QPushButton( i18n( "Move Up" ), page ); + mMoveUpButton = new TQPushButton( i18n( "Move Up" ), page ); mMoveUpButton->setEnabled( false ); pageLayout->addWidget( mMoveUpButton, 3, 1 ); - mMoveDownButton = new QPushButton( i18n( "Move Down" ), page ); + mMoveDownButton = new TQPushButton( i18n( "Move Down" ), page ); mMoveDownButton->setEnabled( false ); pageLayout->addWidget( mMoveDownButton, 4, 1 ); - connect( mUseAutoRange, SIGNAL( toggled( bool ) ), mMinValue, - SLOT( setDisabled( bool ) ) ); - connect( mUseAutoRange, SIGNAL( toggled( bool ) ), mMaxValue, - SLOT( setDisabled( bool ) ) ); - connect( mShowVerticalLines, SIGNAL( toggled( bool ) ), mVerticalLinesDistance, - SLOT( setEnabled( bool ) ) ); - connect( mShowVerticalLines, SIGNAL( toggled( bool ) ), mVerticalLinesScroll, - SLOT( setEnabled( bool ) ) ); - connect( mShowVerticalLines, SIGNAL( toggled( bool ) ), mVerticalLinesColor, - SLOT( setEnabled( bool ) ) ); - connect( mShowHorizontalLines, SIGNAL( toggled( bool ) ), mHorizontalLinesCount, - SLOT( setEnabled( bool ) ) ); - connect( mShowHorizontalLines, SIGNAL( toggled( bool ) ), mHorizontalLinesColor, - SLOT( setEnabled( bool ) ) ); - connect( mShowHorizontalLines, SIGNAL( toggled( bool ) ), mShowLabels, - SLOT( setEnabled( bool ) ) ); - connect( mSensorView, SIGNAL( selectionChanged( QListViewItem* ) ), - SLOT( selectionChanged( QListViewItem* ) ) ); - - connect( mEditButton, SIGNAL( clicked() ), SLOT( editSensor() ) ); - connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeSensor() ) ); - connect( mMoveUpButton, SIGNAL( clicked() ), SLOT( moveUpSensor() ) ); - connect( mMoveDownButton, SIGNAL( clicked() ), SLOT( moveDownSensor() ) ); - connect ( mSensorView, SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int )), SLOT(editSensor())); + connect( mUseAutoRange, TQT_SIGNAL( toggled( bool ) ), mMinValue, + TQT_SLOT( setDisabled( bool ) ) ); + connect( mUseAutoRange, TQT_SIGNAL( toggled( bool ) ), mMaxValue, + TQT_SLOT( setDisabled( bool ) ) ); + connect( mShowVerticalLines, TQT_SIGNAL( toggled( bool ) ), mVerticalLinesDistance, + TQT_SLOT( setEnabled( bool ) ) ); + connect( mShowVerticalLines, TQT_SIGNAL( toggled( bool ) ), mVerticalLinesScroll, + TQT_SLOT( setEnabled( bool ) ) ); + connect( mShowVerticalLines, TQT_SIGNAL( toggled( bool ) ), mVerticalLinesColor, + TQT_SLOT( setEnabled( bool ) ) ); + connect( mShowHorizontalLines, TQT_SIGNAL( toggled( bool ) ), mHorizontalLinesCount, + TQT_SLOT( setEnabled( bool ) ) ); + connect( mShowHorizontalLines, TQT_SIGNAL( toggled( bool ) ), mHorizontalLinesColor, + TQT_SLOT( setEnabled( bool ) ) ); + connect( mShowHorizontalLines, TQT_SIGNAL( toggled( bool ) ), mShowLabels, + TQT_SLOT( setEnabled( bool ) ) ); + connect( mSensorView, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ), + TQT_SLOT( selectionChanged( TQListViewItem* ) ) ); + + connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editSensor() ) ); + connect( mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeSensor() ) ); + connect( mMoveUpButton, TQT_SIGNAL( clicked() ), TQT_SLOT( moveUpSensor() ) ); + connect( mMoveDownButton, TQT_SIGNAL( clicked() ), TQT_SLOT( moveDownSensor() ) ); + connect ( mSensorView, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int )), TQT_SLOT(editSensor())); KAcceleratorManager::manage( this ); } @@ -289,12 +289,12 @@ FancyPlotterSettings::~FancyPlotterSettings() { } -void FancyPlotterSettings::setTitle( const QString &title ) +void FancyPlotterSettings::setTitle( const TQString &title ) { mTitle->setText( title ); } -QString FancyPlotterSettings::title() const +TQString FancyPlotterSettings::title() const { return mTitle->text(); } @@ -313,7 +313,7 @@ bool FancyPlotterSettings::useAutoRange() const void FancyPlotterSettings::setMinValue( double min ) { - mMinValue->setText( QString::number( min ) ); + mMinValue->setText( TQString::number( min ) ); } double FancyPlotterSettings::minValue() const @@ -323,7 +323,7 @@ double FancyPlotterSettings::minValue() const void FancyPlotterSettings::setMaxValue( double max ) { - mMaxValue->setText( QString::number( max ) ); + mMaxValue->setText( TQString::number( max ) ); } double FancyPlotterSettings::maxValue() const @@ -367,12 +367,12 @@ bool FancyPlotterSettings::showVerticalLines() const return mShowVerticalLines->isChecked(); } -void FancyPlotterSettings::setVerticalLinesColor( const QColor &color ) +void FancyPlotterSettings::setVerticalLinesColor( const TQColor &color ) { mVerticalLinesColor->setColor( color ); } -QColor FancyPlotterSettings::verticalLinesColor() const +TQColor FancyPlotterSettings::verticalLinesColor() const { return mVerticalLinesColor->color(); } @@ -411,12 +411,12 @@ bool FancyPlotterSettings::showHorizontalLines() const return mShowHorizontalLines->isChecked(); } -void FancyPlotterSettings::setHorizontalLinesColor( const QColor &color ) +void FancyPlotterSettings::setHorizontalLinesColor( const TQColor &color ) { mHorizontalLinesColor->setColor( color ); } -QColor FancyPlotterSettings::horizontalLinesColor() const +TQColor FancyPlotterSettings::horizontalLinesColor() const { return mHorizontalLinesColor->color(); } @@ -461,12 +461,12 @@ int FancyPlotterSettings::fontSize() const return mFontSize->value(); } -void FancyPlotterSettings::setBackgroundColor( const QColor &color ) +void FancyPlotterSettings::setBackgroundColor( const TQColor &color ) { mBackgroundColor->setColor( color ); } -QColor FancyPlotterSettings::backgroundColor() const +TQColor FancyPlotterSettings::backgroundColor() const { return mBackgroundColor->color(); } @@ -474,16 +474,16 @@ void FancyPlotterSettings::clearDeleted() { mDeleted.clear(); } -QValueList<int> FancyPlotterSettings::deleted() const +TQValueList<int> FancyPlotterSettings::deleted() const { return mDeleted; } -QValueList<int> FancyPlotterSettings::order() const +TQValueList<int> FancyPlotterSettings::order() const { - QValueList<int> newOrder; + TQValueList<int> newOrder; - QListViewItemIterator it( mSensorView ); + TQListViewItemIterator it( mSensorView ); for ( ; it.current(); ++it ) { newOrder.prepend(it.current()->text(0).toInt()); } @@ -493,46 +493,46 @@ QValueList<int> FancyPlotterSettings::order() const void FancyPlotterSettings::resetOrder() { int i = mSensorView->childCount()-1; - QListViewItemIterator it( mSensorView ); + TQListViewItemIterator it( mSensorView ); for ( ; it.current(); ++it, --i) { - it.current()->setText(0, QString::number(i)); + it.current()->setText(0, TQString::number(i)); } } -void FancyPlotterSettings::setSensors( const QValueList< QStringList > &list ) +void FancyPlotterSettings::setSensors( const TQValueList< TQStringList > &list ) { mSensorView->clear(); - QValueList< QStringList >::ConstIterator it; + TQValueList< TQStringList >::ConstIterator it; for ( it = list.begin(); it != list.end(); ++it ) { - QListViewItem* lvi = new QListViewItem( mSensorView, + TQListViewItem* lvi = new TQListViewItem( mSensorView, (*it)[ 0 ], // id (*it)[ 1 ], // host name (*it)[ 2 ], // sensor name (*it)[ 3 ], // unit (*it)[ 4 ] ); // status - QPixmap pm( 12, 12 ); - pm.fill( QColor( (*it)[ 5 ] ) ); + TQPixmap pm( 12, 12 ); + pm.fill( TQColor( (*it)[ 5 ] ) ); lvi->setPixmap( 2, pm ); mSensorView->insertItem( lvi ); } } -QValueList< QStringList > FancyPlotterSettings::sensors() const +TQValueList< TQStringList > FancyPlotterSettings::sensors() const { - QValueList< QStringList > list; + TQValueList< TQStringList > list; - QListViewItemIterator it( mSensorView ); + TQListViewItemIterator it( mSensorView ); for ( ; it.current(); ++it ) { - QStringList entry; + TQStringList entry; entry << it.current()->text( 0 ); entry << it.current()->text( 1 ); entry << it.current()->text( 2 ); entry << it.current()->text( 3 ); entry << it.current()->text( 4 ); QRgb rgb = it.current()->pixmap( 2 )->convertToImage().pixel( 1, 1 ); - QColor color( qRed( rgb ), qGreen( rgb ), qBlue( rgb ) ); + TQColor color( qRed( rgb ), qGreen( rgb ), qBlue( rgb ) ); entry << ( color.name() ); list.prepend( entry ); @@ -543,15 +543,15 @@ QValueList< QStringList > FancyPlotterSettings::sensors() const void FancyPlotterSettings::editSensor() { - QListViewItem* lvi = mSensorView->currentItem(); + TQListViewItem* lvi = mSensorView->currentItem(); if ( !lvi ) return; - QColor color = lvi->pixmap( 2 )->convertToImage().pixel( 1, 1 ); + TQColor color = lvi->pixmap( 2 )->convertToImage().pixel( 1, 1 ); int result = KColorDialog::getColor( color, parentWidget() ); if ( result == KColorDialog::Accepted ) { - QPixmap newPm( 12, 12 ); + TQPixmap newPm( 12, 12 ); newPm.fill( color ); lvi->setPixmap( 2, newPm ); } @@ -559,7 +559,7 @@ void FancyPlotterSettings::editSensor() void FancyPlotterSettings::removeSensor() { - QListViewItem* lvi = mSensorView->currentItem(); + TQListViewItem* lvi = mSensorView->currentItem(); if ( lvi ) { //Note down the id of the one we are deleting @@ -571,7 +571,7 @@ void FancyPlotterSettings::removeSensor() * items can be deleted without forcing the user to select a new * item between the deletes. If all items are deleted, the buttons * are disabled again. */ - QListViewItem* newSelected = 0; + TQListViewItem* newSelected = 0; if ( lvi->itemBelow() ) { lvi->itemBelow()->setSelected( true ); newSelected = lvi->itemBelow(); @@ -583,10 +583,10 @@ void FancyPlotterSettings::removeSensor() delete lvi; - QListViewItemIterator it( mSensorView ); + TQListViewItemIterator it( mSensorView ); for ( ; it.current(); ++it ) { if(it.current()->text(0).toInt() > id) - it.current()->setText(0, QString::number(it.current()->text(0).toInt() -1)); + it.current()->setText(0, TQString::number(it.current()->text(0).toInt() -1)); } @@ -598,7 +598,7 @@ void FancyPlotterSettings::removeSensor() void FancyPlotterSettings::moveUpSensor() { if ( mSensorView->currentItem() != 0 ) { - QListViewItem* item = mSensorView->currentItem()->itemAbove(); + TQListViewItem* item = mSensorView->currentItem()->itemAbove(); if ( item ) { if ( item->itemAbove() ) { @@ -624,7 +624,7 @@ void FancyPlotterSettings::moveDownSensor() } } -void FancyPlotterSettings::selectionChanged( QListViewItem *item ) +void FancyPlotterSettings::selectionChanged( TQListViewItem *item ) { bool state = ( item != 0 ); diff --git a/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.h b/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.h index b813bee34..08e73feca 100644 --- a/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.h +++ b/ksysguard/gui/SensorDisplayLib/FancyPlotterSettings.h @@ -41,11 +41,11 @@ class FancyPlotterSettings : public KDialogBase Q_OBJECT public: - FancyPlotterSettings( QWidget* parent = 0, const char* name = 0 ); + FancyPlotterSettings( TQWidget* parent = 0, const char* name = 0 ); ~FancyPlotterSettings(); - void setTitle( const QString &title ); - QString title() const; + void setTitle( const TQString &title ); + TQString title() const; void setUseAutoRange( bool value ); bool useAutoRange() const; @@ -65,8 +65,8 @@ class FancyPlotterSettings : public KDialogBase void setShowVerticalLines( bool value ); bool showVerticalLines() const; - void setVerticalLinesColor( const QColor &color ); - QColor verticalLinesColor() const; + void setVerticalLinesColor( const TQColor &color ); + TQColor verticalLinesColor() const; void setVerticalLinesDistance( int distance ); int verticalLinesDistance() const; @@ -77,8 +77,8 @@ class FancyPlotterSettings : public KDialogBase void setShowHorizontalLines( bool value ); bool showHorizontalLines() const; - void setHorizontalLinesColor( const QColor &color ); - QColor horizontalLinesColor() const; + void setHorizontalLinesColor( const TQColor &color ); + TQColor horizontalLinesColor() const; void setHorizontalLinesCount( int count ); int horizontalLinesCount() const; @@ -92,13 +92,13 @@ class FancyPlotterSettings : public KDialogBase void setFontSize( int size ); int fontSize() const; - void setBackgroundColor( const QColor &color ); - QColor backgroundColor() const; + void setBackgroundColor( const TQColor &color ); + TQColor backgroundColor() const; - void setSensors( const QValueList< QStringList > &list ); - QValueList< QStringList > sensors() const; - QValueList<int> order() const; - QValueList<int> deleted() const; + void setSensors( const TQValueList< TQStringList > &list ); + TQValueList< TQStringList > sensors() const; + TQValueList<int> order() const; + TQValueList<int> deleted() const; void clearDeleted(); void resetOrder(); @@ -107,7 +107,7 @@ class FancyPlotterSettings : public KDialogBase void removeSensor(); void moveUpSensor(); void moveDownSensor(); - void selectionChanged( QListViewItem* ); + void selectionChanged( TQListViewItem* ); private: @@ -123,21 +123,21 @@ class FancyPlotterSettings : public KDialogBase KIntNumInput *mFontSize; KListView *mSensorView; - QCheckBox *mShowVerticalLines; - QCheckBox *mShowHorizontalLines; - QCheckBox *mVerticalLinesScroll; - QCheckBox *mUseAutoRange; - QCheckBox *mShowLabels; - QCheckBox *mShowTopBar; - QPushButton *mEditButton; - QPushButton *mRemoveButton; - QPushButton *mMoveUpButton; - QPushButton *mMoveDownButton; - QRadioButton *mUsePolygonStyle; - QRadioButton *mUseOriginalStyle; + TQCheckBox *mShowVerticalLines; + TQCheckBox *mShowHorizontalLines; + TQCheckBox *mVerticalLinesScroll; + TQCheckBox *mUseAutoRange; + TQCheckBox *mShowLabels; + TQCheckBox *mShowTopBar; + TQPushButton *mEditButton; + TQPushButton *mRemoveButton; + TQPushButton *mMoveUpButton; + TQPushButton *mMoveDownButton; + TQRadioButton *mUsePolygonStyle; + TQRadioButton *mUseOriginalStyle; /** The numbers of the sensors to be delete.*/ - QValueList<int> mDeleted; + TQValueList<int> mDeleted; }; #endif diff --git a/ksysguard/gui/SensorDisplayLib/ListView.cc b/ksysguard/gui/SensorDisplayLib/ListView.cc index 885daded6..c980196e6 100644 --- a/ksysguard/gui/SensorDisplayLib/ListView.cc +++ b/ksysguard/gui/SensorDisplayLib/ListView.cc @@ -26,7 +26,7 @@ #include <stdlib.h> #include <config.h> -#include <qdom.h> +#include <tqdom.h> #include <kcolorbutton.h> #include <kdebug.h> @@ -41,12 +41,12 @@ #include "ListViewSettings.h" PrivateListViewItem::PrivateListViewItem(PrivateListView *parent) - : QListViewItem(parent) + : TQListViewItem(parent) { _parent = parent; } -int PrivateListViewItem::compare( QListViewItem *item, int col, bool ascending ) const +int PrivateListViewItem::compare( TQListViewItem *item, int col, bool ascending ) const { int type = ((PrivateListView*)listView())->columnType( col ); @@ -79,9 +79,9 @@ int PrivateListViewItem::compare( QListViewItem *item, int col, bool ascending ) else return 1; } else if ( type == PrivateListView::DiskStat ) { - QString prev = key( col, ascending ); - QString next = item->key( col, ascending ); - QString prevKey, nextKey; + TQString prev = key( col, ascending ); + TQString next = item->key( col, ascending ); + TQString prevKey, nextKey; uint counter = prev.length(); for ( uint i = 0; i < counter; ++i ) @@ -102,19 +102,19 @@ int PrivateListViewItem::compare( QListViewItem *item, int col, bool ascending ) return key( col, ascending ).localeAwareCompare( item->key( col, ascending ) ); } -PrivateListView::PrivateListView(QWidget *parent, const char *name) - : QListView(parent, name) +PrivateListView::PrivateListView(TQWidget *parent, const char *name) + : TQListView(parent, name) { - QColorGroup cg = colorGroup(); + TQColorGroup cg = colorGroup(); - cg.setColor(QColorGroup::Link, KSGRD::Style->firstForegroundColor()); - cg.setColor(QColorGroup::Text, KSGRD::Style->secondForegroundColor()); - cg.setColor(QColorGroup::Base, KSGRD::Style->backgroundColor()); + cg.setColor(TQColorGroup::Link, KSGRD::Style->firstForegroundColor()); + cg.setColor(TQColorGroup::Text, KSGRD::Style->secondForegroundColor()); + cg.setColor(TQColorGroup::Base, KSGRD::Style->backgroundColor()); - setPalette(QPalette(cg, cg, cg)); + setPalette(TQPalette(cg, cg, cg)); } -void PrivateListView::update(const QString& answer) +void PrivateListView::update(const TQString& answer) { setUpdatesEnabled(false); viewport()->setUpdatesEnabled(false); @@ -172,9 +172,9 @@ void PrivateListView::removeColumns(void) removeColumn(i); } -void PrivateListView::addColumn(const QString& label, const QString& type) +void PrivateListView::addColumn(const TQString& label, const TQString& type) { - QListView::addColumn( label ); + TQListView::addColumn( label ); int col = columns() - 1; if (type == "s" || type == "S") @@ -197,18 +197,18 @@ void PrivateListView::addColumn(const QString& label, const QString& type) mColumnTypes.append( type ); /* Just use some sensible default values as initial setting. */ - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); setColumnWidth(col, fm.width(label) + 10); } -ListView::ListView(QWidget* parent, const char* name, const QString& title, int, int) +ListView::ListView(TQWidget* parent, const char* name, const TQString& title, int, int) : KSGRD::SensorDisplay(parent, name, title) { setBackgroundColor(KSGRD::Style->backgroundColor()); monitor = new PrivateListView( frame() ); Q_CHECK_PTR(monitor); - monitor->setSelectionMode(QListView::NoSelection); + monitor->setSelectionMode(TQListView::NoSelection); monitor->setItemMargin(2); setMinimumSize(50, 25); @@ -219,7 +219,7 @@ ListView::ListView(QWidget* parent, const char* name, const QString& title, int, } bool -ListView::addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString& title) +ListView::addSensor(const TQString& hostName, const TQString& sensorName, const TQString& sensorType, const TQString& title) { if (sensorType != "listview") return (false); @@ -243,7 +243,7 @@ ListView::updateList() } void -ListView::answerReceived(int id, const QString& answer) +ListView::answerReceived(int id, const TQString& answer) { /* We received something, so the sensor is probably ok. */ sensorError(id, false); @@ -279,23 +279,23 @@ ListView::answerReceived(int id, const QString& answer) } void -ListView::resizeEvent(QResizeEvent*) +ListView::resizeEvent(TQResizeEvent*) { frame()->setGeometry(0, 0, width(), height()); monitor->setGeometry(10, 20, width() - 20, height() - 30); } bool -ListView::restoreSettings(QDomElement& element) +ListView::restoreSettings(TQDomElement& element) { addSensor(element.attribute("hostName"), element.attribute("sensorName"), (element.attribute("sensorType").isEmpty() ? "listview" : element.attribute("sensorType")), element.attribute("title")); - QColorGroup colorGroup = monitor->colorGroup(); - colorGroup.setColor(QColorGroup::Link, restoreColor(element, "gridColor", KSGRD::Style->firstForegroundColor())); - colorGroup.setColor(QColorGroup::Text, restoreColor(element, "textColor", KSGRD::Style->secondForegroundColor())); - colorGroup.setColor(QColorGroup::Base, restoreColor(element, "backgroundColor", KSGRD::Style->backgroundColor())); + TQColorGroup colorGroup = monitor->colorGroup(); + colorGroup.setColor(TQColorGroup::Link, restoreColor(element, "gridColor", KSGRD::Style->firstForegroundColor())); + colorGroup.setColor(TQColorGroup::Text, restoreColor(element, "textColor", KSGRD::Style->secondForegroundColor())); + colorGroup.setColor(TQColorGroup::Base, restoreColor(element, "backgroundColor", KSGRD::Style->backgroundColor())); - monitor->setPalette(QPalette(colorGroup, colorGroup, colorGroup)); + monitor->setPalette(TQPalette(colorGroup, colorGroup, colorGroup)); SensorDisplay::restoreSettings(element); @@ -305,16 +305,16 @@ ListView::restoreSettings(QDomElement& element) } bool -ListView::saveSettings(QDomDocument& doc, QDomElement& element, bool save) +ListView::saveSettings(TQDomDocument& doc, TQDomElement& element, bool save) { element.setAttribute("hostName", sensors().at(0)->hostName()); element.setAttribute("sensorName", sensors().at(0)->name()); element.setAttribute("sensorType", sensors().at(0)->type()); - QColorGroup colorGroup = monitor->colorGroup(); - saveColor(element, "gridColor", colorGroup.color(QColorGroup::Link)); - saveColor(element, "textColor", colorGroup.color(QColorGroup::Text)); - saveColor(element, "backgroundColor", colorGroup.color(QColorGroup::Base)); + TQColorGroup colorGroup = monitor->colorGroup(); + saveColor(element, "gridColor", colorGroup.color(TQColorGroup::Link)); + saveColor(element, "textColor", colorGroup.color(TQColorGroup::Text)); + saveColor(element, "backgroundColor", colorGroup.color(TQColorGroup::Base)); SensorDisplay::saveSettings(doc, element); @@ -329,12 +329,12 @@ ListView::configureSettings() { lvs = new ListViewSettings(this, "ListViewSettings"); Q_CHECK_PTR(lvs); - connect(lvs, SIGNAL(applyClicked()), SLOT(applySettings())); + connect(lvs, TQT_SIGNAL(applyClicked()), TQT_SLOT(applySettings())); - QColorGroup colorGroup = monitor->colorGroup(); - lvs->setGridColor(colorGroup.color(QColorGroup::Link)); - lvs->setTextColor(colorGroup.color(QColorGroup::Text)); - lvs->setBackgroundColor(colorGroup.color(QColorGroup::Base)); + TQColorGroup colorGroup = monitor->colorGroup(); + lvs->setGridColor(colorGroup.color(TQColorGroup::Link)); + lvs->setTextColor(colorGroup.color(TQColorGroup::Text)); + lvs->setBackgroundColor(colorGroup.color(TQColorGroup::Base)); lvs->setTitle(title()); if (lvs->exec()) @@ -347,11 +347,11 @@ ListView::configureSettings() void ListView::applySettings() { - QColorGroup colorGroup = monitor->colorGroup(); - colorGroup.setColor(QColorGroup::Link, lvs->gridColor()); - colorGroup.setColor(QColorGroup::Text, lvs->textColor()); - colorGroup.setColor(QColorGroup::Base, lvs->backgroundColor()); - monitor->setPalette(QPalette(colorGroup, colorGroup, colorGroup)); + TQColorGroup colorGroup = monitor->colorGroup(); + colorGroup.setColor(TQColorGroup::Link, lvs->gridColor()); + colorGroup.setColor(TQColorGroup::Text, lvs->textColor()); + colorGroup.setColor(TQColorGroup::Base, lvs->backgroundColor()); + monitor->setPalette(TQPalette(colorGroup, colorGroup, colorGroup)); setTitle(lvs->title()); @@ -361,11 +361,11 @@ ListView::applySettings() void ListView::applyStyle() { - QColorGroup colorGroup = monitor->colorGroup(); - colorGroup.setColor(QColorGroup::Link, KSGRD::Style->firstForegroundColor()); - colorGroup.setColor(QColorGroup::Text, KSGRD::Style->secondForegroundColor()); - colorGroup.setColor(QColorGroup::Base, KSGRD::Style->backgroundColor()); - monitor->setPalette(QPalette(colorGroup, colorGroup, colorGroup)); + TQColorGroup colorGroup = monitor->colorGroup(); + colorGroup.setColor(TQColorGroup::Link, KSGRD::Style->firstForegroundColor()); + colorGroup.setColor(TQColorGroup::Text, KSGRD::Style->secondForegroundColor()); + colorGroup.setColor(TQColorGroup::Base, KSGRD::Style->backgroundColor()); + monitor->setPalette(TQPalette(colorGroup, colorGroup, colorGroup)); setModified(true); } diff --git a/ksysguard/gui/SensorDisplayLib/ListView.h b/ksysguard/gui/SensorDisplayLib/ListView.h index 4b96329c0..c5e0a550c 100644 --- a/ksysguard/gui/SensorDisplayLib/ListView.h +++ b/ksysguard/gui/SensorDisplayLib/ListView.h @@ -24,8 +24,8 @@ #ifndef _ListView_h_ #define _ListView_h_ -#include <qlistview.h> -#include <qpainter.h> +#include <tqlistview.h> +#include <tqpainter.h> #include <SensorDisplay.h> @@ -41,15 +41,15 @@ class PrivateListView : public QListView public: enum ColumnType { Text, Int, Float, Time, DiskStat }; - PrivateListView(QWidget *parent = 0, const char *name = 0); + PrivateListView(TQWidget *parent = 0, const char *name = 0); - void addColumn(const QString& label, const QString& type); + void addColumn(const TQString& label, const TQString& type); void removeColumns(void); - void update(const QString& answer); + void update(const TQString& answer); int columnType( uint pos ) const; private: - QStringList mColumnTypes; + TQStringList mColumnTypes; }; class PrivateListViewItem : public QListViewItem @@ -57,43 +57,43 @@ class PrivateListViewItem : public QListViewItem public: PrivateListViewItem(PrivateListView *parent = 0); - void paintCell(QPainter *p, const QColorGroup &, int column, int width, int alignment) { - QColorGroup cgroup = _parent->colorGroup(); - QListViewItem::paintCell(p, cgroup, column, width, alignment); - p->setPen(cgroup.color(QColorGroup::Link)); + void paintCell(TQPainter *p, const TQColorGroup &, int column, int width, int alignment) { + TQColorGroup cgroup = _parent->colorGroup(); + TQListViewItem::paintCell(p, cgroup, column, width, alignment); + p->setPen(cgroup.color(TQColorGroup::Link)); p->drawLine(0, height() - 1, width - 1, height() - 1); } - void paintFocus(QPainter *, const QColorGroup, const QRect) {} + void paintFocus(TQPainter *, const TQColorGroup, const TQRect) {} - virtual int compare( QListViewItem*, int column, bool ascending ) const; + virtual int compare( TQListViewItem*, int column, bool ascending ) const; private: - QWidget *_parent; + TQWidget *_parent; }; class ListView : public KSGRD::SensorDisplay { Q_OBJECT public: - ListView(QWidget* parent = 0, const char* name = 0, - const QString& = QString::null, int min = 0, int max = 0); + ListView(TQWidget* parent = 0, const char* name = 0, + const TQString& = TQString::null, int min = 0, int max = 0); ~ListView() {} - bool addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString& sensorDescr); - void answerReceived(int id, const QString& answer); - void resizeEvent(QResizeEvent*); + bool addSensor(const TQString& hostName, const TQString& sensorName, const TQString& sensorType, const TQString& sensorDescr); + void answerReceived(int id, const TQString& answer); + void resizeEvent(TQResizeEvent*); void updateList(); - bool restoreSettings(QDomElement& element); - bool saveSettings(QDomDocument& doc, QDomElement& element, bool save = true); + bool restoreSettings(TQDomElement& element); + bool saveSettings(TQDomDocument& doc, TQDomElement& element, bool save = true); virtual bool hasSettingsDialog() const { return (true); } - virtual void timerEvent(QTimerEvent*) + virtual void timerEvent(TQTimerEvent*) { updateList(); } diff --git a/ksysguard/gui/SensorDisplayLib/ListViewSettings.cc b/ksysguard/gui/SensorDisplayLib/ListViewSettings.cc index 15822206e..81a9b2d41 100644 --- a/ksysguard/gui/SensorDisplayLib/ListViewSettings.cc +++ b/ksysguard/gui/SensorDisplayLib/ListViewSettings.cc @@ -22,7 +22,7 @@ #include <klocale.h> -ListViewSettings::ListViewSettings( QWidget *parent, const char *name ) +ListViewSettings::ListViewSettings( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "List View Settings" ), Ok|Apply|Cancel, Ok, true ) { @@ -30,42 +30,42 @@ ListViewSettings::ListViewSettings( QWidget *parent, const char *name ) setMainWidget( m_settingsWidget ); } -QString ListViewSettings::title() const +TQString ListViewSettings::title() const { return m_settingsWidget->title(); } -QColor ListViewSettings::textColor() const +TQColor ListViewSettings::textColor() const { return m_settingsWidget->textColor(); } -QColor ListViewSettings::backgroundColor() const +TQColor ListViewSettings::backgroundColor() const { return m_settingsWidget->backgroundColor(); } -QColor ListViewSettings::gridColor() const +TQColor ListViewSettings::gridColor() const { return m_settingsWidget->gridColor(); } -void ListViewSettings::setTitle( const QString &title ) +void ListViewSettings::setTitle( const TQString &title ) { m_settingsWidget->setTitle( title ); } -void ListViewSettings::setBackgroundColor( const QColor &c ) +void ListViewSettings::setBackgroundColor( const TQColor &c ) { m_settingsWidget->setBackgroundColor( c ); } -void ListViewSettings::setTextColor( const QColor &c ) +void ListViewSettings::setTextColor( const TQColor &c ) { m_settingsWidget->setTextColor( c ); } -void ListViewSettings::setGridColor( const QColor &c ) +void ListViewSettings::setGridColor( const TQColor &c ) { m_settingsWidget->setGridColor( c ); } diff --git a/ksysguard/gui/SensorDisplayLib/ListViewSettings.h b/ksysguard/gui/SensorDisplayLib/ListViewSettings.h index 9a9790791..06a0b4002 100644 --- a/ksysguard/gui/SensorDisplayLib/ListViewSettings.h +++ b/ksysguard/gui/SensorDisplayLib/ListViewSettings.h @@ -23,8 +23,8 @@ #include <kdialogbase.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> class ListViewSettingsWidget; @@ -34,17 +34,17 @@ class ListViewSettings : public KDialogBase public: - ListViewSettings( QWidget *parent=0, const char *name=0 ); + ListViewSettings( TQWidget *parent=0, const char *name=0 ); - QString title() const; - QColor textColor() const; - QColor backgroundColor() const; - QColor gridColor() const; + TQString title() const; + TQColor textColor() const; + TQColor backgroundColor() const; + TQColor gridColor() const; - void setTitle( const QString & ); - void setTextColor( const QColor & ); - void setBackgroundColor( const QColor & ); - void setGridColor( const QColor & ); + void setTitle( const TQString & ); + void setTextColor( const TQColor & ); + void setBackgroundColor( const TQColor & ); + void setGridColor( const TQColor & ); private: diff --git a/ksysguard/gui/SensorDisplayLib/ListViewSettingsWidget.ui.h b/ksysguard/gui/SensorDisplayLib/ListViewSettingsWidget.ui.h index 14ff5990d..e12bf2132 100644 --- a/ksysguard/gui/SensorDisplayLib/ListViewSettingsWidget.ui.h +++ b/ksysguard/gui/SensorDisplayLib/ListViewSettingsWidget.ui.h @@ -8,49 +8,49 @@ *****************************************************************************/ -QString ListViewSettingsWidget::title() +TQString ListViewSettingsWidget::title() { return m_title->text(); } -QColor ListViewSettingsWidget::gridColor() +TQColor ListViewSettingsWidget::gridColor() { return m_gridColor->color(); } -QColor ListViewSettingsWidget::backgroundColor() +TQColor ListViewSettingsWidget::backgroundColor() { return m_backgroundColor->color(); } -QColor ListViewSettingsWidget::textColor() +TQColor ListViewSettingsWidget::textColor() { return m_textColor->color(); } -void ListViewSettingsWidget::setTitle( const QString &t ) +void ListViewSettingsWidget::setTitle( const TQString &t ) { m_title->setText(t); } -void ListViewSettingsWidget::setBackgroundColor( const QColor &c ) +void ListViewSettingsWidget::setBackgroundColor( const TQColor &c ) { m_backgroundColor->setColor(c); } -void ListViewSettingsWidget::setTextColor( const QColor &c ) +void ListViewSettingsWidget::setTextColor( const TQColor &c ) { m_textColor->setColor(c); } -void ListViewSettingsWidget::setGridColor( const QColor &c ) +void ListViewSettingsWidget::setGridColor( const TQColor &c ) { m_gridColor->setColor(c); } diff --git a/ksysguard/gui/SensorDisplayLib/LogFile.cc b/ksysguard/gui/SensorDisplayLib/LogFile.cc index 9db4c7116..7de7899ab 100644 --- a/ksysguard/gui/SensorDisplayLib/LogFile.cc +++ b/ksysguard/gui/SensorDisplayLib/LogFile.cc @@ -21,11 +21,11 @@ #include <stdio.h> #include <sys/types.h> -#include <qpushbutton.h> -#include <qregexp.h> +#include <tqpushbutton.h> +#include <tqregexp.h> -#include <qfile.h> -#include <qlistbox.h> +#include <tqfile.h> +#include <tqlistbox.h> #include <kfontdialog.h> #include <kdebug.h> @@ -36,10 +36,10 @@ #include "LogFile.moc" -LogFile::LogFile(QWidget *parent, const char *name, const QString& title) +LogFile::LogFile(TQWidget *parent, const char *name, const TQString& title) : KSGRD::SensorDisplay(parent, name, title) { - monitor = new QListBox(this); + monitor = new TQListBox(this); Q_CHECK_PTR(monitor); setMinimumSize(50, 25); @@ -51,20 +51,20 @@ LogFile::LogFile(QWidget *parent, const char *name, const QString& title) LogFile::~LogFile(void) { - sendRequest(sensors().at(0)->hostName(), QString("logfile_unregister %1" ).arg(logFileID), 43); + sendRequest(sensors().at(0)->hostName(), TQString("logfile_unregister %1" ).arg(logFileID), 43); } bool -LogFile::addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString& title) +LogFile::addSensor(const TQString& hostName, const TQString& sensorName, const TQString& sensorType, const TQString& title) { if (sensorType != "logfile") return (false); registerSensor(new KSGRD::SensorProperties(hostName, sensorName, sensorType, title)); - QString sensorID = sensorName.right(sensorName.length() - (sensorName.findRev("/") + 1)); + TQString sensorID = sensorName.right(sensorName.length() - (sensorName.findRev("/") + 1)); - sendRequest(sensors().at(0)->hostName(), QString("logfile_register %1" ).arg(sensorID), 42); + sendRequest(sensors().at(0)->hostName(), TQString("logfile_register %1" ).arg(sensorID), 42); if (title.isEmpty()) setTitle(sensors().at(0)->hostName() + ":" + sensorID); @@ -79,7 +79,7 @@ LogFile::addSensor(const QString& hostName, const QString& sensorName, const QSt void LogFile::configureSettings(void) { - QColorGroup cgroup = monitor->colorGroup(); + TQColorGroup cgroup = monitor->colorGroup(); lfs = new LogFileSettings(this); Q_CHECK_PTR(lfs); @@ -92,16 +92,16 @@ void LogFile::configureSettings(void) lfs->ruleList->insertStringList(filterRules); lfs->title->setText(title()); - connect(lfs->okButton, SIGNAL(clicked()), lfs, SLOT(accept())); - connect(lfs->applyButton, SIGNAL(clicked()), this, SLOT(applySettings())); - connect(lfs->cancelButton, SIGNAL(clicked()), lfs, SLOT(reject())); + connect(lfs->okButton, TQT_SIGNAL(clicked()), lfs, TQT_SLOT(accept())); + connect(lfs->applyButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(applySettings())); + connect(lfs->cancelButton, TQT_SIGNAL(clicked()), lfs, TQT_SLOT(reject())); - connect(lfs->fontButton, SIGNAL(clicked()), this, SLOT(settingsFontSelection())); - connect(lfs->addButton, SIGNAL(clicked()), this, SLOT(settingsAddRule())); - connect(lfs->deleteButton, SIGNAL(clicked()), this, SLOT(settingsDeleteRule())); - connect(lfs->changeButton, SIGNAL(clicked()), this, SLOT(settingsChangeRule())); - connect(lfs->ruleList, SIGNAL(selected(int)), this, SLOT(settingsRuleListSelected(int))); - connect(lfs->ruleText, SIGNAL(returnPressed()), this, SLOT(settingsAddRule())); + connect(lfs->fontButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(settingsFontSelection())); + connect(lfs->addButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(settingsAddRule())); + connect(lfs->deleteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(settingsDeleteRule())); + connect(lfs->changeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(settingsChangeRule())); + connect(lfs->ruleList, TQT_SIGNAL(selected(int)), this, TQT_SLOT(settingsRuleListSelected(int))); + connect(lfs->ruleText, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(settingsAddRule())); if (lfs->exec()) { applySettings(); @@ -113,7 +113,7 @@ void LogFile::configureSettings(void) void LogFile::settingsFontSelection() { - QFont tmpFont = lfs->fontButton->font(); + TQFont tmpFont = lfs->fontButton->font(); if (KFontDialog::getFont(tmpFont) == KFontDialog::Accepted) { lfs->fontButton->setFont(tmpFont); @@ -147,11 +147,11 @@ void LogFile::settingsRuleListSelected(int index) void LogFile::applySettings(void) { - QColorGroup cgroup = monitor->colorGroup(); + TQColorGroup cgroup = monitor->colorGroup(); - cgroup.setColor(QColorGroup::Text, lfs->fgColor->color()); - cgroup.setColor(QColorGroup::Base, lfs->bgColor->color()); - monitor->setPalette(QPalette(cgroup, cgroup, cgroup)); + cgroup.setColor(TQColorGroup::Text, lfs->fgColor->color()); + cgroup.setColor(TQColorGroup::Base, lfs->bgColor->color()); + monitor->setPalette(TQPalette(cgroup, cgroup, cgroup)); monitor->setFont(lfs->fontButton->font()); filterRules.clear(); @@ -166,33 +166,33 @@ void LogFile::applySettings(void) void LogFile::applyStyle() { - QColorGroup cgroup = monitor->colorGroup(); + TQColorGroup cgroup = monitor->colorGroup(); - cgroup.setColor(QColorGroup::Text, KSGRD::Style->firstForegroundColor()); - cgroup.setColor(QColorGroup::Base, KSGRD::Style->backgroundColor()); - monitor->setPalette(QPalette(cgroup, cgroup, cgroup)); + cgroup.setColor(TQColorGroup::Text, KSGRD::Style->firstForegroundColor()); + cgroup.setColor(TQColorGroup::Base, KSGRD::Style->backgroundColor()); + monitor->setPalette(TQPalette(cgroup, cgroup, cgroup)); setModified(true); } bool -LogFile::restoreSettings(QDomElement& element) +LogFile::restoreSettings(TQDomElement& element) { - QFont font; - QColorGroup cgroup = monitor->colorGroup(); + TQFont font; + TQColorGroup cgroup = monitor->colorGroup(); - cgroup.setColor(QColorGroup::Text, restoreColor(element, "textColor", Qt::green)); - cgroup.setColor(QColorGroup::Base, restoreColor(element, "backgroundColor", Qt::black)); - monitor->setPalette(QPalette(cgroup, cgroup, cgroup)); + cgroup.setColor(TQColorGroup::Text, restoreColor(element, "textColor", Qt::green)); + cgroup.setColor(TQColorGroup::Base, restoreColor(element, "backgroundColor", Qt::black)); + monitor->setPalette(TQPalette(cgroup, cgroup, cgroup)); addSensor(element.attribute("hostName"), element.attribute("sensorName"), (element.attribute("sensorType").isEmpty() ? "logfile" : element.attribute("sensorType")), element.attribute("title")); font.fromString( element.attribute( "font" ) ); monitor->setFont(font); - QDomNodeList dnList = element.elementsByTagName("filter"); + TQDomNodeList dnList = element.elementsByTagName("filter"); for (uint i = 0; i < dnList.count(); i++) { - QDomElement element = dnList.item(i).toElement(); + TQDomElement element = dnList.item(i).toElement(); filterRules.append(element.attribute("rule")); } @@ -204,7 +204,7 @@ LogFile::restoreSettings(QDomElement& element) } bool -LogFile::saveSettings(QDomDocument& doc, QDomElement& element, bool save) +LogFile::saveSettings(TQDomDocument& doc, TQDomElement& element, bool save) { element.setAttribute("hostName", sensors().at(0)->hostName()); element.setAttribute("sensorName", sensors().at(0)->name()); @@ -215,10 +215,10 @@ LogFile::saveSettings(QDomDocument& doc, QDomElement& element, bool save) saveColor(element, "textColor", monitor->colorGroup().text()); saveColor(element, "backgroundColor", monitor->colorGroup().base()); - for (QStringList::Iterator it = filterRules.begin(); + for (TQStringList::Iterator it = filterRules.begin(); it != filterRules.end(); it++) { - QDomElement filter = doc.createElement("filter"); + TQDomElement filter = doc.createElement("filter"); filter.setAttribute("rule", (*it)); element.appendChild(filter); } @@ -235,11 +235,11 @@ void LogFile::updateMonitor() { sendRequest(sensors().at(0)->hostName(), - QString("%1 %2" ).arg(sensors().at(0)->name()).arg(logFileID), 19); + TQString("%1 %2" ).arg(sensors().at(0)->name()).arg(logFileID), 19); } void -LogFile::answerReceived(int id, const QString& answer) +LogFile::answerReceived(int id, const TQString& answer) { /* We received something, so the sensor is probably ok. */ sensorError(id, false); @@ -255,10 +255,10 @@ LogFile::answerReceived(int id, const QString& answer) monitor->insertItem(lines[i], -1); - for (QStringList::Iterator it = filterRules.begin(); it != filterRules.end(); it++) { - QRegExp *expr = new QRegExp((*it).latin1()); + for (TQStringList::Iterator it = filterRules.begin(); it != filterRules.end(); it++) { + TQRegExp *expr = new TQRegExp((*it).latin1()); if (expr->search(lines[i].latin1()) != -1) { - KNotifyClient::event(winId(), "pattern_match", QString("rule '%1' matched").arg((*it).latin1())); + KNotifyClient::event(winId(), "pattern_match", TQString("rule '%1' matched").arg((*it).latin1())); } delete expr; } @@ -278,7 +278,7 @@ LogFile::answerReceived(int id, const QString& answer) } void -LogFile::resizeEvent(QResizeEvent*) +LogFile::resizeEvent(TQResizeEvent*) { frame()->setGeometry(0, 0, this->width(), this->height()); monitor->setGeometry(10, 20, this->width() - 20, this->height() - 30); diff --git a/ksysguard/gui/SensorDisplayLib/LogFile.h b/ksysguard/gui/SensorDisplayLib/LogFile.h index 9428f934d..c17cc91eb 100644 --- a/ksysguard/gui/SensorDisplayLib/LogFile.h +++ b/ksysguard/gui/SensorDisplayLib/LogFile.h @@ -26,10 +26,10 @@ class QFile; class QListBox; -#include <qdom.h> -#include <qpopupmenu.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqpopupmenu.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <SensorDisplay.h> @@ -39,22 +39,22 @@ class LogFile : public KSGRD::SensorDisplay { Q_OBJECT public: - LogFile(QWidget *parent = 0, const char *name = 0, const QString& title = 0); + LogFile(TQWidget *parent = 0, const char *name = 0, const TQString& title = 0); ~LogFile(void); - bool addSensor(const QString& hostName, const QString& sensorName, - const QString& sensorType, const QString& sensorDescr); - void answerReceived(int id, const QString& answer); - void resizeEvent(QResizeEvent*); + bool addSensor(const TQString& hostName, const TQString& sensorName, + const TQString& sensorType, const TQString& sensorDescr); + void answerReceived(int id, const TQString& answer); + void resizeEvent(TQResizeEvent*); - bool restoreSettings(QDomElement& element); - bool saveSettings(QDomDocument& doc, QDomElement& element, bool save = true); + bool restoreSettings(TQDomElement& element); + bool saveSettings(TQDomDocument& doc, TQDomElement& element, bool save = true); void updateMonitor(void); void configureSettings(void); - virtual void timerEvent(QTimerEvent*) + virtual void timerEvent(TQTimerEvent*) { updateMonitor(); } @@ -76,8 +76,8 @@ public slots: private: LogFileSettings* lfs; - QListBox* monitor; - QStringList filterRules; + TQListBox* monitor; + TQStringList filterRules; unsigned long logFileID; }; diff --git a/ksysguard/gui/SensorDisplayLib/MultiMeter.cc b/ksysguard/gui/SensorDisplayLib/MultiMeter.cc index 14e805b9d..8a9cc9b60 100644 --- a/ksysguard/gui/SensorDisplayLib/MultiMeter.cc +++ b/ksysguard/gui/SensorDisplayLib/MultiMeter.cc @@ -24,9 +24,9 @@ #include <math.h> #include <stdlib.h> -#include <qdom.h> -#include <qlcdnumber.h> -#include <qtooltip.h> +#include <tqdom.h> +#include <tqlcdnumber.h> +#include <tqtooltip.h> #include <kdebug.h> @@ -36,8 +36,8 @@ #include "MultiMeter.moc" #include "MultiMeterSettings.h" -MultiMeter::MultiMeter(QWidget* parent, const char* name, - const QString& title, double, double, bool nf, bool isApplet) +MultiMeter::MultiMeter(TQWidget* parent, const char* name, + const TQString& title, double, double, bool nf, bool isApplet) : KSGRD::SensorDisplay(parent, name, title, nf, isApplet) { setShowUnit( true ); @@ -47,14 +47,14 @@ MultiMeter::MultiMeter(QWidget* parent, const char* name, normalDigitColor = KSGRD::Style->firstForegroundColor(); alarmDigitColor = KSGRD::Style->alarmColor(); if (noFrame()) - lcd = new QLCDNumber(this, "meterLCD"); + lcd = new TQLCDNumber(this, "meterLCD"); else - lcd = new QLCDNumber(frame(), "meterLCD"); + lcd = new TQLCDNumber(frame(), "meterLCD"); Q_CHECK_PTR(lcd); - lcd->setSegmentStyle(QLCDNumber::Filled); + lcd->setSegmentStyle(TQLCDNumber::Filled); setDigitColor(KSGRD::Style->backgroundColor()); - lcd->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Expanding, false)); + lcd->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, + TQSizePolicy::Expanding, false)); setBackgroundColor(KSGRD::Style->backgroundColor()); /* All RMB clicks to the lcd widget will be handled by @@ -68,8 +68,8 @@ MultiMeter::MultiMeter(QWidget* parent, const char* name, } bool -MultiMeter::addSensor(const QString& hostName, const QString& sensorName, - const QString& sensorType, const QString& title) +MultiMeter::addSensor(const TQString& hostName, const TQString& sensorName, + const TQString& sensorType, const TQString& title) { if (sensorType != "integer" && sensorType != "float") return (false); @@ -80,15 +80,15 @@ MultiMeter::addSensor(const QString& hostName, const QString& sensorName, * requests we use 100 for info requests. */ sendRequest(hostName, sensorName + "?", 100); - QToolTip::remove(lcd); - QToolTip::add(lcd, QString("%1:%2").arg(hostName).arg(sensorName)); + TQToolTip::remove(lcd); + TQToolTip::add(lcd, TQString("%1:%2").arg(hostName).arg(sensorName)); setModified(true); return (true); } void -MultiMeter::answerReceived(int id, const QString& answer) +MultiMeter::answerReceived(int id, const TQString& answer) { /* We received something, so the sensor is probably ok. */ sensorError(id, false); @@ -131,7 +131,7 @@ MultiMeter::answerReceived(int id, const QString& answer) } void -MultiMeter::resizeEvent(QResizeEvent*) +MultiMeter::resizeEvent(TQResizeEvent*) { if (noFrame()) lcd->setGeometry(0, 0, width(), height()); @@ -140,7 +140,7 @@ MultiMeter::resizeEvent(QResizeEvent*) } bool -MultiMeter::restoreSettings(QDomElement& element) +MultiMeter::restoreSettings(TQDomElement& element) { lowerLimitActive = element.attribute("lowerLimitActive").toInt(); lowerLimit = element.attribute("lowerLimit").toLong(); @@ -164,7 +164,7 @@ MultiMeter::restoreSettings(QDomElement& element) } bool -MultiMeter::saveSettings(QDomDocument& doc, QDomElement& element, bool save) +MultiMeter::saveSettings(TQDomDocument& doc, TQDomElement& element, bool save) { element.setAttribute("hostName", sensors().at(0)->hostName()); element.setAttribute("sensorName", sensors().at(0)->name()); @@ -202,7 +202,7 @@ MultiMeter::configureSettings() mms->setAlarmDigitColor(alarmDigitColor); mms->setMeterBackgroundColor(lcd->backgroundColor()); - connect(mms, SIGNAL(applyClicked()), SLOT(applySettings())); + connect(mms, TQT_SIGNAL(applyClicked()), TQT_SLOT(applySettings())); if (mms->exec()) applySettings(); @@ -239,20 +239,20 @@ MultiMeter::applyStyle() } void -MultiMeter::setDigitColor(const QColor& col) +MultiMeter::setDigitColor(const TQColor& col) { - QPalette p = lcd->palette(); - p.setColor(QColorGroup::Foreground, col); + TQPalette p = lcd->palette(); + p.setColor(TQColorGroup::Foreground, col); lcd->setPalette(p); } void -MultiMeter::setBackgroundColor(const QColor& col) +MultiMeter::setBackgroundColor(const TQColor& col) { lcd->setBackgroundColor(col); - QPalette p = lcd->palette(); - p.setColor(QColorGroup::Light, col); - p.setColor(QColorGroup::Dark, col); + TQPalette p = lcd->palette(); + p.setColor(TQColorGroup::Light, col); + p.setColor(TQColorGroup::Dark, col); lcd->setPalette(p); } diff --git a/ksysguard/gui/SensorDisplayLib/MultiMeter.h b/ksysguard/gui/SensorDisplayLib/MultiMeter.h index 58d2477c1..43c85be24 100644 --- a/ksysguard/gui/SensorDisplayLib/MultiMeter.h +++ b/ksysguard/gui/SensorDisplayLib/MultiMeter.h @@ -36,19 +36,19 @@ class MultiMeter : public KSGRD::SensorDisplay Q_OBJECT public: - MultiMeter(QWidget* parent = 0, const char* name = 0, - const QString& = QString::null, double min = 0, double max = 0, bool nf = false, bool isApplet = false); + MultiMeter(TQWidget* parent = 0, const char* name = 0, + const TQString& = TQString::null, double min = 0, double max = 0, bool nf = false, bool isApplet = false); virtual ~MultiMeter() { } - bool addSensor(const QString& hostName, const QString& sensorName, - const QString& sensorType, const QString& sensorDescr); - void answerReceived(int id, const QString& answer); - void resizeEvent(QResizeEvent*); + bool addSensor(const TQString& hostName, const TQString& sensorName, + const TQString& sensorType, const TQString& sensorDescr); + void answerReceived(int id, const TQString& answer); + void resizeEvent(TQResizeEvent*); - bool restoreSettings(QDomElement& element); - bool saveSettings(QDomDocument& doc, QDomElement& element, bool save = true); + bool restoreSettings(TQDomElement& element); + bool saveSettings(TQDomDocument& doc, TQDomElement& element, bool save = true); virtual bool hasSettingsDialog() const { @@ -62,12 +62,12 @@ public slots: void applyStyle(); private: - void setDigitColor(const QColor& col); - void setBackgroundColor(const QColor& col); + void setDigitColor(const TQColor& col); + void setBackgroundColor(const TQColor& col); - QLCDNumber* lcd; - QColor normalDigitColor; - QColor alarmDigitColor; + TQLCDNumber* lcd; + TQColor normalDigitColor; + TQColor alarmDigitColor; MultiMeterSettings* mms; bool lowerLimitActive; diff --git a/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.cc b/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.cc index 9114c583b..436c8540f 100644 --- a/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.cc +++ b/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.cc @@ -22,7 +22,7 @@ #include <klocale.h> -MultiMeterSettings::MultiMeterSettings( QWidget *parent, const char *name ) +MultiMeterSettings::MultiMeterSettings( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Multimeter Settings" ), Ok|Apply|Cancel, Ok, true ) { @@ -30,7 +30,7 @@ MultiMeterSettings::MultiMeterSettings( QWidget *parent, const char *name ) setMainWidget( m_settingsWidget ); } -QString MultiMeterSettings::title() +TQString MultiMeterSettings::title() { return m_settingsWidget->title(); } @@ -60,22 +60,22 @@ double MultiMeterSettings::upperLimit() return m_settingsWidget->upperLimit(); } -QColor MultiMeterSettings::normalDigitColor() +TQColor MultiMeterSettings::normalDigitColor() { return m_settingsWidget->normalDigitColor(); } -QColor MultiMeterSettings::alarmDigitColor() +TQColor MultiMeterSettings::alarmDigitColor() { return m_settingsWidget->alarmDigitColor(); } -QColor MultiMeterSettings::meterBackgroundColor() +TQColor MultiMeterSettings::meterBackgroundColor() { return m_settingsWidget->meterBackgroundColor(); } -void MultiMeterSettings::setTitle( const QString &title ) +void MultiMeterSettings::setTitle( const TQString &title ) { m_settingsWidget->setTitle( title ); } @@ -105,17 +105,17 @@ void MultiMeterSettings::setUpperLimit( double limit ) m_settingsWidget->setUpperLimit( limit ); } -void MultiMeterSettings::setNormalDigitColor( const QColor &c ) +void MultiMeterSettings::setNormalDigitColor( const TQColor &c ) { m_settingsWidget->setNormalDigitColor( c ); } -void MultiMeterSettings::setAlarmDigitColor( const QColor &c ) +void MultiMeterSettings::setAlarmDigitColor( const TQColor &c ) { m_settingsWidget->setAlarmDigitColor( c ); } -void MultiMeterSettings::setMeterBackgroundColor( const QColor &c ) +void MultiMeterSettings::setMeterBackgroundColor( const TQColor &c ) { m_settingsWidget->setMeterBackgroundColor( c ); } diff --git a/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.h b/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.h index 516a02128..e05946a08 100644 --- a/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.h +++ b/ksysguard/gui/SensorDisplayLib/MultiMeterSettings.h @@ -23,8 +23,8 @@ #include <kdialogbase.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> class MultiMeterSettingsWidget; @@ -34,27 +34,27 @@ class MultiMeterSettings : public KDialogBase public: - MultiMeterSettings( QWidget *parent=0, const char *name=0 ); + MultiMeterSettings( TQWidget *parent=0, const char *name=0 ); - QString title(); + TQString title(); bool showUnit(); bool lowerLimitActive(); bool upperLimitActive(); double lowerLimit(); double upperLimit(); - QColor normalDigitColor(); - QColor alarmDigitColor(); - QColor meterBackgroundColor(); + TQColor normalDigitColor(); + TQColor alarmDigitColor(); + TQColor meterBackgroundColor(); - void setTitle( const QString & ); + void setTitle( const TQString & ); void setShowUnit( bool ); void setLowerLimitActive( bool ); void setUpperLimitActive( bool ); void setLowerLimit( double ); void setUpperLimit( double ); - void setNormalDigitColor( const QColor & ); - void setAlarmDigitColor( const QColor & ); - void setMeterBackgroundColor( const QColor & ); + void setNormalDigitColor( const TQColor & ); + void setAlarmDigitColor( const TQColor & ); + void setMeterBackgroundColor( const TQColor & ); private: diff --git a/ksysguard/gui/SensorDisplayLib/MultiMeterSettingsWidget.ui.h b/ksysguard/gui/SensorDisplayLib/MultiMeterSettingsWidget.ui.h index 81d6e73f6..e97fabffc 100644 --- a/ksysguard/gui/SensorDisplayLib/MultiMeterSettingsWidget.ui.h +++ b/ksysguard/gui/SensorDisplayLib/MultiMeterSettingsWidget.ui.h @@ -15,7 +15,7 @@ void MultiMeterSettingsWidget::init() m_title->setFocus(); } -QString MultiMeterSettingsWidget::title() +TQString MultiMeterSettingsWidget::title() { return m_title->text(); } @@ -51,25 +51,25 @@ double MultiMeterSettingsWidget::upperLimit() } -QColor MultiMeterSettingsWidget::normalDigitColor() +TQColor MultiMeterSettingsWidget::normalDigitColor() { return m_normalDigitColor->color(); } -QColor MultiMeterSettingsWidget::alarmDigitColor() +TQColor MultiMeterSettingsWidget::alarmDigitColor() { return m_alarmDigitColor->color(); } -QColor MultiMeterSettingsWidget::meterBackgroundColor() +TQColor MultiMeterSettingsWidget::meterBackgroundColor() { return m_backgroundColor->color(); } -void MultiMeterSettingsWidget::setTitle( const QString &s ) +void MultiMeterSettingsWidget::setTitle( const TQString &s ) { m_title->setText(s); } @@ -89,7 +89,7 @@ void MultiMeterSettingsWidget::setLowerLimitActive( bool b ) void MultiMeterSettingsWidget::setLowerLimit( double d ) { - m_lowerLimit->setText(QString("%1").arg(d)); + m_lowerLimit->setText(TQString("%1").arg(d)); } @@ -101,23 +101,23 @@ void MultiMeterSettingsWidget::setUpperLimitActive( bool b ) void MultiMeterSettingsWidget::setUpperLimit( double d ) { - m_upperLimit->setText(QString("%1").arg(d)); + m_upperLimit->setText(TQString("%1").arg(d)); } -void MultiMeterSettingsWidget::setNormalDigitColor( const QColor &c ) +void MultiMeterSettingsWidget::setNormalDigitColor( const TQColor &c ) { m_normalDigitColor->setColor(c); } -void MultiMeterSettingsWidget::setAlarmDigitColor( const QColor &c ) +void MultiMeterSettingsWidget::setAlarmDigitColor( const TQColor &c ) { m_alarmDigitColor->setColor(c); } -void MultiMeterSettingsWidget::setMeterBackgroundColor( const QColor &c ) +void MultiMeterSettingsWidget::setMeterBackgroundColor( const TQColor &c ) { m_backgroundColor->setColor(c); } diff --git a/ksysguard/gui/SensorDisplayLib/ProcessController.cc b/ksysguard/gui/SensorDisplayLib/ProcessController.cc index b9fcd4f06..f02b02af9 100644 --- a/ksysguard/gui/SensorDisplayLib/ProcessController.cc +++ b/ksysguard/gui/SensorDisplayLib/ProcessController.cc @@ -23,7 +23,7 @@ #include <assert.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kapplication.h> #include <kdebug.h> @@ -37,40 +37,40 @@ #include "ProcessController.moc" #include "SignalIDs.h" -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qgroupbox.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqgroupbox.h> +#include <tqlayout.h> #include <kapplication.h> #include <kpushbutton.h> -ProcessController::ProcessController(QWidget* parent, const char* name, const QString &title, bool nf) +ProcessController::ProcessController(TQWidget* parent, const char* name, const TQString &title, bool nf) : KSGRD::SensorDisplay(parent, name, title, nf) { dict.setAutoDelete(true); - dict.insert("Name", new QString(i18n("Name"))); - dict.insert("PID", new QString(i18n("PID"))); - dict.insert("PPID", new QString(i18n("PPID"))); - dict.insert("UID", new QString(i18n("UID"))); - dict.insert("GID", new QString(i18n("GID"))); - dict.insert("Status", new QString(i18n("Status"))); - dict.insert("User%", new QString(i18n("User%"))); - dict.insert("System%", new QString(i18n("System%"))); - dict.insert("Nice", new QString(i18n("Nice"))); - dict.insert("VmSize", new QString(i18n("VmSize"))); - dict.insert("VmRss", new QString(i18n("VmRss"))); - dict.insert("Login", new QString(i18n("Login"))); - dict.insert("Command", new QString(i18n("Command"))); + dict.insert("Name", new TQString(i18n("Name"))); + dict.insert("PID", new TQString(i18n("PID"))); + dict.insert("PPID", new TQString(i18n("PPID"))); + dict.insert("UID", new TQString(i18n("UID"))); + dict.insert("GID", new TQString(i18n("GID"))); + dict.insert("Status", new TQString(i18n("Status"))); + dict.insert("User%", new TQString(i18n("User%"))); + dict.insert("System%", new TQString(i18n("System%"))); + dict.insert("Nice", new TQString(i18n("Nice"))); + dict.insert("VmSize", new TQString(i18n("VmSize"))); + dict.insert("VmRss", new TQString(i18n("VmRss"))); + dict.insert("Login", new TQString(i18n("Login"))); + dict.insert("Command", new TQString(i18n("Command"))); // Setup the geometry management. - gm = new QVBoxLayout(this, 10); + gm = new TQVBoxLayout(this, 10); Q_CHECK_PTR(gm); gm->addSpacing(15); - gmSearch = new QHBoxLayout(); + gmSearch = new TQHBoxLayout(); Q_CHECK_PTR(gmSearch); gm->addLayout(gmSearch, 0); @@ -81,17 +81,17 @@ ProcessController::ProcessController(QWidget* parent, const char* name, const QS pListSearchLine = new KListViewSearchLineWidget(pList, this, "process_list_search_line"); gmSearch->addWidget(pListSearchLine, 1); - connect(pList, SIGNAL(killProcess(int, int)), - this, SLOT(killProcess(int, int))); - connect(pList, SIGNAL(reniceProcess(const QValueList<int> &, int)), - this, SLOT(reniceProcess(const QValueList<int> &, int))); - connect(pList, SIGNAL(listModified(bool)), - this, SLOT(setModified(bool))); + connect(pList, TQT_SIGNAL(killProcess(int, int)), + this, TQT_SLOT(killProcess(int, int))); + connect(pList, TQT_SIGNAL(reniceProcess(const TQValueList<int> &, int)), + this, TQT_SLOT(reniceProcess(const TQValueList<int> &, int))); + connect(pList, TQT_SIGNAL(listModified(bool)), + this, TQT_SLOT(setModified(bool))); /* Create the combo box to configure the process filter. The * cbFilter must be created prior to constructing pList as the * pList constructor sets cbFilter to its start value. */ - cbFilter = new QComboBox(this, "pList_cbFilter"); + cbFilter = new TQComboBox(this, "pList_cbFilter"); Q_CHECK_PTR(cbFilter); gmSearch->addWidget(cbFilter,0); cbFilter->insertItem(i18n("All Processes"), 0); @@ -100,30 +100,30 @@ ProcessController::ProcessController(QWidget* parent, const char* name, const QS cbFilter->insertItem(i18n("Own Processes"), 3); cbFilter->setMinimumSize(cbFilter->sizeHint()); // Create the check box to switch between tree view and list view. - xbTreeView = new QCheckBox(i18n("&Tree"), this, "xbTreeView"); + xbTreeView = new TQCheckBox(i18n("&Tree"), this, "xbTreeView"); Q_CHECK_PTR(xbTreeView); xbTreeView->setMinimumSize(xbTreeView->sizeHint()); - connect(xbTreeView, SIGNAL(toggled(bool)), - this, SLOT(setTreeView(bool))); + connect(xbTreeView, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(setTreeView(bool))); /* When the both cbFilter and pList are constructed we can connect the * missing link. */ - connect(cbFilter, SIGNAL(activated(int)), - this, SLOT(filterModeChanged(int))); + connect(cbFilter, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(filterModeChanged(int))); // Create the 'Refresh' button. bRefresh = new KPushButton( KGuiItem( i18n( "&Refresh" ), "reload" ), this, "bRefresh" ); Q_CHECK_PTR(bRefresh); bRefresh->setMinimumSize(bRefresh->sizeHint()); - connect(bRefresh, SIGNAL(clicked()), this, SLOT(updateList())); + connect(bRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateList())); // Create the 'Kill' button. bKill = new KPushButton(i18n("&Kill"), this, "bKill"); Q_CHECK_PTR(bKill); bKill->setMinimumSize(bKill->sizeHint()); - connect(bKill, SIGNAL(clicked()), this, SLOT(killProcess())); + connect(bKill, TQT_SIGNAL(clicked()), this, TQT_SLOT(killProcess())); /* Disable the kill button until we know that the daemon supports the * kill command. */ bKill->setEnabled(false); @@ -131,7 +131,7 @@ ProcessController::ProcessController(QWidget* parent, const char* name, const QS gm->addWidget(pList, 1); - gm1 = new QHBoxLayout(); + gm1 = new TQHBoxLayout(); Q_CHECK_PTR(gm1); gm->addLayout(gm1, 0); gm1->addStretch(); @@ -154,7 +154,7 @@ ProcessController::ProcessController(QWidget* parent, const char* name, const QS void ProcessController::setSearchFocus() { //stupid search line widget. See rant in fixTabOrder if(!pListSearchLine->searchLine()) - QTimer::singleShot(100, this, SLOT(setSearchFocus())); + TQTimer::singleShot(100, this, TQT_SLOT(setSearchFocus())); else { pListSearchLine->searchLine()->setFocus(); } @@ -167,7 +167,7 @@ void ProcessController::fixTabOrder() { // //Did i mention I hate this? if(!pListSearchLine->searchLine()) - QTimer::singleShot(100, this, SLOT(fixTabOrder())); + TQTimer::singleShot(100, this, TQT_SLOT(fixTabOrder())); else { setTabOrder(pListSearchLine->searchLine(), cbFilter); setTabOrder(cbFilter, pList); @@ -178,19 +178,19 @@ void ProcessController::fixTabOrder() { } void -ProcessController::resizeEvent(QResizeEvent* ev) +ProcessController::resizeEvent(TQResizeEvent* ev) { if(frame()) frame()->setGeometry(0, 0, width(), height()); - QWidget::resizeEvent(ev); + TQWidget::resizeEvent(ev); } bool -ProcessController::addSensor(const QString& hostName, - const QString& sensorName, - const QString& sensorType, - const QString& title) +ProcessController::addSensor(const TQString& hostName, + const TQString& sensorName, + const TQString& sensorType, + const TQString& title) { if (sensorType != "table") return (false); @@ -220,11 +220,11 @@ void ProcessController::killProcess(int pid, int sig) { sendRequest(sensors().at(0)->hostName(), - QString("kill %1 %2" ).arg(pid).arg(sig), 3); + TQString("kill %1 %2" ).arg(pid).arg(sig), 3); if ( !timerOn() ) // give ksysguardd time to update its proccess list - QTimer::singleShot(3000, this, SLOT(updateList())); + TQTimer::singleShot(3000, this, TQT_SLOT(updateList())); else updateList(); } @@ -232,7 +232,7 @@ ProcessController::killProcess(int pid, int sig) void ProcessController::killProcess() { - const QStringList& selectedAsStrings = pList->getSelectedAsStrings(); + const TQStringList& selectedAsStrings = pList->getSelectedAsStrings(); if (selectedAsStrings.isEmpty()) { KMessageBox::sorry(this, @@ -241,7 +241,7 @@ ProcessController::killProcess() } else { - QString msg = i18n("Do you want to kill the selected process?", + TQString msg = i18n("Do you want to kill the selected process?", "Do you want to kill the %n selected processes?", selectedAsStrings.count()); @@ -253,7 +253,7 @@ ProcessController::killProcess() bool dontAgain = false; - int res = KMessageBox::createKMessageBox(dlg, QMessageBox::Question, + int res = KMessageBox::createKMessageBox(dlg, TQMessageBox::Question, msg, selectedAsStrings, i18n("Do not ask again"), &dontAgain, KMessageBox::Notify); @@ -264,32 +264,32 @@ ProcessController::killProcess() } } - const QValueList<int>& selectedPIds = pList->getSelectedPIds(); + const TQValueList<int>& selectedPIds = pList->getSelectedPIds(); // send kill signal to all seleted processes - QValueListConstIterator<int> it; + TQValueListConstIterator<int> it; for (it = selectedPIds.begin(); it != selectedPIds.end(); ++it) - sendRequest(sensors().at(0)->hostName(), QString("kill %1 %2" ).arg(*it) + sendRequest(sensors().at(0)->hostName(), TQString("kill %1 %2" ).arg(*it) .arg(MENU_ID_SIGKILL), 3); if ( !timerOn()) // give ksysguardd time to update its proccess list - QTimer::singleShot(3000, this, SLOT(updateList())); + TQTimer::singleShot(3000, this, TQT_SLOT(updateList())); else updateList(); } void -ProcessController::reniceProcess(const QValueList<int> &pids, int niceValue) +ProcessController::reniceProcess(const TQValueList<int> &pids, int niceValue) { - for( QValueList<int>::ConstIterator it = pids.constBegin(), end = pids.constEnd(); it != end; ++it ) + for( TQValueList<int>::ConstIterator it = pids.constBegin(), end = pids.constEnd(); it != end; ++it ) sendRequest(sensors().at(0)->hostName(), - QString("setpriority %1 %2" ).arg(*it).arg(niceValue), 5); + TQString("setpriority %1 %2" ).arg(*it).arg(niceValue), 5); sendRequest(sensors().at(0)->hostName(), "ps", 2); //update the display afterwards } void -ProcessController::answerReceived(int id, const QString& answer) +ProcessController::answerReceived(int id, const TQString& answer) { /* We received something, so the sensor is probably ok. */ sensorError(id, false); @@ -314,7 +314,7 @@ ProcessController::answerReceived(int id, const QString& answer) pList->removeColumns(); for (unsigned int i = 0; i < headers.count(); i++) { - QString header; + TQString header; if (dict[headers[i]]) header = *dict[headers[i]]; else @@ -421,11 +421,11 @@ ProcessController::sensorError(int, bool err) } bool -ProcessController::restoreSettings(QDomElement& element) +ProcessController::restoreSettings(TQDomElement& element) { bool result = addSensor(element.attribute("hostName"), element.attribute("sensorName"), (element.attribute("sensorType").isEmpty() ? "table" : element.attribute("sensorType")), - QString::null); + TQString::null); xbTreeView->setChecked(element.attribute("tree").toInt()); setTreeView(element.attribute("tree").toInt()); @@ -450,7 +450,7 @@ ProcessController::restoreSettings(QDomElement& element) } bool -ProcessController::saveSettings(QDomDocument& doc, QDomElement& element, bool save) +ProcessController::saveSettings(TQDomDocument& doc, TQDomElement& element, bool save) { element.setAttribute("hostName", sensors().at(0)->hostName()); element.setAttribute("sensorName", sensors().at(0)->name()); diff --git a/ksysguard/gui/SensorDisplayLib/ProcessController.h b/ksysguard/gui/SensorDisplayLib/ProcessController.h index f834efbb6..45b5e5df8 100644 --- a/ksysguard/gui/SensorDisplayLib/ProcessController.h +++ b/ksysguard/gui/SensorDisplayLib/ProcessController.h @@ -24,8 +24,8 @@ #ifndef _ProcessController_h_ #define _ProcessController_h_ -#include <qdict.h> -#include <qwidget.h> +#include <tqdict.h> +#include <tqwidget.h> #include <kapplication.h> @@ -54,28 +54,28 @@ class ProcessController : public KSGRD::SensorDisplay Q_OBJECT public: - ProcessController(QWidget* parent = 0, const char* name = 0, const QString &title = QString::null, bool nf = false); + ProcessController(TQWidget* parent = 0, const char* name = 0, const TQString &title = TQString::null, bool nf = false); virtual ~ProcessController() { } - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); - bool restoreSettings(QDomElement& element); + bool restoreSettings(TQDomElement& element); - bool saveSettings(QDomDocument& doc, QDomElement& element, bool save = true); + bool saveSettings(TQDomDocument& doc, TQDomElement& element, bool save = true); void refreshList(void) { updateList(); } - virtual void timerEvent(QTimerEvent*) + virtual void timerEvent(TQTimerEvent*) { updateList(); } - virtual bool addSensor(const QString&, const QString&, const QString&, const QString&); + virtual bool addSensor(const TQString&, const TQString&, const TQString&, const TQString&); - virtual void answerReceived(int id, const QString& answer); + virtual void answerReceived(int id, const TQString& answer); virtual void sensorError(int, bool err); @@ -117,7 +117,7 @@ public slots: void killProcess(); void killProcess(int pid, int sig); - void reniceProcess(const QValueList<int> &pids, int niceValue); + void reniceProcess(const TQValueList<int> &pids, int niceValue); void updateList(); @@ -125,30 +125,30 @@ signals: void setFilterMode(int); private: - QVBoxLayout* gm; + TQVBoxLayout* gm; bool killSupported; /// The process list. ProcessList* pList; ///Layout for the search line and process filter combo box - QHBoxLayout* gmSearch; + TQHBoxLayout* gmSearch; KListViewSearchLineWidget *pListSearchLine; - QHBoxLayout* gm1; + TQHBoxLayout* gm1; /// Checkbox to switch between tree and list view - QCheckBox* xbTreeView; + TQCheckBox* xbTreeView; /// This combo boxes control the process filter. - QComboBox* cbFilter; + TQComboBox* cbFilter; /// These buttons force an immedeate refresh or kill a process. KPushButton* bRefresh; KPushButton* bKill; /// Dictionary for header translations. - QDict<QString> dict; + TQDict<TQString> dict; }; #endif diff --git a/ksysguard/gui/SensorDisplayLib/ProcessList.cc b/ksysguard/gui/SensorDisplayLib/ProcessList.cc index 6d158c872..2f5b3fe51 100644 --- a/ksysguard/gui/SensorDisplayLib/ProcessList.cc +++ b/ksysguard/gui/SensorDisplayLib/ProcessList.cc @@ -35,10 +35,10 @@ #include <sys/types.h> #include <unistd.h> -#include <qbitmap.h> -#include <qheader.h> -#include <qimage.h> -#include <qpopupmenu.h> +#include <tqbitmap.h> +#include <tqheader.h> +#include <tqimage.h> +#include <tqpopupmenu.h> #include <kdebug.h> #include <kglobal.h> @@ -57,9 +57,9 @@ //extern const char* timeKey(const char* text); //extern const char* floatKey(const char* text); -QDict<QString> ProcessList::aliases; +TQDict<TQString> ProcessList::aliases; -int ProcessLVI::compare( QListViewItem *item, int col, bool ascending ) const +int ProcessLVI::compare( TQListViewItem *item, int col, bool ascending ) const { int type = ((ProcessList*)listView())->columnType( col ); @@ -100,133 +100,133 @@ int ProcessLVI::compare( QListViewItem *item, int col, bool ascending ) const return key( col, ascending ).localeAwareCompare( item->key( col, ascending ) ); } -ProcessList::ProcessList(QWidget *parent, const char* name) +ProcessList::ProcessList(TQWidget *parent, const char* name) : KListView(parent, name) { iconCache.setAutoDelete(true); columnDict.setAutoDelete(true); columnDict.insert("running", - new QString(i18n("process status", "running"))); + new TQString(i18n("process status", "running"))); columnDict.insert("sleeping", - new QString(i18n("process status", "sleeping"))); + new TQString(i18n("process status", "sleeping"))); columnDict.insert("disk sleep", - new QString(i18n("process status", "disk sleep"))); - columnDict.insert("zombie", new QString(i18n("process status", "zombie"))); + new TQString(i18n("process status", "disk sleep"))); + columnDict.insert("zombie", new TQString(i18n("process status", "zombie"))); columnDict.insert("stopped", - new QString(i18n("process status", "stopped"))); - columnDict.insert("paging", new QString(i18n("process status", "paging"))); - columnDict.insert("idle", new QString(i18n("process status", "idle"))); + new TQString(i18n("process status", "stopped"))); + columnDict.insert("paging", new TQString(i18n("process status", "paging"))); + columnDict.insert("idle", new TQString(i18n("process status", "idle"))); if (aliases.isEmpty()) { #ifdef Q_OS_LINUX - aliases.insert("init", new QString("penguin")); + aliases.insert("init", new TQString("penguin")); #else - aliases.insert("init", new QString("system")); + aliases.insert("init", new TQString("system")); #endif /* kernel stuff */ - aliases.insert("bdflush", new QString("kernel")); - aliases.insert("dhcpcd", new QString("kernel")); - aliases.insert("kapm-idled", new QString("kernel")); - aliases.insert("keventd", new QString("kernel")); - aliases.insert("khubd", new QString("kernel")); - aliases.insert("klogd", new QString("kernel")); - aliases.insert("kreclaimd", new QString("kernel")); - aliases.insert("kreiserfsd", new QString("kernel")); - aliases.insert("ksoftirqd_CPU0", new QString("kernel")); - aliases.insert("ksoftirqd_CPU1", new QString("kernel")); - aliases.insert("ksoftirqd_CPU2", new QString("kernel")); - aliases.insert("ksoftirqd_CPU3", new QString("kernel")); - aliases.insert("ksoftirqd_CPU4", new QString("kernel")); - aliases.insert("ksoftirqd_CPU5", new QString("kernel")); - aliases.insert("ksoftirqd_CPU6", new QString("kernel")); - aliases.insert("ksoftirqd_CPU7", new QString("kernel")); - aliases.insert("kswapd", new QString("kernel")); - aliases.insert("kupdated", new QString("kernel")); - aliases.insert("mdrecoveryd", new QString("kernel")); - aliases.insert("scsi_eh_0", new QString("kernel")); - aliases.insert("scsi_eh_1", new QString("kernel")); - aliases.insert("scsi_eh_2", new QString("kernel")); - aliases.insert("scsi_eh_3", new QString("kernel")); - aliases.insert("scsi_eh_4", new QString("kernel")); - aliases.insert("scsi_eh_5", new QString("kernel")); - aliases.insert("scsi_eh_6", new QString("kernel")); - aliases.insert("scsi_eh_7", new QString("kernel")); + aliases.insert("bdflush", new TQString("kernel")); + aliases.insert("dhcpcd", new TQString("kernel")); + aliases.insert("kapm-idled", new TQString("kernel")); + aliases.insert("keventd", new TQString("kernel")); + aliases.insert("khubd", new TQString("kernel")); + aliases.insert("klogd", new TQString("kernel")); + aliases.insert("kreclaimd", new TQString("kernel")); + aliases.insert("kreiserfsd", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU0", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU1", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU2", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU3", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU4", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU5", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU6", new TQString("kernel")); + aliases.insert("ksoftirqd_CPU7", new TQString("kernel")); + aliases.insert("kswapd", new TQString("kernel")); + aliases.insert("kupdated", new TQString("kernel")); + aliases.insert("mdrecoveryd", new TQString("kernel")); + aliases.insert("scsi_eh_0", new TQString("kernel")); + aliases.insert("scsi_eh_1", new TQString("kernel")); + aliases.insert("scsi_eh_2", new TQString("kernel")); + aliases.insert("scsi_eh_3", new TQString("kernel")); + aliases.insert("scsi_eh_4", new TQString("kernel")); + aliases.insert("scsi_eh_5", new TQString("kernel")); + aliases.insert("scsi_eh_6", new TQString("kernel")); + aliases.insert("scsi_eh_7", new TQString("kernel")); /* daemon and other service providers */ - aliases.insert("artsd", new QString("daemon")); - aliases.insert("atd", new QString("daemon")); - aliases.insert("automount", new QString("daemon")); - aliases.insert("cardmgr", new QString("daemon")); - aliases.insert("cron", new QString("daemon")); - aliases.insert("cupsd", new QString("daemon")); - aliases.insert("in.identd", new QString("daemon")); - aliases.insert("lpd", new QString("daemon")); - aliases.insert("mingetty", new QString("daemon")); - aliases.insert("nscd", new QString("daemon")); - aliases.insert("portmap", new QString("daemon")); - aliases.insert("rpc.statd", new QString("daemon")); - aliases.insert("rpciod", new QString("daemon")); - aliases.insert("sendmail", new QString("daemon")); - aliases.insert("sshd", new QString("daemon")); - aliases.insert("syslogd", new QString("daemon")); - aliases.insert("usbmgr", new QString("daemon")); - aliases.insert("wwwoffled", new QString("daemon")); - aliases.insert("xntpd", new QString("daemon")); - aliases.insert("ypbind", new QString("daemon")); + aliases.insert("artsd", new TQString("daemon")); + aliases.insert("atd", new TQString("daemon")); + aliases.insert("automount", new TQString("daemon")); + aliases.insert("cardmgr", new TQString("daemon")); + aliases.insert("cron", new TQString("daemon")); + aliases.insert("cupsd", new TQString("daemon")); + aliases.insert("in.identd", new TQString("daemon")); + aliases.insert("lpd", new TQString("daemon")); + aliases.insert("mingetty", new TQString("daemon")); + aliases.insert("nscd", new TQString("daemon")); + aliases.insert("portmap", new TQString("daemon")); + aliases.insert("rpc.statd", new TQString("daemon")); + aliases.insert("rpciod", new TQString("daemon")); + aliases.insert("sendmail", new TQString("daemon")); + aliases.insert("sshd", new TQString("daemon")); + aliases.insert("syslogd", new TQString("daemon")); + aliases.insert("usbmgr", new TQString("daemon")); + aliases.insert("wwwoffled", new TQString("daemon")); + aliases.insert("xntpd", new TQString("daemon")); + aliases.insert("ypbind", new TQString("daemon")); /* kde applications */ - aliases.insert("appletproxy", new QString("kdeapp")); - aliases.insert("dcopserver", new QString("kdeapp")); - aliases.insert("kcookiejar", new QString("kdeapp")); - aliases.insert("kde", new QString("kdeapp")); - aliases.insert("kded", new QString("kdeapp")); - aliases.insert("kdeinit", new QString("kdeapp")); - aliases.insert("kdesktop", new QString("kdeapp")); - aliases.insert("kdesud", new QString("kdeapp")); - aliases.insert("kdm", new QString("kdeapp")); - aliases.insert("khotkeys", new QString("kdeapp")); - aliases.insert("kio_file", new QString("kdeapp")); - aliases.insert("kio_uiserver", new QString("kdeapp")); - aliases.insert("klauncher", new QString("kdeapp")); - aliases.insert("ksmserver", new QString("kdeapp")); - aliases.insert("kwrapper", new QString("kdeapp")); - aliases.insert("kwrited", new QString("kdeapp")); - aliases.insert("kxmlrpcd", new QString("kdeapp")); - aliases.insert("startkde", new QString("kdeapp")); + aliases.insert("appletproxy", new TQString("kdeapp")); + aliases.insert("dcopserver", new TQString("kdeapp")); + aliases.insert("kcookiejar", new TQString("kdeapp")); + aliases.insert("kde", new TQString("kdeapp")); + aliases.insert("kded", new TQString("kdeapp")); + aliases.insert("kdeinit", new TQString("kdeapp")); + aliases.insert("kdesktop", new TQString("kdeapp")); + aliases.insert("kdesud", new TQString("kdeapp")); + aliases.insert("kdm", new TQString("kdeapp")); + aliases.insert("khotkeys", new TQString("kdeapp")); + aliases.insert("kio_file", new TQString("kdeapp")); + aliases.insert("kio_uiserver", new TQString("kdeapp")); + aliases.insert("klauncher", new TQString("kdeapp")); + aliases.insert("ksmserver", new TQString("kdeapp")); + aliases.insert("kwrapper", new TQString("kdeapp")); + aliases.insert("kwrited", new TQString("kdeapp")); + aliases.insert("kxmlrpcd", new TQString("kdeapp")); + aliases.insert("startkde", new TQString("kdeapp")); /* other processes */ - aliases.insert("bash", new QString("shell")); - aliases.insert("cat", new QString("tools")); - aliases.insert("egrep", new QString("tools")); - aliases.insert("emacs", new QString("wordprocessing")); - aliases.insert("fgrep", new QString("tools")); - aliases.insert("find", new QString("tools")); - aliases.insert("grep", new QString("tools")); - aliases.insert("ksh", new QString("shell")); - aliases.insert("screen", new QString("openterm")); - aliases.insert("sh", new QString("shell")); - aliases.insert("sort", new QString("tools")); - aliases.insert("ssh", new QString("shell")); - aliases.insert("su", new QString("tools")); - aliases.insert("tcsh", new QString("shell")); - aliases.insert("tee", new QString("tools")); - aliases.insert("vi", new QString("wordprocessing")); + aliases.insert("bash", new TQString("shell")); + aliases.insert("cat", new TQString("tools")); + aliases.insert("egrep", new TQString("tools")); + aliases.insert("emacs", new TQString("wordprocessing")); + aliases.insert("fgrep", new TQString("tools")); + aliases.insert("find", new TQString("tools")); + aliases.insert("grep", new TQString("tools")); + aliases.insert("ksh", new TQString("shell")); + aliases.insert("screen", new TQString("openterm")); + aliases.insert("sh", new TQString("shell")); + aliases.insert("sort", new TQString("tools")); + aliases.insert("ssh", new TQString("shell")); + aliases.insert("su", new TQString("tools")); + aliases.insert("tcsh", new TQString("shell")); + aliases.insert("tee", new TQString("tools")); + aliases.insert("vi", new TQString("wordprocessing")); } /* The filter mode is controlled by a combo box of the parent. If * the mode is changed we get a signal. */ - connect(parent, SIGNAL(setFilterMode(int)), - this, SLOT(setFilterMode(int))); + connect(parent, TQT_SIGNAL(setFilterMode(int)), + this, TQT_SLOT(setFilterMode(int))); /* We need to catch this signal to show various popup menues. */ connect(this, - SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), + TQT_SIGNAL(rightButtonPressed(TQListViewItem*, const TQPoint&, int)), this, - SLOT(handleRMBPressed(QListViewItem*, const QPoint&, int))); + TQT_SLOT(handleRMBPressed(TQListViewItem*, const TQPoint&, int))); /* Since Qt does not tell us the sorting details we have to do our * own bookkeping, so we can save and restore the sorting * settings. */ - connect(header(), SIGNAL(clicked(int)), this, SLOT(sortingChanged(int))); + connect(header(), TQT_SIGNAL(clicked(int)), this, TQT_SLOT(sortingChanged(int))); treeViewEnabled = false; openAll = true; @@ -243,18 +243,18 @@ ProcessList::ProcessList(QWidget *parent, const char* name) setAllColumnsShowFocus(true); setTreeStepSize(17); setSorting(sortColumn, increasing); - setSelectionMode(QListView::Extended); + setSelectionMode(TQListView::Extended); // Create popup menu for RMB clicks on table header - headerPM = new QPopupMenu(); + headerPM = new TQPopupMenu(); headerPM->insertItem(i18n("Remove Column"), HEADER_REMOVE); headerPM->insertItem(i18n("Add Column"), HEADER_ADD); headerPM->insertItem(i18n("Help on Column"), HEADER_HELP); - connect(header(), SIGNAL(sizeChange(int, int, int)), - this, SLOT(sizeChanged(int, int, int))); - connect(header(), SIGNAL(indexChange(int, int, int)), - this, SLOT(indexChanged(int, int, int))); + connect(header(), TQT_SIGNAL(sizeChange(int, int, int)), + this, TQT_SLOT(sizeChanged(int, int, int))); + connect(header(), TQT_SIGNAL(indexChange(int, int, int)), + this, TQT_SLOT(indexChanged(int, int, int))); killSupported = false; setModified(false); @@ -265,34 +265,34 @@ ProcessList::~ProcessList() delete(headerPM); } -const QValueList<int>& +const TQValueList<int>& ProcessList::getSelectedPIds() { selectedPIds.clear(); // iterate through all selected visible items of the listview - QListViewItemIterator it(this, QListViewItemIterator::Visible | QListViewItemIterator::Selected ); + TQListViewItemIterator it(this, TQListViewItemIterator::Visible | TQListViewItemIterator::Selected ); for ( ; it.current(); ++it ) selectedPIds.append(it.current()->text(1).toInt()); return (selectedPIds); } -const QStringList& +const TQStringList& ProcessList::getSelectedAsStrings() { selectedAsStrings.clear(); // iterate through all selected visible items of the listview - QListViewItemIterator it(this, QListViewItemIterator::Visible | QListViewItemIterator::Selected ); - QString spaces; + TQListViewItemIterator it(this, TQListViewItemIterator::Visible | TQListViewItemIterator::Selected ); + TQString spaces; for ( ; it.current(); ++it ) { - spaces.fill(QChar(' '), 7 - it.current()->text(1).length()); + spaces.fill(TQChar(' '), 7 - it.current()->text(1).length()); selectedAsStrings.append("(PID: " + it.current()->text(1) + ")" + spaces + " " + it.current()->text(0)); } return (selectedAsStrings); } bool -ProcessList::update(const QString& list) +ProcessList::update(const TQString& list) { /* Disable painting to avoid flickering effects, * especially when in tree view mode. @@ -312,7 +312,7 @@ ProcessList::update(const QString& list) #if 0 // This is needed for debugging only. kdDebug(1215) << list << endl; - QString l; + TQString l; for (uint j = 0; j < line->count(); j++) l += (*line)[j] + "|"; kdDebug(1215) << "Incomplete ps line:" << l << endl; @@ -336,7 +336,7 @@ ProcessList::update(const QString& list) else buildList(); - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { if ( itemPos( it.current() ) == currItemPos ) { setCurrentItem( it.current() ); @@ -378,12 +378,12 @@ ProcessList::setTreeView(bool tv) } bool -ProcessList::load(QDomElement& el) +ProcessList::load(TQDomElement& el) { - QDomNodeList dnList = el.elementsByTagName("column"); + TQDomNodeList dnList = el.elementsByTagName("column"); for (uint i = 0; i < dnList.count(); ++i) { - QDomElement lel = dnList.item(i).toElement(); + TQDomElement lel = dnList.item(i).toElement(); if (savedWidth.count() <= i) savedWidth.append(lel.attribute("savedWidth").toInt()); else @@ -404,11 +404,11 @@ ProcessList::load(QDomElement& el) } bool -ProcessList::save(QDomDocument& doc, QDomElement& display) +ProcessList::save(TQDomDocument& doc, TQDomElement& display) { for (int i = 0; i < columns(); ++i) { - QDomElement col = doc.createElement("column"); + TQDomElement col = doc.createElement("column"); display.appendChild(col); col.setAttribute("currentWidth", columnWidth(i)); col.setAttribute("savedWidth", savedWidth[i]); @@ -475,7 +475,7 @@ void ProcessList::buildList() { /* Get the first process in the list, check whether it matches the - * filter and append it to QListView widget if so. */ + * filter and append it to TQListView widget if so. */ while (!pl.isEmpty()) { KSGRD::SensorPSLine* p = pl.first(); @@ -553,7 +553,7 @@ ProcessList::isLeafProcess(int pid) } void -ProcessList::extendTree(QPtrList<KSGRD::SensorPSLine>* pl, ProcessLVI* parent, int ppid) +ProcessList::extendTree(TQPtrList<KSGRD::SensorPSLine>* pl, ProcessLVI* parent, int ppid) { KSGRD::SensorPSLine* ps; @@ -599,13 +599,13 @@ ProcessList::extendTree(QPtrList<KSGRD::SensorPSLine>* pl, ProcessLVI* parent, i void ProcessList::addProcess(KSGRD::SensorPSLine* p, ProcessLVI* pli) { - QString name = p->name(); + TQString name = p->name(); if (aliases[name]) name = *aliases[name]; /* Get icon from icon list that might be appropriate for a process * with this name. */ - QPixmap pix; + TQPixmap pix; if (!iconCache[name]) { pix = KGlobal::iconLoader()->loadIcon(name, KIcon::Small, @@ -621,7 +621,7 @@ ProcessList::addProcess(KSGRD::SensorPSLine* p, ProcessLVI* pli) * scale the pixmaps already appropriately. Since I got a bug * report claiming that it doesn't work with GNOME apps I've * added this safeguard. */ - QImage img; + TQImage img; img = pix; img.smoothScale(16, 16); pix = img; @@ -629,17 +629,17 @@ ProcessList::addProcess(KSGRD::SensorPSLine* p, ProcessLVI* pli) /* We copy the icon into a 24x16 pixmap to add a 4 pixel margin on * the left and right side. In tree view mode we use the original * icon. */ - QPixmap icon(24, 16, pix.depth()); + TQPixmap icon(24, 16, pix.depth()); if (!treeViewEnabled) { icon.fill(); bitBlt(&icon, 4, 0, &pix, 0, 0, pix.width(), pix.height()); - QBitmap mask(24, 16, true); + TQBitmap mask(24, 16, true); bitBlt(&mask, 4, 0, pix.mask(), 0, 0, pix.width(), pix.height()); icon.setMask(mask); pix = icon; } - iconCache.insert(name, new QPixmap(pix)); + iconCache.insert(name, new TQPixmap(pix)); } else pix = *(iconCache[name]); @@ -668,7 +668,7 @@ ProcessList::updateMetaInfo(void) selectedPIds.clear(); closedSubTrees.clear(); - QListViewItemIterator it(this); + TQListViewItemIterator it(this); // iterate through all items of the listview for ( ; it.current(); ++it ) @@ -679,7 +679,7 @@ ProcessList::updateMetaInfo(void) closedSubTrees.append(it.current()->text(1).toInt()); } - /* In list view mode all list items are set to closed by QListView. + /* In list view mode all list items are set to closed by TQListView. * If the tree view is now selected, all item will be closed. This is * annoying. So we use the openAll flag to force all trees to open when * the treeViewEnbled flag was set to true. */ @@ -699,9 +699,9 @@ ProcessList::removeColumns(void) } void -ProcessList::addColumn(const QString& label, const QString& type) +ProcessList::addColumn(const TQString& label, const TQString& type) { - QListView::addColumn(label); + TQListView::addColumn(label); uint col = columns() - 1; if (type == "s" || type == "S") setColumnAlignment(col, AlignLeft); @@ -721,7 +721,7 @@ ProcessList::addColumn(const QString& label, const QString& type) mColumnTypes.append(type); /* Just use some sensible default values as initial setting. */ - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); setColumnWidth(col, fm.width(label) + 10); if (currentWidth.count() - 1 == col) @@ -746,7 +746,7 @@ ProcessList::addColumn(const QString& label, const QString& type) setColumnWidth(i, currentWidth[i]); } setColumnWidthMode(i, currentWidth[i] == 0 ? - QListView::Manual : QListView::Maximum); + TQListView::Manual : TQListView::Maximum); header()->moveSection(i, index[i]); } setSorting(sortColumn, increasing); @@ -754,7 +754,7 @@ ProcessList::addColumn(const QString& label, const QString& type) } void -ProcessList::handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col) +ProcessList::handleRMBPressed(TQListViewItem* lvi, const TQPoint& p, int col) { if (!lvi) return; @@ -768,13 +768,13 @@ ProcessList::handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col) int currentNiceValue = 0; for (int i = 0; i < columns(); ++i) - if (QString::compare(header()->label(i), i18n("Nice")) == 0) + if (TQString::compare(header()->label(i), i18n("Nice")) == 0) currentNiceValue = lvi->text(i).toInt(); - QPopupMenu processPM; + TQPopupMenu processPM; if (columnWidth(col) != 0) processPM.insertItem(i18n("Hide Column"), 5); - QPopupMenu* hiddenPM = new QPopupMenu(&processPM); + TQPopupMenu* hiddenPM = new TQPopupMenu(&processPM); for (int i = 0; i < columns(); ++i) if (columnWidth(i) == 0) hiddenPM->insertItem(header()->label(i), i + 100); @@ -786,7 +786,7 @@ ProcessList::handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col) processPM.insertItem(i18n("Select All Processes"), 1); processPM.insertItem(i18n("Unselect All Processes"), 2); - QPopupMenu* signalPM = new QPopupMenu(&processPM); + TQPopupMenu* signalPM = new TQPopupMenu(&processPM); if (killSupported && lvi->isSelected()) { processPM.insertSeparator(); @@ -839,7 +839,7 @@ ProcessList::handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col) selectAllChilds(currentPId, id & 1); break; case 5: - setColumnWidthMode(col, QListView::Manual); + setColumnWidthMode(col, TQListView::Manual); savedWidth[col] = columnWidth(col); setColumnWidth(col, 0); setModified(true); @@ -861,7 +861,7 @@ ProcessList::handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col) /* we go through list to get all task also when update interval is paused */ selectedPIds.clear(); - QListViewItemIterator it(this, QListViewItemIterator::Visible | QListViewItemIterator::Selected); + TQListViewItemIterator it(this, TQListViewItemIterator::Visible | TQListViewItemIterator::Selected); // iterate through all selected visible items of the listview for ( ; it.current(); ++it ) @@ -869,16 +869,16 @@ ProcessList::handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col) selectedPIds.append(it.current()->text(1).toInt()); } - QString msg = i18n("Do you really want to send signal %1 to the selected process?", + TQString msg = i18n("Do you really want to send signal %1 to the selected process?", "Do you really want to send signal %1 to the %n selected processes?", selectedPIds.count()) .arg(signalPM->text(id)); int answ; - switch(answ = KMessageBox::questionYesNo(this, msg, QString::null, i18n("Send"), KStdGuiItem::cancel())) + switch(answ = KMessageBox::questionYesNo(this, msg, TQString::null, i18n("Send"), KStdGuiItem::cancel())) { case KMessageBox::Yes: { - QValueList<int>::Iterator it; + TQValueList<int>::Iterator it; for (it = selectedPIds.begin(); it != selectedPIds.end(); ++it) emit (killProcess(*it, id)); break; @@ -891,7 +891,7 @@ ProcessList::handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col) { /* IDs >= 100 are used for hidden columns. */ int col = id - 100; - setColumnWidthMode(col, QListView::Maximum); + setColumnWidthMode(col, TQListView::Maximum); setColumnWidth(col, savedWidth[col]); setModified(true); } @@ -903,7 +903,7 @@ ProcessList::selectAllItems(bool select) { selectedPIds.clear(); - QListViewItemIterator it(this, QListViewItemIterator::Visible); + TQListViewItemIterator it(this, TQListViewItemIterator::Visible); // iterate through all items of the listview for ( ; it.current(); ++it ) @@ -918,7 +918,7 @@ ProcessList::selectAllItems(bool select) void ProcessList::selectAllChilds(int pid, bool select) { - QListViewItemIterator it(this, QListViewItemIterator::Visible ); + TQListViewItemIterator it(this, TQListViewItemIterator::Visible ); // iterate through all items of the listview for ( ; it.current(); ++it ) diff --git a/ksysguard/gui/SensorDisplayLib/ProcessList.h b/ksysguard/gui/SensorDisplayLib/ProcessList.h index b3f484484..aac28a227 100644 --- a/ksysguard/gui/SensorDisplayLib/ProcessList.h +++ b/ksysguard/gui/SensorDisplayLib/ProcessList.h @@ -25,11 +25,11 @@ #ifndef _ProcessList_h_ #define _ProcessList_h_ -#include <qdict.h> -#include <qdom.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qwidget.h> +#include <tqdict.h> +#include <tqdom.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqwidget.h> #include <kiconloader.h> #include <klistview.h> @@ -40,22 +40,22 @@ typedef const char* (*KeyFunc)(const char*); /** * To support bi-directional sorting, and sorting of text, integers etc. we - * need a specialized version of QListViewItem. + * need a specialized version of TQListViewItem. */ class ProcessLVI : public KListViewItem { public: - ProcessLVI(QListView* lv) : KListViewItem(lv) { } - ProcessLVI(QListViewItem* lvi) : KListViewItem(lvi) { } + ProcessLVI(TQListView* lv) : KListViewItem(lv) { } + ProcessLVI(TQListViewItem* lvi) : KListViewItem(lvi) { } - virtual int compare( QListViewItem *item, int column, bool ) const; + virtual int compare( TQListViewItem *item, int column, bool ) const; }; class QPopupMenu; /** * This class implementes a table filled with information about the running - * processes. The table is derived from QListView. + * processes. The table is derived from TQListView. */ class ProcessList : public KListView { @@ -74,14 +74,14 @@ public: enum ColumnType { Text, Int, Float, Time }; /// The constructor. - ProcessList(QWidget* parent = 0, const char* name = 0); + ProcessList(TQWidget* parent = 0, const char* name = 0); /// The destructor. ~ProcessList(); void removeColumns(); - void addColumn(const QString& header, const QString& type); + void addColumn(const TQString& header, const TQString& type); void setSortColumn(uint col, bool inc) { @@ -100,8 +100,8 @@ public: return increasing; } - const QValueList<int>& getSelectedPIds(); - const QStringList& getSelectedAsStrings(); + const TQValueList<int>& getSelectedPIds(); + const TQStringList& getSelectedAsStrings(); /** * The udpate function can be used to update the displayed process @@ -109,7 +109,7 @@ public: * case the list contains invalid or corrupted info, FALSE is * returned. */ - bool update(const QString& list); + bool update(const TQString& list); int columnType( uint col ) const; @@ -120,8 +120,8 @@ public: killSupported = supported; } - bool load(QDomElement& el); - bool save(QDomDocument& doc, QDomElement& display); + bool load(TQDomElement& el); + bool save(TQDomDocument& doc, TQDomElement& display); public slots: void setTreeView(bool tv); @@ -140,7 +140,7 @@ public slots: void sortingChanged(int col); - void handleRMBPressed(QListViewItem* lvi, const QPoint& p, int col); + void handleRMBPressed(TQListViewItem* lvi, const TQPoint& p, int col); void sizeChanged(int, int, int) { @@ -166,7 +166,7 @@ signals: void killProcess(int pid, int sig); // This signal is emitted when process pid should be reniced. - void reniceProcess(const QValueList<int> &pids, int niceValue); + void reniceProcess(const TQValueList<int> &pids, int niceValue); void listModified(bool); @@ -195,7 +195,7 @@ private: /** * This function constructs the list of processes for list * mode. It's a straightforward appending operation to the - * QListView widget. + * TQListView widget. */ void buildList(); @@ -224,7 +224,7 @@ private: * removing processes from the process list an inserting them into * the tree. */ - void extendTree(QPtrList<KSGRD::SensorPSLine>* pl, ProcessLVI* parent, int ppid); + void extendTree(TQPtrList<KSGRD::SensorPSLine>* pl, ProcessLVI* parent, int ppid); /** * This function adds a process to the list/tree. @@ -247,24 +247,24 @@ private: /* The following lists are primarily used to store table specs between * load() and the actual table creation in addColumn(). */ - QValueList<int> savedWidth; - QValueList<int> currentWidth; - QValueList<int> index; + TQValueList<int> savedWidth; + TQValueList<int> currentWidth; + TQValueList<int> index; - QPtrList<KSGRD::SensorPSLine> pl; + TQPtrList<KSGRD::SensorPSLine> pl; - QStringList mColumnTypes; - QDict<QString> columnDict; + TQStringList mColumnTypes; + TQDict<TQString> columnDict; - QValueList<int> selectedPIds; - QValueList<int> closedSubTrees; - QStringList selectedAsStrings; + TQValueList<int> selectedPIds; + TQValueList<int> closedSubTrees; + TQStringList selectedAsStrings; - static QDict<QString> aliases; + static TQDict<TQString> aliases; - QDict<QPixmap> iconCache; + TQDict<TQPixmap> iconCache; - QPopupMenu* headerPM; + TQPopupMenu* headerPM; }; #endif diff --git a/ksysguard/gui/SensorDisplayLib/ReniceDlg.cc b/ksysguard/gui/SensorDisplayLib/ReniceDlg.cc index 39c05eecf..dfd535883 100644 --- a/ksysguard/gui/SensorDisplayLib/ReniceDlg.cc +++ b/ksysguard/gui/SensorDisplayLib/ReniceDlg.cc @@ -27,22 +27,22 @@ #include "ReniceDlg.moc" -ReniceDlg::ReniceDlg(QWidget* parent, const char* name, int currentPPrio, +ReniceDlg::ReniceDlg(TQWidget* parent, const char* name, int currentPPrio, int pid) : KDialogBase( parent, name, true, i18n("Renice Process"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ) { - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget(page); - vLay = new QVBoxLayout(page, 20, -1, "ReniceLayout"); + vLay = new TQVBoxLayout(page, 20, -1, "ReniceLayout"); - QString msg; + TQString msg; msg = i18n("You are about to change the scheduling priority of\n" "process %1. Be aware that only the Superuser (root)\n" "can decrease the nice level of a process. The lower\n" "the number is the higher the priority.\n\n" "Please enter the desired nice level:").arg(pid); - message = new QLabel(msg, page); + message = new TQLabel(msg, page); message->setMinimumSize(message->sizeHint()); vLay->addWidget(message); diff --git a/ksysguard/gui/SensorDisplayLib/ReniceDlg.h b/ksysguard/gui/SensorDisplayLib/ReniceDlg.h index d8f0d2685..1d490973c 100644 --- a/ksysguard/gui/SensorDisplayLib/ReniceDlg.h +++ b/ksysguard/gui/SensorDisplayLib/ReniceDlg.h @@ -26,11 +26,11 @@ #define _ReniceDlg_h_ #include <kdialogbase.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlcdnumber.h> -#include <qpushbutton.h> -#include <qslider.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlcdnumber.h> +#include <tqpushbutton.h> +#include <tqslider.h> class KIntNumInput; @@ -43,18 +43,18 @@ class ReniceDlg : public KDialogBase Q_OBJECT public: - ReniceDlg(QWidget* parent, const char* name, int currentPPrio, int pid); + ReniceDlg(TQWidget* parent, const char* name, int currentPPrio, int pid); public slots: void slotOk(); void slotCancel(); private: - QBoxLayout* vLay; - QBoxLayout* butLay; - QBoxLayout* sldLay; + TQBoxLayout* vLay; + TQBoxLayout* butLay; + TQBoxLayout* sldLay; - QLabel* message; + TQLabel* message; KIntNumInput* input; }; diff --git a/ksysguard/gui/SensorDisplayLib/SensorDisplay.cc b/ksysguard/gui/SensorDisplayLib/SensorDisplay.cc index 805c9a492..c80ad65ee 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorDisplay.cc +++ b/ksysguard/gui/SensorDisplayLib/SensorDisplay.cc @@ -21,12 +21,12 @@ */ -#include <qcheckbox.h> -#include <qdom.h> -#include <qpopupmenu.h> -#include <qspinbox.h> -#include <qwhatsthis.h> -#include <qbitmap.h> +#include <tqcheckbox.h> +#include <tqdom.h> +#include <tqpopupmenu.h> +#include <tqspinbox.h> +#include <tqwhatsthis.h> +#include <tqbitmap.h> #include <kapplication.h> #include <kdebug.h> @@ -43,9 +43,9 @@ using namespace KSGRD; -SensorDisplay::SensorDisplay( QWidget *parent, const char *name, - const QString &title, bool nf, bool isApplet) - : QWidget( parent, name ) +SensorDisplay::SensorDisplay( TQWidget *parent, const char *name, + const TQString &title, bool nf, bool isApplet) + : TQWidget( parent, name ) { mIsApplet = isApplet; mSensors.setAutoDelete( true ); @@ -61,10 +61,10 @@ SensorDisplay::SensorDisplay( QWidget *parent, const char *name, mPlotterWdg = 0; setTimerOn( true ); - QWhatsThis::add( this, "dummy" ); + TQWhatsThis::add( this, "dummy" ); if(!nf) { - mFrame = new QGroupBox( 2, Qt::Vertical, "", this, "displayFrame"); + mFrame = new TQGroupBox( 2, Qt::Vertical, "", this, "displayFrame"); mFrame->setFlat(true); mFrame->setAlignment(Qt::AlignHCenter); mFrame->setInsideMargin(2); @@ -101,7 +101,7 @@ void SensorDisplay::registerSensor( SensorProperties *sp ) * a case the user can re-enter the connect information and the * connection will be established. */ if ( !SensorMgr->engageHost( sp->hostName() ) ) { - QString msg = i18n( "It is impossible to connect to \'%1\'." ).arg( sp->hostName() ); + TQString msg = i18n( "It is impossible to connect to \'%1\'." ).arg( sp->hostName() ); KMessageBox::error( this, msg ); } @@ -140,24 +140,24 @@ void SensorDisplay::configureUpdateInterval() } } -void SensorDisplay::timerEvent( QTimerEvent* ) +void SensorDisplay::timerEvent( TQTimerEvent* ) { int i = 0; for ( SensorProperties *s = mSensors.first(); s; s = mSensors.next(), ++i ) sendRequest( s->hostName(), s->name(), i ); } -void SensorDisplay::resizeEvent( QResizeEvent* ) +void SensorDisplay::resizeEvent( TQResizeEvent* ) { if(mFrame) mFrame->setGeometry( rect() ); } -bool SensorDisplay::eventFilter( QObject *object, QEvent *event ) +bool SensorDisplay::eventFilter( TQObject *object, TQEvent *event ) { - if ( event->type() == QEvent::MouseButtonPress && - ( (QMouseEvent*)event)->button() == RightButton ) { - QPopupMenu pm; + if ( event->type() == TQEvent::MouseButtonPress && + ( (TQMouseEvent*)event)->button() == RightButton ) { + TQPopupMenu pm; if ( mIsApplet ) { pm.insertItem( i18n( "Launch &System Guard"), 1 ); pm.insertSeparator(); @@ -172,7 +172,7 @@ bool SensorDisplay::eventFilter( QObject *object, QEvent *event ) else pm.insertItem( i18n( "P&ause Update" ), 6 ); - switch ( pm.exec( QCursor::pos() ) ) { + switch ( pm.exec( TQCursor::pos() ) ) { case 1: KRun::run(*KService::serviceByDesktopName("ksysguard"), KURL::List()); break; @@ -180,7 +180,7 @@ bool SensorDisplay::eventFilter( QObject *object, QEvent *event ) configureSettings(); break; case 3: { - QCustomEvent *e = new QCustomEvent( QEvent::User ); + TQCustomEvent *e = new TQCustomEvent( TQEvent::User ); e->setData( this ); kapp->postEvent( parent(), e ); } @@ -199,16 +199,16 @@ bool SensorDisplay::eventFilter( QObject *object, QEvent *event ) } return true; - } else if ( event->type() == QEvent::MouseButtonRelease && - ( ( QMouseEvent*)event)->button() == LeftButton ) { + } else if ( event->type() == TQEvent::MouseButtonRelease && + ( ( TQMouseEvent*)event)->button() == LeftButton ) { setFocus(); } - return QWidget::eventFilter( object, event ); + return TQWidget::eventFilter( object, event ); } -void SensorDisplay::sendRequest( const QString &hostName, - const QString &command, int id ) +void SensorDisplay::sendRequest( const TQString &hostName, + const TQString &command, int id ) { if ( !SensorMgr->sendRequest( hostName, command, (SensorClient*)this, id ) ) sensorError( id, true ); @@ -236,7 +236,7 @@ void SensorDisplay::sensorError( int sensorId, bool err ) void SensorDisplay::updateWhatsThis() { - QWhatsThis::add( this, i18n( + TQWhatsThis::add( this, i18n( "<qt><p>This is a sensor display. To customize a sensor display click " "and hold the right mouse button on either the frame or the " "display box and select the <i>Properties</i> entry from the popup " @@ -244,34 +244,34 @@ void SensorDisplay::updateWhatsThis() "</p>%1</qt>" ).arg( additionalWhatsThis() ) ); } -void SensorDisplay::hosts( QStringList& list ) +void SensorDisplay::hosts( TQStringList& list ) { for ( SensorProperties *s = mSensors.first(); s; s = mSensors.next() ) if ( !list.contains( s->hostName() ) ) list.append( s->hostName() ); } -QColor SensorDisplay::restoreColor( QDomElement &element, const QString &attr, - const QColor& fallback ) +TQColor SensorDisplay::restoreColor( TQDomElement &element, const TQString &attr, + const TQColor& fallback ) { bool ok; uint c = element.attribute( attr ).toUInt( &ok ); if ( !ok ) return fallback; else - return QColor( (c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF ); + return TQColor( (c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF ); } -void SensorDisplay::saveColor( QDomElement &element, const QString &attr, - const QColor &color ) +void SensorDisplay::saveColor( TQDomElement &element, const TQString &attr, + const TQColor &color ) { int r, g, b; color.rgb( &r, &g, &b ); element.setAttribute( attr, (r << 16) | (g << 8) | b ); } -bool SensorDisplay::addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &description ) +bool SensorDisplay::addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &description ) { registerSensor( new SensorProperties( hostName, name, type, description ) ); return true; @@ -315,9 +315,9 @@ bool SensorDisplay::useGlobalUpdateInterval() const return mUseGlobalUpdateInterval; } -QString SensorDisplay::additionalWhatsThis() +TQString SensorDisplay::additionalWhatsThis() { - return QString::null; + return TQString::null; } void SensorDisplay::sensorLost( int reqId ) @@ -325,20 +325,20 @@ void SensorDisplay::sensorLost( int reqId ) sensorError( reqId, true ); } -bool SensorDisplay::restoreSettings( QDomElement &element ) +bool SensorDisplay::restoreSettings( TQDomElement &element ) { - QString str = element.attribute( "showUnit", "X" ); + TQString str = element.attribute( "showUnit", "X" ); if(!str.isEmpty() && str != "X") { mShowUnit = str.toInt(); } - str = element.attribute( "unit", QString::null ); + str = element.attribute( "unit", TQString::null ); if(!str.isEmpty()) setUnit(str); - str = element.attribute( "title", QString::null ); + str = element.attribute( "title", TQString::null ); if(!str.isEmpty()) setTitle(str); - if ( element.attribute( "updateInterval" ) != QString::null ) { + if ( element.attribute( "updateInterval" ) != TQString::null ) { mUseGlobalUpdateInterval = false; setUpdateInterval( element.attribute( "updateInterval", "2" ).toInt() ); } else { @@ -360,7 +360,7 @@ bool SensorDisplay::restoreSettings( QDomElement &element ) return true; } -bool SensorDisplay::saveSettings( QDomDocument&, QDomElement &element, bool ) +bool SensorDisplay::saveSettings( TQDomDocument&, TQDomElement &element, bool ) { element.setAttribute( "title", title() ); element.setAttribute( "unit", unit() ); @@ -404,7 +404,7 @@ bool SensorDisplay::modified() const return mModified; } -QPtrList<SensorProperties> &SensorDisplay::sensors() +TQPtrList<SensorProperties> &SensorDisplay::sensors() { return mSensors; } @@ -439,12 +439,12 @@ void SensorDisplay::setSensorOk( bool ok ) if ( mErrorIndicator ) return; - QPixmap errorIcon = KGlobal::iconLoader()->loadIcon( "connect_creating", KIcon::Desktop, + TQPixmap errorIcon = KGlobal::iconLoader()->loadIcon( "connect_creating", KIcon::Desktop, KIcon::SizeSmall ); if ( !mPlotterWdg ) return; - mErrorIndicator = new QWidget( mPlotterWdg ); + mErrorIndicator = new TQWidget( mPlotterWdg ); mErrorIndicator->setErasePixmap( errorIcon ); mErrorIndicator->resize( errorIcon.size() ); if ( errorIcon.mask() ) @@ -454,7 +454,7 @@ void SensorDisplay::setSensorOk( bool ok ) } } -void SensorDisplay::setTitle( const QString &title ) +void SensorDisplay::setTitle( const TQString &title ) { mTitle = title; @@ -465,7 +465,7 @@ void SensorDisplay::setTitle( const QString &title ) /* Changing the frame title may increase the width of the frame and * hence breaks the layout. To avoid this, we save the original size * and restore it after we have set the frame title. */ - QSize s = mFrame->size(); + TQSize s = mFrame->size(); if ( mShowUnit && !mUnit.isEmpty() ) mFrame->setTitle( mTitle + " [" + mUnit + "]" ); @@ -474,17 +474,17 @@ void SensorDisplay::setTitle( const QString &title ) mFrame->setGeometry( 0, 0, s.width(), s.height() ); } -QString SensorDisplay::title() const +TQString SensorDisplay::title() const { return mTitle; } -void SensorDisplay::setUnit( const QString &unit ) +void SensorDisplay::setUnit( const TQString &unit ) { mUnit = unit; } -QString SensorDisplay::unit() const +TQString SensorDisplay::unit() const { return mUnit; } @@ -499,13 +499,13 @@ bool SensorDisplay::showUnit() const return mShowUnit; } -void SensorDisplay::setPlotterWidget( QWidget *wdg ) +void SensorDisplay::setPlotterWidget( TQWidget *wdg ) { mPlotterWdg = wdg; } -QWidget *SensorDisplay::frame() +TQWidget *SensorDisplay::frame() { return mFrame; } @@ -520,9 +520,9 @@ bool SensorDisplay::noFrame() const return !mFrame; } -void SensorDisplay::reorderSensors(const QValueList<int> &orderOfSensors) +void SensorDisplay::reorderSensors(const TQValueList<int> &orderOfSensors) { - QPtrList<SensorProperties> newSensors; + TQPtrList<SensorProperties> newSensors; for ( uint i = 0; i < orderOfSensors.count(); ++i ) { newSensors.append( mSensors.at(orderOfSensors[i] )); } @@ -537,8 +537,8 @@ SensorProperties::SensorProperties() { } -SensorProperties::SensorProperties( const QString &hostName, const QString &name, - const QString &type, const QString &description ) +SensorProperties::SensorProperties( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &description ) : mHostName( hostName ), mName( name ), mType( type ), mDescription( description ) { mOk = false; @@ -548,52 +548,52 @@ SensorProperties::~SensorProperties() { } -void SensorProperties::setHostName( const QString &hostName ) +void SensorProperties::setHostName( const TQString &hostName ) { mHostName = hostName; } -QString SensorProperties::hostName() const +TQString SensorProperties::hostName() const { return mHostName; } -void SensorProperties::setName( const QString &name ) +void SensorProperties::setName( const TQString &name ) { mName = name; } -QString SensorProperties::name() const +TQString SensorProperties::name() const { return mName; } -void SensorProperties::setType( const QString &type ) +void SensorProperties::setType( const TQString &type ) { mType = type; } -QString SensorProperties::type() const +TQString SensorProperties::type() const { return mType; } -void SensorProperties::setDescription( const QString &description ) +void SensorProperties::setDescription( const TQString &description ) { mDescription = description; } -QString SensorProperties::description() const +TQString SensorProperties::description() const { return mDescription; } -void SensorProperties::setUnit( const QString &unit ) +void SensorProperties::setUnit( const TQString &unit ) { mUnit = unit; } -QString SensorProperties::unit() const +TQString SensorProperties::unit() const { return mUnit; } diff --git a/ksysguard/gui/SensorDisplayLib/SensorDisplay.h b/ksysguard/gui/SensorDisplayLib/SensorDisplay.h index e5e867a01..72f1af543 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorDisplay.h +++ b/ksysguard/gui/SensorDisplayLib/SensorDisplay.h @@ -24,10 +24,10 @@ #ifndef KSG_SENSORDISPLAY_H #define KSG_SENSORDISPLAY_H -#include <qgroupbox.h> -#include <qlabel.h> -#include <qvaluelist.h> -#include <qwidget.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqvaluelist.h> +#include <tqwidget.h> #include <knotifyclient.h> @@ -48,7 +48,7 @@ class SensorProperties; more sensors in any form. It must be inherited by all displays that should be inserted into the work sheet. */ -class SensorDisplay : public QWidget, public SensorClient +class SensorDisplay : public TQWidget, public SensorClient { Q_OBJECT @@ -56,8 +56,8 @@ class SensorDisplay : public QWidget, public SensorClient /** Constructor. */ - SensorDisplay( QWidget *parent = 0, const char *name = 0, - const QString& title = 0, bool nf = false, bool isApplet = false ); + SensorDisplay( TQWidget *parent = 0, const char *name = 0, + const TQString& title = 0, bool nf = false, bool isApplet = false ); /** Destructor. @@ -67,22 +67,22 @@ class SensorDisplay : public QWidget, public SensorClient /** Sets the title of the display. */ - void setTitle( const QString &title ); + void setTitle( const TQString &title ); /** Returns the title of the display. */ - QString title() const; + TQString title() const; /** Sets the unit of the display. */ - void setUnit( const QString &unit ); + void setUnit( const TQString &unit ); /** Returns the unit of the display. */ - QString unit() const; + TQString unit() const; /** Sets whether the unit string should be displayed at the top @@ -123,17 +123,17 @@ class SensorDisplay : public QWidget, public SensorClient /** This method appends all hosts of the display to @ref list. */ - void hosts( QStringList& list ); + void hosts( TQStringList& list ); /** Sets the widget on which the error icon can be drawn. */ - void setPlotterWidget( QWidget *plotter ); + void setPlotterWidget( TQWidget *plotter ); /** Returns the widget on which the error icon can be drawn. */ - QWidget *plotterWidget() const; + TQWidget *plotterWidget() const; /** Add a sensor to the display. @@ -143,8 +143,8 @@ class SensorDisplay : public QWidget, public SensorClient @param type The type of the sensor. @param description A short description of the sensor. */ - virtual bool addSensor( const QString &hostName, const QString &name, - const QString &type, const QString &description ); + virtual bool addSensor( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &description ); /** Removes the sensor from the display, that is at the position @@ -158,7 +158,7 @@ class SensorDisplay : public QWidget, public SensorClient a request to a sensor since it performs an appropriate error handling by removing the display of necessary. */ - void sendRequest( const QString &hostName, const QString &cmd, int id ); + void sendRequest( const TQString &hostName, const TQString &cmd, int id ); /** Raises the configure dialog to setup the update interval. @@ -180,12 +180,12 @@ class SensorDisplay : public QWidget, public SensorClient /** Reimplement this method to setup the display from config data. */ - virtual bool restoreSettings( QDomElement& ); + virtual bool restoreSettings( TQDomElement& ); /** Reimplement this method to save the displays config data. */ - virtual bool saveSettings( QDomDocument&, QDomElement&, bool = true ); + virtual bool saveSettings( TQDomDocument&, TQDomElement&, bool = true ); /** Reimplement this method to catch error messages from the SensorManager. @@ -237,32 +237,32 @@ class SensorDisplay : public QWidget, public SensorClient void modified( bool modified ); protected: - virtual bool eventFilter( QObject*, QEvent* ); - virtual void resizeEvent( QResizeEvent* ); - virtual void timerEvent( QTimerEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); + virtual void resizeEvent( TQResizeEvent* ); + virtual void timerEvent( TQTimerEvent* ); void registerSensor( SensorProperties *sp ); void unregisterSensor( uint pos ); - QColor restoreColor( QDomElement &element, const QString &attr, - const QColor& fallback ); - void saveColor( QDomElement &element, const QString &attr, - const QColor &color ); + TQColor restoreColor( TQDomElement &element, const TQString &attr, + const TQColor& fallback ); + void saveColor( TQDomElement &element, const TQString &attr, + const TQColor &color ); - virtual QString additionalWhatsThis(); + virtual TQString additionalWhatsThis(); void setSensorOk( bool ok ); bool modified() const; bool timerOn() const; - QWidget *frame(); + TQWidget *frame(); // void setNoFrame( bool value ); bool noFrame() const; - void reorderSensors(const QValueList<int> &orderOfSensors); - QPtrList<SensorProperties> &sensors(); + void reorderSensors(const TQValueList<int> &orderOfSensors); + TQPtrList<SensorProperties> &sensors(); private: void updateWhatsThis(); @@ -277,49 +277,49 @@ class SensorDisplay : public QWidget, public SensorClient int mUpdateInterval; // The frame around the other widgets. - QGroupBox* mFrame; + TQGroupBox* mFrame; - QPtrList<SensorProperties> mSensors; + TQPtrList<SensorProperties> mSensors; - QString mTitle; - QString mUnit; + TQString mTitle; + TQString mUnit; - QWidget* mErrorIndicator; - QWidget* mPlotterWdg; + TQWidget* mErrorIndicator; + TQWidget* mPlotterWdg; }; class SensorProperties { public: SensorProperties(); - SensorProperties( const QString &hostName, const QString &name, - const QString &type, const QString &description ); + SensorProperties( const TQString &hostName, const TQString &name, + const TQString &type, const TQString &description ); ~SensorProperties(); - void setHostName( const QString &hostName ); - QString hostName() const; + void setHostName( const TQString &hostName ); + TQString hostName() const; - void setName( const QString &name ); - QString name() const; + void setName( const TQString &name ); + TQString name() const; - void setType( const QString &type ); - QString type() const; + void setType( const TQString &type ); + TQString type() const; - void setDescription( const QString &description ); - QString description() const; + void setDescription( const TQString &description ); + TQString description() const; - void setUnit( const QString &unit ); - QString unit() const; + void setUnit( const TQString &unit ); + TQString unit() const; void setIsOk( bool value ); bool isOk() const; private: - QString mHostName; - QString mName; - QString mType; - QString mDescription; - QString mUnit; + TQString mHostName; + TQString mName; + TQString mType; + TQString mDescription; + TQString mUnit; /* This flag indicates whether the communication to the sensor is * ok or not. */ diff --git a/ksysguard/gui/SensorDisplayLib/SensorLogger.cc b/ksysguard/gui/SensorDisplayLib/SensorLogger.cc index b51ba67e0..383bf525e 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLogger.cc +++ b/ksysguard/gui/SensorDisplayLib/SensorLogger.cc @@ -25,17 +25,17 @@ #include <ksgrd/SensorManager.h> #include <ksgrd/StyleEngine.h> -#include <qfile.h> +#include <tqfile.h> #include "SensorLogger.moc" #include "SensorLoggerSettings.h" -SLListViewItem::SLListViewItem(QListView *parent) - : QListViewItem(parent) +SLListViewItem::SLListViewItem(TQListView *parent) + : TQListViewItem(parent) { } -LogSensor::LogSensor(QListView *parent) +LogSensor::LogSensor(TQListView *parent) : timerID( NONE ), lowerLimitActive( 0 ), upperLimitActive( 0 ), lowerLimit( 0 ), upperLimit( 0 ) { @@ -78,15 +78,15 @@ LogSensor::stopLogging(void) } void -LogSensor::timerEvent(QTimerEvent*) +LogSensor::timerEvent(TQTimerEvent*) { KSGRD::SensorMgr->sendRequest(hostName, sensorName, (KSGRD::SensorClient*) this, 42); } void -LogSensor::answerReceived(int id, const QString& answer) +LogSensor::answerReceived(int id, const TQString& answer) { - QFile logFile(fileName); + TQFile logFile(fileName); if (!logFile.open(IO_ReadWrite | IO_Append)) { @@ -97,7 +97,7 @@ LogSensor::answerReceived(int id, const QString& answer) switch (id) { case 42: { - QTextStream stream(&logFile); + TQTextStream stream(&logFile); double value = answer.toDouble(); if (lowerLimitActive && value < lowerLimit) @@ -106,7 +106,7 @@ LogSensor::answerReceived(int id, const QString& answer) lowerLimitActive = false; lvi->setTextColor(monitor->colorGroup().foreground()); lvi->repaint(); - KNotifyClient::event(monitor->winId(), "sensor_alarm", QString("sensor '%1' at '%2' reached lower limit").arg(sensorName).arg(hostName)); + KNotifyClient::event(monitor->winId(), "sensor_alarm", TQString("sensor '%1' at '%2' reached lower limit").arg(sensorName).arg(hostName)); timerOn(); } else if (upperLimitActive && value > upperLimit) { @@ -114,23 +114,23 @@ LogSensor::answerReceived(int id, const QString& answer) upperLimitActive = false; lvi->setTextColor(monitor->colorGroup().foreground()); lvi->repaint(); - KNotifyClient::event(monitor->winId(), "sensor_alarm", QString("sensor '%1' at '%2' reached upper limit").arg(sensorName).arg(hostName)); + KNotifyClient::event(monitor->winId(), "sensor_alarm", TQString("sensor '%1' at '%2' reached upper limit").arg(sensorName).arg(hostName)); timerOn(); } - QDate date = QDateTime::currentDateTime().date(); - QTime time = QDateTime::currentDateTime().time(); + TQDate date = TQDateTime::currentDateTime().date(); + TQTime time = TQDateTime::currentDateTime().time(); - stream << QString("%1 %2 %3 %4 %5: %6\n").arg(date.shortMonthName(date.month())).arg(date.day()).arg(time.toString()).arg(hostName).arg(sensorName).arg(value); + stream << TQString("%1 %2 %3 %4 %5: %6\n").arg(date.shortMonthName(date.month())).arg(date.day()).arg(time.toString()).arg(hostName).arg(sensorName).arg(value); } } logFile.close(); } -SensorLogger::SensorLogger(QWidget *parent, const char *name, const QString& title) +SensorLogger::SensorLogger(TQWidget *parent, const char *name, const TQString& title) : KSGRD::SensorDisplay(parent, name, title) { - monitor = new QListView(this, "monitor"); + monitor = new TQListView(this, "monitor"); Q_CHECK_PTR(monitor); monitor->addColumn(i18n("Logging")); @@ -139,14 +139,14 @@ SensorLogger::SensorLogger(QWidget *parent, const char *name, const QString& tit monitor->addColumn(i18n("Host Name")); monitor->addColumn(i18n("Log File")); - QColorGroup cgroup = monitor->colorGroup(); - cgroup.setColor(QColorGroup::Text, KSGRD::Style->firstForegroundColor()); - cgroup.setColor(QColorGroup::Base, KSGRD::Style->backgroundColor()); - cgroup.setColor(QColorGroup::Foreground, KSGRD::Style->alarmColor()); - monitor->setPalette(QPalette(cgroup, cgroup, cgroup)); - monitor->setSelectionMode(QListView::NoSelection); + TQColorGroup cgroup = monitor->colorGroup(); + cgroup.setColor(TQColorGroup::Text, KSGRD::Style->firstForegroundColor()); + cgroup.setColor(TQColorGroup::Base, KSGRD::Style->backgroundColor()); + cgroup.setColor(TQColorGroup::Foreground, KSGRD::Style->alarmColor()); + monitor->setPalette(TQPalette(cgroup, cgroup, cgroup)); + monitor->setSelectionMode(TQListView::NoSelection); - connect(monitor, SIGNAL(rightButtonClicked(QListViewItem*, const QPoint&, int)), this, SLOT(RMBClicked(QListViewItem*, const QPoint&, int))); + connect(monitor, TQT_SIGNAL(rightButtonClicked(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT(RMBClicked(TQListViewItem*, const TQPoint&, int))); setTitle(i18n("Sensor Logger")); @@ -163,7 +163,7 @@ SensorLogger::~SensorLogger(void) } bool -SensorLogger::addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString&) +SensorLogger::addSensor(const TQString& hostName, const TQString& sensorName, const TQString& sensorType, const TQString&) { if (sensorType != "integer" && sensorType != "float") return (false); @@ -232,12 +232,12 @@ SensorLogger::editSensor(LogSensor* sensor) void SensorLogger::configureSettings() { - QColorGroup cgroup = monitor->colorGroup(); + TQColorGroup cgroup = monitor->colorGroup(); sls = new SensorLoggerSettings(this, "SensorLoggerSettings"); Q_CHECK_PTR(sls); - connect( sls, SIGNAL( applyClicked() ), SLOT( applySettings() ) ); + connect( sls, TQT_SIGNAL( applyClicked() ), TQT_SLOT( applySettings() ) ); sls->setTitle(title()); sls->setForegroundColor(cgroup.text()); @@ -254,14 +254,14 @@ SensorLogger::configureSettings() void SensorLogger::applySettings() { - QColorGroup cgroup = monitor->colorGroup(); + TQColorGroup cgroup = monitor->colorGroup(); setTitle(sls->title()); - cgroup.setColor(QColorGroup::Text, sls->foregroundColor()); - cgroup.setColor(QColorGroup::Base, sls->backgroundColor()); - cgroup.setColor(QColorGroup::Foreground, sls->alarmColor()); - monitor->setPalette(QPalette(cgroup, cgroup, cgroup)); + cgroup.setColor(TQColorGroup::Text, sls->foregroundColor()); + cgroup.setColor(TQColorGroup::Base, sls->backgroundColor()); + cgroup.setColor(TQColorGroup::Foreground, sls->alarmColor()); + monitor->setPalette(TQPalette(cgroup, cgroup, cgroup)); setModified(true); } @@ -269,31 +269,31 @@ SensorLogger::applySettings() void SensorLogger::applyStyle(void) { - QColorGroup cgroup = monitor->colorGroup(); + TQColorGroup cgroup = monitor->colorGroup(); - cgroup.setColor(QColorGroup::Text, KSGRD::Style->firstForegroundColor()); - cgroup.setColor(QColorGroup::Base, KSGRD::Style->backgroundColor()); - cgroup.setColor(QColorGroup::Foreground, KSGRD::Style->alarmColor()); - monitor->setPalette(QPalette(cgroup, cgroup, cgroup)); + cgroup.setColor(TQColorGroup::Text, KSGRD::Style->firstForegroundColor()); + cgroup.setColor(TQColorGroup::Base, KSGRD::Style->backgroundColor()); + cgroup.setColor(TQColorGroup::Foreground, KSGRD::Style->alarmColor()); + monitor->setPalette(TQPalette(cgroup, cgroup, cgroup)); setModified(true); } bool -SensorLogger::restoreSettings(QDomElement& element) +SensorLogger::restoreSettings(TQDomElement& element) { - QColorGroup cgroup = monitor->colorGroup(); + TQColorGroup cgroup = monitor->colorGroup(); - cgroup.setColor(QColorGroup::Text, restoreColor(element, "textColor", Qt::green)); - cgroup.setColor(QColorGroup::Base, restoreColor(element, "backgroundColor", Qt::black)); - cgroup.setColor(QColorGroup::Foreground, restoreColor(element, "alarmColor", Qt::red)); - monitor->setPalette(QPalette(cgroup, cgroup, cgroup)); + cgroup.setColor(TQColorGroup::Text, restoreColor(element, "textColor", Qt::green)); + cgroup.setColor(TQColorGroup::Base, restoreColor(element, "backgroundColor", Qt::black)); + cgroup.setColor(TQColorGroup::Foreground, restoreColor(element, "alarmColor", Qt::red)); + monitor->setPalette(TQPalette(cgroup, cgroup, cgroup)); logSensors.clear(); - QDomNodeList dnList = element.elementsByTagName("logsensors"); + TQDomNodeList dnList = element.elementsByTagName("logsensors"); for (uint i = 0; i < dnList.count(); i++) { - QDomElement element = dnList.item(i).toElement(); + TQDomElement element = dnList.item(i).toElement(); LogSensor* sensor = new LogSensor(monitor); Q_CHECK_PTR(sensor); @@ -317,7 +317,7 @@ SensorLogger::restoreSettings(QDomElement& element) } bool -SensorLogger::saveSettings(QDomDocument& doc, QDomElement& element, bool save) +SensorLogger::saveSettings(TQDomDocument& doc, TQDomElement& element, bool save) { saveColor(element, "textColor", monitor->colorGroup().text()); saveColor(element, "backgroundColor", monitor->colorGroup().base()); @@ -325,15 +325,15 @@ SensorLogger::saveSettings(QDomDocument& doc, QDomElement& element, bool save) for (LogSensor* sensor = logSensors.first(); sensor != 0; sensor = logSensors.next()) { - QDomElement log = doc.createElement("logsensors"); + TQDomElement log = doc.createElement("logsensors"); log.setAttribute("sensorName", sensor->getSensorName()); log.setAttribute("hostName", sensor->getHostName()); log.setAttribute("fileName", sensor->getFileName()); log.setAttribute("timerInterval", sensor->getTimerInterval()); - log.setAttribute("lowerLimitActive", QString("%1").arg(sensor->getLowerLimitActive())); - log.setAttribute("lowerLimit", QString("%1").arg(sensor->getLowerLimit())); - log.setAttribute("upperLimitActive", QString("%1").arg(sensor->getUpperLimitActive())); - log.setAttribute("upperLimit", QString("%1").arg(sensor->getUpperLimit())); + log.setAttribute("lowerLimitActive", TQString("%1").arg(sensor->getLowerLimitActive())); + log.setAttribute("lowerLimit", TQString("%1").arg(sensor->getLowerLimit())); + log.setAttribute("upperLimitActive", TQString("%1").arg(sensor->getUpperLimitActive())); + log.setAttribute("upperLimit", TQString("%1").arg(sensor->getUpperLimit())); element.appendChild(log); } @@ -347,20 +347,20 @@ SensorLogger::saveSettings(QDomDocument& doc, QDomElement& element, bool save) } void -SensorLogger::answerReceived(int, const QString&) +SensorLogger::answerReceived(int, const TQString&) { // we do not use this, since all answers are received by the LogSensors } void -SensorLogger::resizeEvent(QResizeEvent*) +SensorLogger::resizeEvent(TQResizeEvent*) { frame()->setGeometry(0, 0, this->width(), this->height()); monitor->setGeometry(10, 20, this->width() - 20, this->height() - 30); } LogSensor* -SensorLogger::getLogSensor(QListViewItem* item) +SensorLogger::getLogSensor(TQListViewItem* item) { for (LogSensor* sensor = logSensors.first(); sensor != 0; sensor = logSensors.next()) { @@ -373,9 +373,9 @@ SensorLogger::getLogSensor(QListViewItem* item) } void -SensorLogger::RMBClicked(QListViewItem* item, const QPoint& point, int) +SensorLogger::RMBClicked(TQListViewItem* item, const TQPoint& point, int) { - QPopupMenu pm; + TQPopupMenu pm; if (hasSettingsDialog()) pm.insertItem(i18n("&Properties"), 1); pm.insertItem(i18n("&Remove Display"), 2); @@ -404,7 +404,7 @@ SensorLogger::RMBClicked(QListViewItem* item, const QPoint& point, int) configureSettings(); break; case 2: { - QCustomEvent* ev = new QCustomEvent(QEvent::User); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User); ev->setData(this); kapp->postEvent(parent(), ev); break; diff --git a/ksysguard/gui/SensorDisplayLib/SensorLogger.h b/ksysguard/gui/SensorDisplayLib/SensorLogger.h index 835e62401..018e36bf9 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLogger.h +++ b/ksysguard/gui/SensorDisplayLib/SensorLogger.h @@ -21,13 +21,13 @@ #ifndef _SensorLogger_h #define _SensorLogger_h -#include <qdom.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qpopupmenu.h> -#include <qspinbox.h> -#include <qstring.h> +#include <tqdom.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqpopupmenu.h> +#include <tqspinbox.h> +#include <tqstring.h> #include <SensorDisplay.h> @@ -40,35 +40,35 @@ class SensorLoggerSettings; class SLListViewItem : public QListViewItem { public: - SLListViewItem(QListView *parent = 0); + SLListViewItem(TQListView *parent = 0); - void setTextColor(const QColor& color) { textColor = color; } + void setTextColor(const TQColor& color) { textColor = color; } - void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) { - QColorGroup cgroup(cg); - cgroup.setColor(QColorGroup::Text, textColor); - QListViewItem::paintCell(p, cgroup, column, width, alignment); + void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int alignment) { + TQColorGroup cgroup(cg); + cgroup.setColor(TQColorGroup::Text, textColor); + TQListViewItem::paintCell(p, cgroup, column, width, alignment); } - void paintFocus(QPainter *, const QColorGroup, const QRect) {} + void paintFocus(TQPainter *, const TQColorGroup, const TQRect) {} private: - QColor textColor; + TQColor textColor; }; -class LogSensor : public QObject, public KSGRD::SensorClient +class LogSensor : public TQObject, public KSGRD::SensorClient { Q_OBJECT public: - LogSensor(QListView *parent); + LogSensor(TQListView *parent); ~LogSensor(void); - void answerReceived(int id, const QString& answer); + void answerReceived(int id, const TQString& answer); - void setHostName(const QString& name) { hostName = name; lvi->setText(3, name); } - void setSensorName(const QString& name) { sensorName = name; lvi->setText(2, name); } - void setFileName(const QString& name) + void setHostName(const TQString& name) { hostName = name; lvi->setText(3, name); } + void setSensorName(const TQString& name) { sensorName = name; lvi->setText(2, name); } + void setFileName(const TQString& name) { fileName = name; lvi->setText(4, name); @@ -87,18 +87,18 @@ public: timerOn(); } - lvi->setText(1, QString("%1").arg(interval)); + lvi->setText(1, TQString("%1").arg(interval)); } - QString getSensorName(void) { return sensorName; } - QString getHostName(void) { return hostName; } - QString getFileName(void) { return fileName; } + TQString getSensorName(void) { return sensorName; } + TQString getHostName(void) { return hostName; } + TQString getFileName(void) { return fileName; } int getTimerInterval(void) { return timerInterval; } bool getUpperLimitActive(void) { return upperLimitActive; } bool getLowerLimitActive(void) { return lowerLimitActive; } double getUpperLimit(void) { return upperLimit; } double getLowerLimit(void) { return lowerLimit; } - QListViewItem* getListViewItem(void) { return lvi; } + TQListViewItem* getListViewItem(void) { return lvi; } public slots: void timerOff() @@ -118,16 +118,16 @@ public slots: void stopLogging(void); protected: - virtual void timerEvent(QTimerEvent*); + virtual void timerEvent(TQTimerEvent*); private: - QListView* monitor; + TQListView* monitor; SLListViewItem* lvi; - QPixmap pixmap_running; - QPixmap pixmap_waiting; - QString sensorName; - QString hostName; - QString fileName; + TQPixmap pixmap_running; + TQPixmap pixmap_waiting; + TQString sensorName; + TQString hostName; + TQString fileName; int timerInterval; int timerID; @@ -143,19 +143,19 @@ class SensorLogger : public KSGRD::SensorDisplay { Q_OBJECT public: - SensorLogger(QWidget *parent = 0, const char *name = 0, const QString& title = 0); + SensorLogger(TQWidget *parent = 0, const char *name = 0, const TQString& title = 0); ~SensorLogger(void); - bool addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, - const QString& sensorDescr); + bool addSensor(const TQString& hostName, const TQString& sensorName, const TQString& sensorType, + const TQString& sensorDescr); bool editSensor(LogSensor*); - void answerReceived(int id, const QString& answer); - void resizeEvent(QResizeEvent*); + void answerReceived(int id, const TQString& answer); + void resizeEvent(TQResizeEvent*); - bool restoreSettings(QDomElement& element); - bool saveSettings(QDomDocument& doc, QDomElement& element, bool save = true); + bool restoreSettings(TQDomElement& element); + bool saveSettings(TQDomDocument& doc, TQDomElement& element, bool save = true); void configureSettings(void); @@ -167,15 +167,15 @@ public: public slots: void applySettings(); void applyStyle(); - void RMBClicked(QListViewItem*, const QPoint&, int); + void RMBClicked(TQListViewItem*, const TQPoint&, int); protected: - LogSensor* getLogSensor(QListViewItem*); + LogSensor* getLogSensor(TQListViewItem*); private: - QListView* monitor; + TQListView* monitor; - QPtrList<LogSensor> logSensors; + TQPtrList<LogSensor> logSensors; SensorLoggerDlg *sld; SensorLoggerSettings *sls; diff --git a/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.cc b/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.cc index f07b55ae4..a6f686db3 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.cc +++ b/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.cc @@ -20,17 +20,17 @@ #include "SensorLoggerDlg.h" #include "SensorLoggerDlgWidget.h" -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> -SensorLoggerDlg::SensorLoggerDlg( QWidget *parent, const char *name ) +SensorLoggerDlg::SensorLoggerDlg( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Sensor Logger" ), Ok|Cancel, Ok, true ) { - QWidget *main = new QWidget( this ); + TQWidget *main = new TQWidget( this ); - QVBoxLayout *topLayout = new QVBoxLayout( main, 0, KDialog::spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( main, 0, KDialog::spacingHint() ); m_loggerWidget = new SensorLoggerDlgWidget( main, "m_loggerWidget" ); topLayout->addWidget( m_loggerWidget ); @@ -39,7 +39,7 @@ SensorLoggerDlg::SensorLoggerDlg( QWidget *parent, const char *name ) setMainWidget( main ); } -QString SensorLoggerDlg::fileName() const +TQString SensorLoggerDlg::fileName() const { return m_loggerWidget->fileName(); } @@ -69,7 +69,7 @@ double SensorLoggerDlg::upperLimit() const return m_loggerWidget->upperLimit(); } -void SensorLoggerDlg::setFileName( const QString &url ) +void SensorLoggerDlg::setFileName( const TQString &url ) { m_loggerWidget->setFileName( url ); } diff --git a/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.h b/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.h index 3af8290c8..e5061c722 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.h +++ b/ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.h @@ -23,8 +23,8 @@ #include <kdialogbase.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> class SensorLoggerDlgWidget; @@ -34,16 +34,16 @@ class SensorLoggerDlg : public KDialogBase public: - SensorLoggerDlg( QWidget *parent=0, const char *name=0 ); + SensorLoggerDlg( TQWidget *parent=0, const char *name=0 ); - QString fileName() const; + TQString fileName() const; int timerInterval() const; bool lowerLimitActive() const; bool upperLimitActive() const; double lowerLimit() const; double upperLimit() const; - void setFileName( const QString & ); + void setFileName( const TQString & ); void setTimerInterval( int ); void setLowerLimitActive( bool ); void setUpperLimitActive( bool ); diff --git a/ksysguard/gui/SensorDisplayLib/SensorLoggerDlgWidget.ui.h b/ksysguard/gui/SensorDisplayLib/SensorLoggerDlgWidget.ui.h index afe0767e9..ad1f2687b 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLoggerDlgWidget.ui.h +++ b/ksysguard/gui/SensorDisplayLib/SensorLoggerDlgWidget.ui.h @@ -17,7 +17,7 @@ void SensorLoggerDlgWidget::init() } -QString SensorLoggerDlgWidget::fileName() +TQString SensorLoggerDlgWidget::fileName() { return m_fileName->url(); } @@ -53,7 +53,7 @@ double SensorLoggerDlgWidget::upperLimit() } -void SensorLoggerDlgWidget::setFileName( const QString &url ) +void SensorLoggerDlgWidget::setFileName( const TQString &url ) { m_fileName->setURL(url); } @@ -73,7 +73,7 @@ void SensorLoggerDlgWidget::setLowerLimitActive( bool b ) void SensorLoggerDlgWidget::setLowerLimit( double d ) { - m_lowerLimit->setText(QString("%1").arg(d)); + m_lowerLimit->setText(TQString("%1").arg(d)); } @@ -85,5 +85,5 @@ void SensorLoggerDlgWidget::setUpperLimitActive( bool b ) void SensorLoggerDlgWidget::setUpperLimit( double d ) { - m_upperLimit->setText(QString("%1").arg(d)); + m_upperLimit->setText(TQString("%1").arg(d)); } diff --git a/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.cc b/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.cc index 568108547..2935242fd 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.cc +++ b/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.cc @@ -22,7 +22,7 @@ #include <klocale.h> -SensorLoggerSettings::SensorLoggerSettings( QWidget *parent, const char *name ) +SensorLoggerSettings::SensorLoggerSettings( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Sensor Logger Settings" ), Ok|Apply|Cancel, Ok, true ) { @@ -30,42 +30,42 @@ SensorLoggerSettings::SensorLoggerSettings( QWidget *parent, const char *name ) setMainWidget( m_settingsWidget ); } -QString SensorLoggerSettings::title() +TQString SensorLoggerSettings::title() { return m_settingsWidget->title(); } -QColor SensorLoggerSettings::foregroundColor() +TQColor SensorLoggerSettings::foregroundColor() { return m_settingsWidget->foregroundColor(); } -QColor SensorLoggerSettings::backgroundColor() +TQColor SensorLoggerSettings::backgroundColor() { return m_settingsWidget->backgroundColor(); } -QColor SensorLoggerSettings::alarmColor() +TQColor SensorLoggerSettings::alarmColor() { return m_settingsWidget->alarmColor(); } -void SensorLoggerSettings::setTitle( const QString &title ) +void SensorLoggerSettings::setTitle( const TQString &title ) { m_settingsWidget->setTitle( title ); } -void SensorLoggerSettings::setBackgroundColor( const QColor &c ) +void SensorLoggerSettings::setBackgroundColor( const TQColor &c ) { m_settingsWidget->setBackgroundColor( c ); } -void SensorLoggerSettings::setForegroundColor( const QColor &c ) +void SensorLoggerSettings::setForegroundColor( const TQColor &c ) { m_settingsWidget->setForegroundColor( c ); } -void SensorLoggerSettings::setAlarmColor( const QColor &c ) +void SensorLoggerSettings::setAlarmColor( const TQColor &c ) { m_settingsWidget->setAlarmColor( c ); } diff --git a/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.h b/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.h index 639f55944..e3f937166 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.h +++ b/ksysguard/gui/SensorDisplayLib/SensorLoggerSettings.h @@ -23,8 +23,8 @@ #include <kdialogbase.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> class SensorLoggerSettingsWidget; @@ -34,17 +34,17 @@ class SensorLoggerSettings : public KDialogBase public: - SensorLoggerSettings( QWidget *parent=0, const char *name=0 ); + SensorLoggerSettings( TQWidget *parent=0, const char *name=0 ); - QString title(); - QColor foregroundColor(); - QColor backgroundColor(); - QColor alarmColor(); + TQString title(); + TQColor foregroundColor(); + TQColor backgroundColor(); + TQColor alarmColor(); - void setTitle( const QString & ); - void setForegroundColor( const QColor & ); - void setBackgroundColor( const QColor & ); - void setAlarmColor( const QColor & ); + void setTitle( const TQString & ); + void setForegroundColor( const TQColor & ); + void setBackgroundColor( const TQColor & ); + void setAlarmColor( const TQColor & ); private: diff --git a/ksysguard/gui/SensorDisplayLib/SensorLoggerSettingsWidget.ui.h b/ksysguard/gui/SensorDisplayLib/SensorLoggerSettingsWidget.ui.h index 751366466..a655a1751 100644 --- a/ksysguard/gui/SensorDisplayLib/SensorLoggerSettingsWidget.ui.h +++ b/ksysguard/gui/SensorDisplayLib/SensorLoggerSettingsWidget.ui.h @@ -8,49 +8,49 @@ *****************************************************************************/ -QString SensorLoggerSettingsWidget::title() +TQString SensorLoggerSettingsWidget::title() { return m_title->text(); } -QColor SensorLoggerSettingsWidget::foregroundColor() +TQColor SensorLoggerSettingsWidget::foregroundColor() { return m_foregroundColor->color(); } -QColor SensorLoggerSettingsWidget::backgroundColor() +TQColor SensorLoggerSettingsWidget::backgroundColor() { return m_backgroundColor->color(); } -QColor SensorLoggerSettingsWidget::alarmColor() +TQColor SensorLoggerSettingsWidget::alarmColor() { return m_alarmColor->color(); } -void SensorLoggerSettingsWidget::setTitle( const QString &t ) +void SensorLoggerSettingsWidget::setTitle( const TQString &t ) { m_title->setText(t); } -void SensorLoggerSettingsWidget::setForegroundColor( const QColor &c ) +void SensorLoggerSettingsWidget::setForegroundColor( const TQColor &c ) { m_foregroundColor->setColor(c); } -void SensorLoggerSettingsWidget::setBackgroundColor( const QColor &c ) +void SensorLoggerSettingsWidget::setBackgroundColor( const TQColor &c ) { m_backgroundColor->setColor(c); } -void SensorLoggerSettingsWidget::setAlarmColor( const QColor &c ) +void SensorLoggerSettingsWidget::setAlarmColor( const TQColor &c ) { m_alarmColor->setColor(c); } diff --git a/ksysguard/gui/SensorDisplayLib/SignalPlotter.cc b/ksysguard/gui/SensorDisplayLib/SignalPlotter.cc index f8ad121f1..3d4d9c6f6 100644 --- a/ksysguard/gui/SensorDisplayLib/SignalPlotter.cc +++ b/ksysguard/gui/SensorDisplayLib/SignalPlotter.cc @@ -24,8 +24,8 @@ #include <math.h> #include <string.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <kdebug.h> #include <kglobal.h> @@ -34,8 +34,8 @@ #include "SignalPlotter.h" -SignalPlotter::SignalPlotter( QWidget *parent, const char *name ) - : QWidget( parent, name ) +SignalPlotter::SignalPlotter( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { // Auto deletion does not work for pointer to arrays. mBeamData.setAutoDelete( false ); @@ -50,8 +50,8 @@ SignalPlotter::SignalPlotter( QWidget *parent, const char *name ) // Anything smaller than this does not make sense. setMinimumSize( 16, 16 ); - setSizePolicy( QSizePolicy( QSizePolicy::Expanding, - QSizePolicy::Expanding, false ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, + TQSizePolicy::Expanding, false ) ); mShowVerticalLines = true; mVerticalLinesColor = KSGRD::Style->firstForegroundColor(); @@ -77,7 +77,7 @@ SignalPlotter::~SignalPlotter() delete [] p; } -bool SignalPlotter::addBeam( const QColor &color ) +bool SignalPlotter::addBeam( const TQColor &color ) { double* d = new double[ mSamples ]; memset( d, 0, sizeof(double) * mSamples ); @@ -87,7 +87,7 @@ bool SignalPlotter::addBeam( const QColor &color ) return true; } -void SignalPlotter::addSample( const QValueList<double>& sampleBuf ) +void SignalPlotter::addSample( const TQValueList<double>& sampleBuf ) { if ( mBeamData.count() != sampleBuf.count() ) return; @@ -114,7 +114,7 @@ void SignalPlotter::addSample( const QValueList<double>& sampleBuf ) } // Shift data buffers one sample down and insert new samples. - QValueList<double>::ConstIterator s; + TQValueList<double>::ConstIterator s; for ( d = mBeamData.first(), s = sampleBuf.begin(); d; d = mBeamData.next(), ++s ) { memmove( d, d + 1, ( mSamples - 1 ) * sizeof( double ) ); d[ mSamples - 1 ] = *s; @@ -123,14 +123,14 @@ void SignalPlotter::addSample( const QValueList<double>& sampleBuf ) update(); } -void SignalPlotter::reorderBeams( const QValueList<int>& newOrder ) +void SignalPlotter::reorderBeams( const TQValueList<int>& newOrder ) { if(newOrder.count() != mBeamData.count()) { kdDebug() << "Serious problem in move sample" << endl; return; } - QPtrList<double> newBeamData; - QValueList<QColor> newBeamColor; + TQPtrList<double> newBeamData; + TQValueList<TQColor> newBeamColor; for(uint i = 0; i < newOrder.count(); i++) { int newIndex = newOrder[i]; @@ -152,7 +152,7 @@ void SignalPlotter::changeRange( int beam, double min, double max ) mMaxValue = max; } -QValueList<QColor> &SignalPlotter::beamColors() +TQValueList<TQColor> &SignalPlotter::beamColors() { return mBeamColor; } @@ -164,12 +164,12 @@ void SignalPlotter::removeBeam( uint pos ) delete [] p; } -void SignalPlotter::setTitle( const QString &title ) +void SignalPlotter::setTitle( const TQString &title ) { mTitle = title; } -QString SignalPlotter::title() const +TQString SignalPlotter::title() const { return mTitle; } @@ -239,12 +239,12 @@ bool SignalPlotter::showVerticalLines() const return mShowVerticalLines; } -void SignalPlotter::setVerticalLinesColor( const QColor &color ) +void SignalPlotter::setVerticalLinesColor( const TQColor &color ) { mVerticalLinesColor = color; } -QColor SignalPlotter::verticalLinesColor() const +TQColor SignalPlotter::verticalLinesColor() const { return mVerticalLinesColor; } @@ -279,12 +279,12 @@ bool SignalPlotter::showHorizontalLines() const return mShowHorizontalLines; } -void SignalPlotter::setHorizontalLinesColor( const QColor &color ) +void SignalPlotter::setHorizontalLinesColor( const TQColor &color ) { mHorizontalLinesColor = color; } -QColor SignalPlotter::horizontalLinesColor() const +TQColor SignalPlotter::horizontalLinesColor() const { return mHorizontalLinesColor; } @@ -329,17 +329,17 @@ int SignalPlotter::fontSize() const return mFontSize; } -void SignalPlotter::setBackgroundColor( const QColor &color ) +void SignalPlotter::setBackgroundColor( const TQColor &color ) { mBackgroundColor = color; } -QColor SignalPlotter::backgroundColor() const +TQColor SignalPlotter::backgroundColor() const { return mBackgroundColor; } -void SignalPlotter::resizeEvent( QResizeEvent* ) +void SignalPlotter::resizeEvent( TQResizeEvent* ) { Q_ASSERT( width() > 2 ); @@ -385,7 +385,7 @@ void SignalPlotter::updateDataBuffers() mSamples = newSampleNum; } -void SignalPlotter::paintEvent( QPaintEvent* ) +void SignalPlotter::paintEvent( TQPaintEvent* ) { uint w = width(); uint h = height(); @@ -394,14 +394,14 @@ void SignalPlotter::paintEvent( QPaintEvent* ) if ( w <= 2 ) return; - QPixmap pm( w, h ); - QPainter p; + TQPixmap pm( w, h ); + TQPainter p; p.begin( &pm, this ); pm.fill( mBackgroundColor ); /* Draw white line along the bottom and the right side of the * widget to create a 3D like look. */ - p.setPen( QColor( colorGroup().light() ) ); + p.setPen( TQColor( colorGroup().light() ) ); if(mShowThinFrame) { p.drawLine( 0, h - 1, w - 1, h - 1 ); p.drawLine( w - 1, 0, w - 1, h - 1 ); @@ -441,7 +441,7 @@ void SignalPlotter::paintEvent( QPaintEvent* ) /* Draw horizontal bar with current sensor values at top of display. */ p.setPen( mHorizontalLinesColor ); int x0 = w / 2; - p.setFont( QFont( p.font().family(), mFontSize ) ); + p.setFont( TQFont( p.font().family(), mFontSize ) ); top = p.fontMetrics().height(); h -= top; int h0 = top - 2; // h0 is our new top. It's at least 5 pixels high @@ -452,7 +452,7 @@ void SignalPlotter::paintEvent( QPaintEvent* ) double bias = -minValue; double scaleFac = ( w - x0 - 2 ) / range; - QValueList<QColor>::Iterator col; + TQValueList<TQColor>::Iterator col; col = mBeamColor.begin(); for ( double* d = mBeamData.first(); d; d = mBeamData.next(), ++col ) { int start = x0 + (int)( bias * scaleFac ); @@ -502,7 +502,7 @@ void SignalPlotter::paintEvent( QPaintEvent* ) int xPos = 0; for ( int i = 0; i < mSamples; i++, xPos += mHorizontalScale ) { double bias = -minValue; - QValueList<QColor>::Iterator col; + TQValueList<TQColor>::Iterator col; col = mBeamColor.begin(); double sum = 0.0; for ( double* d = mBeamData.first(); d; d = mBeamData.next(), ++col ) { @@ -537,7 +537,7 @@ void SignalPlotter::paintEvent( QPaintEvent* ) int x1 = w - ( ( mSamples + 1 ) * mHorizontalScale ); for ( int i = 0; i < mSamples; i++ ) { - QValueList<QColor>::Iterator col; + TQValueList<TQColor>::Iterator col; col = mBeamColor.begin(); double sum = 0.0; int y = top + h - 2; @@ -563,10 +563,10 @@ void SignalPlotter::paintEvent( QPaintEvent* ) /* If the line is longer than 2 pixels we draw only the last * 2 pixels with the bright color. The rest is painted with * a 50% darker color. */ - QPen lastPen = QPen( p.pen() ); + TQPen lastPen = TQPen( p.pen() ); p.setPen( (*col).dark( 150 ) ); p.setBrush( (*col).dark( 150 ) ); - QPointArray pa( 4 ); + TQPointArray pa( 4 ); int prevY = ( i == 0 ) ? y : prevVals[ j ]; pa.putPoints( 0, 1, x1, prevY ); pa.putPoints( 1, 1, x2, y ); @@ -612,8 +612,8 @@ void SignalPlotter::paintEvent( QPaintEvent* ) * Values are only draw when width is greater than 60 */ if ( mShowHorizontalLines ) { p.setPen( mHorizontalLinesColor ); - p.setFont( QFont( p.font().family(), mFontSize ) ); - QString val; + p.setFont( TQFont( p.font().family(), mFontSize ) ); + TQString val; /* top = 0 or font.height depending on whether there's a topbar or not * h = graphing area.height - i.e. the actual space we have to draw inside @@ -628,7 +628,7 @@ void SignalPlotter::paintEvent( QPaintEvent* ) if ( mShowLabels && h > ( mFontSize + 1 ) * ( mHorizontalLinesCount + 1 ) && w > 60 ) { - val = QString::number(maxValue - (y * range) / (mHorizontalLinesCount+1 ) ); + val = TQString::number(maxValue - (y * range) / (mHorizontalLinesCount+1 ) ); p.drawText( 6, y_coord - 1, val ); //draw the text one pixel raised above the line } } @@ -636,7 +636,7 @@ void SignalPlotter::paintEvent( QPaintEvent* ) //Draw the bottom most (minimum) number as well if ( mShowLabels && h > ( mFontSize + 1 ) * ( mHorizontalLinesCount + 1 ) && w > 60 ) { - val = QString::number( minValue ); + val = TQString::number( minValue ); p.drawText( 6, top + h - 2, val ); } } diff --git a/ksysguard/gui/SensorDisplayLib/SignalPlotter.h b/ksysguard/gui/SensorDisplayLib/SignalPlotter.h index 9a9544b3c..1ac227212 100644 --- a/ksysguard/gui/SensorDisplayLib/SignalPlotter.h +++ b/ksysguard/gui/SensorDisplayLib/SignalPlotter.h @@ -24,10 +24,10 @@ #ifndef KSG_SIGNALPLOTTER_H #define KSG_SIGNALPLOTTER_H -#include <qptrlist.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qwidget.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqwidget.h> #define GRAPH_POLYGON 0 #define GRAPH_ORIGINAL 1 @@ -39,20 +39,20 @@ class SignalPlotter : public QWidget Q_OBJECT public: - SignalPlotter( QWidget *parent = 0, const char *name = 0 ); + SignalPlotter( TQWidget *parent = 0, const char *name = 0 ); ~SignalPlotter(); - bool addBeam( const QColor &color ); - void addSample( const QValueList<double> &samples ); + bool addBeam( const TQColor &color ); + void addSample( const TQValueList<double> &samples ); void removeBeam( uint pos ); void changeRange( int beam, double min, double max ); - QValueList<QColor> &beamColors(); + TQValueList<TQColor> &beamColors(); - void setTitle( const QString &title ); - QString title() const; + void setTitle( const TQString &title ); + TQString title() const; void setUseAutoRange( bool value ); bool useAutoRange() const; @@ -72,8 +72,8 @@ class SignalPlotter : public QWidget void setShowVerticalLines( bool value ); bool showVerticalLines() const; - void setVerticalLinesColor( const QColor &color ); - QColor verticalLinesColor() const; + void setVerticalLinesColor( const TQColor &color ); + TQColor verticalLinesColor() const; void setVerticalLinesDistance( int distance ); int verticalLinesDistance() const; @@ -84,8 +84,8 @@ class SignalPlotter : public QWidget void setShowHorizontalLines( bool value ); bool showHorizontalLines() const; - void setHorizontalLinesColor( const QColor &color ); - QColor horizontalLinesColor() const; + void setHorizontalLinesColor( const TQColor &color ); + TQColor horizontalLinesColor() const; void setHorizontalLinesCount( int count ); int horizontalLinesCount() const; @@ -99,17 +99,17 @@ class SignalPlotter : public QWidget void setFontSize( int size ); int fontSize() const; - void setBackgroundColor( const QColor &color ); - QColor backgroundColor() const; - void reorderBeams( const QValueList<int>& newOrder ); + void setBackgroundColor( const TQColor &color ); + TQColor backgroundColor() const; + void reorderBeams( const TQValueList<int>& newOrder ); void setThinFrame(bool set) { mShowThinFrame = set; } protected: void updateDataBuffers(); - virtual void resizeEvent( QResizeEvent* ); - virtual void paintEvent( QPaintEvent* ); + virtual void resizeEvent( TQResizeEvent* ); + virtual void paintEvent( TQPaintEvent* ); private: double mMinValue; @@ -120,28 +120,28 @@ class SignalPlotter : public QWidget uint mGraphStyle; bool mShowVerticalLines; - QColor mVerticalLinesColor; + TQColor mVerticalLinesColor; uint mVerticalLinesDistance; bool mVerticalLinesScroll; uint mVerticalLinesOffset; uint mHorizontalScale; bool mShowHorizontalLines; - QColor mHorizontalLinesColor; + TQColor mHorizontalLinesColor; uint mHorizontalLinesCount; bool mShowLabels; bool mShowTopBar; uint mFontSize; - QColor mBackgroundColor; + TQColor mBackgroundColor; - QPtrList<double> mBeamData; - QValueList<QColor> mBeamColor; + TQPtrList<double> mBeamData; + TQValueList<TQColor> mBeamColor; unsigned int mSamples; - QString mTitle; + TQString mTitle; }; #endif |