]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiProgress.cpp
Fix handling of the add branch textfield in GuiBranches
[lyx.git] / src / frontends / qt4 / GuiProgress.cpp
index 0f6724c95609e9ce1c1c161c8a248228a5e31c91..ab8c6bd3cfb470284913784acc148ac2ebc765a5 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "qt_helpers.h"
 
+#include "frontends/alert.h"
+
 #include "support/debug.h"
 #include "support/Systemcall.h"
 
@@ -58,12 +60,26 @@ 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()));
+}
+
+
+int GuiProgress::prompt(docstring const & title, docstring const & question,
+                       int default_button, int cancel_button,
+                       docstring const & b1, docstring const & b2)
+{
+       return Alert::prompt(title, question, default_button, cancel_button, b1, b2);
 }
 
 
 QString GuiProgress::currentTime()
 {
-       return QTime::currentTime().toString("hh:mm:ss:zzz") + "ms";
+       return QTime::currentTime().toString("hh:mm:ss.zzz");
 }
 
 
@@ -97,7 +113,19 @@ void GuiProgress::doClearMessages()
 }
 
 
+void GuiProgress::startFlushing()
+{
+       flushDelay_.start();
+}
+
+
 void GuiProgress::lyxerrFlush()
+{
+       triggerFlush();
+}
+
+
+void GuiProgress::updateWithLyXErr()
 {
        appendLyXErrMessage(toqstr(lyxerr_stream_.str()));
        lyxerr_stream_.str("");
@@ -106,13 +134,13 @@ void GuiProgress::lyxerrFlush()
 
 void GuiProgress::lyxerrConnect()
 {
-       lyxerr.setSecond(&lyxerr_stream_);
+       lyxerr.setSecondStream(&lyxerr_stream_);
 }
 
 
 void GuiProgress::lyxerrDisconnect()
 {
-       lyxerr.setSecond(0);
+       lyxerr.setSecondStream(0);
 }