#include "FormError.h"
#include "form_error.h"
#include "insets/inseterror.h"
+#include "support/LAssert.h"
-FormError::FormError( LyXView * lv, Dialogs * d )
- : FormInset( lv, d, _("LaTeX Error") ),
+
+FormError::FormError(LyXView * lv, Dialogs * d)
+ : FormInset( lv, d, _("LaTeX Error"), new OkCancelPolicy),
dialog_(0), inset_(0)
{
+ Assert(lv && d);
// let the dialog be shown
// This is a permanent connection so we won't bother
// storing a copy because we won't be disconnecting.
FL_FORM * FormError::form() const
{
- if (dialog_ ) return dialog_->form;
+ if (dialog_) return dialog_->form;
return 0;
}
}
-void FormError::showInset( InsetError * inset )
+void FormError::showInset(InsetError * inset)
{
- if (inset == 0) return;
+ if (inset == 0) return; // Is this _really_ allowed? (Lgb)
// If connected to another inset, disconnect from it.
if (inset_)
inset_ = inset;
message_ = inset->getContents();
- ih_ = inset->hide.connect(slot(this, &FormError::hide));
+ ih_ = inset->hideDialog.connect(slot(this, &FormError::hide));
show();
}
// Workaround dumb xforms sizing bug
minw_ = form()->w;
minh_ = form()->h;
+
+ // Manage the cancel/close button
+ bc_.setCancel(dialog_->button_cancel);
+ bc_.refresh();
}