]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiProgressView.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiProgressView.cpp
index edc0d8530d01a002be7fdf6ccd014ff4f3240ee0..a22ea60d01b76bee5d34dd61925bb39c1a68b5af 100644 (file)
@@ -16,6 +16,7 @@
 #include "GuiProgressView.h"
 
 #include "GuiApplication.h"
+#include "GuiProgress.h"
 #include "qt_helpers.h"
 
 #include "FuncRequest.h"
@@ -51,8 +52,8 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
        Qt::WindowFlags flags)
        : DockView(parent, "progress", qt_("Progress/Debug Messages"), area, flags)
 {
-       eolnLast = true;
-       widget_ = new ProgressViewWidget();
+       eol_last_ = true;
+       widget_ = new ProgressViewWidget;
        widget_->setMinimumHeight(150);
        widget_->debugMessagesTW->setSizePolicy(QSizePolicy::Ignored,
                                                QSizePolicy::Expanding);
@@ -105,7 +106,7 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
                connect(progress, SIGNAL(appendMessage(QString const &)),
                        this, SLOT(appendText(QString const &)));
                connect(progress, SIGNAL(appendLyXErrMessage(QString const &)),
-                       this, SLOT(appendLyXErrText(QString const &)));
+                       this, SLOT(appendLyXErrText(QString const &)), Qt::QueuedConnection);
                connect(progress, SIGNAL(appendError(QString const &)),
                        this, SLOT(appendText(QString const &)));
                connect(progress, SIGNAL(clearMessages()), this, SLOT(clearText()));
@@ -167,7 +168,7 @@ void GuiProgressView::clearText()
 {
        if (widget_->autoClearCB->isChecked()){
                widget_->outTE->clear();
-               eolnLast = true;
+               eol_last_ = true;
        }
 }
 
@@ -177,7 +178,7 @@ void GuiProgressView::appendLyXErrText(QString const & text)
        widget_->outTE->moveCursor(QTextCursor::End);
        widget_->outTE->insertPlainText(text);
        widget_->outTE->ensureCursorVisible();
-       eolnLast = false;
+       eol_last_ = false;
        // Give the user a chance to disable debug messages because
        // showing Debug::ANY messages completely blocks the GUI.
        // Text is not always send as the whole line, so we must be
@@ -185,7 +186,7 @@ void GuiProgressView::appendLyXErrText(QString const & text)
        // WARNING: processing events could cause crashes!
        // TODO: find a better solution
        if (text.endsWith("\n")) {
-               eolnLast = true;
+               eol_last_ = true;
                QApplication::processEvents();
        }
 }
@@ -197,9 +198,9 @@ void GuiProgressView::appendText(QString const & text)
                return;
        QString str = GuiProgress::currentTime();
        str += ": " + text;
-       if (!eolnLast)
+       if (!eol_last_)
                str = "\n" + str;
-       eolnLast = text.endsWith("\n");
+       eol_last_ = text.endsWith("\n");
 
        widget_->outTE->moveCursor(QTextCursor::End);
        widget_->outTE->insertPlainText(str);