]> git.lyx.org Git - features.git/commitdiff
Move debug window into designers stuff instead of dynamical building
authorPavel Sanda <sanda@lyx.org>
Mon, 28 Dec 2009 21:40:14 +0000 (21:40 +0000)
committerPavel Sanda <sanda@lyx.org>
Mon, 28 Dec 2009 21:40:14 +0000 (21:40 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32661 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiProgressView.cpp
src/frontends/qt4/GuiProgressView.h
src/frontends/qt4/Makefile.am
src/frontends/qt4/ui/ProgressViewUi.ui [new file with mode: 0644]

index 00ba5ee6a00f60805f12ebdec00387e65d05bdcd..7f7f3bf807e4e5440fec42a63c022ca4ff0eca1c 100644 (file)
@@ -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<GuiProgress*>(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();
 }
 
 
index 8ca57eb381772325eede9869f3aeab3acf98dd43..81107521fde9c1895d44d30e818ae2fa8ea2baf3 100644 (file)
 #ifndef GUIPROGRESSVIEW_H
 #define GUIPROGRESSVIEW_H
 
+#include "ui_ProgressViewUi.h"
 
 #include "DockView.h"
 
 #include "GuiProgress.h"
 
-#include <QTextEdit>
-
 #include <string>
 
+#include <QDockWidget>
+#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_;
 };
 
 
index df0bcb819c4c2f12c3c90e5abc09ff0abba3e2a6..5eee3a62360333e98b93471d2817004e52f7e871 100644 (file)
@@ -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 (file)
index 0000000..fdcf155
--- /dev/null
@@ -0,0 +1,82 @@
+<ui version="4.0" >
+ <class>ProgressViewUi</class>
+ <widget class="QWidget" name="ProgressViewUi" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>468</width>
+    <height>94</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string/>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="margin" >
+    <number>0</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item row="0" column="1" >
+    <layout class="QVBoxLayout" >
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QCheckBox" name="autoClearCB" >
+       <property name="toolTip" >
+        <string>Automatic cleanup of the window before LaTeX compilation proceeds</string>
+       </property>
+       <property name="text" >
+        <string>&amp;Automatic clear</string>
+       </property>
+       <property name="checked" >
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="updatePB" >
+       <property name="enabled" >
+        <bool>false</bool>
+       </property>
+       <property name="text" >
+        <string>&amp;Update</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeHint" stdset="0" >
+        <size>
+         <width>20</width>
+         <height>1</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="0" >
+    <widget class="QTextEdit" name="outTE" />
+   </item>
+  </layout>
+ </widget>
+ <tabstops>
+  <tabstop>autoClearCB</tabstop>
+  <tabstop>updatePB</tabstop>
+ </tabstops>
+ <includes>
+  <include location="local" >qt_i18n.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>