diff options
Diffstat (limited to 'kpresenter/KPrTransEffectDia.cpp')
-rw-r--r-- | kpresenter/KPrTransEffectDia.cpp | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/kpresenter/KPrTransEffectDia.cpp b/kpresenter/KPrTransEffectDia.cpp index 120b9bfc..2d305841 100644 --- a/kpresenter/KPrTransEffectDia.cpp +++ b/kpresenter/KPrTransEffectDia.cpp @@ -30,20 +30,20 @@ #include "KPrPageEffects.h" #include "KPrSoundPlayer.h" -#include <qsplitter.h> -#include <qheader.h> -#include <qwmatrix.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qimage.h> -#include <qpushbutton.h> -#include <qcheckbox.h> -#include <qslider.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qframe.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqsplitter.h> +#include <tqheader.h> +#include <tqwmatrix.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqimage.h> +#include <tqpushbutton.h> +#include <tqcheckbox.h> +#include <tqslider.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <kdebug.h> #include <kurlrequester.h> @@ -55,16 +55,16 @@ #include <kfiledialog.h> -KPrEffectPreview::KPrEffectPreview( QWidget *parent, KPrDocument *_doc, KPrView *_view ) - : QLabel( parent ), doc( _doc ), view( _view ), m_pageEffect( 0 ) +KPrEffectPreview::KPrEffectPreview( TQWidget *tqparent, KPrDocument *_doc, KPrView *_view ) + : TQLabel( tqparent ), doc( _doc ), view( _view ), m_pageEffect( 0 ) { setFrameStyle( StyledPanel | Sunken ); } -void KPrEffectPreview::setPixmap( const QPixmap& pixmap ) +void KPrEffectPreview::setPixmap( const TQPixmap& pixmap ) { // find the right size - QRect rect = pixmap.rect(); + TQRect rect = pixmap.rect(); int w = rect.width(); int h = rect.height(); if ( w > h ) { @@ -83,45 +83,45 @@ void KPrEffectPreview::setPixmap( const QPixmap& pixmap ) setMinimumSize( w, h ); // create smaller pixmap for preview - const QImage img( pixmap.convertToImage().smoothScale( w, h, QImage::ScaleFree ) ); + const TQImage img( pixmap.convertToImage().smoothScale( w, h, TQ_ScaleFree ) ); m_pixmap.convertFromImage( img ); - QLabel::setPixmap( m_pixmap ); + TQLabel::setPixmap( m_pixmap ); } void KPrEffectPreview::run( PageEffect effect, EffectSpeed speed ) { - QRect rect = m_pixmap.rect(); + TQRect rect = m_pixmap.rect(); m_target.resize( rect.size() ); - m_target.fill( Qt::black ); + m_target.fill( TQt::black ); //kPchangePages( this, m_pixmap, m_target, effect, speed ); if ( m_pageEffect ) { m_pageEffectTimer.stop(); - QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) ); + TQObject::disconnect( &m_pageEffectTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotDoPageEffect() ) ); m_pageEffect->finish(); delete m_pageEffect; m_pageEffect = 0; - QLabel::repaint(); + TQLabel::tqrepaint(); } - m_pageEffect = new KPrPageEffects( this, m_target, effect, speed ); + m_pageEffect = new KPrPageEffects( TQT_TQPAINTDEVICE(this), m_target, effect, speed ); if ( m_pageEffect->doEffect() ) { delete m_pageEffect; m_pageEffect = 0; - QLabel::update(); + TQLabel::update(); } else { - connect( &m_pageEffectTimer, SIGNAL( timeout() ), SLOT( slotDoPageEffect() ) ); + connect( &m_pageEffectTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotDoPageEffect() ) ); m_pageEffectTimer.start( 50, true ); } - //QLabel::update(); + //TQLabel::update(); } @@ -130,10 +130,10 @@ void KPrEffectPreview::slotDoPageEffect() if ( m_pageEffect->doEffect() ) { m_pageEffectTimer.stop(); - QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) ); + TQObject::disconnect( &m_pageEffectTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotDoPageEffect() ) ); delete m_pageEffect; m_pageEffect = 0; - QLabel::update(); + TQLabel::update(); } else { @@ -142,26 +142,26 @@ void KPrEffectPreview::slotDoPageEffect() } -KPrTransEffectDia::KPrTransEffectDia( QWidget *parent, const char *name, +KPrTransEffectDia::KPrTransEffectDia( TQWidget *tqparent, const char *name, KPrDocument *_doc, KPrView *_view ) - : KDialogBase( parent, name, true, "", KDialogBase::User1|Ok|Cancel ), + : KDialogBase( tqparent, name, true, "", KDialogBase::User1|Ok|Cancel ), doc( _doc ), view( _view ), soundPlayer( 0 ) { enableButtonSeparator( true ); - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget(page); - QBoxLayout *topLayout = new QHBoxLayout( page, KDialog::marginHint(), KDialog::spacingHint() ); - QWidget* leftpart = new QWidget( page ); + TQBoxLayout *topLayout = new TQHBoxLayout( page, KDialog::marginHint(), KDialog::spacingHint() ); + TQWidget* leftpart = new TQWidget( page ); topLayout->addWidget( leftpart ); - QWidget* rightpart = new QWidget( page ); + TQWidget* rightpart = new TQWidget( page ); topLayout->addWidget( rightpart ); // right-side of the dialog, for showing effect preview - QVBoxLayout *rightlayout = new QVBoxLayout( rightpart, KDialog::marginHint(), KDialog::spacingHint() ); - rightlayout->setAutoAdd( true ); + TQVBoxLayout *righttqlayout = new TQVBoxLayout( rightpart, KDialog::marginHint(), KDialog::spacingHint() ); + righttqlayout->setAutoAdd( true ); effectPreview = new KPrEffectPreview( rightpart, doc, view ); @@ -169,36 +169,36 @@ KPrTransEffectDia::KPrTransEffectDia( QWidget *parent, const char *name, KPrPage* pg = doc->pageList().at( pgnum ); // pixmap for effect preview - QRect rect= pg->getZoomPageRect(); - QPixmap pix( rect.size() ); - pix.fill( Qt::white ); + TQRect rect= pg->getZoomPageRect(); + TQPixmap pix( rect.size() ); + pix.fill( TQt::white ); view->getCanvas()->drawPageInPix( pix, pgnum, 100 ); effectPreview->setPixmap( pix ); pageEffect = pg->getPageEffect(); speed = pg->getPageEffectSpeed(); - QVBoxLayout *leftlayout = new QVBoxLayout( leftpart, KDialog::marginHint(), KDialog::spacingHint() ); - leftlayout->setAutoAdd( true ); + TQVBoxLayout *lefttqlayout = new TQVBoxLayout( leftpart, KDialog::marginHint(), KDialog::spacingHint() ); + lefttqlayout->setAutoAdd( true ); - new QLabel( i18n("Effect:"), leftpart ); + new TQLabel( i18n("Effect:"), leftpart ); - effectList = new QListBox( leftpart ); + effectList = new TQListBox( leftpart ); effectList->insertItem( i18n( "No Effect" ) ); - effectList->insertItem( i18n( "Close Horizontal" ) ); - effectList->insertItem( i18n( "Close Vertical" ) ); + effectList->insertItem( i18n( "CloseQt::Horizontal" ) ); + effectList->insertItem( i18n( "CloseQt::Vertical" ) ); effectList->insertItem( i18n( "Close From All Directions" ) ); - effectList->insertItem( i18n( "Open Horizontal" ) ); - effectList->insertItem( i18n( "Open Vertical" ) ); + effectList->insertItem( i18n( "OpenQt::Horizontal" ) ); + effectList->insertItem( i18n( "OpenQt::Vertical" ) ); effectList->insertItem( i18n( "Open From All Directions" ) ); - effectList->insertItem( i18n( "Interlocking Horizontal 1" ) ); - effectList->insertItem( i18n( "Interlocking Horizontal 2" ) ); - effectList->insertItem( i18n( "Interlocking Vertical 1" ) ); - effectList->insertItem( i18n( "Interlocking Vertical 2" ) ); + effectList->insertItem( i18n( "InterlockingQt::Horizontal 1" ) ); + effectList->insertItem( i18n( "InterlockingQt::Horizontal 2" ) ); + effectList->insertItem( i18n( "InterlockingQt::Vertical 1" ) ); + effectList->insertItem( i18n( "InterlockingQt::Vertical 2" ) ); effectList->insertItem( i18n( "Surround 1" ) ); effectList->insertItem( i18n( "Fly Away 1" ) ); - effectList->insertItem( i18n( "Blinds Horizontal" ) ); - effectList->insertItem( i18n( "Blinds Vertical" ) ); + effectList->insertItem( i18n( "BlindsQt::Horizontal" ) ); + effectList->insertItem( i18n( "BlindsQt::Vertical" ) ); effectList->insertItem( i18n( "Box In" ) ); effectList->insertItem( i18n( "Box Out" ) ); effectList->insertItem( i18n( "Checkerboard Across" ) ); @@ -232,16 +232,16 @@ KPrTransEffectDia::KPrTransEffectDia( QWidget *parent, const char *name, if( pageEffect == PEF_RANDOM ) effectList->setCurrentItem( effectList->count()-1 ); - connect( effectList, SIGNAL(highlighted(int)), this, SLOT(effectChanged(int)) ); - connect( effectList, SIGNAL( doubleClicked ( QListBoxItem *) ), this, SLOT( effectChanged()) ); + connect( effectList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(effectChanged(int)) ); + connect( effectList, TQT_SIGNAL( doubleClicked ( TQListBoxItem *) ), this, TQT_SLOT( effectChanged()) ); - new QLabel( i18n("Speed:"), leftpart ); + new TQLabel( i18n("Speed:"), leftpart ); - QWidget* sp = new QWidget( leftpart ); - QBoxLayout* speedLayout = new QHBoxLayout( sp, KDialog::marginHint(), KDialog::spacingHint() ); + TQWidget* sp = new TQWidget( leftpart ); + TQBoxLayout* speedLayout = new TQHBoxLayout( sp, KDialog::marginHint(), KDialog::spacingHint() ); speedLayout->setAutoAdd( true ); - speedCombo = new QComboBox( sp ); + speedCombo = new TQComboBox( sp ); speedCombo->insertItem(i18n("Slow") ); speedCombo->insertItem(i18n("Medium") ); speedCombo->insertItem(i18n("Fast") ); @@ -249,74 +249,74 @@ KPrTransEffectDia::KPrTransEffectDia( QWidget *parent, const char *name, speedCombo->setCurrentItem( speed ); - connect( speedCombo, SIGNAL(activated(int)), this, SLOT(speedChanged(int)) ); + connect( speedCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(speedChanged(int)) ); - QWidget* previewgrp = new QWidget( leftpart ); - QBoxLayout* previewLayout = new QHBoxLayout( previewgrp, KDialog::marginHint(), KDialog::spacingHint() ); + TQWidget* previewgrp = new TQWidget( leftpart ); + TQBoxLayout* previewLayout = new TQHBoxLayout( previewgrp, KDialog::marginHint(), KDialog::spacingHint() ); previewLayout->setAutoAdd( true ); - automaticPreview = new QCheckBox( i18n( "Automatic preview" ), previewgrp ); + automaticPreview = new TQCheckBox( i18n( "Automatic preview" ), previewgrp ); automaticPreview->setChecked( true ); - QWidget* previewspacer = new QWidget( previewgrp ); - previewspacer->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, - QSizePolicy::Expanding ) ); + TQWidget* previewspacer = new TQWidget( previewgrp ); + previewspacer->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, + TQSizePolicy::Expanding ) ); - previewButton = new QPushButton( previewgrp ); + previewButton = new TQPushButton( previewgrp ); previewButton->setText( i18n("Preview") ); - connect( previewButton, SIGNAL(clicked()), this, SLOT(preview()) ); + connect( previewButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(preview()) ); - QFrame* line = new QFrame( leftpart ); - line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); + TQFrame* line = new TQFrame( leftpart ); + line->setFrameStyle( TQFrame::HLine | TQFrame::Sunken ); soundFileName = pg->getPageSoundFileName(); soundEffect = pg->getPageSoundEffect(); - checkSoundEffect = new QCheckBox( i18n( "Sound effect" ), leftpart ); + checkSoundEffect = new TQCheckBox( i18n( "Sound effect" ), leftpart ); checkSoundEffect->setChecked( soundEffect ); - connect( checkSoundEffect, SIGNAL( clicked() ), this, SLOT( soundEffectChanged() ) ); + connect( checkSoundEffect, TQT_SIGNAL( clicked() ), this, TQT_SLOT( soundEffectChanged() ) ); - QWidget* soundgrp = new QWidget( leftpart ); - QBoxLayout* soundLayout = new QHBoxLayout( soundgrp, KDialog::marginHint(), KDialog::spacingHint() ); + TQWidget* soundgrp = new TQWidget( leftpart ); + TQBoxLayout* soundLayout = new TQHBoxLayout( soundgrp, KDialog::marginHint(), KDialog::spacingHint() ); soundLayout->setAutoAdd( true ); - lSoundEffect = new QLabel( i18n( "File name:" ), soundgrp ); + lSoundEffect = new TQLabel( i18n( "File name:" ), soundgrp ); requester = new KURLRequester( soundgrp ); requester->setURL( soundFileName ); - connect( requester, SIGNAL( openFileDialog( KURLRequester * ) ), - this, SLOT( slotRequesterClicked( KURLRequester * ) ) ); - connect( requester, SIGNAL( textChanged( const QString& ) ), - this, SLOT( slotSoundFileChanged( const QString& ) ) ); + connect( requester, TQT_SIGNAL( openFileDialog( KURLRequester * ) ), + this, TQT_SLOT( slotRequesterClicked( KURLRequester * ) ) ); + connect( requester, TQT_SIGNAL( textChanged( const TQString& ) ), + this, TQT_SLOT( slotSoundFileChanged( const TQString& ) ) ); - buttonTestPlaySoundEffect = new QPushButton( soundgrp ); + buttonTestPlaySoundEffect = new TQPushButton( soundgrp ); buttonTestPlaySoundEffect->setPixmap( BarIcon("1rightarrow", KIcon::SizeSmall) ); - QToolTip::add( buttonTestPlaySoundEffect, i18n("Play") ); + TQToolTip::add( buttonTestPlaySoundEffect, i18n("Play") ); - connect( buttonTestPlaySoundEffect, SIGNAL( clicked() ), this, SLOT( playSound() ) ); + connect( buttonTestPlaySoundEffect, TQT_SIGNAL( clicked() ), this, TQT_SLOT( playSound() ) ); - buttonTestStopSoundEffect = new QPushButton( soundgrp ); + buttonTestStopSoundEffect = new TQPushButton( soundgrp ); buttonTestStopSoundEffect->setPixmap( BarIcon("player_stop", KIcon::SizeSmall) ); - QToolTip::add( buttonTestStopSoundEffect, i18n("Stop") ); + TQToolTip::add( buttonTestStopSoundEffect, i18n("Stop") ); - connect( buttonTestStopSoundEffect, SIGNAL( clicked() ), this, SLOT( stopSound() ) ); + connect( buttonTestStopSoundEffect, TQT_SIGNAL( clicked() ), this, TQT_SLOT( stopSound() ) ); soundEffect = pg->getPageSoundEffect(); setButtonText(KDialogBase::User1,i18n( "Apply &Global" )); slideTime = pg->getPageTimer(); - new QLabel( i18n("Automatically advance to the next slide after:"), rightpart ); + new TQLabel( i18n("Automatically advance to the next slide after:"), rightpart ); timeSlider = new KIntNumInput( slideTime, rightpart ); timeSlider->setRange( 1, 600, 1 ); timeSlider->setSuffix( i18n( " seconds" ) ); - connect( timeSlider, SIGNAL(valueChanged(int)), this, SLOT(timeChanged(int)) ); + connect( timeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(timeChanged(int)) ); - QWidget* rspacer = new QWidget( rightpart ); - rspacer->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + TQWidget* rspacer = new TQWidget( rightpart ); + rspacer->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); - QWidget* lspacer = new QWidget( leftpart ); + TQWidget* lspacer = new TQWidget( leftpart ); lspacer->setMinimumSize( 10, spacingHint() ); soundEffectChanged(); @@ -372,23 +372,23 @@ void KPrTransEffectDia::soundEffectChanged() } } -static QString getSoundFileFilter() +static TQString getSoundFileFilter() { - QStringList fileList; + TQStringList fileList; fileList << "wav" << "au" << "mp3" << "mp1" << "mp2" << "mpg" << "dat" << "mpeg" << "ogg" << "cdda" << "cda " << "vcd" << "null"; fileList.sort(); bool comma = false; - QString full, str; - QStringList::ConstIterator end( fileList.end() ); - for ( QStringList::ConstIterator it = fileList.begin(); it != end; ++it ) { + TQString full, str; + TQStringList::ConstIterator end( fileList.end() ); + for ( TQStringList::ConstIterator it = fileList.begin(); it != end; ++it ) { if ( comma ) str += '\n'; comma = true; - str += QString( i18n( "*.%1|%2 Files" ) ).arg( *it ).arg( (*it).upper() ); + str += TQString( i18n( "*.%1|%2 Files" ) ).tqarg( *it ).tqarg( (*it).upper() ); - full += QString( "*.") + (*it) + ' '; + full += TQString( "*.") + (*it) + ' '; } str = full + '|' + i18n( "All Supported Files" ) + '\n' + str; @@ -399,16 +399,16 @@ static QString getSoundFileFilter() void KPrTransEffectDia::slotRequesterClicked( KURLRequester * ) { - QString filter = getSoundFileFilter(); + TQString filter = getSoundFileFilter(); requester->fileDialog()->setFilter( filter ); // find the first "sound"-resource that contains files - QStringList soundDirs = KGlobal::dirs()->resourceDirs( "sound" ); + TQStringList soundDirs = KGlobal::dirs()->resourceDirs( "sound" ); if ( !soundDirs.isEmpty() ) { KURL soundURL; - QDir dir; - dir.setFilter( QDir::Files | QDir::Readable ); - QStringList::ConstIterator it = soundDirs.begin(); + TQDir dir; + dir.setFilter( TQDir::Files | TQDir::Readable ); + TQStringList::ConstIterator it = soundDirs.begin(); while ( it != soundDirs.end() ) { dir = *it; if ( dir.isReadable() && dir.count() > 2 ) { @@ -421,7 +421,7 @@ void KPrTransEffectDia::slotRequesterClicked( KURLRequester * ) } } -void KPrTransEffectDia::slotSoundFileChanged( const QString& text ) +void KPrTransEffectDia::slotSoundFileChanged( const TQString& text ) { soundFileName = text; |