3 * \file GuiProgressView.cpp
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
14 #include "GuiProgressView.h"
16 #include "qt_helpers.h"
18 #include "support/debug.h"
27 ProgressViewWidget::ProgressViewWidget()
34 GuiProgressView::~GuiProgressView()
40 GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
41 Qt::WindowFlags flags) : DockView(parent, "progress", "Debug/Progress window", area, flags)
43 widget_ = new ProgressViewWidget();
46 GuiProgress* progress = dynamic_cast<GuiProgress*>(support::ProgressInterface::instance());
49 connect(progress, SIGNAL(processStarted(QString const &)), this, SLOT(appendText(QString const &)));
50 //connect(progress, SIGNAL(processFinished(QString const &)), this, SLOT(appendText(QString const &)));
51 connect(progress, SIGNAL(appendMessage(QString const &)), this, SLOT(appendText(QString const &)));
52 connect(progress, SIGNAL(appendError(QString const &)), this, SLOT(appendText(QString const &)));
53 connect(progress, SIGNAL(clearMessages()), this, SLOT(clearText()));
58 void GuiProgressView::clearText()
60 if (widget_->autoClearCB->isChecked())
61 widget_->outTE->clear();
65 void GuiProgressView::appendText(QString const & text)
69 QString time = QTime::currentTime().toString();
70 widget_->outTE->insertPlainText(time + ": " + text.trimmed() + "\n");
71 widget_->outTE->ensureCursorVisible();
76 Dialog * createGuiProgressView(GuiView & guiview)
79 return new GuiProgressView(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
81 return new GuiProgressView(guiview, Qt::BottomDockWidgetArea);
87 } // namespace frontend
90 #include "moc_GuiProgressView.cpp"