2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
15 #pragma implementation
19 #include "FormError.h"
20 #include "form_error.h"
21 #include "insets/inseterror.h"
23 FormError::FormError( LyXView * lv, Dialogs * d )
24 : FormInset( lv, d, _("LaTeX Error") ),
27 // let the dialog be shown
28 // This is a permanent connection so we won't bother
29 // storing a copy because we won't be disconnecting.
30 d->showError.connect(slot(this, &FormError::showInset));
34 FormError::~FormError()
40 FL_FORM * FormError::form() const
42 if ( dialog_ ) return dialog_->form;
47 void FormError::disconnect()
51 FormInset::disconnect();
55 void FormError::showInset( InsetError * inset )
57 if (inset == 0) return;
59 // If connected to another inset, disconnect from it.
64 message_ = inset->getContents();
65 ih_ = inset->hide.connect(slot(this, &FormError::hide));
70 void FormError::update()
72 fl_set_object_label(dialog_->message, message_.c_str());
76 void FormError::build()
78 dialog_ = build_error();
80 // Workaround dumb xforms sizing bug