From: Pavel Sanda Date: Sun, 3 Jan 2010 16:30:54 +0000 (+0000) Subject: LyXErr and statusbar messages hsould have different routes. X-Git-Tag: 2.0.0~4600 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1cbab9937b67d2d4df1c95b2b91a586f57740225;p=features.git LyXErr and statusbar messages hsould have different routes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32754 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiProgress.cpp b/src/frontends/qt4/GuiProgress.cpp index 7347f30ace..bcec51b4f0 100644 --- a/src/frontends/qt4/GuiProgress.cpp +++ b/src/frontends/qt4/GuiProgress.cpp @@ -98,7 +98,7 @@ void GuiProgress::doClearMessages() void GuiProgress::dolyxerrFlush() { - appendError(toqstr(lyxerr_stream_.str())); + appendLyXErrMessage(toqstr(lyxerr_stream_.str())); lyxerr_stream_.str(""); // give the user a chance to disable debug messages because // showing Debug::ANY messages completely blocks the GUI diff --git a/src/frontends/qt4/GuiProgress.h b/src/frontends/qt4/GuiProgress.h index 23f47f7bcd..4f5f5e7dd8 100644 --- a/src/frontends/qt4/GuiProgress.h +++ b/src/frontends/qt4/GuiProgress.h @@ -48,6 +48,7 @@ Q_SIGNALS: void appendError(QString const &); void clearMessages(); void lyxerrFlush(); + void appendLyXErrMessage(QString const & text); // Alert interface void warning(QString const & title, QString const & message); diff --git a/src/frontends/qt4/GuiProgressView.cpp b/src/frontends/qt4/GuiProgressView.cpp index 06d53344aa..cd6bac5255 100644 --- a/src/frontends/qt4/GuiProgressView.cpp +++ b/src/frontends/qt4/GuiProgressView.cpp @@ -84,6 +84,7 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area, connect(progress, SIGNAL(processStarted(QString const &)), this, SLOT(appendText(QString const &))); //connect(progress, SIGNAL(processFinished(QString const &)), this, SLOT(appendText(QString const &))); connect(progress, SIGNAL(appendMessage(QString const &)), this, SLOT(appendText(QString const &))); + connect(progress, SIGNAL(appendLyXErrMessage(QString const &)), this, SLOT(appendLyXErrText(QString const &))); connect(progress, SIGNAL(appendError(QString const &)), this, SLOT(appendText(QString const &))); connect(progress, SIGNAL(clearMessages()), this, SLOT(clearText())); progress->lyxerrConnect(); @@ -116,16 +117,23 @@ void GuiProgressView::clearText() } +void GuiProgressView::appendLyXErrText(QString const & text) +{ + widget_->outTE->insertPlainText(text); + widget_->outTE->ensureCursorVisible(); +} + + void GuiProgressView::appendText(QString const & text) { if (text.isEmpty()) return; - QString time = QTime::currentTime().toString(); - if (text.endsWith("\n")) - widget_->outTE->insertPlainText(time + ": " + text); - else - widget_->outTE->insertPlainText(text); + QString str = QTime::currentTime().toString(); + str += ": " + text; + if (!text.endsWith("\n")) + str += "\n"; + widget_->outTE->insertPlainText(str); widget_->outTE->ensureCursorVisible(); } diff --git a/src/frontends/qt4/GuiProgressView.h b/src/frontends/qt4/GuiProgressView.h index 645ef6a191..9a08dac133 100644 --- a/src/frontends/qt4/GuiProgressView.h +++ b/src/frontends/qt4/GuiProgressView.h @@ -70,6 +70,7 @@ public: private Q_SLOTS: void appendText(QString const & text); + void appendLyXErrText(QString const & text); void clearText(); void levelChanged();