summaryrefslogtreecommitdiffstats
path: root/src/knemod/interface.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 18:16:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 18:16:06 +0000
commit02a6c8f36311eb6225066df35adf8d00f9cd942b (patch)
treeceb91c373877f7a69209e184c81b53dc6f9402d7 /src/knemod/interface.cpp
parent09e6e27fe85b2efb28072f1c81f6581fa6837d92 (diff)
downloadknemo-02a6c8f36311eb6225066df35adf8d00f9cd942b.tar.gz
knemo-02a6c8f36311eb6225066df35adf8d00f9cd942b.zip
TQt4 port knemo
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knemo@1238869 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/knemod/interface.cpp')
-rw-r--r--src/knemod/interface.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/knemod/interface.cpp b/src/knemod/interface.cpp
index 2378662..2242e40 100644
--- a/src/knemod/interface.cpp
+++ b/src/knemod/interface.cpp
@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
-#include <qtimer.h>
-#include <qpixmap.h>
+#include <tqtimer.h>
+#include <tqpixmap.h>
#include <kwin.h>
#include <kdebug.h>
@@ -32,10 +32,10 @@
#include "interfacestatusdialog.h"
#include "interfacestatisticsdialog.h"
-Interface::Interface( QString ifname,
+Interface::Interface( TQString ifname,
const GeneralData& generalData,
const PlotterSettings& plotterSettings )
- : QObject(),
+ : TQObject(),
mType( UNKNOWN_TYPE ),
mState( UNKNOWN_STATE ),
mOutgoingPos( 0 ),
@@ -51,20 +51,20 @@ Interface::Interface( QString ifname,
mGeneralData( generalData ),
mPlotterSettings( plotterSettings )
{
- connect( &mMonitor, SIGNAL( statusChanged( int ) ),
- &mIcon, SLOT( updateStatus( int ) ) );
- connect( &mMonitor, SIGNAL( available( int ) ),
- &mIcon, SLOT( updateTrayStatus( int ) ) );
- connect( &mMonitor, SIGNAL( notAvailable( int ) ),
- &mIcon, SLOT( updateTrayStatus( int ) ) );
- connect( &mMonitor, SIGNAL( notExisting( int ) ),
- &mIcon, SLOT( updateTrayStatus( int ) ) );
- connect( &mMonitor, SIGNAL( available( int ) ),
- this, SLOT( setStartTime( int ) ) );
- connect( &mMonitor, SIGNAL( statusChanged( int ) ),
- this, SLOT( resetData( int ) ) );
- connect( &mIcon, SIGNAL( statisticsSelected() ),
- this, SLOT( showStatisticsDialog() ) );
+ connect( &mMonitor, TQT_SIGNAL( statusChanged( int ) ),
+ &mIcon, TQT_SLOT( updatetqStatus( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( available( int ) ),
+ &mIcon, TQT_SLOT( updateTraytqStatus( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( notAvailable( int ) ),
+ &mIcon, TQT_SLOT( updateTraytqStatus( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( notExisting( int ) ),
+ &mIcon, TQT_SLOT( updateTraytqStatus( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( available( int ) ),
+ this, TQT_SLOT( setStartTime( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( statusChanged( int ) ),
+ this, TQT_SLOT( resetData( int ) ) );
+ connect( &mIcon, TQT_SIGNAL( statisticsSelected() ),
+ this, TQT_SLOT( showStatisticsDialog() ) );
}
Interface::~Interface()
@@ -92,9 +92,9 @@ Interface::~Interface()
void Interface::configChanged()
{
// UNKNOWN_STATE to avoid notification
- mIcon.updateTrayStatus( UNKNOWN_STATE );
+ mIcon.updateTraytqStatus( UNKNOWN_STATE );
// handle changed iconset by user
- mIcon.updateStatus( mState );
+ mIcon.updatetqStatus( mState );
mIcon.updateToolTip();
mIcon.updateMenu();
@@ -127,13 +127,13 @@ void Interface::configChanged()
void Interface::activateMonitor()
{
- mMonitor.checkStatus( this );
+ mMonitor.checktqStatus( this );
}
void Interface::setStartTime( int )
{
- mStartTime.setDate( QDate::currentDate() );
- mStartTime.setTime( QTime::currentTime() );
+ mStartTime.setDate( TQDate::tqcurrentDate() );
+ mStartTime.setTime( TQTime::currentTime() );
}
void Interface::showStatusDialog()
@@ -143,16 +143,16 @@ void Interface::showStatusDialog()
if ( mStatusDialog == 0L )
{
mStatusDialog = new InterfaceStatusDialog( this );
- connect( &mMonitor, SIGNAL( available( int ) ),
- mStatusDialog, SLOT( enableNetworkGroups( int ) ) );
- connect( &mMonitor, SIGNAL( notAvailable( int ) ),
- mStatusDialog, SLOT( disableNetworkGroups( int ) ) );
- connect( &mMonitor, SIGNAL( notExisting( int ) ),
- mStatusDialog, SLOT( disableNetworkGroups( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( available( int ) ),
+ mStatusDialog, TQT_SLOT( enableNetworkGroups( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( notAvailable( int ) ),
+ mStatusDialog, TQT_SLOT( disableNetworkGroups( int ) ) );
+ connect( &mMonitor, TQT_SIGNAL( notExisting( int ) ),
+ mStatusDialog, TQT_SLOT( disableNetworkGroups( int ) ) );
if ( mStatistics != 0 )
{
- connect( mStatistics, SIGNAL( currentEntryChanged() ),
- mStatusDialog, SLOT( statisticsChanged() ) );
+ connect( mStatistics, TQT_SIGNAL( currentEntryChanged() ),
+ mStatusDialog, TQT_SLOT( statisticsChanged() ) );
mStatusDialog->statisticsChanged();
}
activateOrHide( mStatusDialog, true );
@@ -176,9 +176,9 @@ void Interface::showSignalPlotter( bool wasMiddleButton )
configurePlotter();
activateOrHide( mPlotter, true );
- mPlotterTimer = new QTimer();
- connect( mPlotterTimer, SIGNAL( timeout() ),
- this, SLOT( updatePlotter() ) );
+ mPlotterTimer = new TQTimer();
+ connect( mPlotterTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( updatePlotter() ) );
mPlotterTimer->start( 1000 );
}
else
@@ -206,20 +206,20 @@ void Interface::showStatisticsDialog()
// should never happen but you never know...
startStatistics();
}
- connect( mStatistics, SIGNAL( dayStatisticsChanged() ),
- mStatisticsDialog, SLOT( updateDays() ) );
- connect( mStatistics, SIGNAL( monthStatisticsChanged() ),
- mStatisticsDialog, SLOT( updateMonths() ) );
- connect( mStatistics, SIGNAL( yearStatisticsChanged() ),
- mStatisticsDialog, SLOT( updateYears() ) );
- connect( mStatistics, SIGNAL( currentEntryChanged() ),
- mStatisticsDialog, SLOT( updateCurrentEntry() ) );
- connect( mStatisticsDialog, SIGNAL( clearDailyStatisticsClicked() ),
- mStatistics, SLOT( clearDayStatistics() ) );
- connect( mStatisticsDialog, SIGNAL( clearMonthlyStatisticsClicked() ),
- mStatistics, SLOT( clearMonthStatistics() ) );
- connect( mStatisticsDialog, SIGNAL( clearYearlyStatisticsClicked() ),
- mStatistics, SLOT( clearYearStatistics() ) );
+ connect( mStatistics, TQT_SIGNAL( dayStatisticsChanged() ),
+ mStatisticsDialog, TQT_SLOT( updateDays() ) );
+ connect( mStatistics, TQT_SIGNAL( monthStatisticsChanged() ),
+ mStatisticsDialog, TQT_SLOT( updateMonths() ) );
+ connect( mStatistics, TQT_SIGNAL( yearStatisticsChanged() ),
+ mStatisticsDialog, TQT_SLOT( updateYears() ) );
+ connect( mStatistics, TQT_SIGNAL( currentEntryChanged() ),
+ mStatisticsDialog, TQT_SLOT( updateCurrentEntry() ) );
+ connect( mStatisticsDialog, TQT_SIGNAL( clearDailyStatisticsClicked() ),
+ mStatistics, TQT_SLOT( clearDayStatistics() ) );
+ connect( mStatisticsDialog, TQT_SIGNAL( clearMonthlyStatisticsClicked() ),
+ mStatistics, TQT_SLOT( clearMonthStatistics() ) );
+ connect( mStatisticsDialog, TQT_SIGNAL( clearYearlyStatisticsClicked() ),
+ mStatistics, TQT_SLOT( clearYearStatistics() ) );
mStatisticsDialog->updateDays();
mStatisticsDialog->updateMonths();
@@ -252,7 +252,7 @@ void Interface::updatePlotter()
double outgoingBytes = mData.outgoingBytes / 1024.0 / (double) mGeneralData.pollInterval;
double incomingBytes = mData.incomingBytes / 1024.0 / (double) mGeneralData.pollInterval;
- QValueList<double> trafficList;
+ TQValueList<double> trafficList;
switch ( mVisibleBeams )
{
case BOTH:
@@ -310,7 +310,7 @@ void Interface::configurePlotter()
if ( mPlotterSettings.showIncoming )
nextVisibleBeams = (VisibleBeams) ( nextVisibleBeams | INCOMING_TRAFFIC );
- QValueList<QColor>& colors = mPlotter->beamColors();
+ TQValueList<TQColor>& colors = mPlotter->beamColors();
switch( mVisibleBeams )
{
case NONE:
@@ -398,20 +398,20 @@ void Interface::configurePlotter()
break;
}
mVisibleBeams = nextVisibleBeams;
- mPlotter->repaint();
+ mPlotter->tqrepaint();
}
void Interface::startStatistics()
{
mStatistics = new InterfaceStatistics( this );
- connect( &mMonitor, SIGNAL( incomingData( unsigned long ) ),
- mStatistics, SLOT( addIncomingData( unsigned long ) ) );
- connect( &mMonitor, SIGNAL( outgoingData( unsigned long ) ),
- mStatistics, SLOT( addOutgoingData( unsigned long ) ) );
+ connect( &mMonitor, TQT_SIGNAL( incomingData( unsigned long ) ),
+ mStatistics, TQT_SLOT( addIncomingData( unsigned long ) ) );
+ connect( &mMonitor, TQT_SIGNAL( outgoingData( unsigned long ) ),
+ mStatistics, TQT_SLOT( addOutgoingData( unsigned long ) ) );
if ( mStatusDialog != 0 )
{
- connect( mStatistics, SIGNAL( currentEntryChanged() ),
- mStatusDialog, SLOT( statisticsChanged() ) );
+ connect( mStatistics, TQT_SIGNAL( currentEntryChanged() ),
+ mStatusDialog, TQT_SLOT( statisticsChanged() ) );
mStatusDialog->statisticsChanged();
}
@@ -434,7 +434,7 @@ void Interface::stopStatistics()
}
// taken from ksystemtray.cpp
-void Interface::activateOrHide( QWidget* widget, bool onlyActivate )
+void Interface::activateOrHide( TQWidget* widget, bool onlyActivate )
{
if ( !widget )
return;
@@ -456,7 +456,7 @@ void Interface::activateOrHide( QWidget* widget, bool onlyActivate )
else
{
KWinModule module;
- for( QValueList< WId >::ConstIterator it = module.stackingOrder().fromLast();
+ for( TQValueList< WId >::ConstIterator it = module.stackingOrder().fromLast();
it != module.stackingOrder().end() && (*it) != widget->winId();
--it )
{
@@ -464,7 +464,7 @@ void Interface::activateOrHide( QWidget* widget, bool onlyActivate )
NET::WMGeometry | NET::XAWMState | NET::WMState | NET::WMWindowType );
if( info2.mappingState() != NET::Visible )
continue; // not visible on current desktop -> ignore
- if( !info2.geometry().intersects( widget->geometry()))
+ if( !info2.geometry().intersects( widget->tqgeometry()))
continue; // not obscuring the window -> ignore
if( !info1.hasState( NET::KeepAbove ) && info2.hasState( NET::KeepAbove ))
continue; // obscured by window kept above -> ignore