From 883717e5ec82217ee74daa87afd6b0169202df21 Mon Sep 17 00:00:00 2001 From: John Levon Date: Sun, 26 Aug 2001 18:49:33 +0000 Subject: [PATCH] Qt2 latex error dialog git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2591 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 9 +++ src/frontends/qt2/Dialogs.C | 5 +- src/frontends/qt2/Makefile.am | 1 - src/frontends/qt2/Makefile.dialogs | 7 ++ src/frontends/qt2/QError.C | 39 +++++++++++ src/frontends/qt2/QError.h | 35 ++++++++++ src/frontends/qt2/QErrorDialog.C | 29 ++++++++ src/frontends/qt2/QErrorDialog.h | 31 +++++++++ src/frontends/qt2/QIndexDialog.C | 7 +- src/frontends/qt2/QIndexDialog.h | 1 - src/frontends/qt2/README | 3 +- src/frontends/qt2/ui/QErrorDialog.ui | 100 +++++++++++++++++++++++++++ 12 files changed, 257 insertions(+), 10 deletions(-) create mode 100644 src/frontends/qt2/QError.C create mode 100644 src/frontends/qt2/QError.h create mode 100644 src/frontends/qt2/QErrorDialog.C create mode 100644 src/frontends/qt2/QErrorDialog.h create mode 100644 src/frontends/qt2/ui/QErrorDialog.ui diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index c54870554e..d3846a53cf 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,12 @@ +2001-08-26 John Levon + + * Dialogs.C: + * Makefile.am: + * Makefile.dialogs: + * QError.[Ch]: + * QErrorDialog.[Ch]: + * ui/QErrorDialog.ui: add LaTeX error dialog + 2001-08-26 John Levon * Dialogs.C: diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 8534d880fc..a1e8293cd8 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -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(*lv, *this)); add(new GUIBibtex(*lv, *this)); add(new GUICharacter(*lv, *this)); + add(new GUIError(*lv, *this)); add(new GUIIndex(*lv, *this)); add(new GUIRef(*lv, *this)); add(new GUIUrl(*lv, *this)); diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index cde332acf3..5ea55f9767 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -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 \ diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs index 9ffa79424d..3080e1f9a6 100644 --- a/src/frontends/qt2/Makefile.dialogs +++ b/src/frontends/qt2/Makefile.dialogs @@ -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 index 0000000000..4053e2be2f --- /dev/null +++ b/src/frontends/qt2/QError.C @@ -0,0 +1,39 @@ +/** + * \file QError.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include + +#include "QErrorDialog.h" +#include "ControlError.h" +#include "QError.h" +#include "Qt2BC.h" +#include "gettext.h" + +#include +#include + +typedef Qt2CB > 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 index 0000000000..f43c78a8e2 --- /dev/null +++ b/src/frontends/qt2/QError.h @@ -0,0 +1,35 @@ +// -*- C++ -*- +/** + * \file QError.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QERROR_H +#define QERROR_H + +#include "Qt2Base.h" + +class ControlError; +class QErrorDialog; + +class QError : + public Qt2CB > +{ + 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 index 0000000000..55aa28e5f9 --- /dev/null +++ b/src/frontends/qt2/QErrorDialog.C @@ -0,0 +1,29 @@ +/** + * \file QErrorDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include "QErrorDialog.h" +#include "Dialogs.h" +#include "QError.h" + +#include +#include + +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 index 0000000000..786b908577 --- /dev/null +++ b/src/frontends/qt2/QErrorDialog.h @@ -0,0 +1,31 @@ +/** + * \file QErrorDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QERRORDIALOG_H +#define QERRORDIALOG_H + +#include + +#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 diff --git a/src/frontends/qt2/QIndexDialog.C b/src/frontends/qt2/QIndexDialog.C index bcfd25b6d4..2f12f9c152 100644 --- a/src/frontends/qt2/QIndexDialog.C +++ b/src/frontends/qt2/QIndexDialog.C @@ -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(); diff --git a/src/frontends/qt2/QIndexDialog.h b/src/frontends/qt2/QIndexDialog.h index 64af848927..56645548f8 100644 --- a/src/frontends/qt2/QIndexDialog.h +++ b/src/frontends/qt2/QIndexDialog.h @@ -20,7 +20,6 @@ class QIndexDialog : public QIndexDialogBase public: QIndexDialog(QIndex * form); - ~QIndexDialog(); protected slots: virtual void change_adaptor(); diff --git a/src/frontends/qt2/README b/src/frontends/qt2/README index 2fa5e7387d..0e499f3a60 100644 --- a/src/frontends/qt2/README +++ b/src/frontends/qt2/README @@ -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 index 0000000000..f06572a79b --- /dev/null +++ b/src/frontends/qt2/ui/QErrorDialog.ui @@ -0,0 +1,100 @@ + +QErrorDialogBase + + QDialog + + name + QErrorDialogBase + + + geometry + + 0 + 0 + 368 + 236 + + + + caption + LaTeX Error + + + + margin + 11 + + + spacing + 6 + + + QTextView + + name + errorTV + + + toolTip + LaTeX error messages + + + + QLayoutWidget + + name + Layout3 + + + + margin + 0 + + + spacing + 6 + + + + name + Spacer3 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QPushButton + + name + closePB + + + text + &Close + + + default + true + + + + + + + + change_adaptor() + + -- 2.39.5