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 widget_->outTE->clear();
64 void GuiProgressView::appendText(QString const & text)
68 QString time = QTime::currentTime().toString();
69 widget_->outTE->insertPlainText(time + ": " + text.trimmed() + "\n");
70 widget_->outTE->ensureCursorVisible();
75 Dialog * createGuiProgressView(GuiView & guiview)
78 return new GuiProgressView(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
80 return new GuiProgressView(guiview, Qt::BottomDockWidgetArea);
86 } // namespace frontend
89 #include "moc_GuiProgressView.cpp"