25#include <tqprogressbar.h> 
   26#include <tqtextbrowser.h> 
   28#include <tdeapplication.h> 
   33#include "printprogress.h" 
   35using namespace KABPrinting;
 
   37PrintProgress::PrintProgress( TQWidget *parent, 
const char *name )
 
   38  : TQWidget( parent, name )
 
   40  setCaption( i18n( 
"Printing: Progress" ) );
 
   42  TQGridLayout *topLayout = 
new TQGridLayout( 
this, 1, 1, KDialog::marginHint(),
 
   43                                            KDialog::spacingHint() );
 
   45  mLogBrowser = 
new TQTextBrowser( 
this );
 
   46  topLayout->addWidget( mLogBrowser, 0, 0 );
 
   48  mProgressBar = 
new TQProgressBar( 
this );
 
   49  mProgressBar->setProgress( 0 );
 
   50  topLayout->addWidget( mProgressBar, 1, 0 );
 
   52  resize( TQSize( 370, 220 ).expandedTo( minimumSizeHint() ) );
 
   55PrintProgress::~PrintProgress()
 
   61  mMessages.append( msg );
 
   63  TQString head = TQString( 
"<qt><b>" ) + i18n( 
"Progress" ) +
 
   64                 TQString( 
":</b><ul>" );
 
   66  TQString foot = TQString( 
"</ul></qt>" );
 
   69  TQStringList::ConstIterator it;
 
   70  for ( it = mMessages.begin(); it != mMessages.end(); ++it )
 
   71    body.append( TQString( 
"<li>" ) + (*it) + TQString( 
"</li>" ) );
 
   73  mLogBrowser->setText( head + body + foot );
 
   74  tdeApp->processEvents();
 
   79  mProgressBar->setProgress( step );
 
   80  tdeApp->processEvents();
 
   83#include "printprogress.moc" 
void addMessage(const TQString &)
Add a message to the message log.
 
void setProgress(int)
Set the progress to a certain amount.