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"
22 #include "support/LAssert.h"
25 FormError::FormError(LyXView * lv, Dialogs * d)
26 : FormInset( lv, d, _("LaTeX Error")),
30 // let the dialog be shown
31 // This is a permanent connection so we won't bother
32 // storing a copy because we won't be disconnecting.
33 d->showError.connect(slot(this, &FormError::showInset));
37 FL_FORM * FormError::form() const
39 if (dialog_.get()) return dialog_->form;
44 void FormError::disconnect()
48 FormInset::disconnect();
52 void FormError::showInset(InsetError * inset)
54 if (inset == 0) return; // Is this _really_ allowed? (Lgb)
56 // If connected to another inset, disconnect from it.
61 message_ = inset->getContents();
62 ih_ = inset->hideDialog.connect(slot(this, &FormError::hide));
67 void FormError::update()
69 fl_set_object_label(dialog_->message, message_.c_str());
73 void FormError::build()
75 dialog_.reset(build_error());
77 // Workaround dumb xforms sizing bug
81 // Manage the cancel/close button
82 bc().setCancel(dialog_->button_cancel);