2009-12-20 14:26:55 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file GuiProgress.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Peter Kümmel
|
2009-12-29 15:05:37 +00:00
|
|
|
* \author Pavel Sanda
|
2009-12-20 14:26:55 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GUIPROGRESS_H
|
|
|
|
#define GUIPROGRESS_H
|
|
|
|
|
|
|
|
#include "support/ProgressInterface.h"
|
|
|
|
|
|
|
|
#include "DockView.h"
|
|
|
|
|
2010-06-07 20:25:41 +00:00
|
|
|
|
2009-12-20 14:26:55 +00:00
|
|
|
#include <QSplashScreen>
|
|
|
|
#include <QTimer>
|
|
|
|
|
2009-12-29 15:05:37 +00:00
|
|
|
#include <sstream>
|
2009-12-20 14:26:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
|
2009-12-21 11:48:19 +00:00
|
|
|
class GuiProgress :
|
|
|
|
public QObject,
|
|
|
|
public lyx::support::ProgressInterface
|
2009-12-20 14:26:55 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2009-12-21 11:48:19 +00:00
|
|
|
|
2009-12-20 14:26:55 +00:00
|
|
|
public:
|
2010-03-05 18:07:05 +00:00
|
|
|
GuiProgress();
|
2009-12-29 15:05:37 +00:00
|
|
|
~GuiProgress();
|
2009-12-21 11:48:19 +00:00
|
|
|
|
2009-12-29 15:05:37 +00:00
|
|
|
void lyxerrConnect();
|
|
|
|
void lyxerrDisconnect();
|
2010-01-13 19:07:18 +00:00
|
|
|
void lyxerrFlush();
|
2010-06-07 20:25:41 +00:00
|
|
|
|
|
|
|
static QString currentTime();
|
2009-12-20 14:26:55 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2010-03-05 18:07:05 +00:00
|
|
|
|
|
|
|
// ProgressInterface
|
2009-12-20 14:26:55 +00:00
|
|
|
void processStarted(QString const &);
|
|
|
|
void processFinished(QString const &);
|
|
|
|
void appendMessage(QString const &);
|
|
|
|
void appendError(QString const &);
|
|
|
|
void clearMessages();
|
2010-01-03 16:30:54 +00:00
|
|
|
void appendLyXErrMessage(QString const & text);
|
2009-12-20 14:26:55 +00:00
|
|
|
|
2010-03-05 18:07:05 +00:00
|
|
|
|
|
|
|
void clearMessageText();
|
|
|
|
void updateStatusBarMessage(QString const &);
|
|
|
|
|
2009-12-21 11:48:19 +00:00
|
|
|
// Alert interface
|
|
|
|
void warning(QString const & title, QString const & message);
|
|
|
|
void toggleWarning(QString const & title, QString const & msg, QString const & formatted);
|
|
|
|
void error(QString const & title, QString const & message);
|
|
|
|
void information(QString const & title, QString const & message);
|
|
|
|
|
2009-12-20 14:26:55 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void doProcessStarted(QString const &);
|
|
|
|
void doProcessFinished(QString const &);
|
|
|
|
void doAppendMessage(QString const &);
|
|
|
|
void doAppendError(QString const &);
|
|
|
|
void doClearMessages();
|
|
|
|
|
2009-12-21 11:48:19 +00:00
|
|
|
void doWarning(QString const &, QString const &);
|
|
|
|
void doToggleWarning(QString const & title, QString const & msg, QString const & formatted);
|
|
|
|
void doError(QString const &, QString const &);
|
|
|
|
void doInformation(QString const &, QString const &);
|
2009-12-20 14:26:55 +00:00
|
|
|
|
2010-06-07 20:25:41 +00:00
|
|
|
void updateWithLyXErr();
|
|
|
|
|
2009-12-21 11:48:19 +00:00
|
|
|
|
|
|
|
private:
|
2009-12-20 14:26:55 +00:00
|
|
|
void appendText(QString const &);
|
2010-06-07 20:25:41 +00:00
|
|
|
std::ostringstream lyxerr_stream_;
|
|
|
|
QTimer flushDelay_;
|
2009-12-20 14:26:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|