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"
29 GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
30 Qt::WindowFlags flags) : DockView(parent, "progress", "Progress monitoring", area, flags)
32 setWindowTitle(qt_("Progress monitoring"));
33 setWidget(&text_edit);
34 text_edit.setReadOnly(true);
36 GuiProgress* progress = dynamic_cast<GuiProgress*>(support::ProgressInterface::instance());
39 connect(progress, SIGNAL(processStarted(QString const &)), this, SLOT(appendText(QString const &)));
40 //connect(progress, SIGNAL(processFinished(QString const &)), this, SLOT(appendText(QString const &)));
41 connect(progress, SIGNAL(appendMessage(QString const &)), this, SLOT(appendText(QString const &)));
42 connect(progress, SIGNAL(appendError(QString const &)), this, SLOT(appendText(QString const &)));
43 connect(progress, SIGNAL(clearMessages()), this, SLOT(clearText()));
48 void GuiProgressView::clearText()
54 void GuiProgressView::appendText(QString const & text)
58 QString time = QTime::currentTime().toString();
59 text_edit.insertPlainText(time + ": " + text + "\n");
60 text_edit.ensureCursorVisible();
65 Dialog * createGuiProgressView(GuiView & guiview)
68 return new GuiProgressView(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
70 return new GuiProgressView(guiview, Qt::BottomDockWidgetArea);
76 } // namespace frontend
79 #include "moc_GuiProgressView.cpp"