>> However, I'm not sure whether everyone likes this approach. Anyway, I

>> think the concept of the LFUN being dispatched or not is what you
>> need: did I get a result or didn't anything happen.
>just to mention that r32760 follows your advice (scopes and buffer
>switch handled in F&R widget).

Ok.. We might even move the (now static) functions next_open_buffer,
next_document_buffer and friends to GuiView sometime. These are very
general functions and implement some tasks for which GuiView is
responsible. But let's wait before doing that.

>The only "drawback", as compared to the previous approach
>in which I was directly using "GuiView::setBuffer()", is
>that the buffers in which the search is performed are displayed
>anyway by LFUN_BUFFER_SWITCH. So, if multiple buffers are
>searched within a scope before finding a match, the user
>sees this fast changing of buffers before the GUI stops
>on the matching element. In case no match is found, the
>last buffer in the scope is temporarily shown while the
>dialog prompts the user, etc....

This is not only caused by the fact that you're using LFUN_BUFFER_SWITCH
instead of GuiView::setBuffer, but also by the fact that you now call
LFUN_FINDADV for each buffer, so it will be shown anyway when
dispatching this LFUN.

I'm not sure this is a problem. At least the user now sees and
experiences that all buffers are searched. One problem however is that
all hidden buffers are now shown. 

If you really want to search in hidden buffers (and/or non-current
workareas) we either have to change some design, we can hide the buffer
again when nothing is found, or freeze the view for a moment such that
we can switch buffer without showing the user.

The first can be achieved by extending GuiView::setBuffer which can make
a hidden buffer the current buffer. But I foresee a lot of problems/work
because we use to think in currentWorkArea terms. Especially when
considering the case in which one buffer has multiple workareas in
multiple tabs and in multiple views. Maybe we should invent some concept
like a "hidden workarea" .. Brr.

The second means that we see the buffers flickering (appearing and
disappearing), which is probably more annoying (I know I started with
the opposite reasoning before).

The last option is also useful when closing LyX (then you also see all
buffers closed one-by-one, which is annoying).

Vincent

Reply via email to