]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiProgress.cpp
Remove the .aux and .bbl files and update the citation labels
[lyx.git] / src / frontends / qt4 / GuiProgress.cpp
index 4fa8a134909a80fd80089788f7aa13d54b2ada3d..aec058cf8e66110787aa9fe23ce71a0882b90308 100644 (file)
@@ -58,20 +58,30 @@ GuiProgress::GuiProgress()
                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");
 }
 
 
@@ -89,11 +99,23 @@ void GuiProgress::doAppendError(QString const & msg)
 
 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("");
@@ -102,13 +124,13 @@ void GuiProgress::lyxerrFlush()
 
 void GuiProgress::lyxerrConnect()
 {
-       lyxerr.setSecond(&lyxerr_stream_);
+       lyxerr.setSecondStream(&lyxerr_stream_);
 }
 
 
 void GuiProgress::lyxerrDisconnect()
 {
-       lyxerr.setSecond(0);
+       lyxerr.setSecondStream(0);
 }
 
 
@@ -121,7 +143,7 @@ GuiProgress::~GuiProgress()
 void GuiProgress::appendText(QString const & text)
 {
        if (!text.isEmpty())
-               Q_EMIT updateStatusBarMessage(text);
+               updateStatusBarMessage(text);
 }