summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrMSPresentationSetup.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kpresenter/KPrMSPresentationSetup.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpresenter/KPrMSPresentationSetup.cpp')
-rw-r--r--kpresenter/KPrMSPresentationSetup.cpp220
1 files changed, 110 insertions, 110 deletions
diff --git a/kpresenter/KPrMSPresentationSetup.cpp b/kpresenter/KPrMSPresentationSetup.cpp
index eb639604..f9a87fd5 100644
--- a/kpresenter/KPrMSPresentationSetup.cpp
+++ b/kpresenter/KPrMSPresentationSetup.cpp
@@ -33,17 +33,17 @@
#include <kio/netaccess.h>
#include <ktempfile.h>
-#include <qdir.h>
-#include <qframe.h>
-#include <qfileinfo.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qpushbutton.h>
-#include <qvbox.h>
-#include <qwhatsthis.h>
+#include <tqdir.h>
+#include <tqframe.h>
+#include <tqfileinfo.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqpushbutton.h>
+#include <tqvbox.h>
+#include <tqwhatsthis.h>
#include <kapplication.h>
#include <kbuttonbox.h>
@@ -84,15 +84,15 @@ void KPrMSPresentation::initCreation( KProgress *progressBar )
// we create the DCIM file, and then iterate through looking
// for the next "available" directory slot
KURL str( path + "/DCIM" );
- KIO::NetAccess::mkdir( str,( QWidget* )0L );
+ KIO::NetAccess::mkdir( str,( TQWidget* )0L );
p = progressBar->progress();
progressBar->setProgress( ++p );
kapp->processEvents();
for (int dirNum = 101; dirNum < 999; dirNum++) {
- slidePath = QString("/DCIM/%1MSPJP").arg(dirNum);
- if (! KIO::NetAccess::exists(( path + slidePath), true, ( QWidget* )0L) )
+ slidePath = TQString("/DCIM/%1MSPJP").tqarg(dirNum);
+ if (! KIO::NetAccess::exists(( path + slidePath), true, ( TQWidget* )0L) )
break;
}
@@ -101,20 +101,20 @@ void KPrMSPresentation::initCreation( KProgress *progressBar )
kapp->processEvents();
str = ( path + slidePath );
- KIO::NetAccess::mkdir( str,( QWidget* )0L );
+ KIO::NetAccess::mkdir( str,( TQWidget* )0L );
p = progressBar->progress();
progressBar->setProgress( ++p );
kapp->processEvents();
// now do the SPP file directory
str = ( path + "/MSSONY" );
- KIO::NetAccess::mkdir( str,( QWidget* )0L );
+ KIO::NetAccess::mkdir( str,( TQWidget* )0L );
p = progressBar->progress();
progressBar->setProgress( ++p );
kapp->processEvents();
str = ( path + "/MSSONY/PJ" );
- KIO::NetAccess::mkdir( str,( QWidget* )0L );
+ KIO::NetAccess::mkdir( str,( TQWidget* )0L );
p = progressBar->progress();
@@ -122,13 +122,13 @@ void KPrMSPresentation::initCreation( KProgress *progressBar )
kapp->processEvents();
// create the title slides
- QPixmap titleSlide( 1024, 768 );
+ TQPixmap titleSlide( 1024, 768 );
titleSlide.fill( backColour );
- QPainter painter( &titleSlide );
+ TQPainter painter( &titleSlide );
//the second title is just blank, so create that now
KTempFile tmp;
- QString filename = path + slidePath + "/SPJT0002.JPG";
+ TQString filename = path + slidePath + "/SPJT0002.JPG";
titleSlide.save( tmp.name(), "JPEG" );
KIO::NetAccess::file_move( tmp.name(), filename, -1, true /*overwrite*/);
@@ -137,10 +137,10 @@ void KPrMSPresentation::initCreation( KProgress *progressBar )
kapp->processEvents();
// and put the specified title string on the first slide
- QFont textFont( "SansSerif", 96 );
+ TQFont textFont( "SansSerif", 96 );
painter.setFont( textFont );
painter.setPen( textColour );
- painter.drawText( titleSlide.rect(), Qt::AlignCenter | Qt::WordBreak, title );
+ painter.drawText( titleSlide.rect(), TQt::AlignCenter | TQt::WordBreak, title );
filename = path + slidePath + "/SPJT0001.JPG";
KTempFile tmp2;
@@ -157,7 +157,7 @@ void KPrMSPresentation::createSlidesPictures( KProgress *progressBar )
{
if ( slideInfos.isEmpty() )
return;
- QString filename;
+ TQString filename;
int p;
for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
int pgNum = slideInfos[i].pageNumber;
@@ -181,34 +181,34 @@ void KPrMSPresentation::createIndexFile( KProgress *progressBar )
int p;
KTempFile sppFile;
- QString filenameStore = (path + "/MSSONY/PJ/" + title + ".SPP");
+ TQString filenameStore = (path + "/MSSONY/PJ/" + title + ".SPP");
- QDataStream sppStream( sppFile.file() );
- sppStream.setByteOrder(QDataStream::LittleEndian);
+ TQDataStream sppStream( sppFile.file() );
+ sppStream.setByteOrder(TQDataStream::LittleEndian);
p = progressBar->progress();
progressBar->setProgress( ++p );
kapp->processEvents();
// We are doing little endian
- sppStream << (Q_UINT32)0x00505053; // SPP magic header
- sppStream << (Q_UINT32)0x00000000; // four null bytes
- sppStream << (Q_UINT32)0x30303130; // version(?) 0100
- sppStream << (Q_UINT32)0x00000000; // more nulls
- sppStream << (Q_UINT32)(slideInfos.count());
+ sppStream << (TQ_UINT32)0x00505053; // SPP magic header
+ sppStream << (TQ_UINT32)0x00000000; // four null bytes
+ sppStream << (TQ_UINT32)0x30303130; // version(?) 0100
+ sppStream << (TQ_UINT32)0x00000000; // more nulls
+ sppStream << (TQ_UINT32)(slideInfos.count());
// DCIM path 1, 68 bytes null padded
char buff[68];
- strncpy( buff, QString("%1").arg(slidePath).ascii(), 67 );
+ strncpy( buff, TQString("%1").tqarg(slidePath).ascii(), 67 );
buff[67] = 0x00;
sppStream.writeRawBytes( buff, 68 );
- sppStream << (Q_UINT32)0x00000001; // fixed value
- sppStream << (Q_UINT32)0x00000005; // fixed value
- sppStream << (Q_UINT32)0x00000000; // more nulls
- sppStream << (Q_UINT32)0x00000000; // more nulls
- sppStream << (Q_UINT32)0x00000000; // more nulls
- sppStream << (Q_UINT32)0x00000000; // more nulls
- sppStream << (Q_UINT32)0x00000000; // more nulls
- sppStream << (Q_UINT32)0x00000000; // more nulls
+ sppStream << (TQ_UINT32)0x00000001; // fixed value
+ sppStream << (TQ_UINT32)0x00000005; // fixed value
+ sppStream << (TQ_UINT32)0x00000000; // more nulls
+ sppStream << (TQ_UINT32)0x00000000; // more nulls
+ sppStream << (TQ_UINT32)0x00000000; // more nulls
+ sppStream << (TQ_UINT32)0x00000000; // more nulls
+ sppStream << (TQ_UINT32)0x00000000; // more nulls
+ sppStream << (TQ_UINT32)0x00000000; // more nulls
p = progressBar->progress();
progressBar->setProgress( ++p );
kapp->processEvents();
@@ -230,20 +230,20 @@ void KPrMSPresentation::createIndexFile( KProgress *progressBar )
sppStream.writeRawBytes( buff, 44 );
//not really sure what this is about
- sppStream << (Q_UINT32)0xffff0000;
- sppStream << (Q_UINT32)0xffff00ff;
- sppStream << (Q_UINT32)0xffff00ff;
- sppStream << (Q_UINT32)0x000000ff;
- sppStream << (Q_UINT32)0x00000002;
+ sppStream << (TQ_UINT32)0xffff0000;
+ sppStream << (TQ_UINT32)0xffff00ff;
+ sppStream << (TQ_UINT32)0xffff00ff;
+ sppStream << (TQ_UINT32)0x000000ff;
+ sppStream << (TQ_UINT32)0x00000002;
for (int i = 0; i < (296/4); i++) {
- sppStream << (Q_UINT32)0x00000000;
+ sppStream << (TQ_UINT32)0x00000000;
}
p = progressBar->progress();
progressBar->setProgress( ++p );
kapp->processEvents();
// Add in the slide filenames
- QString filename;
+ TQString filename;
for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
filename.sprintf("SPJP%04i.JPG", i+3);
strncpy( buff, filename.ascii(), 63 );
@@ -258,7 +258,7 @@ void KPrMSPresentation::createIndexFile( KProgress *progressBar )
// the logic is 16384 bytes total, lead in is 512 bytes, and there
// is 64 bytes for each real slide
for(unsigned int i = 0; i < (16384-512-64*(slideInfos.count()))/4; i++) {
- sppStream << (Q_UINT32)0x00000000;
+ sppStream << (TQ_UINT32)0x00000000;
}
p = progressBar->progress();
@@ -284,114 +284,114 @@ void KPrMSPresentation::init()
}
if ( slideInfos.isEmpty() )
kdWarning() << "No slides selected!" << endl;
- backColour = Qt::black;
- textColour = Qt::white;
+ backColour = TQt::black;
+ textColour = TQt::white;
path = KGlobalSettings::documentPath();
}
KPrMSPresentationSetup::KPrMSPresentationSetup( KPrDocument *_doc, KPrView *_view )
- : QDialog( 0, "", false ), msPres( _doc, _view )
+ : TQDialog( 0, "", false ), msPres( _doc, _view )
{
doc = _doc;
view = _view;
- QLabel *helptext = new QLabel( this );
- helptext->setAlignment( Qt::WordBreak | Qt::AlignTop| Qt::AlignLeft );
+ TQLabel *helptext = new TQLabel( this );
+ helptext->tqsetAlignment( TQt::WordBreak | TQt::AlignTop| TQt::AlignLeft );
helptext->setText( i18n( "Please enter the directory where the memory stick "
"presentation should be saved. Please also enter a "
"title for the slideshow presentation. " ) );
- QLabel *lable2 = new QLabel( i18n("Path:"), this );
- lable2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ TQLabel *lable2 = new TQLabel( i18n("Path:"), this );
+ lable2->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
path=new KURLRequester( this );
path->setMode( KFile::Directory);
path->lineEdit()->setText(msPres.getPath());
lable2->setBuddy(path);
- QHBoxLayout *pathLayout = new QHBoxLayout;
+ TQHBoxLayout *pathLayout = new TQHBoxLayout;
pathLayout->addWidget(lable2);
pathLayout->addWidget(path);
- connect( path, SIGNAL( textChanged(const QString&) ),
- this, SLOT( slotChoosePath(const QString&) ) );
- connect( path, SIGNAL( urlSelected( const QString&) ),
- this, SLOT( slotChoosePath(const QString&) ) );
+ connect( path, TQT_SIGNAL( textChanged(const TQString&) ),
+ this, TQT_SLOT( slotChoosePath(const TQString&) ) );
+ connect( path, TQT_SIGNAL( urlSelected( const TQString&) ),
+ this, TQT_SLOT( slotChoosePath(const TQString&) ) );
- QLabel *lable1 = new QLabel( i18n("Title:"), this, "lable1" );
- lable1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ TQLabel *lable1 = new TQLabel( i18n("Title:"), this, "lable1" );
+ lable1->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
// TODO - check if there is already a presentation with this title, and
// add a number after it until there isn't.
title = new KLineEdit( msPres.getTitle(), this );
lable1->setBuddy( title );
- QHBoxLayout *titleLayout = new QHBoxLayout;
+ TQHBoxLayout *titleLayout = new TQHBoxLayout;
titleLayout->addWidget( lable1 );
titleLayout->addWidget( title );
- QHBox *moreBox = new QHBox( this );
- QPushButton *showColourButton = new QPushButton( i18n("&Set Colors"), moreBox );
+ TQHBox *moreBox = new TQHBox( this );
+ TQPushButton *showColourButton = new TQPushButton( i18n("&Set Colors"), moreBox );
showColourButton->setToggleButton( true );
- connect( showColourButton, SIGNAL( toggled(bool) ), this, SLOT( showColourGroup(bool) ) );
+ connect( showColourButton, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( showColourGroup(bool) ) );
- QVBoxLayout *topLayout = new QVBoxLayout;
+ TQVBoxLayout *topLayout = new TQVBoxLayout;
topLayout->addWidget( helptext );
topLayout->addSpacing( 10 );
topLayout->addLayout( pathLayout );
topLayout->addLayout( titleLayout );
topLayout->addWidget( moreBox );
- colourGroup = new QGroupBox( 2, Qt::Vertical,
+ colourGroup = new TQGroupBox( 2, Qt::Vertical,
i18n("Preliminary Slides"),
this , "colourBox" );
- QWhatsThis::add( colourGroup,
+ TQWhatsThis::add( colourGroup,
i18n( "This section allows you to set the colors for "
"the preliminary slides; it does not affect the "
"presentation in any way, and it is normal to "
"leave these set to the default.") );
- QHBox *textColourLayout = new QHBox( colourGroup );
- QLabel *lable3 = new QLabel( i18n("Text color:"), textColourLayout );
- lable3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ TQHBox *textColourLayout = new TQHBox( colourGroup );
+ TQLabel *lable3 = new TQLabel( i18n("Text color:"), textColourLayout );
+ lable3->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
textColour = new KColorButton( msPres.getTextColour(), textColourLayout );
lable3->setBuddy( textColour );
- QHBox *backgroundColourLayout = new QHBox( colourGroup );
- QLabel *lable4 = new QLabel( i18n("Background color:"), backgroundColourLayout );
- lable4->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ TQHBox *backgroundColourLayout = new TQHBox( colourGroup );
+ TQLabel *lable4 = new TQLabel( i18n("Background color:"), backgroundColourLayout );
+ lable4->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
backColour = new KColorButton( msPres.getBackColour(), backgroundColourLayout );
lable4->setBuddy( backColour );
colourGroup->setHidden( true );
- QHBox *buttonLayout = new QHBox( this );
+ TQHBox *buttonLayout = new TQHBox( this );
KPushButton *helpButton = new KPushButton( KStdGuiItem::help(), buttonLayout );
- QWhatsThis::add( helpButton,
+ TQWhatsThis::add( helpButton,
i18n( "Selecting this button will take you to the KPresenter "
"documentation that provides more information on how "
"to use the Memory Stick export function. ") );
KPushButton *createButton = new KPushButton( KStdGuiItem::ok(), buttonLayout );
- QWhatsThis::add( createButton,
+ TQWhatsThis::add( createButton,
i18n( "Selecting this button will proceed to generating "
"the presentation in the special Sony format." ) );
KPushButton *cancelButton = new KPushButton( KStdGuiItem::cancel(), buttonLayout );
- QWhatsThis::add( cancelButton,
+ TQWhatsThis::add( cancelButton,
i18n( "Selecting this button will cancel out of the "
"generation of the presentation, and return "
"to the normal KPresenter view. No files will "
"be affected." ) );
- mainLayout = new QVBoxLayout( this );
+ mainLayout = new TQVBoxLayout( this );
mainLayout->setMargin(11);
mainLayout->setSpacing(6);
mainLayout->addLayout(topLayout);
mainLayout->addSpacing( 10 );
mainLayout->addWidget(colourGroup);
mainLayout->addWidget(buttonLayout);
- mainLayout->setResizeMode( QLayout::Fixed );
- mainLayout->setGeometry( QRect( 0, 0, 300, 220 ) );
+ mainLayout->setResizeMode( TQLayout::Fixed );
+ mainLayout->setGeometry( TQRect( 0, 0, 300, 220 ) );
- connect( helpButton, SIGNAL( clicked() ), this, SLOT ( helpMe() ) );
- connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( createButton, SIGNAL( clicked() ), this, SLOT( finish() ) );
+ connect( helpButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT ( helpMe() ) );
+ connect( cancelButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
+ connect( createButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( finish() ) );
}
KPrMSPresentationSetup::~KPrMSPresentationSetup()
@@ -412,10 +412,10 @@ void KPrMSPresentationSetup::showColourGroup(bool on)
{
if (on) {
colourGroup->setHidden( false );
- mainLayout->setGeometry( QRect(0, 0, 300, 220 ) );
+ mainLayout->setGeometry( TQRect(0, 0, 300, 220 ) );
} else {
colourGroup->setHidden( true );
- mainLayout->setGeometry( QRect(0, 0, 300, 320 ) );
+ mainLayout->setGeometry( TQRect(0, 0, 300, 320 ) );
}
}
@@ -438,18 +438,18 @@ void KPrMSPresentationSetup::finish()
// 3. that the .spp file doesn't already exist. If it does, offer to overwrite it.
// If we fail to create a directory, or the user tells us not to bother creating it,
// or the user doesn't want to overwrite it, go back.
- QString pathname = path->lineEdit()->text();
+ TQString pathname = path->lineEdit()->text();
// path doesn't exist. ask user if it should be created.
if ( !KIO::NetAccess::exists(pathname, false, this) ) {
- QString msg = i18n( "<qt>The directory <b>%1</b> does not exist.<br>"
+ TQString msg = i18n( "<qt>The directory <b>%1</b> does not exist.<br>"
"Do you want create it?</qt>" );
- if( KMessageBox::questionYesNo( this, msg.arg( pathname ),
+ if( KMessageBox::questionYesNo( this, msg.tqarg( pathname ),
i18n( "Directory Not Found" ) )
== KMessageBox::Yes)
{
// we are trying to create the directory
- QDir dir;
+ TQDir dir;
bool ok = KIO::NetAccess::mkdir( pathname,this );
if( !ok ) {
// then directory couldn't be created
@@ -466,12 +466,12 @@ void KPrMSPresentationSetup::finish()
}
}
- QString sppFile( pathname + "/MSSONY/PJ/" + title->text() + ".SPP" );
+ TQString sppFile( pathname + "/MSSONY/PJ/" + title->text() + ".SPP" );
if (KIO::NetAccess::exists(sppFile, false, this ) ) {
if ( KMessageBox::warningYesNo( 0,
i18n( "You are about to overwrite an existing index "
"file : %1.\n "
- "Do you want to proceed?" ).arg( sppFile ),
+ "Do you want to proceed?" ).tqarg( sppFile ),
i18n( "Overwrite Presentation" ) )
== KMessageBox::No) {
path->setFocus();
@@ -485,7 +485,7 @@ void KPrMSPresentationSetup::finish()
}
-void KPrMSPresentationSetup::slotChoosePath(const QString &text)
+void KPrMSPresentationSetup::slotChoosePath(const TQString &text)
{
msPres.setPath(text);
}
@@ -495,7 +495,7 @@ void KPrMSPresentationSetup::slotChoosePath(const QString &text)
KPrMSPresentationCreateDialog::KPrMSPresentationCreateDialog( KPrDocument *_doc, KPrView *_view,
const KPrMSPresentation &_msPres )
- : QDialog( 0, "", false ), msPres( _msPres )
+ : TQDialog( 0, "", false ), msPres( _msPres )
{
doc = _doc;
view = _view;
@@ -532,7 +532,7 @@ void KPrMSPresentationCreateDialog::start()
void KPrMSPresentationCreateDialog::initCreation()
{
- QFont f = step1->font(), f2 = step1->font();
+ TQFont f = step1->font(), f2 = step1->font();
f.setBold( true );
step1->setFont( f );
@@ -547,7 +547,7 @@ void KPrMSPresentationCreateDialog::initCreation()
void KPrMSPresentationCreateDialog::createSlidesPictures()
{
- QFont f = step2->font(), f2 = f;
+ TQFont f = step2->font(), f2 = f;
f.setBold( true );
step2->setFont( f );
@@ -564,7 +564,7 @@ void KPrMSPresentationCreateDialog::createSlidesPictures()
void KPrMSPresentationCreateDialog::createIndexFile()
{
- QFont f = step3->font(), f2 = f;
+ TQFont f = step3->font(), f2 = f;
f.setBold( true );
step3->setFont( f );
@@ -581,23 +581,23 @@ void KPrMSPresentationCreateDialog::createIndexFile()
void KPrMSPresentationCreateDialog::setupGUI()
{
- back = new QVBox( this );
+ back = new TQVBox( this );
back->setMargin( KDialog::marginHint() );
- QFrame *line;
+ TQFrame *line;
- step1 = new QLabel( i18n( "Create directory structure" ), back );
- step2 = new QLabel( i18n( "Create pictures of the slides" ), back );
- step3 = new QLabel( i18n( "Create index file" ), back );
+ step1 = new TQLabel( i18n( "Create directory structure" ), back );
+ step2 = new TQLabel( i18n( "Create pictures of the slides" ), back );
+ step3 = new TQLabel( i18n( "Create index file" ), back );
- line = new QFrame( back );
- line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ line = new TQFrame( back );
+ line->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
line->setMaximumHeight( 20 );
progressBar = new KProgress( back );
- line = new QFrame( back );
- line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ line = new TQFrame( back );
+ line->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
line->setMaximumHeight( 20 );
KButtonBox *bb = new KButtonBox( back );
@@ -606,12 +606,12 @@ void KPrMSPresentationCreateDialog::setupGUI()
bDone->setEnabled( false );
- connect( bDone, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( bDone, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
}
-void KPrMSPresentationCreateDialog::resizeEvent( QResizeEvent *e )
+void KPrMSPresentationCreateDialog::resizeEvent( TQResizeEvent *e )
{
- QDialog::resizeEvent( e );
+ TQDialog::resizeEvent( e );
back->resize( size() );
}