Commit 576596d9 authored by Luigi Toscano's avatar Luigi Toscano

Remove fontProgressDialog, no more used

parent ae555519
......@@ -41,7 +41,6 @@ set(okularGenerator_dvi_SRCS
fontEncodingPool.cpp
fontMap.cpp
fontpool.cpp
fontprogress.cpp
dvisourcesplitter.cpp
dviexport.cpp
)
......
......@@ -23,7 +23,6 @@
#include "dviFile.h"
#include "dviRenderer.h"
#include "fontprogress.h"
#include "kvs_debug.h"
#include <KStandardDirs>
......
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; c-brace-offset: 0; -*-
// fontprogress.cpp
//
// (C) 2001--2004 Stefan Kebekus
// Distributed under the GPL
#include <config.h>
#include "fontprogress.h"
#include <klocale.h>
#include <kvbox.h>
#include <QApplication>
#include <QLabel>
#include <QProcess>
#include <QProgressBar>
/*
* Constructs a fontProgressDialog which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
fontProgressDialog::fontProgressDialog(const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip, QWidget* parent, bool progressbar)
: KDialog( parent),
TextLabel2(0),
TextLabel1(0),
ProgressBar1(0),
progress(0),
process(0)
{
setCaption( i18n( "Font Generation Progress Dialog" ) );
setModal( true );
setButtons( Cancel );
setDefaultButton( Cancel );
setCursor(QCursor(Qt::WaitCursor));
setButtonGuiItem(Cancel, KGuiItem(i18n("Abort"), "process-stop", abortTip));
if (helpIndex.isEmpty() == false) {
setHelp(helpIndex, "okular");
setHelpLinkText( i18n( "What is happening here?") );
enableLinkedHelp(true);
} else
enableLinkedHelp(false);
KVBox* page = new KVBox( this );
setMainWidget( page );
TextLabel1 = new QLabel(label, page);
TextLabel1->setAlignment(Qt::AlignCenter);
TextLabel1->setWhatsThis( whatsThis );
TextLabel1->setToolTip( ttip );
if (progressbar) {
ProgressBar1 = new QProgressBar( page );
ProgressBar1->setFormat(i18n("%v of %m"));
ProgressBar1->setWhatsThis( whatsThis );
ProgressBar1->setToolTip( ttip );
} else
ProgressBar1 = NULL;
TextLabel2 = new QLabel("", page);
TextLabel2->setAlignment(Qt::AlignCenter);
TextLabel2->setWhatsThis( whatsThis );
TextLabel2->setToolTip( ttip );
qApp->connect(this, SIGNAL(finished()), this, SLOT(killProcess()));
}
/*
* Destroys the object and frees any allocated resources
*/
fontProgressDialog::~fontProgressDialog()
{
// no need to delete child widgets, Qt does it all for us
}
void fontProgressDialog::increaseNumSteps(const QString& explanation)
{
if (ProgressBar1 != 0)
ProgressBar1->setValue(progress++);
TextLabel2->setText( explanation );
}
void fontProgressDialog::setTotalSteps(int steps, QProcess* proc)
{
process = proc;
if (ProgressBar1 != 0) {
ProgressBar1->setMaximum(steps);
ProgressBar1->setValue(0);
}
progress = 0;
}
void fontProgressDialog::killProcess()
{
if (!process.isNull()) {
process->kill();
process = 0;
}
}
#include "fontprogress.moc"
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; c-brace-offset: 0; -*-
//
// fontprogress.h
//
// (C) 2001-2004 Stefan Kebekus
// Distributed under the GPL
#ifndef FONT_GENERATION_H
#define FONT_GENERATION_H
#include <kdialog.h>
#include <QPointer>
class QProgressBar;
class QLabel;
class QProcess;
/**
* A dialog to give feedback to the user when kpsewhich is generating fonts.
*
* This class implements a dialog which pops up, shows a progress bar
* and displays the MetaFont output. It contains three slots,
* outputReceiver, setTotalSteps and hideDialog which can be connected
* with the appropriate signals emitted by the fontpool class.
*
* @author Stefan Kebekus <kebekus@kde.org>
*
*
**/
class fontProgressDialog : public KDialog
{
Q_OBJECT
public:
fontProgressDialog(const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip,
QWidget* parent = 0, bool progressbar=true );
~fontProgressDialog();
/** The number of steps already done is increased, the text received
here is analyzed and presented to the user. */
void increaseNumSteps(const QString& explanation);
/** Used to initialize the progress bar. If the argument @c proc is
non-zero, the associated process will be killed when the "abort"
button is pressed. The pointer is stored internally inside a
QPointer, so it is safe to delete the real QProcess instance
at any time. */
void setTotalSteps(int, QProcess* proc=0);
QLabel* TextLabel2;
private slots:
/** Calling this slot does nothing than to kill the process that is
pointed to be procIO, if procIO is not zero.*/
void killProcess();
private:
QLabel* TextLabel1;
QProgressBar* ProgressBar1;
int progress;
QPointer<QProcess> process;
};
#endif // FONT_GENERATION_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment