mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
don't block GUI when showing all debug messages
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34612 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
fea446303d
commit
ddc38c93ca
@ -58,6 +58,10 @@ GuiProgress::GuiProgress()
|
||||
SLOT(doError(QString const &, QString const &)));
|
||||
connect(this, SIGNAL(information(QString const &, QString const &)),
|
||||
SLOT(doInformation(QString const &, QString const &)));
|
||||
|
||||
flushDelay_.setInterval(200);
|
||||
flushDelay_.setSingleShot(true);
|
||||
connect(&flushDelay_, SIGNAL(timeout()), this, SLOT(updateWithLyXErr()));
|
||||
}
|
||||
|
||||
|
||||
@ -98,6 +102,12 @@ void GuiProgress::doClearMessages()
|
||||
|
||||
|
||||
void GuiProgress::lyxerrFlush()
|
||||
{
|
||||
flushDelay_.start();
|
||||
}
|
||||
|
||||
|
||||
void GuiProgress::updateWithLyXErr()
|
||||
{
|
||||
appendLyXErrMessage(toqstr(lyxerr_stream_.str()));
|
||||
lyxerr_stream_.str("");
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "DockView.h"
|
||||
|
||||
#include <QTextEdit>
|
||||
|
||||
#include <QSplashScreen>
|
||||
#include <QTimer>
|
||||
|
||||
@ -41,8 +41,8 @@ public:
|
||||
void lyxerrConnect();
|
||||
void lyxerrDisconnect();
|
||||
void lyxerrFlush();
|
||||
|
||||
static QString currentTime();
|
||||
|
||||
static QString currentTime();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
@ -76,10 +76,13 @@ private Q_SLOTS:
|
||||
void doError(QString const &, QString const &);
|
||||
void doInformation(QString const &, QString const &);
|
||||
|
||||
void updateWithLyXErr();
|
||||
|
||||
|
||||
private:
|
||||
void appendText(QString const &);
|
||||
std::ostringstream lyxerr_stream_;
|
||||
std::ostringstream lyxerr_stream_;
|
||||
QTimer flushDelay_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -202,7 +202,7 @@ LyXErr & toStream(LyXErr & l, T t)
|
||||
{
|
||||
if (l.enabled()){
|
||||
l.stream() << t;
|
||||
if (l.second_used()){
|
||||
if (l.second_used()) {
|
||||
l.second() << t;
|
||||
ProgressInterface::instance()->lyxerrFlush();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user