From: Alfredo Braunstein Date: Sat, 21 Jun 2003 08:50:06 +0000 (+0000) Subject: The error boxes are no more! See also Bug: 192, Bug: 807, Bug: 899 and Bug: 973 X-Git-Tag: 1.6.10~16605 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=74aaf64a5331b233cb8554651523baf9e7622e6e;p=features.git The error boxes are no more! See also Bug: 192, Bug: 807, Bug: 899 and Bug: 973 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7201 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 594a1b98eb..74c224d6cd 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2003-06-21 Alfredo Braunstein + + * ControlError.[Ch]: removed + * Makefile.am: adjust + 2003-06-20 Angus Leeming * tex_helpers.[Ch] (getTexFileList): changed to diff --git a/src/frontends/controllers/ControlError.C b/src/frontends/controllers/ControlError.C deleted file mode 100644 index 66857f6b66..0000000000 --- a/src/frontends/controllers/ControlError.C +++ /dev/null @@ -1,30 +0,0 @@ -/** - * \file ControlError.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS - */ - -#include - -#include "ControlError.h" - - -ControlError::ControlError(Dialog & parent) - : Dialog::Controller(parent) -{} - - -bool ControlError::initialiseParams(string const & data) -{ - params_ = data; -} - - -void ControlError::clearParams() -{ - params_.erase(); -} diff --git a/src/frontends/controllers/ControlError.h b/src/frontends/controllers/ControlError.h deleted file mode 100644 index 3a05a319dc..0000000000 --- a/src/frontends/controllers/ControlError.h +++ /dev/null @@ -1,40 +0,0 @@ -// -*- C++ -*- -/** - * \file ControlError.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS - */ - -#ifndef CONTROLERROR_H -#define CONTROLERROR_H - - -#include "Dialog.h" - - -class ControlError : public Dialog::Controller { -public: - /// - ControlError(Dialog &); - /// - virtual bool initialiseParams(string const & data); - /// - virtual void clearParams(); - /// - virtual void dispatchParams() {} - /// - virtual bool isBufferDependent() const { return true; } - /// - string & params() { return params_; } - /// - string const & params() const { return params_; } - /// -private: - string params_; -}; - -#endif // CONTROLERROR_H diff --git a/src/frontends/controllers/Makefile.am b/src/frontends/controllers/Makefile.am index b827c7d611..f7bf61a093 100644 --- a/src/frontends/controllers/Makefile.am +++ b/src/frontends/controllers/Makefile.am @@ -48,8 +48,6 @@ libcontrollers_la_SOURCES= \ ControlDialog_impl.h \ ControlDocument.C \ ControlDocument.h \ - ControlError.C \ - ControlError.h \ ControlErrorList.C \ ControlErrorList.h \ ControlERT.C \ diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 55c4a528e6..9f18671b05 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,11 @@ +2003-06-21 Alfredo Braunstein + + * QError.[Ch]: + * QErrorDialog.[Ch]: + * ui/QErrorDialogBase.ui: removed + * Makefile.am: + * Makefile.dialogs: + * Dialogs.C: adjust 2003-06-21 Alfredo Braunstein diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index cec245da3b..d42278dab8 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -18,7 +18,6 @@ #include "ControlChanges.h" #include "ControlCharacter.h" #include "ControlCitation.h" -#include "ControlError.h" #include "ControlErrorList.h" #include "ControlERT.h" #include "ControlExternal.h" @@ -44,7 +43,6 @@ #include "QChanges.h" #include "QCharacter.h" #include "QCitation.h" -#include "QError.h" #include "QErrorList.h" #include "QERT.h" #include "QExternal.h" @@ -149,10 +147,6 @@ Dialog * Dialogs::build(string const & name) dialog->setController(new ControlCitation(*dialog)); dialog->setView(new QCitation(*dialog)); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); - } else if (name == "error") { - dialog->setController(new ControlError(*dialog)); - dialog->setView(new QError(*dialog)); - dialog->bc().bp(new OkCancelPolicy); } else if (name == "errorlist") { dialog->setController(new ControlErrorList(*dialog)); dialog->setView(new QErrorList(*dialog)); diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index c8014104c7..a4c269600d 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -34,7 +34,6 @@ libqt2_la_SOURCES = \ QCharacter.C QCharacter.h \ QCitation.C QCitation.h \ QDocument.C QDocument.h \ - QError.C QError.h \ QErrorList.C QErrorList.h \ QERT.C QERT.h \ QExternal.C QExternal.h \ diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs index 8431af2b9d..bbbc547f75 100644 --- a/src/frontends/qt2/Makefile.dialogs +++ b/src/frontends/qt2/Makefile.dialogs @@ -22,7 +22,6 @@ UIFILES = \ QCitationFindDialogBase.ui \ QDelimiterDialogBase.ui \ QDocumentDialogBase.ui \ - QErrorDialogBase.ui \ QErrorListDialogBase.ui \ QERTDialogBase.ui \ QExternalDialogBase.ui \ @@ -87,7 +86,6 @@ MOCFILES = \ QContentPane.C QContentPane.h \ QDelimiterDialog.C QDelimiterDialog.h \ QDocumentDialog.C QDocumentDialog.h \ - QErrorDialog.C QErrorDialog.h \ QErrorListDialog.C QErrorListDialog.h \ QERTDialog.C QERTDialog.h \ QExternalDialog.C QExternalDialog.h \ diff --git a/src/frontends/qt2/QError.C b/src/frontends/qt2/QError.C deleted file mode 100644 index 12a2dac3e0..0000000000 --- a/src/frontends/qt2/QError.C +++ /dev/null @@ -1,44 +0,0 @@ -/** - * \file QError.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS - */ - -#include - - -#include "ControlError.h" -#include "qt_helpers.h" - -#include -#include - -#include "QErrorDialog.h" -#include "QError.h" -#include "Qt2BC.h" - -typedef QController > base_class; - - -QError::QError(Dialog & parent) - : base_class(parent, _("LyX: LaTeX Error")) -{ -} - - -void QError::build_dialog() -{ - dialog_.reset(new QErrorDialog(this)); - - bcview().setCancel(dialog_->closePB); -} - - -void QError::update_contents() -{ - dialog_->errorTV->setText(toqstr(controller().params())); -} diff --git a/src/frontends/qt2/QError.h b/src/frontends/qt2/QError.h deleted file mode 100644 index 84de64a00a..0000000000 --- a/src/frontends/qt2/QError.h +++ /dev/null @@ -1,38 +0,0 @@ -// -*- C++ -*- -/** - * \file QError.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS - */ - -#ifndef QERROR_H -#define QERROR_H - - -#include "QDialogView.h" - -class ControlError; -class QErrorDialog; - - -class QError - : public QController > -{ -public: - friend class QErrorDialog; - - QError(Dialog &); -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 deleted file mode 100644 index 42eed74073..0000000000 --- a/src/frontends/qt2/QErrorDialog.C +++ /dev/null @@ -1,35 +0,0 @@ -/** - * \file QErrorDialog.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS - */ - -#include - - -#include "QError.h" - -#include -#include - -#include "QErrorDialog.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 deleted file mode 100644 index 337f00cc29..0000000000 --- a/src/frontends/qt2/QErrorDialog.h +++ /dev/null @@ -1,30 +0,0 @@ -// -*- C++ -*- -/** - * \file QErrorDialog.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS - */ - -#ifndef QERRORDIALOG_H -#define QERRORDIALOG_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 diff --git a/src/frontends/qt2/ui/QErrorDialogBase.ui b/src/frontends/qt2/ui/QErrorDialogBase.ui deleted file mode 100644 index 9bd5cb73d7..0000000000 --- a/src/frontends/qt2/ui/QErrorDialogBase.ui +++ /dev/null @@ -1,106 +0,0 @@ - -QErrorDialogBase -config.h -qt_helpers.h - - QDialog - - name - QErrorDialogBase - - - geometry - - 0 - 0 - 356 - 236 - - - - caption - LaTeX Error - - - sizeGripEnabled - true - - - - 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() - - diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 6f64664c07..6af27ac3f5 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,11 @@ +2003-06-21 Alfredo Braunstein + + * FormError.[Ch]: + * forms/form_error.fd: removed + * forms/Makefile.am: + * Makefile.am: adjust + * Dialogs.C: adjust + 2003-06-20 Angus Leeming * FormBibtex.C (input, update): changes due to changed controller diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index 19da7e5bcc..5a6545efa8 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -21,7 +21,6 @@ #include "ControlCharacter.h" #include "ControlCitation.h" #include "ControlCommand.h" -#include "ControlError.h" #include "ControlErrorList.h" #include "ControlERT.h" #include "ControlExternal.h" @@ -47,7 +46,6 @@ #include "FormChanges.h" #include "FormCharacter.h" #include "FormCitation.h" -#include "FormError.h" #include "FormErrorList.h" #include "FormERT.h" #include "FormExternal.h" @@ -179,10 +177,6 @@ Dialog * Dialogs::build(string const & name) dialog->setController(new ControlCitation(*dialog)); dialog->setView(new FormCitation(*dialog)); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); - } else if (name == "error") { - dialog->setController(new ControlError(*dialog)); - dialog->setView(new FormError(*dialog)); - dialog->bc().bp(new OkCancelPolicy); } else if (name == "errorlist") { dialog->setController(new ControlErrorList(*dialog)); dialog->setView(new FormErrorList(*dialog)); diff --git a/src/frontends/xforms/FormError.C b/src/frontends/xforms/FormError.C deleted file mode 100644 index 71933b17e1..0000000000 --- a/src/frontends/xforms/FormError.C +++ /dev/null @@ -1,42 +0,0 @@ -/** - * \file FormError.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS - */ - - -#include - -#include "xformsBC.h" -#include "ControlError.h" -#include "FormError.h" -#include "forms/form_error.h" -#include "xforms_helpers.h" // formatted -#include "lyx_forms.h" - -typedef FormController > base_class; - -FormError::FormError(Dialog & parent) - : base_class(parent, _("LaTeX Error")) -{} - - -void FormError::build() -{ - dialog_.reset(build_error(this)); - - // Manage the cancel/close button - bcview().setCancel(dialog_->button_close); -} - - -void FormError::update() -{ - string const txt = formatted(controller().params(), - dialog_->frame_message->w - 10); - fl_set_object_label(dialog_->frame_message, txt.c_str()); -} diff --git a/src/frontends/xforms/FormError.h b/src/frontends/xforms/FormError.h deleted file mode 100644 index fc95d9a2e3..0000000000 --- a/src/frontends/xforms/FormError.h +++ /dev/null @@ -1,37 +0,0 @@ -// -*- C++ -*- -/** - * \file FormError.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS - */ - -#ifndef FORMERROR_H -#define FORMERROR_H - - -#include "FormDialogView.h" - - -class ControlError; -struct FD_error; - -/** This class provides an XForms implementation of the Error Dialog. - */ -class FormError : public FormController > { -public: - /// Constructor - FormError(Dialog &); -private: - /// not needed. - virtual void apply() {} - /// Build the dialog - virtual void build(); - /// Update dialog before showing it - virtual void update(); -}; - -#endif // FORMERROR_H diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index e7b9f64b58..320e427956 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -79,8 +79,6 @@ libxforms_la_SOURCES = \ FormCitation.h \ FormDocument.C \ FormDocument.h \ - FormError.C \ - FormError.h \ FormErrorList.C \ FormErrorList.h \ FormERT.C \ diff --git a/src/frontends/xforms/forms/Makefile.am b/src/frontends/xforms/forms/Makefile.am index 1ef3041717..d782ef1f49 100644 --- a/src/frontends/xforms/forms/Makefile.am +++ b/src/frontends/xforms/forms/Makefile.am @@ -17,7 +17,6 @@ SRCS = form_aboutlyx.fd \ form_character.fd \ form_citation.fd \ form_document.fd \ - form_error.fd \ form_errorlist.fd \ form_ert.fd \ form_external.fd \ diff --git a/src/frontends/xforms/forms/form_error.fd b/src/frontends/xforms/forms/form_error.fd deleted file mode 100644 index ae80b8d469..0000000000 --- a/src/frontends/xforms/forms/form_error.fd +++ /dev/null @@ -1,70 +0,0 @@ -Magic: 13000 - -Internal Form Definition File - (do not change) - -Number of forms: 1 -Unit of measure: FL_COORD_PIXEL - -=============== FORM =============== -Name: form_error -Width: 400 -Height: 240 -Number of Objects: 3 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 400 240 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_BOX -type: FRAME_BOX -box: 10 10 380 180 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NorthWest FL_SouthEast -name: frame_message -callback: -argument: - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 135 200 130 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Close|^[ -shortcut: ^M -resize: FL_RESIZE_NONE -gravity: FL_South FL_South -name: button_close -callback: C_FormDialogView_CancelCB -argument: 0 - -============================== -create_the_forms diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 76ae310cc5..8a16ff1635 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-06-21 Alfredo Braunstein + + * inseterror.[Ch]: removed + 2003-06-21 Alfredo Braunstein * insetinclude.C (docbook): use parseError instead of sgmlError diff --git a/src/insets/Makefile.am b/src/insets/Makefile.am index 13ec16c0fb..48829a3e38 100644 --- a/src/insets/Makefile.am +++ b/src/insets/Makefile.am @@ -39,8 +39,6 @@ libinsets_la_SOURCES = \ insetcommandparams.h \ insetenv.C \ insetenv.h \ - inseterror.C \ - inseterror.h \ insetert.C \ insetert.h \ insetexternal.C \ diff --git a/src/insets/inseterror.C b/src/insets/inseterror.C deleted file mode 100644 index d4dc0ab2f8..0000000000 --- a/src/insets/inseterror.C +++ /dev/null @@ -1,96 +0,0 @@ -/** - * \file inseterror.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Lars Gullik Bjønnes - * - * Full author contact details are available in file CREDITS - */ - -#include - -#include "inseterror.h" - -#include "BufferView.h" -#include "funcrequest.h" -#include "gettext.h" -#include "lyxfont.h" -#include "metricsinfo.h" - -#include "frontends/Dialogs.h" -#include "frontends/font_metrics.h" -#include "frontends/LyXView.h" -#include "frontends/Painter.h" - -#include "support/LAssert.h" - -using std::ostream; - - -InsetError::InsetError(string const & str) - : contents(str) -{} - - -// InsetError::InsetError(string const & str, bool) -// : contents(str) -// {} - - -InsetError::~InsetError() -{ - Dialogs::hide("error", this); -} - - -dispatch_result InsetError::localDispatch(FuncRequest const & cmd) -{ - // UNUSED: dispatch_result result = UNDISPATCHED; - - switch (cmd.action) { - case LFUN_MOUSE_RELEASE: - case LFUN_INSET_EDIT: - cmd.view()->owner()->getDialogs().show("error", getContents(), this); - return DISPATCHED; - - default: - return Inset::localDispatch(cmd); - } -} - - -void InsetError::metrics(MetricsInfo & mi, Dimension & dim) const -{ - LyXFont efont; - efont.setSize(mi.base.font.size()).decSize(); - dim_.asc = font_metrics::maxAscent(efont) + 1; - dim_.des = font_metrics::maxDescent(efont) + 1; - dim_.wid = 6 + font_metrics::width(_("Error"), efont); - dim = dim_; -} - - -void InsetError::draw(PainterInfo & pi, int x, int y) const -{ - lyx::Assert(pi.base.bv); - cache(pi.base.bv); - - LyXFont efont; - efont.setSize(pi.base.font.size()).decSize(); - efont.setColor(LColor::error); - - // Draw as "Error" in a framed box - x += 1; - pi.pain.fillRectangle(x, y - dim_.asc + 1, - dim_.wid - 2, dim_.asc + dim_.des - 2, LColor::insetbg); - pi.pain.rectangle(x, y - dim_.asc + 1, - dim_.wid - 2, dim_.asc + dim_.des - 2, LColor::error); - pi.pain.text(x + 2, y, _("Error"), efont); -} - - -string const InsetError::editMessage() const -{ - return _("Opened error"); -} diff --git a/src/insets/inseterror.h b/src/insets/inseterror.h deleted file mode 100644 index 8799c8b208..0000000000 --- a/src/insets/inseterror.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- -/** - * \file inseterror.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Lars Gullik Bjønnes - * - * Full author contact details are available in file CREDITS - */ - -#ifndef INSET_ERROR_H -#define INSET_ERROR_H - -#include "inset.h" -#include "LString.h" -#include "dimension.h" - -/** Used for error messages from LaTeX runs. - - The edit-operation opens a - dialog with the text of the error-message. The inset is displayed as - "Error" in a box, and automatically deleted. */ -class InsetError : public Inset { -public: - /// - explicit - InsetError(string const &); - /// - ~InsetError(); - /// - virtual dispatch_result localDispatch(FuncRequest const & cmd); - /// - void metrics(MetricsInfo &, Dimension &) const; - /// - void draw(PainterInfo & pi, int x, int y) const; - /// - void write(Buffer const *, std::ostream &) const {} - /// - void read(Buffer const *, LyXLex &) {} - /// - int latex(Buffer const *, std::ostream &, - LatexRunParams const &) const { return 0; } - /// - int ascii(Buffer const *, std::ostream &, int) const { return 0; } - /// - int linuxdoc(Buffer const *, std::ostream &) const { return 0; } - /// - int docbook(Buffer const *, std::ostream &, bool) const { return 0; } - /// - bool autoDelete() const { return true; } - /// what appears in the minibuffer when opening - string const editMessage() const; - /// - EDITABLE editable() const { return IS_EDITABLE; } - /// - InsetBase * clone() const { - return new InsetError(contents); - } - /// - Inset::Code lyxCode() const { return Inset::ERROR_CODE; } - /// We don't want "begin" and "end inset" in lyx-file - bool directWrite() const { return true; }; - /// - string const & getContents() const { return contents; } -private: - /// - string contents; - /// - mutable Dimension dim_; -}; -#endif