From 85c73e7fcc221a9dfbac9a8158fbfc386f5c2c3e Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Mon, 28 Dec 2009 21:40:14 +0000 Subject: [PATCH] Move debug window into designers stuff instead of dynamical building git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32661 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiProgressView.cpp | 24 +++++--- src/frontends/qt4/GuiProgressView.h | 18 +++++- src/frontends/qt4/Makefile.am | 1 + src/frontends/qt4/ui/ProgressViewUi.ui | 82 ++++++++++++++++++++++++++ 4 files changed, 115 insertions(+), 10 deletions(-) create mode 100644 src/frontends/qt4/ui/ProgressViewUi.ui diff --git a/src/frontends/qt4/GuiProgressView.cpp b/src/frontends/qt4/GuiProgressView.cpp index 00ba5ee6a0..7f7f3bf807 100644 --- a/src/frontends/qt4/GuiProgressView.cpp +++ b/src/frontends/qt4/GuiProgressView.cpp @@ -24,14 +24,24 @@ namespace lyx { namespace frontend { +ProgressViewWidget::ProgressViewWidget() +{ + setupUi(this); + +} + + +GuiProgressView::~GuiProgressView() +{ + delete widget_; +} GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area, - Qt::WindowFlags flags) : DockView(parent, "progress", "Progress monitoring", area, flags) + Qt::WindowFlags flags) : DockView(parent, "progress", "Debug/Progress window", area, flags) { - setWindowTitle(qt_("Progress monitoring")); - setWidget(&text_edit); - text_edit.setReadOnly(true); + widget_ = new ProgressViewWidget(); + setWidget(widget_); GuiProgress* progress = dynamic_cast(support::ProgressInterface::instance()); @@ -47,7 +57,7 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area, void GuiProgressView::clearText() { - text_edit.clear(); + widget_->outTE->clear(); } @@ -56,8 +66,8 @@ void GuiProgressView::appendText(QString const & text) if (text.isEmpty()) return; QString time = QTime::currentTime().toString(); - text_edit.insertPlainText(time + ": " + text.trimmed() + "\n"); - text_edit.ensureCursorVisible(); + widget_->outTE->insertPlainText(time + ": " + text.trimmed() + "\n"); + widget_->outTE->ensureCursorVisible(); } diff --git a/src/frontends/qt4/GuiProgressView.h b/src/frontends/qt4/GuiProgressView.h index 8ca57eb381..81107521fd 100644 --- a/src/frontends/qt4/GuiProgressView.h +++ b/src/frontends/qt4/GuiProgressView.h @@ -12,19 +12,29 @@ #ifndef GUIPROGRESSVIEW_H #define GUIPROGRESSVIEW_H +#include "ui_ProgressViewUi.h" #include "DockView.h" #include "GuiProgress.h" -#include - #include +#include +#include "qt_helpers.h" namespace lyx { namespace frontend { +class ProgressViewWidget : public QWidget, public Ui::ProgressViewUi +{ + Q_OBJECT + +public: + ProgressViewWidget(); +private: + +}; class GuiProgressView : public DockView { @@ -36,6 +46,7 @@ public: Qt::DockWidgetArea area, ///< Position of the dock (and also drawer) Qt::WindowFlags flags = 0); + ~GuiProgressView(); /// Controller inherited method. ///@{ bool initialiseParams(std::string const &) { return true; } @@ -45,6 +56,7 @@ public: bool canApply() const { return true; } bool canApplyToReadOnly() const { return true; } void updateView() {} + bool wantInitialFocus() const { return false; } ///@} private Q_SLOTS: @@ -52,7 +64,7 @@ private Q_SLOTS: void clearText(); private: - QTextEdit text_edit; + ProgressViewWidget * widget_; }; diff --git a/src/frontends/qt4/Makefile.am b/src/frontends/qt4/Makefile.am index df0bcb819c..5eee3a6236 100644 --- a/src/frontends/qt4/Makefile.am +++ b/src/frontends/qt4/Makefile.am @@ -316,6 +316,7 @@ UIFILES = \ PrintUi.ui \ PrintindexUi.ui \ PrintNomenclUi.ui \ + ProgressViewUi.ui \ RefUi.ui \ SearchUi.ui \ SendtoUi.ui \ diff --git a/src/frontends/qt4/ui/ProgressViewUi.ui b/src/frontends/qt4/ui/ProgressViewUi.ui new file mode 100644 index 0000000000..fdcf155c5b --- /dev/null +++ b/src/frontends/qt4/ui/ProgressViewUi.ui @@ -0,0 +1,82 @@ + + ProgressViewUi + + + + 0 + 0 + 468 + 94 + + + + + + + + 0 + + + 6 + + + + + 6 + + + 0 + + + + + Automatic cleanup of the window before LaTeX compilation proceeds + + + &Automatic clear + + + true + + + + + + + false + + + &Update + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + + + + + + autoClearCB + updatePB + + + qt_i18n.h + + + +