summaryrefslogtreecommitdiffstats
path: root/kontact/plugins/weather/summarywidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kontact/plugins/weather/summarywidget.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kontact/plugins/weather/summarywidget.cpp')
-rw-r--r--kontact/plugins/weather/summarywidget.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/kontact/plugins/weather/summarywidget.cpp b/kontact/plugins/weather/summarywidget.cpp
index 04a559ae4..8c1064094 100644
--- a/kontact/plugins/weather/summarywidget.cpp
+++ b/kontact/plugins/weather/summarywidget.cpp
@@ -20,10 +20,10 @@
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qimage.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtooltip.h>
+#include <tqimage.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
#include <dcopclient.h>
#include <dcopref.h>
@@ -38,38 +38,38 @@
#include "summarywidget.h"
-SummaryWidget::SummaryWidget( QWidget *parent, const char *name )
+SummaryWidget::SummaryWidget( TQWidget *parent, const char *name )
: Kontact::Summary( parent, name ),
DCOPObject( "WeatherSummaryWidget" ), mProc( 0 )
{
- mLayout = new QVBoxLayout( this, 3, 3 );
+ mLayout = new TQVBoxLayout( this, 3, 3 );
mLayout->setAlignment( Qt::AlignTop );
- QPixmap icon = KGlobal::iconLoader()->loadIcon( "kweather", KIcon::Desktop, KIcon::SizeMedium );
- QWidget *header = createHeader( this, icon, i18n( "Weather Service" ) );
+ TQPixmap icon = KGlobal::iconLoader()->loadIcon( "kweather", KIcon::Desktop, KIcon::SizeMedium );
+ TQWidget *header = createHeader( this, icon, i18n( "Weather Service" ) );
mLayout->addWidget( header );
- QString error;
- QCString appID;
+ TQString error;
+ TQCString appID;
bool serviceAvailable = true;
if ( !kapp->dcopClient()->isApplicationRegistered( "KWeatherService" ) ) {
- if ( KApplication::startServiceByDesktopName( "kweatherservice", QStringList(), &error, &appID ) ) {
- QLabel *label = new QLabel( i18n( "No weather dcop service available;\nyou need KWeather to use this plugin." ), this );
+ if ( KApplication::startServiceByDesktopName( "kweatherservice", TQStringList(), &error, &appID ) ) {
+ TQLabel *label = new TQLabel( i18n( "No weather dcop service available;\nyou need KWeather to use this plugin." ), this );
mLayout->addWidget( label, Qt::AlignHCenter | AlignVCenter );
serviceAvailable = false;
}
}
if ( serviceAvailable ) {
- connectDCOPSignal( 0, 0, "fileUpdate(QString)", "refresh(QString)", false );
- connectDCOPSignal( 0, 0, "stationRemoved(QString)", "stationRemoved(QString)", false );
+ connectDCOPSignal( 0, 0, "fileUpdate(TQString)", "refresh(TQString)", false );
+ connectDCOPSignal( 0, 0, "stationRemoved(TQString)", "stationRemoved(TQString)", false );
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
DCOPReply reply = dcopCall.call( "listStations()", true );
if ( reply.isValid() ) {
mStations = reply;
- connect( &mTimer, SIGNAL( timeout() ), this, SLOT( timeout() ) );
+ connect( &mTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( timeout() ) );
mTimer.start( 0 );
} else {
kdDebug(5602) << "ERROR: dcop reply not valid..." << endl;
@@ -94,19 +94,19 @@ void SummaryWidget::updateView()
}
- QValueList<WeatherData> dataList = mWeatherMap.values();
+ TQValueList<WeatherData> dataList = mWeatherMap.values();
qHeapSort( dataList );
- QValueList<WeatherData>::Iterator it;
+ TQValueList<WeatherData>::Iterator it;
for ( it = dataList.begin(); it != dataList.end(); ++it ) {
- QString cover;
+ TQString cover;
for ( uint i = 0; i < (*it).cover().count(); ++i )
- cover += QString( "- %1\n" ).arg( (*it).cover()[ i ] );
+ cover += TQString( "- %1\n" ).arg( (*it).cover()[ i ] );
- QImage img;
+ TQImage img;
img = (*it).icon();
- QGridLayout *layout = new QGridLayout( mLayout, 3, 3, 3 );
+ TQGridLayout *layout = new TQGridLayout( mLayout, 3, 3, 3 );
mLayouts.append( layout );
KURLLabel* urlLabel = new KURLLabel( this );
@@ -117,20 +117,20 @@ void SummaryWidget::updateView()
urlLabel->setAlignment( AlignTop );
layout->addMultiCellWidget( urlLabel, 0, 1, 0, 0 );
mLabels.append( urlLabel );
- connect ( urlLabel, SIGNAL( leftClickedURL( const QString& ) ),
- this, SLOT( showReport( const QString& ) ) );
+ connect ( urlLabel, TQT_SIGNAL( leftClickedURL( const TQString& ) ),
+ this, TQT_SLOT( showReport( const TQString& ) ) );
- QLabel* label = new QLabel( this );
- label->setText( QString( "%1 (%2)" ).arg( (*it).name() ).arg( (*it).temperature() ) );
- QFont font = label->font();
+ TQLabel* label = new TQLabel( this );
+ label->setText( TQString( "%1 (%2)" ).arg( (*it).name() ).arg( (*it).temperature() ) );
+ TQFont font = label->font();
font.setBold( true );
label->setFont( font );
label->setAlignment( AlignLeft );
layout->addMultiCellWidget( label, 0, 0, 1, 2 );
mLabels.append( label );
- QString labelText;
- labelText = QString( "<b>%1:</b> %2<br>"
+ TQString labelText;
+ labelText = TQString( "<b>%1:</b> %2<br>"
"<b>%3:</b> %4<br>"
"<b>%5:</b> %6" )
.arg( i18n( "Last updated on" ) )
@@ -140,15 +140,15 @@ void SummaryWidget::updateView()
.arg( i18n( "Rel. Humidity" ) )
.arg( (*it).relativeHumidity() );
- QToolTip::add( label, labelText.replace( " ", "&nbsp;" ) );
+ TQToolTip::add( label, labelText.replace( " ", "&nbsp;" ) );
- label = new QLabel( cover, this );
+ label = new TQLabel( cover, this );
label->setAlignment( AlignLeft );
layout->addMultiCellWidget( label, 1, 1, 1, 2 );
mLabels.append( label );
}
- for ( QLabel *label = mLabels.first(); label; label = mLabels.next() )
+ for ( TQLabel *label = mLabels.first(); label; label = mLabels.next() )
label->show();
}
@@ -162,44 +162,44 @@ void SummaryWidget::timeout()
mTimer.start( 15 * 60000 );
}
-void SummaryWidget::refresh( QString station )
+void SummaryWidget::refresh( TQString station )
{
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
- mWeatherMap[ station ].setIcon( dcopCall.call( "currentIcon(QString)", station, true ) );
- mWeatherMap[ station ].setName( dcopCall.call( "stationName(QString)", station, true ) );
- mWeatherMap[ station ].setCover( dcopCall.call( "cover(QString)", station, true ) );
- mWeatherMap[ station ].setDate( dcopCall.call( "date(QString)", station, true ) );
- mWeatherMap[ station ].setTemperature( dcopCall.call( "temperature(QString)", station, true ) );
- mWeatherMap[ station ].setWindSpeed( dcopCall.call( "wind(QString)", station, true ) );
- mWeatherMap[ station ].setRelativeHumidity( dcopCall.call( "relativeHumidity(QString)", station, true ) );
+ mWeatherMap[ station ].setIcon( dcopCall.call( "currentIcon(TQString)", station, true ) );
+ mWeatherMap[ station ].setName( dcopCall.call( "stationName(TQString)", station, true ) );
+ mWeatherMap[ station ].setCover( dcopCall.call( "cover(TQString)", station, true ) );
+ mWeatherMap[ station ].setDate( dcopCall.call( "date(TQString)", station, true ) );
+ mWeatherMap[ station ].setTemperature( dcopCall.call( "temperature(TQString)", station, true ) );
+ mWeatherMap[ station ].setWindSpeed( dcopCall.call( "wind(TQString)", station, true ) );
+ mWeatherMap[ station ].setRelativeHumidity( dcopCall.call( "relativeHumidity(TQString)", station, true ) );
mWeatherMap[ station ].setStationID(station);
updateView();
}
-void SummaryWidget::stationRemoved( QString station )
+void SummaryWidget::stationRemoved( TQString station )
{
mWeatherMap.remove( station );
updateView();
}
-bool SummaryWidget::eventFilter( QObject *obj, QEvent* e )
+bool SummaryWidget::eventFilter( TQObject *obj, TQEvent* e )
{
if ( obj->inherits( "KURLLabel" ) ) {
- if ( e->type() == QEvent::Enter )
+ if ( e->type() == TQEvent::Enter )
emit message(
i18n( "View Weather Report for Station" ) );
- if ( e->type() == QEvent::Leave )
- emit message( QString::null );
+ if ( e->type() == TQEvent::Leave )
+ emit message( TQString::null );
}
return Kontact::Summary::eventFilter( obj, e );
}
-QStringList SummaryWidget::configModules() const
+TQStringList SummaryWidget::configModules() const
{
- return QStringList( "kcmweatherservice.desktop" );
+ return TQStringList( "kcmweatherservice.desktop" );
}
void SummaryWidget::updateSummary( bool )
@@ -207,11 +207,11 @@ void SummaryWidget::updateSummary( bool )
timeout();
}
-void SummaryWidget::showReport( const QString &stationID )
+void SummaryWidget::showReport( const TQString &stationID )
{
mProc = new KProcess;
- QApplication::connect( mProc, SIGNAL( processExited( KProcess* ) ),
- this, SLOT( reportFinished( KProcess* ) ) );
+ TQApplication::connect( mProc, TQT_SIGNAL( processExited( KProcess* ) ),
+ this, TQT_SLOT( reportFinished( KProcess* ) ) );
*mProc << "kweatherreport";
*mProc << stationID;