diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/progressdialog.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-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 'libkdepim/progressdialog.cpp')
-rw-r--r-- | libkdepim/progressdialog.cpp | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/libkdepim/progressdialog.cpp b/libkdepim/progressdialog.cpp index 10a0b868d..f35f23909 100644 --- a/libkdepim/progressdialog.cpp +++ b/libkdepim/progressdialog.cpp @@ -33,17 +33,17 @@ #include <config.h> #endif -#include <qapplication.h> -#include <qlayout.h> -#include <qprogressbar.h> -#include <qtimer.h> -#include <qheader.h> -#include <qobject.h> -#include <qscrollview.h> -#include <qtoolbutton.h> -#include <qpushbutton.h> -#include <qvbox.h> -#include <qtooltip.h> +#include <tqapplication.h> +#include <tqlayout.h> +#include <tqprogressbar.h> +#include <tqtimer.h> +#include <tqheader.h> +#include <tqobject.h> +#include <tqscrollview.h> +#include <tqtoolbutton.h> +#include <tqpushbutton.h> +#include <tqvbox.h> +#include <tqtooltip.h> #include <klocale.h> #include <kdialog.h> @@ -54,44 +54,44 @@ #include "progressdialog.h" #include "progressmanager.h" #include "ssllabel.h" -#include <qwhatsthis.h> +#include <tqwhatsthis.h> namespace KPIM { class TransactionItem; -TransactionItemView::TransactionItemView( QWidget * parent, +TransactionItemView::TransactionItemView( TQWidget * parent, const char * name, WFlags f ) - : QScrollView( parent, name, f ) { + : TQScrollView( parent, name, f ) { setFrameStyle( NoFrame ); - mBigBox = new QVBox( viewport() ); + mBigBox = new TQVBox( viewport() ); mBigBox->setSpacing( 5 ); addChild( mBigBox ); - setResizePolicy( QScrollView::AutoOneFit ); // Fit so that the box expands horizontally + setResizePolicy( TQScrollView::AutoOneFit ); // Fit so that the box expands horizontally } TransactionItem* TransactionItemView::addTransactionItem( ProgressItem* item, bool first ) { TransactionItem *ti = new TransactionItem( mBigBox, item, first ); ti->hide(); - QTimer::singleShot( 1000, ti, SLOT( show() ) ); + TQTimer::singleShot( 1000, ti, TQT_SLOT( show() ) ); return ti; } void TransactionItemView::resizeContents( int w, int h ) { - // (handling of QEvent::LayoutHint in QScrollView calls this method) + // (handling of TQEvent::LayoutHint in TQScrollView calls this method) //kdDebug(5300) << k_funcinfo << w << "," << h << endl; - QScrollView::resizeContents( w, h ); + TQScrollView::resizeContents( w, h ); // Tell the layout in the parent (progressdialog) that our size changed updateGeometry(); // Resize the parent (progressdialog) - this works but resize horizontally too often //parentWidget()->adjustSize(); - QApplication::sendPostedEvents( 0, QEvent::ChildInserted ); - QApplication::sendPostedEvents( 0, QEvent::LayoutHint ); - QSize sz = parentWidget()->sizeHint(); + TQApplication::sendPostedEvents( 0, TQEvent::ChildInserted ); + TQApplication::sendPostedEvents( 0, TQEvent::LayoutHint ); + TQSize sz = parentWidget()->sizeHint(); int currentWidth = parentWidget()->width(); // Don't resize to sz.width() every time when it only reduces a little bit if ( currentWidth < sz.width() || currentWidth > sz.width() + 100 ) @@ -99,19 +99,19 @@ void TransactionItemView::resizeContents( int w, int h ) parentWidget()->resize( currentWidth, sz.height() ); } -QSize TransactionItemView::sizeHint() const +TQSize TransactionItemView::sizeHint() const { return minimumSizeHint(); } -QSize TransactionItemView::minimumSizeHint() const +TQSize TransactionItemView::minimumSizeHint() const { int f = 2 * frameWidth(); // Make room for a vertical scrollbar in all cases, to avoid a horizontal one int vsbExt = verticalScrollBar()->sizeHint().width(); int minw = topLevelWidget()->width() / 3; int maxh = topLevelWidget()->height() / 2; - QSize sz( mBigBox->minimumSizeHint() ); + TQSize sz( mBigBox->minimumSizeHint() ); sz.setWidth( QMAX( sz.width(), minw ) + f + vsbExt ); sz.setHeight( QMIN( sz.height(), maxh ) + f ); return sz; @@ -124,12 +124,12 @@ void TransactionItemView::slotLayoutFirstItem() The below relies on some details in Qt's behaviour regarding deleting objects. This slot is called from the destroyed signal of an item just going away. That item is at that point still in the list of chilren, but - since the vtable is already gone, it will have type QObject. The first + since the vtable is already gone, it will have type TQObject. The first one with both the right name and the right class therefor is what will be the first item very shortly. That's the one we want to remove the hline for. */ - QObject *o = mBigBox->child( "TransactionItem", "KPIM::TransactionItem" ); + TQObject *o = mBigBox->child( "TransactionItem", "KPIM::TransactionItem" ); TransactionItem *ti = dynamic_cast<TransactionItem*>( o ); if ( ti ) { ti->hideHLine(); @@ -139,52 +139,52 @@ void TransactionItemView::slotLayoutFirstItem() // ---------------------------------------------------------------------------- -TransactionItem::TransactionItem( QWidget* parent, +TransactionItem::TransactionItem( TQWidget* parent, ProgressItem *item, bool first ) - : QVBox( parent, "TransactionItem" ), mCancelButton( 0 ), mItem( item ) + : TQVBox( parent, "TransactionItem" ), mCancelButton( 0 ), mItem( item ) { setSpacing( 2 ); setMargin( 2 ); - setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Fixed ) ); - mFrame = new QFrame( this ); - mFrame->setFrameShape( QFrame::HLine ); - mFrame->setFrameShadow( QFrame::Raised ); + mFrame = new TQFrame( this ); + mFrame->setFrameShape( TQFrame::HLine ); + mFrame->setFrameShadow( TQFrame::Raised ); mFrame->show(); setStretchFactor( mFrame, 3 ); - QHBox *h = new QHBox( this ); + TQHBox *h = new TQHBox( this ); h->setSpacing( 5 ); - mItemLabel = new QLabel( item->label(), h ); + mItemLabel = new TQLabel( item->label(), h ); // always interpret the label text as RichText, but disable word wrapping mItemLabel->setTextFormat( Qt::RichText ); mItemLabel->setAlignment( Qt::AlignAuto | Qt::AlignVCenter | Qt::SingleLine ); - h->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) ); + h->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Fixed ) ); - mProgress = new QProgressBar( 100, h ); + mProgress = new TQProgressBar( 100, h ); mProgress->setProgress( item->progress() ); if ( item->canBeCanceled() ) { - mCancelButton = new QPushButton( SmallIcon( "cancel" ), QString::null, h ); - QToolTip::add( mCancelButton, i18n("Cancel this operation.") ); - connect ( mCancelButton, SIGNAL( clicked() ), - this, SLOT( slotItemCanceled() )); + mCancelButton = new TQPushButton( SmallIcon( "cancel" ), TQString::null, h ); + TQToolTip::add( mCancelButton, i18n("Cancel this operation.") ); + connect ( mCancelButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotItemCanceled() )); } - h = new QHBox( this ); + h = new TQHBox( this ); h->setSpacing( 5 ); - h->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) ); + h->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Fixed ) ); mSSLLabel = new SSLLabel( h ); - mSSLLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); - mItemStatus = new QLabel( item->status(), h ); + mSSLLabel->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); + mItemStatus = new TQLabel( item->status(), h ); // always interpret the status text as RichText, but disable word wrapping mItemStatus->setTextFormat( Qt::RichText ); mItemStatus->setAlignment( Qt::AlignAuto | Qt::AlignVCenter | Qt::SingleLine ); // richtext leads to sizeHint acting as if wrapping was enabled though, // so make sure we only ever have the height of one line. - mItemStatus->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored ) ); + mItemStatus->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Ignored ) ); mItemStatus->setFixedHeight( mItemLabel->sizeHint().height() ); setCrypto( item->usesCrypto() ); if( first ) hideHLine(); @@ -204,12 +204,12 @@ void TransactionItem::setProgress( int progress ) mProgress->setProgress( progress ); } -void TransactionItem::setLabel( const QString& label ) +void TransactionItem::setLabel( const TQString& label ) { mItemLabel->setText( label ); } -void TransactionItem::setStatus( const QString& status ) +void TransactionItem::setStatus( const TQString& status ) { mItemStatus->setText( status ); } @@ -239,10 +239,10 @@ void TransactionItem::addSubTransaction( ProgressItem* /*item*/ ) // --------------------------------------------------------------------------- -ProgressDialog::ProgressDialog( QWidget* alignWidget, QWidget* parent, const char* name ) +ProgressDialog::ProgressDialog( TQWidget* alignWidget, TQWidget* parent, const char* name ) : OverlayWidget( alignWidget, parent, name ), mWasLastShown( false ) { - setFrameStyle( QFrame::Panel | QFrame::Sunken ); // QFrame + setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); // QFrame setSpacing( 0 ); // QHBox setMargin( 1 ); @@ -250,15 +250,15 @@ ProgressDialog::ProgressDialog( QWidget* alignWidget, QWidget* parent, const cha // No more close button for now, since there is no more autoshow /* - QVBox* rightBox = new QVBox( this ); - QToolButton* pbClose = new QToolButton( rightBox ); + TQVBox* rightBox = new TQVBox( this ); + TQToolButton* pbClose = new TQToolButton( rightBox ); pbClose->setAutoRaise(true); - pbClose->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); + pbClose->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); pbClose->setFixedSize( 16, 16 ); pbClose->setIconSet( KGlobal::iconLoader()->loadIconSet( "fileclose", KIcon::Small, 14 ) ); - QToolTip::add( pbClose, i18n( "Hide detailed progress window" ) ); - connect(pbClose, SIGNAL(clicked()), this, SLOT(slotClose())); - QWidget* spacer = new QWidget( rightBox ); // don't let the close button take up all the height + TQToolTip::add( pbClose, i18n( "Hide detailed progress window" ) ); + connect(pbClose, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClose())); + TQWidget* spacer = new TQWidget( rightBox ); // don't let the close button take up all the height rightBox->setStretchFactor( spacer, 100 ); */ @@ -267,23 +267,23 @@ ProgressDialog::ProgressDialog( QWidget* alignWidget, QWidget* parent, const cha * appearing and vanishing items. */ ProgressManager *pm = ProgressManager::instance(); - connect ( pm, SIGNAL( progressItemAdded( KPIM::ProgressItem* ) ), - this, SLOT( slotTransactionAdded( KPIM::ProgressItem* ) ) ); - connect ( pm, SIGNAL( progressItemCompleted( KPIM::ProgressItem* ) ), - this, SLOT( slotTransactionCompleted( KPIM::ProgressItem* ) ) ); - connect ( pm, SIGNAL( progressItemProgress( KPIM::ProgressItem*, unsigned int ) ), - this, SLOT( slotTransactionProgress( KPIM::ProgressItem*, unsigned int ) ) ); - connect ( pm, SIGNAL( progressItemStatus( KPIM::ProgressItem*, const QString& ) ), - this, SLOT( slotTransactionStatus( KPIM::ProgressItem*, const QString& ) ) ); - connect ( pm, SIGNAL( progressItemLabel( KPIM::ProgressItem*, const QString& ) ), - this, SLOT( slotTransactionLabel( KPIM::ProgressItem*, const QString& ) ) ); - connect ( pm, SIGNAL( progressItemUsesCrypto(KPIM::ProgressItem*, bool) ), - this, SLOT( slotTransactionUsesCrypto( KPIM::ProgressItem*, bool ) ) ); - connect ( pm, SIGNAL( showProgressDialog() ), - this, SLOT( slotShow() ) ); + connect ( pm, TQT_SIGNAL( progressItemAdded( KPIM::ProgressItem* ) ), + this, TQT_SLOT( slotTransactionAdded( KPIM::ProgressItem* ) ) ); + connect ( pm, TQT_SIGNAL( progressItemCompleted( KPIM::ProgressItem* ) ), + this, TQT_SLOT( slotTransactionCompleted( KPIM::ProgressItem* ) ) ); + connect ( pm, TQT_SIGNAL( progressItemProgress( KPIM::ProgressItem*, unsigned int ) ), + this, TQT_SLOT( slotTransactionProgress( KPIM::ProgressItem*, unsigned int ) ) ); + connect ( pm, TQT_SIGNAL( progressItemStatus( KPIM::ProgressItem*, const TQString& ) ), + this, TQT_SLOT( slotTransactionStatus( KPIM::ProgressItem*, const TQString& ) ) ); + connect ( pm, TQT_SIGNAL( progressItemLabel( KPIM::ProgressItem*, const TQString& ) ), + this, TQT_SLOT( slotTransactionLabel( KPIM::ProgressItem*, const TQString& ) ) ); + connect ( pm, TQT_SIGNAL( progressItemUsesCrypto(KPIM::ProgressItem*, bool) ), + this, TQT_SLOT( slotTransactionUsesCrypto( KPIM::ProgressItem*, bool ) ) ); + connect ( pm, TQT_SIGNAL( showProgressDialog() ), + this, TQT_SLOT( slotShow() ) ); } -void ProgressDialog::closeEvent( QCloseEvent* e ) +void ProgressDialog::closeEvent( TQCloseEvent* e ) { e->accept(); hide(); @@ -312,7 +312,7 @@ void ProgressDialog::slotTransactionAdded( ProgressItem *item ) if ( ti ) mTransactionsToListviewItems.replace( item, ti ); if ( first && mWasLastShown ) - QTimer::singleShot( 1000, this, SLOT( slotShow() ) ); + TQTimer::singleShot( 1000, this, TQT_SLOT( slotShow() ) ); } } @@ -323,14 +323,14 @@ void ProgressDialog::slotTransactionCompleted( ProgressItem *item ) TransactionItem *ti = mTransactionsToListviewItems[ item ]; mTransactionsToListviewItems.remove( item ); ti->setItemComplete(); - QTimer::singleShot( 3000, ti, SLOT( deleteLater() ) ); + TQTimer::singleShot( 3000, ti, TQT_SLOT( deleteLater() ) ); // see the slot for comments as to why that works - connect ( ti, SIGNAL( destroyed() ), - mScrollView, SLOT( slotLayoutFirstItem() ) ); + connect ( ti, TQT_SIGNAL( destroyed() ), + mScrollView, TQT_SLOT( slotLayoutFirstItem() ) ); } // This was the last item, hide. if ( mTransactionsToListviewItems.empty() ) - QTimer::singleShot( 3000, this, SLOT( slotHide() ) ); + TQTimer::singleShot( 3000, this, TQT_SLOT( slotHide() ) ); } void ProgressDialog::slotTransactionCanceled( ProgressItem* ) @@ -347,7 +347,7 @@ void ProgressDialog::slotTransactionProgress( ProgressItem *item, } void ProgressDialog::slotTransactionStatus( ProgressItem *item, - const QString& status ) + const TQString& status ) { if ( mTransactionsToListviewItems.contains( item ) ) { TransactionItem *ti = mTransactionsToListviewItems[ item ]; @@ -356,7 +356,7 @@ void ProgressDialog::slotTransactionStatus( ProgressItem *item, } void ProgressDialog::slotTransactionLabel( ProgressItem *item, - const QString& label ) + const TQString& label ) { if ( mTransactionsToListviewItems.contains( item ) ) { TransactionItem *ti = mTransactionsToListviewItems[ item ]; |