X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiProgress.cpp;h=0735265384532e891035c4346f3fecb3a128d498;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=c6c5506bd07d222a6621ff5f6dea1caf38210741;hpb=dd4cbb3591d20498e6410f1156f4f99e306ad73f;p=lyx.git diff --git a/src/frontends/qt4/GuiProgress.cpp b/src/frontends/qt4/GuiProgress.cpp index c6c5506bd0..0735265384 100644 --- a/src/frontends/qt4/GuiProgress.cpp +++ b/src/frontends/qt4/GuiProgress.cpp @@ -5,6 +5,7 @@ * Licence details can be found in the file COPYING. * * \author Peter Kümmel + * \author Pavel Sanda * * Full author contact details are available in file CREDITS. */ @@ -16,12 +17,13 @@ #include "qt_helpers.h" +#include "support/debug.h" #include "support/Systemcall.h" #include #include #include - +#include namespace lyx { @@ -39,8 +41,6 @@ public: }; - - GuiProgress::GuiProgress(GuiView * view) : view_(view) { connect(this, SIGNAL(processStarted(QString const &)), SLOT(doProcessStarted(QString const &))); @@ -65,15 +65,15 @@ GuiProgress::GuiProgress(GuiView * view) : view_(view) void GuiProgress::doProcessStarted(QString const & cmd) { - QString time = QTime::currentTime().toString(Qt::SystemLocaleShortDate); - appendText(time + ": <" + cmd + "> started\n"); + QString time = QTime::currentTime().toString(); + appendText(time + ": <" + cmd + "> started"); } void GuiProgress::doProcessFinished(QString const & cmd) { - QString time = QTime::currentTime().toString(Qt::SystemLocaleShortDate); - appendText(time + ": <" + cmd + "> done\n"); + QString time = QTime::currentTime().toString(); + appendText(time + ": <" + cmd + "> done"); } @@ -95,9 +95,35 @@ void GuiProgress::doClearMessages() } +void GuiProgress::lyxerrFlush() +{ + appendLyXErrMessage(toqstr(lyxerr_stream_.str())); + lyxerr_stream_.str(""); +} + + +void GuiProgress::lyxerrConnect() +{ + lyxerr.setSecond(&lyxerr_stream_); +} + + +void GuiProgress::lyxerrDisconnect() +{ + lyxerr.setSecond(0); +} + + +GuiProgress::~GuiProgress() +{ + lyxerrDisconnect(); +} + + void GuiProgress::appendText(QString const & text) { - view_->message(qstring_to_ucs4(text)); + if (!text.isEmpty()) + view_->updateMessage(text); } @@ -142,4 +168,4 @@ void GuiProgress::doInformation(QString const & title, QString const & message) } // namespace frontend } // namespace lyx -#include "moc_GuiProgress.cpp" \ No newline at end of file +#include "moc_GuiProgress.cpp"