SLOT(doError(QString const &, QString const &)));
connect(this, SIGNAL(information(QString const &, QString const &)),
SLOT(doInformation(QString const &, QString const &)));
+ connect(this, SIGNAL(triggerFlush()),
+ SLOT(startFlushing()));
+
+ flushDelay_.setInterval(200);
+ flushDelay_.setSingleShot(true);
+ connect(&flushDelay_, SIGNAL(timeout()), this, SLOT(updateWithLyXErr()));
+}
+
+
+QString GuiProgress::currentTime()
+{
+ return QTime::currentTime().toString("hh:mm:ss.zzz");
}
void GuiProgress::doProcessStarted(QString const & cmd)
{
- QString time = QTime::currentTime().toString();
- appendText(time + ": <" + cmd + "> started");
+ appendText(currentTime() + ": <" + cmd + "> started");
}
void GuiProgress::doProcessFinished(QString const & cmd)
{
- QString time = QTime::currentTime().toString();
- appendText(time + ": <" + cmd + "> done");
+ appendText(currentTime() + ": <" + cmd + "> done");
}
void GuiProgress::doClearMessages()
{
- Q_EMIT clearMessageText();
+ clearMessageText();
+}
+
+
+void GuiProgress::startFlushing()
+{
+ flushDelay_.start();
}
void GuiProgress::lyxerrFlush()
+{
+ triggerFlush();
+}
+
+
+void GuiProgress::updateWithLyXErr()
{
appendLyXErrMessage(toqstr(lyxerr_stream_.str()));
lyxerr_stream_.str("");
void GuiProgress::lyxerrConnect()
{
- lyxerr.setSecond(&lyxerr_stream_);
+ lyxerr.setSecondStream(&lyxerr_stream_);
}
void GuiProgress::lyxerrDisconnect()
{
- lyxerr.setSecond(0);
+ lyxerr.setSecondStream(0);
}
void GuiProgress::appendText(QString const & text)
{
if (!text.isEmpty())
- Q_EMIT updateStatusBarMessage(text);
+ updateStatusBarMessage(text);
}