]> git.lyx.org Git - features.git/commitdiff
Qt2 latex error dialog
authorJohn Levon <levon@movementarian.org>
Sun, 26 Aug 2001 18:49:33 +0000 (18:49 +0000)
committerJohn Levon <levon@movementarian.org>
Sun, 26 Aug 2001 18:49:33 +0000 (18:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2591 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
src/frontends/qt2/ChangeLog
src/frontends/qt2/Dialogs.C
src/frontends/qt2/Makefile.am
src/frontends/qt2/Makefile.dialogs
src/frontends/qt2/QError.C [new file with mode: 0644]
src/frontends/qt2/QError.h [new file with mode: 0644]
src/frontends/qt2/QErrorDialog.C [new file with mode: 0644]
src/frontends/qt2/QErrorDialog.h [new file with mode: 0644]
src/frontends/qt2/QIndexDialog.C
src/frontends/qt2/QIndexDialog.h
src/frontends/qt2/README
src/frontends/qt2/ui/QErrorDialog.ui [new file with mode: 0644]

index c54870554ea096a7b453cfe8318d6731d468f86d..d3846a53cf4e1c83de1c6749044ddb2e66865735 100644 (file)
@@ -1,3 +1,12 @@
+2001-08-26  John Levon  <moz@compsoc.man.ac.uk>
+
+       * Dialogs.C:
+       * Makefile.am:
+       * Makefile.dialogs: 
+       * QError.[Ch]:
+       * QErrorDialog.[Ch]:
+       * ui/QErrorDialog.ui: add LaTeX error dialog
+
 2001-08-26  John Levon  <moz@compsoc.man.ac.uk>
 
        * Dialogs.C:
index 8534d880fcd035e960d61fd715af17ed26c8e369..a1e8293cd8361ecebe53782490f17df41645694c 100644 (file)
@@ -17,6 +17,7 @@
 #include "QBibtexDialog.h"
 #include "QCharacterDialog.h"
 #include "QCitationDialog.h"
+#include "QErrorDialog.h"
 #include "QIndexDialog.h"
 #include "QRefDialog.h"
 #include "QURLDialog.h"
@@ -26,6 +27,7 @@
 #include "QBibtex.h"
 #include "QCharacter.h"
 #include "QCitation.h"
+#include "QError.h"
 #include "QIndex.h"
 #include "QParagraph.h"
 #include "QPrint.h"
@@ -47,6 +49,7 @@
 #include "controllers/ControlBibtex.h"
 #include "controllers/ControlCharacter.h"
 #include "controllers/ControlCitation.h"
+#include "controllers/ControlError.h"
 #include "controllers/ControlIndex.h"
 #include "controllers/ControlRef.h"
 #include "controllers/ControlSplash.h"
@@ -55,7 +58,6 @@
 #include "controllers/ControlButtons.h"
 #include "controllers/ControlCitation.h"
 #include "controllers/ControlERT.h"
-#include "controllers/ControlError.h"
 #include "controllers/ControlExternal.h"
 #include "controllers/ControlFloat.h"
 #include "controllers/ControlGraphics.h"
@@ -90,6 +92,7 @@ Dialogs::Dialogs(LyXView * lv)
        add(new GUIBibitem<QBibitem, Qt2BC>(*lv, *this));
        add(new GUIBibtex<QBibtex, Qt2BC>(*lv, *this));
        add(new GUICharacter<QCharacter, Qt2BC>(*lv, *this));
+       add(new GUIError<QError, Qt2BC>(*lv, *this)); 
        add(new GUIIndex<QIndex, Qt2BC>(*lv, *this));
        add(new GUIRef<QRef, Qt2BC>(*lv, *this));
        add(new GUIUrl<QURL, Qt2BC>(*lv, *this));
index cde332acf3c08188d3b04d4ce48ebfdfe935f575..5ea55f976754f84c10e243fe20d5591124d7c8eb 100644 (file)
@@ -26,7 +26,6 @@ libqt2_la_OBJADD = \
        ../xforms/FormBaseDeprecated.lo \
        ../xforms/FormBrowser.lo \
        ../xforms/FormDocument.lo \
-       ../xforms/FormError.lo \
        ../xforms/FormExternal.lo \
        ../xforms/FormGraphics.lo \
        ../xforms/FormInclude.lo \
index 9ffa79424dfe9ba2d43897fcd92e9267eb9658a0..3080e1f9a626831cf53fd54db48dd6101c531cf8 100644 (file)
@@ -7,6 +7,7 @@ DIALOGS = \
        QCharacter \
        QCitation \
        QDocument \
+       QError \
        QIndex \
        QParagraph \
        QPrint \
@@ -30,6 +31,8 @@ DIALOGSOURCES = \
        QCitation.C QCitationDialog.C \
        QDocument.h QDocumentDialog.h \
        QDocument.C QDocumentDialog.C \
+       QError.h QErrorDialog.h \
+       QError.C QErrorDialog.C \
        QIndex.h QIndexDialog.h \
        QIndex.C QIndexDialog.C \
        QParagraph.h QParagraphDialog.h \
@@ -56,6 +59,7 @@ MOCDIALOGS = \
        QCharacterDialog_moc.C \
        QCitationDialog_moc.C \
        QDocumentDialog_moc.C \
+       QErrorDialog_moc.C \
        QIndexDialog_moc.C \
        QParagraphDialog_moc.C \
        QPrintDialog_moc.C \
@@ -79,6 +83,8 @@ UIDIALOGS = \
        QCitationDialogBase.C \
        QDocumentDialogBase.h \
        QDocumentDialogBase.C \
+       QErrorDialogBase.C \
+       QErrorDialogBase.h \
        QIndexDialogBase.h \
        QIndexDialogBase.C \
        QParagraphDialogBase.h \
@@ -103,6 +109,7 @@ UIMOCDIALOGS = \
        QCharacterDialogBase_moc.C \
        QCitationDialogBase_moc.C \
        QDocumentDialogBase_moc.C \
+       QErrorDialogBase_moc.C \
        QIndexDialogBase_moc.C \
        QParagraphDialogBase_moc.C \
        QPrintDialogBase_moc.C \
diff --git a/src/frontends/qt2/QError.C b/src/frontends/qt2/QError.C
new file mode 100644 (file)
index 0000000..4053e2b
--- /dev/null
@@ -0,0 +1,39 @@
+/**
+ * \file QError.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+
+#include "QErrorDialog.h"
+#include "ControlError.h"
+#include "QError.h"
+#include "Qt2BC.h"
+#include "gettext.h"
+
+#include <qtextview.h>
+#include <qpushbutton.h>
+
+typedef Qt2CB<ControlError, Qt2DB<QErrorDialog> > base_class;
+QError::QError(ControlError & c)
+       : base_class(c, _("LaTeX Error"))
+{
+}
+
+
+void QError::build_dialog()
+{
+       dialog_.reset(new QErrorDialog(this));
+
+       bc().setCancel(dialog_->closePB);
+}
+
+void QError::update_contents()
+{
+       dialog_->errorTV->setText(controller().params().c_str());
+}
diff --git a/src/frontends/qt2/QError.h b/src/frontends/qt2/QError.h
new file mode 100644 (file)
index 0000000..f43c78a
--- /dev/null
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+/**
+ * \file QError.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QERROR_H
+#define QERROR_H
+
+#include "Qt2Base.h"
+
+class ControlError;
+class QErrorDialog;
+
+class QError :
+       public Qt2CB<ControlError, Qt2DB<QErrorDialog> > 
+{
+       friend class QErrorDialog;
+public: 
+       QError(ControlError &);
+
+private: 
+       /// Apply changes
+       virtual void apply() {};
+       /// update
+       virtual void update_contents();
+       /// build the dialog
+       virtual void build_dialog();
+};
+
+#endif // QERROR_H
diff --git a/src/frontends/qt2/QErrorDialog.C b/src/frontends/qt2/QErrorDialog.C
new file mode 100644 (file)
index 0000000..55aa28e
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+ * \file QErrorDialog.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include "QErrorDialog.h"
+#include "Dialogs.h"
+#include "QError.h"
+
+#include <qwidget.h>
+#include <qpushbutton.h>
+
+QErrorDialog::QErrorDialog(QError * form)
+       : QErrorDialogBase(0, 0, false, 0),
+       form_(form)
+{
+       connect(closePB, SIGNAL(clicked()),
+               form, SLOT(slotClose()));
+}
+
+void QErrorDialog::closeEvent(QCloseEvent * e)
+{
+       form_->slotWMHide();
+       e->accept();
+}
diff --git a/src/frontends/qt2/QErrorDialog.h b/src/frontends/qt2/QErrorDialog.h
new file mode 100644 (file)
index 0000000..786b908
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * \file QErrorDialog.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QERRORDIALOG_H
+#define QERRORDIALOG_H
+#include <config.h>
+#include "ui/QErrorDialogBase.h"
+
+class QError;
+
+class QErrorDialog : public QErrorDialogBase
+{ Q_OBJECT
+
+public:
+       QErrorDialog(QError * form);
+
+protected:
+       virtual void closeEvent(QCloseEvent * e);
+
+private:
+       QError * form_;
+};
+
+#endif // QERRORDIALOG_H
index bcfd25b6d45c51a5c8a78cebb22c3d766953d2a9..2f12f9c15242d3f8b496eb188eb667c8654699f2 100644 (file)
@@ -24,18 +24,13 @@ QIndexDialog::QIndexDialog(QIndex * form)
 }
 
  
-QIndexDialog::~QIndexDialog()
-{
-}
-
-
 void QIndexDialog::change_adaptor()
 {
        form_->changed();
 }
 
  
-void QIndexDialog::closeEvent(QCloseEvent *e)
+void QIndexDialog::closeEvent(QCloseEvent * e)
 {
        form_->slotWMHide();
        e->accept();
index 64af848927823b4ff781d33f57a134baadaacd14..56645548f813caee48ee63767c99bfe7d9404251 100644 (file)
@@ -20,7 +20,6 @@ class QIndexDialog : public QIndexDialogBase
 
 public:
        QIndexDialog(QIndex * form);
-       ~QIndexDialog();
 
 protected slots:
        virtual void change_adaptor();
index 2fa5e7387db2d323bd3828f83ff9c956a4da0cdc..0e499f3a60f79559e642d89bcc279dd9faf31de7 100644 (file)
@@ -56,9 +56,10 @@ Dialog               Maintainer      MVC conversion
 ----------------------------------------------
 About          John            Done
 Bibtex         John            Done
-Character      Edwin
+Character      Edwin           Done
 Citation       Kalle           Done
 Document       Kalle           Waiting for MVC
+Error          John            Done 
 Index          Kalle           Done
 Paragraph      Edwin           Waiting for MVC
 Print          Edwin
diff --git a/src/frontends/qt2/ui/QErrorDialog.ui b/src/frontends/qt2/ui/QErrorDialog.ui
new file mode 100644 (file)
index 0000000..f06572a
--- /dev/null
@@ -0,0 +1,100 @@
+<!DOCTYPE UI><UI>
+<class>QErrorDialogBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>QErrorDialogBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>368</width>
+            <height>236</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>LaTeX Error</string>
+    </property>
+    <vbox>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget>
+            <class>QTextView</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>errorTV</cstring>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>LaTeX error messages</string>
+            </property>
+        </widget>
+        <widget>
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout3</cstring>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer3</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>closePB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Close</string>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+    </vbox>
+</widget>
+<connections>
+    <slot access="public">change_adaptor()</slot>
+</connections>
+</UI>