On 09/04/2009 19:44, Vincent van Ravesteijn wrote:
Hi all,
I have some questions on de handling of LFUN_INSET_TOGGLE / SETTINGS.
1. If an LFUN_INSET_TOGGLE is send to an InsetCommand, the settings
dialog is shown. Wouldn't it make more sense to dispatch an
LFUN_INSET_SETTINGS instead ?
yes. History and Inertia...
2. the status of LFUN_INSET_SETTINGS is handled by
BufferView::getStatus() and the dispatch is handled by
Text::dispatch(). This looks at least a bit awkward. Shouldn't these
be handled by the same class ?
Yes.
3. when Text::dispatch() handles the LFUN_INSET_SETTINGS, it resolves
the inset of interest and calls inset.showInsetDialog(). Should this
not be handled by the Inset. Thus Text::dispatch calls Inset::dispatch
which then calls showInsetDialog. In this way you can dispatch the
LFUN_INSET_SETTINGS to an Inset (which seems like a good thing to do)
without running into an assertion.
and yes.
Can I adjust the code to solve these peculiarities ?
Sounds good to me.
Abdel.