Citation labels now update immediately if the citation engine is changed

from the document dialog.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8756 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2004-05-17 08:52:21 +00:00
parent 33243f7003
commit 3ea4eeb8a5
6 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2004-05-17 Angus Leeming <leeming@lyx.org>
* lfuns.h:
* LyXAction.C (init): new LFUN_INSET_REFRESH.
* lyxfunc.C (dispatch): in the LFUN_BUFFERPARAMS_APPLY block loop
over all insets and dispatch LFUN_INSET_REFRESH to any citation insets
if the citation engine has changed.
2004-05-14 José Matos <jamatos@lyx.org>
* buffer.C (makeDocBookFile): add a default Formal Public Identifier

View File

@ -336,6 +336,7 @@ void LyXAction::init()
{ LFUN_SAVE_AS_DEFAULT, "buffer-save-as-default", Noop },
{ LFUN_BUFFERPARAMS_APPLY, "buffer-params-apply", Noop },
{ LFUN_LYXRC_APPLY, "lyxrc-apply", NoBuffer },
{ LFUN_INSET_REFRESH, "", Noop },
{ LFUN_NOACTION, "", Noop }
};

View File

@ -1,3 +1,8 @@
2004-05-17 Angus Leeming <leeming@lyx.org>
* insetcommand.C (priv_dispatch): act on receipt of LFUN_INSET_REFRESH
to force the button label to be re-generated.
2004-05-14 José Matos <jamatos@lyx.org>
* insetlabel (docbook): do not ouput label, for the moment.

View File

@ -101,6 +101,10 @@ int InsetCommand::docbook(Buffer const &, ostream &,
void InsetCommand::priv_dispatch(LCursor & cur, FuncRequest & cmd)
{
switch (cmd.action) {
case LFUN_INSET_REFRESH:
set_label_ = false;
break;
case LFUN_INSET_MODIFY: {
InsetCommandParams p;
InsetCommandMailer::string2params(mailer_name_, cmd.argument, p);

View File

@ -349,6 +349,7 @@ enum kb_action {
// 265
LFUN_LYXRC_APPLY,
LFUN_GRAPHICS_EDIT,
LFUN_INSET_REFRESH,
LFUN_LASTACTION // end of the table
};

View File

@ -1313,6 +1313,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
}
case LFUN_BUFFERPARAMS_APPLY: {
biblio::CiteEngine const engine =
owner->buffer()->params().cite_engine;
istringstream ss(argument);
LyXLex lex(0,0);
lex.setStream(ss);
@ -1325,6 +1328,18 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
<< (unknown_tokens == 1 ? "" : "s")
<< endl;
}
if (engine == owner->buffer()->params().cite_engine)
break;
LCursor & cur = view()->cursor();
FuncRequest fr(LFUN_INSET_REFRESH);
InsetBase & inset = owner->buffer()->inset();
InsetIterator it = inset_iterator_begin(inset);
InsetIterator const end = inset_iterator_end(inset);
for (; it != end; ++it)
if (it->lyxCode() == InsetBase::CITE_CODE)
it->dispatch(cur, fr);
break;
}