2005-08-26 18:18:29 +00:00
|
|
|
// -*- C++ -*-
|
2004-11-09 14:16:30 +00:00
|
|
|
//
|
2001-03-29 11:05:22 +00:00
|
|
|
// fontprogress.h
|
|
|
|
//
|
2004-11-09 14:16:30 +00:00
|
|
|
// (C) 2001-2004 Stefan Kebekus
|
2001-03-29 11:05:22 +00:00
|
|
|
// Distributed under the GPL
|
|
|
|
|
2001-03-28 10:16:48 +00:00
|
|
|
#ifndef FONT_GENERATION_H
|
|
|
|
#define FONT_GENERATION_H
|
|
|
|
|
|
|
|
#include <kdialogbase.h>
|
2005-11-14 19:50:47 +00:00
|
|
|
|
2005-09-21 18:10:56 +00:00
|
|
|
#include <QPointer>
|
2001-03-28 10:16:48 +00:00
|
|
|
|
2004-11-09 14:16:30 +00:00
|
|
|
class KProgress;
|
2001-03-28 10:16:48 +00:00
|
|
|
class QLabel;
|
2005-11-14 19:50:47 +00:00
|
|
|
class QProcess;
|
2001-03-28 10:16:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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 KDialogBase
|
2005-10-14 22:46:01 +00:00
|
|
|
{
|
2001-03-28 10:16:48 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2005-10-03 20:01:17 +00:00
|
|
|
fontProgressDialog(const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip,
|
2005-10-14 22:46:01 +00:00
|
|
|
QWidget* parent = 0, const QString &name = 0, bool progressbar=true );
|
2001-03-28 10:16:48 +00:00
|
|
|
~fontProgressDialog();
|
2005-10-14 22:46:01 +00:00
|
|
|
|
2004-11-09 14:16:30 +00:00
|
|
|
/** The number of steps already done is increased, the text received
|
2005-10-14 22:46:01 +00:00
|
|
|
here is analyzed and presented to the user. */
|
2005-10-03 20:01:17 +00:00
|
|
|
void increaseNumSteps(const QString& explanation);
|
2005-10-13 22:41:50 +00:00
|
|
|
|
|
|
|
/** 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
|
2005-11-14 19:50:47 +00:00
|
|
|
QPointer, so it is safe to delete the real QProcess instance
|
2005-10-13 22:41:50 +00:00
|
|
|
at any time. */
|
2005-11-14 19:50:47 +00:00
|
|
|
void setTotalSteps(int, QProcess* proc=0);
|
2005-10-14 22:46:01 +00:00
|
|
|
|
2005-10-19 22:59:09 +00:00
|
|
|
QLabel* TextLabel2;
|
2004-11-09 14:16:30 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
/** Calling this slot does nothing than to kill the process that is
|
2005-10-14 22:46:01 +00:00
|
|
|
pointed to be procIO, if procIO is not zero.*/
|
2005-11-14 19:50:47 +00:00
|
|
|
void killProcess();
|
2004-11-09 14:16:30 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QLabel* TextLabel1;
|
|
|
|
KProgress* ProgressBar1;
|
|
|
|
int progress;
|
2005-11-14 19:50:47 +00:00
|
|
|
QPointer<QProcess> process;
|
2001-03-28 10:16:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FONT_GENERATION_H
|