kpresenter

KPrMSPresentationSetup.cpp

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright 2004 Brad Hards <bradh@frogmouth.net>
00004    Loosely based on webpresention.cc, which is:
00005      Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00006      Copyright 2001, 2002 Nicolas GOUTTE <goutte@kde.org>
00007      Copyright 2002 Ariya Hidayat <ariya@kde.org>
00008 
00009    This library is free software; you can redistribute it and/or
00010    modify it under the terms of the GNU Library General Public
00011    License as published by the Free Software Foundation; either
00012    version 2 of the License, or (at your option) any later version.
00013 
00014    This library is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017    Library General Public License for more details.
00018 
00019    You should have received a copy of the GNU Library General Public License
00020    along with this library; see the file COPYING.LIB.  If not, write to
00021    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022  * Boston, MA 02110-1301, USA.
00023 */
00024 
00025 #include "KPrMSPresentationSetup.h"
00026 
00027 #include "KPrView.h"
00028 #include "KPrDocument.h"
00029 
00030 #include "KPrCanvas.h"
00031 #include "KPrPage.h"
00032 
00033 #include <kio/netaccess.h>
00034 #include <ktempfile.h>
00035 
00036 #include <qdir.h>
00037 #include <qframe.h>
00038 #include <qfileinfo.h>
00039 #include <qhbox.h>
00040 #include <qlabel.h>
00041 #include <qlayout.h>
00042 #include <qpixmap.h>
00043 #include <qpainter.h>
00044 #include <qpushbutton.h>
00045 #include <qvbox.h>
00046 #include <qwhatsthis.h>
00047 
00048 #include <kapplication.h>
00049 #include <kbuttonbox.h>
00050 #include <kcolorbutton.h>
00051 #include <kglobal.h>
00052 #include <kglobalsettings.h>
00053 #include <klineedit.h>
00054 #include <klocale.h>
00055 #include <kmessagebox.h>
00056 #include <kprogress.h>
00057 #include <kstandarddirs.h>
00058 #include <kurlrequester.h>
00059 #include <kstdguiitem.h>
00060 #include <kpushbutton.h>
00061 
00062 KPrMSPresentation::KPrMSPresentation( KPrDocument *_doc, KPrView *_view )
00063 {
00064     doc = _doc;
00065     view = _view;
00066     init();
00067 }
00068 
00069 KPrMSPresentation::KPrMSPresentation( const KPrMSPresentation &msPres )
00070     : title( msPres.title ),
00071       slideInfos( msPres.slideInfos ), backColour( msPres.backColour ),
00072       textColour( msPres.textColour ), path( msPres.path )
00073 {
00074     doc = msPres.doc;
00075     view = msPres.view;
00076 }
00077 
00078 void KPrMSPresentation::initCreation( KProgress *progressBar )
00079 {
00080     int p;
00081 
00082     // the title images, and the subsequent real images need to
00083     // be in a file under DCIM/, and they start at 101MSPJP, so
00084     // we create the DCIM file, and then iterate through looking
00085     // for the next "available" directory slot
00086     KURL str(  path + "/DCIM"  );
00087     KIO::NetAccess::mkdir( str,( QWidget* )0L  );
00088 
00089     p = progressBar->progress();
00090     progressBar->setProgress( ++p );
00091     kapp->processEvents();
00092 
00093     for (int dirNum = 101; dirNum < 999; dirNum++) {
00094         slidePath = QString("/DCIM/%1MSPJP").arg(dirNum);
00095         if (! KIO::NetAccess::exists(( path + slidePath), true, ( QWidget* )0L) )
00096             break;
00097     }
00098 
00099     p = progressBar->progress();
00100     progressBar->setProgress( ++p );
00101     kapp->processEvents();
00102 
00103     str = (  path + slidePath );
00104     KIO::NetAccess::mkdir( str,( QWidget* )0L  );
00105     p = progressBar->progress();
00106     progressBar->setProgress( ++p );
00107     kapp->processEvents();
00108 
00109     // now do the SPP file directory
00110     str = (  path + "/MSSONY" );
00111     KIO::NetAccess::mkdir( str,( QWidget* )0L  );
00112 
00113     p = progressBar->progress();
00114     progressBar->setProgress( ++p );
00115     kapp->processEvents();
00116     str = (  path + "/MSSONY/PJ" );
00117     KIO::NetAccess::mkdir( str,( QWidget* )0L  );
00118 
00119 
00120     p = progressBar->progress();
00121     progressBar->setProgress( ++p );
00122     kapp->processEvents();
00123 
00124     // create the title slides
00125     QPixmap titleSlide( 1024, 768 );
00126     titleSlide.fill( backColour );
00127     QPainter painter( &titleSlide );
00128 
00129     //the second title is just blank, so create that now
00130     KTempFile tmp;
00131     QString filename = path + slidePath + "/SPJT0002.JPG";
00132     titleSlide.save( tmp.name(), "JPEG" );
00133     KIO::NetAccess::file_move( tmp.name(), filename, -1, true /*overwrite*/);
00134 
00135     p = progressBar->progress();
00136     progressBar->setProgress( ++p );
00137     kapp->processEvents();
00138 
00139     // and put the specified title string on the first slide
00140     QFont textFont( "SansSerif", 96 );
00141     painter.setFont( textFont );
00142     painter.setPen( textColour );
00143     painter.drawText( titleSlide.rect(), Qt::AlignCenter | Qt::WordBreak, title );
00144     filename = path + slidePath + "/SPJT0001.JPG";
00145 
00146     KTempFile tmp2;
00147     titleSlide.save( tmp2.name(), "JPEG" );
00148     KIO::NetAccess::file_move( tmp2.name(), filename, -1, true /*overwrite*/);
00149 
00150     p = progressBar->progress();
00151     progressBar->setProgress( ++p );
00152     kapp->processEvents();
00153 
00154 }
00155 
00156 void KPrMSPresentation::createSlidesPictures( KProgress *progressBar )
00157 {
00158     if ( slideInfos.isEmpty() )
00159         return;
00160     QString filename;
00161     int p;
00162     for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
00163         int pgNum = slideInfos[i].pageNumber;
00164         filename.sprintf("/SPJP%04i.JPG", i+3);
00165 
00166         KTempFile tmp;
00167 
00168         view->getCanvas()->exportPage( pgNum, 1023, 767,
00169                                        tmp.name(), "JPEG" );
00170 
00171         KIO::NetAccess::file_move( tmp.name(), ( path + slidePath + filename ), -1, true /*overwrite*/);
00172 
00173         p = progressBar->progress();
00174         progressBar->setProgress( ++p );
00175         kapp->processEvents();
00176     }
00177 }
00178 
00179 void KPrMSPresentation::createIndexFile( KProgress *progressBar )
00180 {
00181     int p;
00182     KTempFile sppFile;
00183 
00184     QString filenameStore = (path + "/MSSONY/PJ/" + title + ".SPP");
00185 
00186     QDataStream sppStream( sppFile.file() );
00187     sppStream.setByteOrder(QDataStream::LittleEndian);
00188     p = progressBar->progress();
00189     progressBar->setProgress( ++p );
00190     kapp->processEvents();
00191 
00192     // We are doing little endian
00193     sppStream << (Q_UINT32)0x00505053; // SPP magic header
00194     sppStream << (Q_UINT32)0x00000000; // four null bytes
00195     sppStream << (Q_UINT32)0x30303130; // version(?) 0100
00196     sppStream << (Q_UINT32)0x00000000; // more nulls
00197     sppStream << (Q_UINT32)(slideInfos.count());
00198 
00199     // DCIM path 1, 68 bytes null padded
00200     char buff[68];
00201     strncpy( buff, QString("%1").arg(slidePath).ascii(), 67 );
00202     buff[67] = 0x00;
00203     sppStream.writeRawBytes( buff, 68 );
00204     sppStream << (Q_UINT32)0x00000001; // fixed value
00205     sppStream << (Q_UINT32)0x00000005; // fixed value
00206     sppStream << (Q_UINT32)0x00000000; // more nulls
00207     sppStream << (Q_UINT32)0x00000000; // more nulls
00208     sppStream << (Q_UINT32)0x00000000; // more nulls
00209     sppStream << (Q_UINT32)0x00000000; // more nulls
00210     sppStream << (Q_UINT32)0x00000000; // more nulls
00211     sppStream << (Q_UINT32)0x00000000; // more nulls
00212     p = progressBar->progress();
00213     progressBar->setProgress( ++p );
00214     kapp->processEvents();
00215 
00216     // title 1, 16 bytes null padded
00217     strncpy( buff, "SPJT0001.JPG", 15 );
00218     buff[15] = 0x00;
00219     sppStream.writeRawBytes( buff, 16 );
00220 
00221     // title 2, 16 bytes null padded
00222     strncpy( buff, "SPJT0002.JPG", 15 );
00223     buff[15] = 0x00;
00224     sppStream.writeRawBytes( buff, 16 );
00225 
00226 
00227     // type face (?), 44 bytes null padded
00228     strncpy( buff, "MS Sans Serif", 43 );
00229     buff[44] = 0x00;
00230     sppStream.writeRawBytes( buff, 44 );
00231 
00232     //not really sure what this is about
00233     sppStream << (Q_UINT32)0xffff0000;
00234     sppStream << (Q_UINT32)0xffff00ff;
00235     sppStream << (Q_UINT32)0xffff00ff;
00236     sppStream << (Q_UINT32)0x000000ff;
00237     sppStream << (Q_UINT32)0x00000002;
00238     for (int i = 0; i < (296/4); i++) {
00239         sppStream << (Q_UINT32)0x00000000;
00240     }
00241     p = progressBar->progress();
00242     progressBar->setProgress( ++p );
00243     kapp->processEvents();
00244 
00245     // Add in the slide filenames
00246     QString filename;
00247     for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
00248         filename.sprintf("SPJP%04i.JPG", i+3);
00249         strncpy( buff, filename.ascii(), 63 );
00250         buff[64] = 0x00;
00251         sppStream.writeRawBytes( buff, 64 );
00252         p = progressBar->progress();
00253         progressBar->setProgress( ++p );
00254         kapp->processEvents();
00255     }
00256 
00257     // OK, now we need to fill to 16384 bytes
00258     // the logic is 16384 bytes total, lead in is 512 bytes, and there
00259     // is 64 bytes for each real slide
00260     for(unsigned int i = 0;  i < (16384-512-64*(slideInfos.count()))/4; i++) {
00261         sppStream << (Q_UINT32)0x00000000;
00262     }
00263 
00264     p = progressBar->progress();
00265     progressBar->setProgress( ++p );
00266     kapp->processEvents();
00267 
00268     sppFile.close();
00269     KIO::NetAccess::file_move( sppFile.name(), filenameStore, -1, true /*overwrite*/);
00270 }
00271 
00272 void KPrMSPresentation::init()
00273 {
00274     title = i18n("Slideshow");
00275 
00276     for ( unsigned int i = 0; i < doc->getPageNums(); i++ )
00277     {
00278         if ( doc->isSlideSelected( i ) )
00279         {
00280             SlideInfo info;
00281             info.pageNumber = i;
00282             slideInfos.append( info );
00283         }
00284     }
00285     if ( slideInfos.isEmpty() )
00286         kdWarning() << "No slides selected!" << endl;
00287     backColour = Qt::black;
00288     textColour = Qt::white;
00289 
00290     path = KGlobalSettings::documentPath();
00291 }
00292 
00293 KPrMSPresentationSetup::KPrMSPresentationSetup( KPrDocument *_doc, KPrView *_view )
00294     : QDialog( 0, "", false ), msPres(  _doc, _view )
00295 {
00296     doc = _doc;
00297     view = _view;
00298 
00299 
00300     QLabel *helptext = new QLabel( this );
00301     helptext->setAlignment( Qt::WordBreak | Qt::AlignTop| Qt::AlignLeft );
00302     helptext->setText( i18n( "Please enter the directory where the memory stick "
00303                              "presentation should be saved. Please also enter a "
00304                              "title for the slideshow presentation. " ) );
00305 
00306     QLabel *lable2 = new QLabel( i18n("Path:"), this );
00307     lable2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
00308     path=new KURLRequester( this );
00309     path->setMode( KFile::Directory);
00310     path->lineEdit()->setText(msPres.getPath());
00311     lable2->setBuddy(path);
00312     QHBoxLayout *pathLayout = new QHBoxLayout;
00313     pathLayout->addWidget(lable2);
00314     pathLayout->addWidget(path);
00315 
00316     connect( path, SIGNAL( textChanged(const QString&) ),
00317              this, SLOT( slotChoosePath(const QString&) ) );
00318     connect( path, SIGNAL( urlSelected( const QString&) ),
00319              this, SLOT( slotChoosePath(const QString&) ) );
00320 
00321 
00322     QLabel *lable1 = new QLabel( i18n("Title:"), this, "lable1" );
00323     lable1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
00324     // TODO - check if there is already a presentation with this title, and
00325     // add a number after it until there isn't.
00326     title = new KLineEdit( msPres.getTitle(), this );
00327     lable1->setBuddy( title );
00328     QHBoxLayout *titleLayout = new QHBoxLayout;
00329     titleLayout->addWidget( lable1 );
00330     titleLayout->addWidget( title );
00331 
00332     QHBox *moreBox = new QHBox( this );
00333     QPushButton *showColourButton = new QPushButton( i18n("&Set Colors"), moreBox );
00334     showColourButton->setToggleButton( true );
00335     connect( showColourButton, SIGNAL( toggled(bool) ), this, SLOT( showColourGroup(bool) ) );
00336 
00337     QVBoxLayout *topLayout = new QVBoxLayout;
00338     topLayout->addWidget( helptext );
00339     topLayout->addSpacing( 10 );
00340     topLayout->addLayout( pathLayout );
00341     topLayout->addLayout( titleLayout );
00342     topLayout->addWidget( moreBox );
00343 
00344     colourGroup = new QGroupBox( 2, Qt::Vertical,
00345                                             i18n("Preliminary Slides"),
00346                                             this , "colourBox" );
00347     QWhatsThis::add( colourGroup,
00348                      i18n( "This section allows you to set the colors for "
00349                            "the preliminary slides; it does not affect the "
00350                            "presentation in any way, and it is normal to "
00351                            "leave these set to the default.") );
00352     QHBox *textColourLayout = new QHBox( colourGroup );
00353     QLabel *lable3 = new QLabel( i18n("Text color:"), textColourLayout );
00354     lable3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
00355     textColour = new KColorButton( msPres.getTextColour(), textColourLayout );
00356     lable3->setBuddy( textColour );
00357 
00358     QHBox *backgroundColourLayout = new QHBox( colourGroup );
00359     QLabel *lable4 = new QLabel( i18n("Background color:"), backgroundColourLayout );
00360     lable4->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
00361     backColour = new KColorButton( msPres.getBackColour(), backgroundColourLayout );
00362     lable4->setBuddy( backColour );
00363     colourGroup->setHidden( true );
00364 
00365     QHBox *buttonLayout = new QHBox( this );
00366     KPushButton *helpButton = new KPushButton( KStdGuiItem::help(), buttonLayout );
00367     QWhatsThis::add( helpButton,
00368                      i18n( "Selecting this button will take you to the KPresenter "
00369                            "documentation that provides more information on how "
00370                            "to use the Memory Stick export function. ") );
00371     KPushButton *createButton = new KPushButton( KStdGuiItem::ok(), buttonLayout );
00372     QWhatsThis::add( createButton,
00373                      i18n( "Selecting this button will proceed to generating "
00374                            "the presentation in the special Sony format." ) );
00375     KPushButton *cancelButton = new KPushButton( KStdGuiItem::cancel(), buttonLayout );
00376     QWhatsThis::add( cancelButton,
00377                      i18n( "Selecting this button will cancel out of the "
00378                            "generation of the presentation, and return "
00379                            "to the normal KPresenter view. No files will "
00380                            "be affected." ) );
00381 
00382     mainLayout = new QVBoxLayout( this );
00383     mainLayout->setMargin(11);
00384     mainLayout->setSpacing(6);
00385     mainLayout->addLayout(topLayout);
00386     mainLayout->addSpacing( 10 );
00387     mainLayout->addWidget(colourGroup);
00388     mainLayout->addWidget(buttonLayout);
00389     mainLayout->setResizeMode( QLayout::Fixed );
00390     mainLayout->setGeometry( QRect( 0, 0, 300, 220 ) );
00391 
00392     connect( helpButton, SIGNAL( clicked() ), this, SLOT ( helpMe() ) );
00393     connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
00394     connect( createButton, SIGNAL( clicked() ), this, SLOT( finish() ) );
00395 }
00396 
00397 KPrMSPresentationSetup::~KPrMSPresentationSetup()
00398 {
00399     view->enableMSPres();
00400 }
00401 
00402 void KPrMSPresentationSetup::createMSPresentation( KPrDocument *_doc, KPrView *_view )
00403 {
00404     KPrMSPresentationSetup *dlg = new KPrMSPresentationSetup( _doc, _view );
00405 
00406     dlg->setCaption( i18n( "Create Memory Stick Slideshow" ) );
00407     dlg->exec();
00408     delete dlg;
00409 }
00410 
00411 void KPrMSPresentationSetup::showColourGroup(bool on)
00412 {
00413     if (on) {
00414         colourGroup->setHidden( false );
00415         mainLayout->setGeometry( QRect(0, 0, 300, 220 ) );
00416     } else {
00417         colourGroup->setHidden( true );
00418         mainLayout->setGeometry( QRect(0, 0, 300, 320 ) );
00419     }
00420 }
00421 
00422 void KPrMSPresentationSetup::helpMe()
00423 {
00424     kapp->invokeHelp("ms-export");
00425 }
00426 
00427 void KPrMSPresentationSetup::finish()
00428 {
00429     msPres.setTitle( title->text() );
00430 
00431     msPres.setBackColour( backColour->color() );
00432     msPres.setTextColour( textColour->color() );
00433     msPres.setPath( path->lineEdit()->text() );
00434 
00435     // Things to sanity check:
00436     // 1. that the directory exists. If not, offer to create it.
00437     // 2. that the directory is writable.
00438     // 3. that the .spp file doesn't already exist. If it does, offer to overwrite it.
00439     // If we fail to create a directory, or the user tells us not to bother creating it,
00440     // or the user doesn't want to overwrite it, go back.
00441     QString pathname = path->lineEdit()->text();
00442 
00443     // path doesn't exist. ask user if it should be created.
00444     if ( !KIO::NetAccess::exists(pathname, false, this) ) {
00445         QString msg = i18n( "<qt>The directory <b>%1</b> does not exist.<br>"
00446                             "Do you want create it?</qt>" );
00447         if( KMessageBox::questionYesNo( this, msg.arg( pathname ),
00448                                         i18n( "Directory Not Found" ) )
00449             == KMessageBox::Yes)
00450             {
00451                 // we are trying to create the directory
00452                 QDir dir;
00453                 bool ok = KIO::NetAccess::mkdir( pathname,this );
00454                 if( !ok ) {
00455                     // then directory couldn't be created
00456                     KMessageBox::sorry( this,
00457                                         i18n( "Cannot create directory." ) );
00458                     path->setFocus();
00459                     return;
00460                 }
00461             }
00462         else {
00463             // user preferred not to create directory
00464             path->setFocus();
00465             return;
00466         }
00467     }
00468 
00469     QString sppFile( pathname + "/MSSONY/PJ/" + title->text() + ".SPP" );
00470     if (KIO::NetAccess::exists(sppFile, false, this ) ) {
00471         if ( KMessageBox::warningYesNo( 0,
00472                                    i18n( "You are about to overwrite an existing index "
00473                                          "file : %1.\n "
00474                                          "Do you want to proceed?" ).arg( sppFile ),
00475                                    i18n( "Overwrite Presentation" ) )
00476              == KMessageBox::No) {
00477             path->setFocus();
00478             return;
00479         }
00480     }
00481 
00482     close();
00483 
00484     KPrMSPresentationCreateDialog::createMSPresentation( doc, view, msPres );
00485 
00486 }
00487 
00488 void KPrMSPresentationSetup::slotChoosePath(const QString &text)
00489 {
00490     msPres.setPath(text);
00491 }
00492 
00493 
00494 
00495 
00496 KPrMSPresentationCreateDialog::KPrMSPresentationCreateDialog( KPrDocument *_doc, KPrView *_view,
00497                                                             const KPrMSPresentation &_msPres )
00498     : QDialog( 0, "", false ), msPres( _msPres )
00499 {
00500     doc = _doc;
00501     view = _view;
00502 
00503     setupGUI();
00504 }
00505 
00506 KPrMSPresentationCreateDialog::~KPrMSPresentationCreateDialog()
00507 {
00508     view->enableMSPres();
00509 }
00510 
00511 void KPrMSPresentationCreateDialog::createMSPresentation( KPrDocument *_doc, KPrView *_view,
00512                                                          const KPrMSPresentation &_msPres )
00513 {
00514     KPrMSPresentationCreateDialog *dlg = new KPrMSPresentationCreateDialog( _doc, _view, _msPres );
00515 
00516     dlg->setCaption( i18n( "Create Memory Stick Slideshow" ) );
00517     dlg->resize( 400, 250 );
00518     dlg->show();
00519     dlg->start();
00520 }
00521 
00522 void KPrMSPresentationCreateDialog::start()
00523 {
00524     setCursor( waitCursor );
00525     initCreation();
00526     createSlidesPictures();
00527     createIndexFile();
00528     setCursor( arrowCursor );
00529 
00530     bDone->setEnabled( true );
00531 }
00532 
00533 void KPrMSPresentationCreateDialog::initCreation()
00534 {
00535     QFont f = step1->font(), f2 = step1->font();
00536     f.setBold( true );
00537     step1->setFont( f );
00538 
00539     progressBar->setProgress( 0 );
00540     progressBar->setTotalSteps( msPres.initSteps() );
00541 
00542     msPres.initCreation( progressBar );
00543 
00544     step1->setFont( f2 );
00545     progressBar->setProgress( progressBar->totalSteps() );
00546 }
00547 
00548 void KPrMSPresentationCreateDialog::createSlidesPictures()
00549 {
00550     QFont f = step2->font(), f2 = f;
00551     f.setBold( true );
00552     step2->setFont( f );
00553 
00554     progressBar->setProgress( 0 );
00555     if ( msPres.slidesSteps() > 0 )
00556     {
00557         progressBar->setTotalSteps( msPres.slidesSteps() );
00558         msPres.createSlidesPictures( progressBar );
00559     }
00560 
00561     step2->setFont( f2 );
00562     progressBar->setProgress( progressBar->totalSteps() );
00563 }
00564 
00565 void KPrMSPresentationCreateDialog::createIndexFile()
00566 {
00567     QFont f = step3->font(), f2 = f;
00568     f.setBold( true );
00569     step3->setFont( f );
00570 
00571     progressBar->setProgress( 0 );
00572     if ( msPres.indexFileSteps() > 0 )
00573     {
00574         progressBar->setTotalSteps( msPres.indexFileSteps() );
00575         msPres.createIndexFile( progressBar );
00576     }
00577 
00578     step3->setFont( f2 );
00579     progressBar->setProgress( progressBar->totalSteps() );
00580 }
00581 
00582 void KPrMSPresentationCreateDialog::setupGUI()
00583 {
00584     back = new QVBox( this );
00585     back->setMargin( KDialog::marginHint() );
00586 
00587     QFrame *line;
00588 
00589     step1 = new QLabel( i18n( "Create directory structure" ), back );
00590     step2 = new QLabel( i18n( "Create pictures of the slides" ), back );
00591     step3 = new QLabel( i18n( "Create index file" ), back );
00592 
00593     line = new QFrame( back );
00594     line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
00595     line->setMaximumHeight( 20 );
00596 
00597     progressBar = new KProgress( back );
00598 
00599     line = new QFrame( back );
00600     line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
00601     line->setMaximumHeight( 20 );
00602 
00603     KButtonBox *bb = new KButtonBox( back );
00604     bb->addStretch();
00605     bDone = bb->addButton( i18n( "Done" ) );
00606 
00607     bDone->setEnabled( false );
00608 
00609     connect( bDone, SIGNAL( clicked() ), this, SLOT( accept() ) );
00610 }
00611 
00612 void KPrMSPresentationCreateDialog::resizeEvent( QResizeEvent *e )
00613 {
00614     QDialog::resizeEvent( e );
00615     back->resize( size() );
00616 }
00617 
00618 #include "KPrGradient.h"
00619 #include "KPrMSPresentationSetup.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys