kaddressbook Library API Documentation

printprogress.cpp

00001 /* -*- C++ -*-
00002    This file implements the printing progress widget.
00003 
00004    the KDE addressbook
00005 
00006    $ Author: Mirko Boehm $
00007    $ Copyright: (C) 1996-2002, Mirko Boehm $
00008    $ Contact: mirko@kde.org
00009          http://www.kde.org $
00010    $ License: LGPL with the following explicit clarification:
00011          This code may be linked against any version of the Qt toolkit
00012          from Troll Tech, Norway. $
00013 
00014    $Revision: 1.3 $
00015 */
00016 
00017 #include <qlayout.h>
00018 #include <qtextbrowser.h>
00019 #include <qprogressbar.h>
00020 #include <kapplication.h>
00021 #include <kdialog.h>
00022 #include <klocale.h>
00023 #include <kdebug.h>
00024 #include "printprogress.h"
00025 
00026 namespace KABPrinting {
00027 
00028     PrintProgress::PrintProgress(QWidget *parent)
00029         : PrintProgressBase(parent)
00030     {
00031         // <HACK reason="Designers fixed layout spacings">
00032         layout()->setMargin(KDialog::marginHint());
00033         layout()->setSpacing(KDialog::spacingHint());
00034         // </HACK>
00035     }
00036 
00037     PrintProgress::~PrintProgress()
00038     {
00039     }
00040 
00041     void PrintProgress::addMessage(const QString &msg)
00042     {
00043         messages.append(msg);
00044         QString head=QString("<qt><b>") + i18n("Progress") + QString(":</b><ul>");
00045         QString foot=QString("</ul></qt>");
00046         QString body;
00047         QStringList::Iterator it;
00048         for(it=messages.begin(); it!=messages.end(); ++it)
00049         {
00050             body.append(QString("<li>")+(*it)+QString("</li>"));
00051         }
00052         tbLog->setText(head+body+foot);
00053         kapp->processEvents();
00054     }
00055 
00056     void PrintProgress::setProgress(int step)
00057     {
00058         pbProgress->setProgress(step);
00059         kapp->processEvents();
00060     }
00061 }
00062 
00063 #include "printprogress.moc"
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:10 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001