I have a question for those that know:

in my new GUIIndependent (xforms implementation) InsetRef dialog (that is the
new "big" dialog with browser), I can go to the reference and go back. Well and
good.

I go back by calling LxXFunc::Dispatch( LFUN_REF_BACK ), which in turn 
calls BufferView::Pimpl::restorePosition()

In turn this function calls BufferView::Pimpl::buffer() which UPDATES all
buffer dependent dialogs:
                owner_->getDialogs()->updateBufferDependent();

This completely messes things up in my dialog (ie, it resets everything!)

I have modified BufferView::Pimpl::restorePosition() as shown below. This works
for my needs, but will it break anything else? 

void BufferView::Pimpl::restorePosition()
{
        if (backstack.empty()) return;
        
        int  x, y;
        string fname = backstack.pop(&x, &y);
        
        beforeChange();
        Buffer * b = bufferlist.exists(fname) ?
                bufferlist.getBuffer(fname) :
                bufferlist.loadLyXFile(fname); // don't ask, just load it
-       buffer(b);
+       if( !bufferlist.exists(fname) ) buffer(b);
        bv_->text->SetCursorFromCoordinates(bv_, x, y);
        update(BufferView::SELECT|BufferView::FITCUR);
} 

Actually, not knowing what is going on here, why is there the call to buffer(b)
at all? It doesn't seem to make much sense.

The alternative is that I wrap disconnect/connect calls around my call within
the dialog. Ie:

                u_.disconnect();
                lv_->getLyXFunc()->Dispatch( LFUN_REF_INSERT,
                                             params.getAsString().c_str() );
                u_ = d_->updateBufferDependent.
                         connect(slot(this, &FormCommand::update));

Any comments? Someone out there is far more knowledgeable than me!
Angus





Reply via email to