FormError::FormError(LyXView * lv, Dialogs * d)
- : lv_(lv), d_(d), inset_(0), u_(0), h_(0), ih_(0), dialog_(NULL)
+ : lv_(lv), d_(d), inset_(0), u_(0), h_(0), ih_(0), dialog_(0)
{
// let the dialog be shown
// These are permanent connections so we won't bother
void FormError::showInset( InsetError * const inset )
{
- if( dialog_!=NULL || inset == 0 ) return;
+ if( dialog_!=0 || inset == 0 ) return;
inset_ = inset;
- ih_ = inset_->hide.connect(slot(this, &FormError::hide));
+ ih_ = inset_->hideDialog.connect(slot(this, &FormError::hide));
show();
}
// packing dialog to main window
dialog_ = mbox;
- mainAppWin->add_action(*dialog_, N_(" Error "));
+ mainAppWin->add_action(*dialog_, _(" Error "));
// setting focus
GTK_WIDGET_SET_FLAGS (GTK_WIDGET(b_close->gtkobj()), GTK_CAN_DEFAULT);
b_close->clicked.connect(slot(mainAppWin, &GLyxAppWin::remove_action));
dialog_->destroy.connect(slot(this, &FormError::free));
- u_ = d_->updateBufferDependent.connect(slot(this, &FormError::update));
+ u_ = d_->updateBufferDependent.connect(slot(this, &FormError::updateSlot));
h_ = d_->hideBufferDependent.connect(slot(this, &FormError::hide));
}
}
-
-void FormError::update()
+
+void FormError::updateSlot(bool buffchanged)
{
+ if (buffchanged) hide();
}
void FormError::hide()
{
- if (dialog_!=NULL) mainAppWin->remove_action();
+ if (dialog_!=0) mainAppWin->remove_action();
}
void FormError::free()
{
- if (dialog_!=NULL)
+ if (dialog_!=0)
{
- dialog_ = NULL;
+ dialog_ = 0;
u_.disconnect();
h_.disconnect();
inset_ = 0;