summaryrefslogtreecommitdiffstats
path: root/korn/boxcontaineritem.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 /korn/boxcontaineritem.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 'korn/boxcontaineritem.cpp')
-rw-r--r--korn/boxcontaineritem.cpp132
1 files changed, 66 insertions, 66 deletions
diff --git a/korn/boxcontaineritem.cpp b/korn/boxcontaineritem.cpp
index fec7ab41d..4dec01904 100644
--- a/korn/boxcontaineritem.cpp
+++ b/korn/boxcontaineritem.cpp
@@ -35,22 +35,22 @@
#include <kprocess.h>
#include <kshortcut.h>
-#include <qbitmap.h>
-#include <qcolor.h>
-#include <qfont.h>
-#include <qgrid.h>
-#include <qlabel.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qptrlist.h>
-#include <qstring.h>
-#include <qtooltip.h>
-#include <qvbox.h>
+#include <tqbitmap.h>
+#include <tqcolor.h>
+#include <tqfont.h>
+#include <tqgrid.h>
+#include <tqlabel.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqptrlist.h>
+#include <tqstring.h>
+#include <tqtooltip.h>
+#include <tqvbox.h>
-BoxContainerItem::BoxContainerItem( QObject * parent, const char * name )
+BoxContainerItem::BoxContainerItem( TQObject * parent, const char * name )
: AccountManager( parent, name ),
DCOPObject(),
- _command( new QString )
+ _command( new TQString )
{
short i;
@@ -81,48 +81,48 @@ BoxContainerItem::~BoxContainerItem()
void BoxContainerItem::readConfig( KConfig* config, const int index )
{
//Read information about how the thing have to look like
- config->setGroup( QString( "korn-%1" ).arg( index ) );
+ config->setGroup( TQString( "korn-%1" ).arg( index ) );
if( config->readBoolEntry( "hasnormalicon", false ) )
- _icons[ 0 ] = new QString( config->readEntry( "normalicon", "" ) );
+ _icons[ 0 ] = new TQString( config->readEntry( "normalicon", "" ) );
else
_icons[ 0 ] = 0;
if( config->readBoolEntry( "hasnewicon", false ) )
- _icons[ 1 ] = new QString( config->readEntry( "newicon", "" ) );
+ _icons[ 1 ] = new TQString( config->readEntry( "newicon", "" ) );
else
_icons[ 1 ] = 0;
if( config->readBoolEntry( "hasnormalanim", false ) )
- _anims[ 0 ] = new QString( config->readEntry( "normalanim", "" ) );
+ _anims[ 0 ] = new TQString( config->readEntry( "normalanim", "" ) );
else
_anims[ 0 ] = 0;
if( config->readBoolEntry( "hasnewanim", false ) )
- _anims[ 1 ] = new QString( config->readEntry( "newanim", "" ) );
+ _anims[ 1 ] = new TQString( config->readEntry( "newanim", "" ) );
else
_anims[ 1 ] = 0;
if( config->readBoolEntry( "hasnormalfgcolour", false ) )
- _fgColour[ 0 ] = new QColor( config->readColorEntry( "normalfgcolour" ) );
+ _fgColour[ 0 ] = new TQColor( config->readColorEntry( "normalfgcolour" ) );
else
_fgColour[ 0 ] = 0;
if( config->readBoolEntry( "hasnewfgcolour", false ) )
- _fgColour[ 1 ] = new QColor( config->readColorEntry( "newfgcolour" ) );
+ _fgColour[ 1 ] = new TQColor( config->readColorEntry( "newfgcolour" ) );
else
_fgColour[ 1 ] = 0;
if( config->readBoolEntry( "hasnormalbgcolour", false ) )
- _bgColour[ 0 ] = new QColor( config->readColorEntry( "normalbgcolour" ) );
+ _bgColour[ 0 ] = new TQColor( config->readColorEntry( "normalbgcolour" ) );
else
_bgColour[ 0 ] = 0;
if( config->readBoolEntry( "hasnewbgcolour", false ) )
- _bgColour[ 1 ] = new QColor( config->readColorEntry( "newbgcolour" ) );
+ _bgColour[ 1 ] = new TQColor( config->readColorEntry( "newbgcolour" ) );
else
_bgColour[ 1 ] = 0;
if( config->readBoolEntry( "hasnormalfont", false ) )
- _fonts[ 0 ] = new QFont( config->readFontEntry( "normalfont" ) );
+ _fonts[ 0 ] = new TQFont( config->readFontEntry( "normalfont" ) );
else
_fonts[ 0 ] = 0;
if( config->readBoolEntry( "hasnewfont", false ) )
- _fonts[ 1 ] = new QFont( config->readFontEntry( "newfont" ) );
+ _fonts[ 1 ] = new TQFont( config->readFontEntry( "newfont" ) );
else
_fonts[ 1 ] = 0;
@@ -159,12 +159,12 @@ void BoxContainerItem::readConfig( KConfig* config, const int index )
AccountManager::readConfig( config, index );
}
-void BoxContainerItem::runCommand( const QString& cmd )
+void BoxContainerItem::runCommand( const TQString& cmd )
{
KProcess *process = new KProcess;
process->setUseShell( true );
*process << cmd;
- connect( process, SIGNAL( processExited (KProcess *) ), this, SLOT( processExited( KProcess * ) ) );
+ connect( process, TQT_SIGNAL( processExited (KProcess *) ), this, TQT_SLOT( processExited( KProcess * ) ) );
process->start();
}
@@ -194,45 +194,45 @@ void BoxContainerItem::mouseButtonPressed( Qt::ButtonState state )
void BoxContainerItem::fillKPopupMenu( KPopupMenu* popupMenu, KActionCollection* actions ) const
{
- /*popupMenu->insertItem( i18n( "&Configure" ), this, SLOT( slotConfigure() ) );
- popupMenu->insertItem( i18n( "&Recheck" ), this, SLOT( slotRecheck() ) );
- popupMenu->insertItem( i18n( "R&eset Counter" ), this, SLOT( slotReset() ) );
- popupMenu->insertItem( i18n( "&View Emails" ), this, SLOT( slotView() ) );
- popupMenu->insertItem( i18n( "R&un Command" ), this, SLOT( slotRunCommand() ) );*/
-
- (new KAction( i18n("&Configure"), KShortcut(), this, SLOT( slotConfigure() ), actions ))->plug( popupMenu );
- (new KAction( i18n("&Recheck"), KShortcut(), this, SLOT( slotRecheck() ), actions ))->plug( popupMenu );
- (new KAction( i18n("R&eset Counter"), KShortcut(), this, SLOT( slotReset() ), actions ))->plug( popupMenu );
- (new KAction( i18n("&View Emails"), KShortcut(), this, SLOT( slotView() ), actions ))->plug( popupMenu );
- (new KAction( i18n("R&un Command"), KShortcut(), this, SLOT( slotRunCommand() ), actions ))->plug( popupMenu );
+ /*popupMenu->insertItem( i18n( "&Configure" ), this, TQT_SLOT( slotConfigure() ) );
+ popupMenu->insertItem( i18n( "&Recheck" ), this, TQT_SLOT( slotRecheck() ) );
+ popupMenu->insertItem( i18n( "R&eset Counter" ), this, TQT_SLOT( slotReset() ) );
+ popupMenu->insertItem( i18n( "&View Emails" ), this, TQT_SLOT( slotView() ) );
+ popupMenu->insertItem( i18n( "R&un Command" ), this, TQT_SLOT( slotRunCommand() ) );*/
+
+ (new KAction( i18n("&Configure"), KShortcut(), this, TQT_SLOT( slotConfigure() ), actions ))->plug( popupMenu );
+ (new KAction( i18n("&Recheck"), KShortcut(), this, TQT_SLOT( slotRecheck() ), actions ))->plug( popupMenu );
+ (new KAction( i18n("R&eset Counter"), KShortcut(), this, TQT_SLOT( slotReset() ), actions ))->plug( popupMenu );
+ (new KAction( i18n("&View Emails"), KShortcut(), this, TQT_SLOT( slotView() ), actions ))->plug( popupMenu );
+ (new KAction( i18n("R&un Command"), KShortcut(), this, TQT_SLOT( slotRunCommand() ), actions ))->plug( popupMenu );
popupMenu->insertSeparator();
- KStdAction::help( this, SLOT( help() ), actions )->plug( popupMenu );
- KStdAction::reportBug( this, SLOT( reportBug() ), actions )->plug( popupMenu );
- KStdAction::aboutApp( this, SLOT( about() ), actions )->plug( popupMenu );
+ KStdAction::help( this, TQT_SLOT( help() ), actions )->plug( popupMenu );
+ KStdAction::reportBug( this, TQT_SLOT( reportBug() ), actions )->plug( popupMenu );
+ KStdAction::aboutApp( this, TQT_SLOT( about() ), actions )->plug( popupMenu );
}
-void BoxContainerItem::showPassivePopup( QWidget* parent, QPtrList< KornMailSubject >* list, int total,
- const QString &accountName, bool date )
+void BoxContainerItem::showPassivePopup( TQWidget* parent, TQPtrList< KornMailSubject >* list, int total,
+ const TQString &accountName, bool date )
{
KPassivePopup *popup = new KPassivePopup( parent, "Passive popup" );
- QVBox *mainvlayout = popup->standardView( i18n( "KOrn - %1/%2 (total: %3)" ).arg( objId() ).arg( accountName )
- .arg( total ), "", QPixmap(), 0 );
- QGrid *mainglayout = new QGrid( date ? 3 : 2 ,mainvlayout, "Grid-Layout" );
+ TQVBox *mainvlayout = popup->standardView( i18n( "KOrn - %1/%2 (total: %3)" ).arg( objId() ).arg( accountName )
+ .arg( total ), "", TQPixmap(), 0 );
+ TQGrid *mainglayout = new TQGrid( date ? 3 : 2 ,mainvlayout, "Grid-Layout" );
- QLabel *title = new QLabel( i18n("From"), mainglayout, "from_label" );
- QFont font = title->font();
+ TQLabel *title = new TQLabel( i18n("From"), mainglayout, "from_label" );
+ TQFont font = title->font();
font.setBold( true );
title->setFont( font );
- title = new QLabel( i18n("Subject"), mainglayout, "subject_label" );
+ title = new TQLabel( i18n("Subject"), mainglayout, "subject_label" );
font = title->font();
font.setBold( true );
title->setFont( font );
if( date )
{
- title = new QLabel( i18n("Date"), mainglayout, "date_label" );
+ title = new TQLabel( i18n("Date"), mainglayout, "date_label" );
font = title->font();
font.setBold( true );
title->setFont( font );
@@ -240,13 +240,13 @@ void BoxContainerItem::showPassivePopup( QWidget* parent, QPtrList< KornMailSubj
for( KornMailSubject* subject = list->first(); subject; subject = list->next() )
{
- new QLabel( subject->getSender(), mainglayout, "from-value" );
- new QLabel( subject->getSubject(), mainglayout, "subject-value" );
+ new TQLabel( subject->getSender(), mainglayout, "from-value" );
+ new TQLabel( subject->getSubject(), mainglayout, "subject-value" );
if( date )
{
- QDateTime tijd;
+ TQDateTime tijd;
tijd.setTime_t( subject->getDate() );
- new QLabel( tijd.toString(), mainglayout, "date-value" );
+ new TQLabel( tijd.toString(), mainglayout, "date-value" );
}
}
@@ -257,7 +257,7 @@ void BoxContainerItem::showPassivePopup( QWidget* parent, QPtrList< KornMailSubj
popup->show(); //Display it
}
-void BoxContainerItem::drawLabel( QLabel *label, const int count, const bool newMessages )
+void BoxContainerItem::drawLabel( TQLabel *label, const int count, const bool newMessages )
{
//This would fail if bool have fome other values.
short index = newMessages ? 1 : 0;
@@ -267,10 +267,10 @@ void BoxContainerItem::drawLabel( QLabel *label, const int count, const bool new
bool hasBg = _bgColour[ index ] && _bgColour[ index ]->isValid();
bool hasFg = _fgColour[ index ] && _fgColour[ index ]->isValid();
- QPixmap pixmap;
+ TQPixmap pixmap;
label->setText( "" );
- //QToolTip::add( label, this->getTooltip() );
+ //TQToolTip::add( label, this->getTooltip() );
if( hasAnim )
{ //An animation can't have a foreground-colour and can't have a icon.
@@ -317,7 +317,7 @@ void BoxContainerItem::drawLabel( QLabel *label, const int count, const bool new
label->setFont( *_fonts[ index ] );
label->setPaletteForegroundColor( *_fgColour[ index ] );
label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
- label->setText( QString::number( count ) );
+ label->setText( TQString::number( count ) );
}
if( hasFg || hasBg || hasIcon || hasAnim )
@@ -327,14 +327,14 @@ void BoxContainerItem::drawLabel( QLabel *label, const int count, const bool new
}
//This function makes a pixmap which is based on icon, but has a number painted on it.
-QPixmap BoxContainerItem::calcComplexPixmap( const QPixmap &icon, const QColor& fgColour, const QFont* font, const int count )
+TQPixmap BoxContainerItem::calcComplexPixmap( const TQPixmap &icon, const TQColor& fgColour, const TQFont* font, const int count )
{
- QPixmap result( icon );
- QPixmap numberPixmap( icon.size() );
- QImage iconImage( icon.convertToImage() );
- QImage numberImage;
+ TQPixmap result( icon );
+ TQPixmap numberPixmap( icon.size() );
+ TQImage iconImage( icon.convertToImage() );
+ TQImage numberImage;
QRgb *rgbline;
- QPainter p;
+ TQPainter p;
//Make a transparent number; first make a white number on a black background.
//This pixmap also is the base alpha-channel, the foreground colour is added later.
@@ -343,7 +343,7 @@ QPixmap BoxContainerItem::calcComplexPixmap( const QPixmap &icon, const QColor&
p.setPen( Qt::white );
if( font )
p.setFont( *font );
- p.drawText( icon.rect(), Qt::AlignCenter, QString::number( count ) );
+ p.drawText( icon.rect(), Qt::AlignCenter, TQString::number( count ) );
p.end();
//Convert to image and add the alpha channel.
@@ -369,10 +369,10 @@ QPixmap BoxContainerItem::calcComplexPixmap( const QPixmap &icon, const QColor&
return result;
}
-void BoxContainerItem::setAnimIcon( QLabel* label, const QString& anim )
+void BoxContainerItem::setAnimIcon( TQLabel* label, const TQString& anim )
{
label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
- label->setMovie( QMovie( anim ) );
+ label->setMovie( TQMovie( anim ) );
label->show();
}