Abdelrazak Younes schreef:
Vincent van Ravesteijn wrote:
Vincent van Ravesteijn schreef:

>>> I mean, if you look for one thing or two to implement ;-)

>> What's the second ?

> "Insert Cross-Reference at Cursor position" ;-) Abdel.

Done.

Vincent
This is a patch that will add two functions to the context menu of Labels (and erroneously still also References) in the Outline.

I hope you like my solution(s).

I like it on a first glance and I like very much this new feature!

But I am not sure I like the introduction of LFUN_OUTLINER_CONTEXT; this is a GUI only thing and the core shouldn't have to know what's going on, only the TocWidget should know that a context menu was requested inside itself. For me, the separation line is simple, the only thing the core has to know about is what's going on in the current work area.

But maybe I don't really understand the issue here. Did you introduce this LFUN so that you can reuse the current menu infrastructure? I think (but I am not sure) that you should be able to use it without it. I guess this means that I disagree with JMarc ;-)

The issue here is that LyX needs to know who needs to process the dispatch-command. When e.g. a copy-label-as-reference command is dispatched, it can either be processed by BufferView and the InsetLabel at the cursor position, or by GuiView and the tocWidget.

As I already said in the answer to JMarc, I do not know how to decide which of the two to choose. Maybe we can look for which window the focus has (?), or use the getStatus mechanism to check whether the tocWidget displayed the context menu, or create new LFUNs especially for filling the context menu of the toc's, or use the new outliner-context command 'modifier'. If you have a good idea ... please let me know.



Good stuff.

Thanks.


Abdel.

Vincent

Reply via email to