]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormError.C
controller-view split of FormLog and FormVCLog.
[lyx.git] / src / frontends / xforms / FormError.C
index afd6c0b52bde177baca69460ef4653d09bd2caa1..0a6b5b2d1a583f3e926ddb05de99f861742dd32a 100644 (file)
 #include "insets/inseterror.h"
 #include "support/LAssert.h"
 
+using SigC::slot;
 
 FormError::FormError(LyXView * lv, Dialogs * d)
-       : FormInset( lv, d, _("LaTeX Error"), new IgnorantPolicy),
-         dialog_(0), inset_(0)
+       : FormInset( lv, d, _("LaTeX Error")),
+         inset_(0)
 {
        Assert(lv && d);
        // let the dialog be shown
@@ -34,15 +35,9 @@ FormError::FormError(LyXView * lv, Dialogs * d)
 }
 
 
-FormError::~FormError()
-{
-       delete dialog_;
-}
-
-
 FL_FORM * FormError::form() const
 {
-       if (dialog_) return dialog_->form;
+       if (dialog_.get()) return dialog_->form;
        return 0;
 }
 
@@ -65,7 +60,7 @@ void FormError::showInset(InsetError * inset)
 
        inset_ = inset;
        message_ = inset->getContents();
-       ih_ = inset->hide.connect(slot(this, &FormError::hide));
+       ih_ = inset->hideDialog.connect(slot(this, &FormError::hide));
        show();
 }
 
@@ -78,9 +73,9 @@ void FormError::update()
 
 void FormError::build()
 {
-       dialog_ = build_error();
+       dialog_.reset(build_error());
 
-       // Workaround dumb xforms sizing bug
-       minw_ = form()->w;
-       minh_ = form()->h;
+        // Manage the cancel/close button
+       bc().setCancel(dialog_->button_cancel);
+       bc().refresh();
 }