My head is spinning a little from all these answers, but I'd like to thank all
of you for the ideas.
I think I'll summarise what I'm going to try and implement:
The signal in BufferView::Pimpl::workAreaButtonRelease() remains unchanged:
switch( inset_hit->LyxCode() ) {
case Inset::CITATION_CODE:
owner_->getDialogs()->showCitation( (InsetCitation *)inset_hit );
break;
default:
inset_hit->Edit(bv_, x, y, button);
break;
}
A new signal is emitted in LyXFunc::Dispatch()
case LFUN_CREATE_CITATION:
owner->getDialogs()->createCitation( argument );
break;
This signal doesn't need a "this" argument because the FormCitation contains a
LyXView * lv_ already
Pressing ok/apply in the Citation dialog can therefore call code like:
lv_->getLyXFunc()->Dispatch(LFUN_INSERT_CITATION, new_argument);
which triggers the following code in LyXFunc::Dispatch()
case LFUN_INSERT_CITATION:
InsetCitation * inset = new InsetCitation(argument);
if (!owner->view()->insertInset(inset))
delete inset;
break;
This way, the functionality is kept in the kernel. No new variables need to be
stored in the inset. Everybody's happy. Please say yes here!
I've even worked out how to lock the citation dialog so that it deals with only
one InsetCitation at a time. Woo hoo!
Again, thanks for the suggestions.
Angus