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"
27 GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
28 Qt::WindowFlags flags) : DockView(parent, "progress", "Progress monitoring", area, flags)
30 setWindowTitle(qt_("Progress monitoring"));
31 setWidget(&text_edit);
32 text_edit.setReadOnly(true);
34 GuiProgress* progress = dynamic_cast<GuiProgress*>(support::ProgressInterface::instance());
37 connect(progress, SIGNAL(processStarted(QString const &)), this, SLOT(appendText(QString const &)));
38 //connect(progress, SIGNAL(processFinished(QString const &)), this, SLOT(appendText(QString const &)));
39 connect(progress, SIGNAL(appendMessage(QString const &)), this, SLOT(appendText(QString const &)));
40 connect(progress, SIGNAL(appendError(QString const &)), this, SLOT(appendText(QString const &)));
41 connect(progress, SIGNAL(clearMessages()), this, SLOT(clearText()));
46 void GuiProgressView::clearText()
52 void GuiProgressView::appendText(QString const & text)
56 QString time = QTime::currentTime().toString();
57 text_edit.insertPlainText(time + ": " + text + "\n");
58 text_edit.ensureCursorVisible();
63 Dialog * createGuiProgressView(GuiView & guiview)
66 return new GuiProgressView(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
68 return new GuiProgressView(guiview, Qt::BottomDockWidgetArea);
74 } // namespace frontend
77 #include "moc_GuiProgressView.cpp"