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"
26 FormError::FormError(LyXView * lv, Dialogs * d)
27 : FormInset( lv, d, _("LaTeX Error")),
31 // let the dialog be shown
32 // This is a permanent connection so we won't bother
33 // storing a copy because we won't be disconnecting.
34 d->showError.connect(slot(this, &FormError::showInset));
38 FL_FORM * FormError::form() const
40 if (dialog_.get()) return dialog_->form;
45 void FormError::disconnect()
49 FormInset::disconnect();
53 void FormError::showInset(InsetError * inset)
55 if (inset == 0) return; // Is this _really_ allowed? (Lgb)
57 // If connected to another inset, disconnect from it.
62 message_ = inset->getContents();
63 ih_ = inset->hideDialog.connect(slot(this, &FormError::hide));
68 void FormError::update()
70 fl_set_object_label(dialog_->message, message_.c_str());
74 void FormError::build()
76 dialog_.reset(build_error());
78 // Workaround dumb xforms sizing bug
82 // Manage the cancel/close button
83 bc().setCancel(dialog_->button_cancel);