lyx_mirror/src/frontends/qt4/GuiProgress.h
Pavel Sanda d481f75848 Move lyxerrFlush() out of singnal/slot business.
Under massive load of lyxerr<< messages we lose synchronization in ui
and messages get garbled into each other.

This patch helps a lot, note however that the problem is generally hard to
solve in multithreaded environment because from inside lyxerr there is no
way how to know that t1b should be bound to t1a when thread is switched in 
unfortunated time and thread thread2 goes for his bussiness.

thread1 out<<t1a<<t1b<<"\n";
thread2 out<<t2a<<t2b<<"\n";






git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33013 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-13 19:07:18 +00:00

86 lines
1.8 KiB
C++

// -*- 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
* \author Pavel Sanda
*
* Full author contact details are available in file CREDITS.
*/
#ifndef GUIPROGRESS_H
#define GUIPROGRESS_H
#include "support/ProgressInterface.h"
#include "DockView.h"
#include <QTextEdit>
#include <QSplashScreen>
#include <QTimer>
#include <sstream>
namespace lyx {
namespace frontend {
class GuiProgress :
public QObject,
public lyx::support::ProgressInterface
{
Q_OBJECT
public:
GuiProgress(GuiView * view);
~GuiProgress();
void lyxerrConnect();
void lyxerrDisconnect();
void lyxerrFlush();
Q_SIGNALS:
void processStarted(QString const &);
void processFinished(QString const &);
void appendMessage(QString const &);
void appendError(QString const &);
void clearMessages();
void appendLyXErrMessage(QString const & text);
// 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);
private Q_SLOTS:
void doProcessStarted(QString const &);
void doProcessFinished(QString const &);
void doAppendMessage(QString const &);
void doAppendError(QString const &);
void doClearMessages();
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 &);
private:
GuiView* view_;
void appendText(QString const &);
std::ostringstream lyxerr_stream_;
};
} // namespace frontend
} // namespace lyx
#endif