mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18: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 &)));
|
SLOT(doError(QString const &, QString const &)));
|
||||||
connect(this, SIGNAL(information(QString const &, QString const &)),
|
connect(this, SIGNAL(information(QString const &, QString const &)),
|
||||||
SLOT(doInformation(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()
|
void GuiProgress::lyxerrFlush()
|
||||||
|
{
|
||||||
|
flushDelay_.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiProgress::updateWithLyXErr()
|
||||||
{
|
{
|
||||||
appendLyXErrMessage(toqstr(lyxerr_stream_.str()));
|
appendLyXErrMessage(toqstr(lyxerr_stream_.str()));
|
||||||
lyxerr_stream_.str("");
|
lyxerr_stream_.str("");
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include "DockView.h"
|
#include "DockView.h"
|
||||||
|
|
||||||
#include <QTextEdit>
|
|
||||||
#include <QSplashScreen>
|
#include <QSplashScreen>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public:
|
|||||||
void lyxerrDisconnect();
|
void lyxerrDisconnect();
|
||||||
void lyxerrFlush();
|
void lyxerrFlush();
|
||||||
|
|
||||||
static QString currentTime();
|
static QString currentTime();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
||||||
@ -76,10 +76,13 @@ private Q_SLOTS:
|
|||||||
void doError(QString const &, QString const &);
|
void doError(QString const &, QString const &);
|
||||||
void doInformation(QString const &, QString const &);
|
void doInformation(QString const &, QString const &);
|
||||||
|
|
||||||
|
void updateWithLyXErr();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void appendText(QString const &);
|
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()){
|
if (l.enabled()){
|
||||||
l.stream() << t;
|
l.stream() << t;
|
||||||
if (l.second_used()){
|
if (l.second_used()) {
|
||||||
l.second() << t;
|
l.second() << t;
|
||||||
ProgressInterface::instance()->lyxerrFlush();
|
ProgressInterface::instance()->lyxerrFlush();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user