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"), new OkCancelPolicy),
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 FormError::~FormError()
43 FL_FORM * FormError::form() const
45 if (dialog_) return dialog_->form;
50 void FormError::disconnect()
54 FormInset::disconnect();
58 void FormError::showInset(InsetError * inset)
60 if (inset == 0) return; // Is this _really_ allowed? (Lgb)
62 // If connected to another inset, disconnect from it.
67 message_ = inset->getContents();
68 ih_ = inset->hideDialog.connect(slot(this, &FormError::hide));
73 void FormError::update()
75 fl_set_object_label(dialog_->message, message_.c_str());
79 void FormError::build()
81 dialog_ = build_error();
83 // Workaround dumb xforms sizing bug
87 // Manage the cancel/close button
88 bc_.setCancel(dialog_->button_cancel);