On Mon, 9 Oct 2000, Angus Leeming wrote:

> Attached are two patches. Both are physically large but very simple.
> 
> patch_insets
> ==========

Haven't looked at this one.

> patch_xforms
> ==========
> the updateBufferDependent signal is now connected to 
> FormBase::updateOrHide(). If the daughter class should ALWAYS be updated when 
> the buffer changes, this is flagged by an enum passed to the FormBase c-tor. 
> If it should hide when the buffer changes, then the enum reflects this.

I'd still prefer to see you override connect() in appropriate classes
rather than turn FormBase into a swiss-army knife.  Perhaps we need a
FormInsetBase since it's basically insets that will get caught out on a
buffer change -- that is, put updateOrHide() in FormInsetBase. Although in
this case overriding connect() should be sufficient.

FormCommand::connect() can be set to connect hide()/apply() to
FormCommand::updateOrHide() and FormToc::connect() can override that to
call FormBase::connect().  That is, put the buffer check in a more
appropriate point in the hierarchy.  It doesn't count for many of the
dialogs and I don't like the idea of storing of Buffer * anyway.  I'll
have check what I did in the lyx repository but I'm sure most of the stuff
was working okay there without any update problems.

I also found myself confused by the patch thinking that FormPreferences
would be hidden when the user switches buffers even though it's buffer
independent.  That was because of the presense of the HIDE in the call of
the FormBase constructor. We should probably shuffle the order of the
parameters and add a default value for BufferDependency.

Remember that insets aren't the only things with dialogs so you shouldn't
be pushing everything inset-related into FormBase because it just doesn't
make sense for other dialogs.  If you find yourself writing the word inset
ina comment in FormBase then that piece of code probably doesn't belong in
FormBase.

> I consider both patches to be bug fixes, so would like them applied before 
> 1.1.6.

I'll apply this anyway since it also contains the FormParagraph conversion
and should fix the buffer-close segfault.

Allan. (ARRae)

Reply via email to