I've implemented a controller-view split for the TOC popup. The functionality
is that of the original xforms code before Lars introduced us to the new
buffer labelling scheme.
It isn't particularly pretty though. I'm sure we can do better. No doubt that
means that the API available to the GUI porters will change. For this, no
apologies!
Moreover, I note that the popup has no apply() functionality. That is, you
can change the lists in the popup to browse the file, but if the inset is a
TOC popup it will stay as a TOC popup and not change to a figure popup or an
algorithm popup. Is this the desired functionality?
Finally note that clicking on an item in the TOC browser will take you to
that point in the document. Clicking on a similar item in the figure browser
will not. This is something to do with an invalid ID returned by
toclist_[choice-1].par->id()
and is not a "frontend" problem, but a "backend" one. I've put a check for a
valid LyXParagraph * in LyCFunc::Dispatch (LFUN_GOTO_PARAGRAPH), so selecting
such an item no longer results in a crash.
Angus