+2005-10-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * LyXAction.C:
+ * lfuns.h:
+ * lyxfunc.C: reimplement LFUN_INSERT_CITATION, which is needed
+ by bibliography managers (bug 2071).
+
2005-10-07 Martin Vermeer <martin.vermeer@hut.fi>
* BufferView_pimpl.C (update): choose arguments to update call so
{ LFUN_INSERT_LABEL, "label-insert", Noop },
{ LFUN_INSET_OPTARG, "optional-insert", Noop },
{ LFUN_INSERT_BIBITEM, "bibitem-insert", Noop },
+ { LFUN_INSERT_CITATION, "citation-insert", Noop },
{ LFUN_BIBDB_ADD, "bibtex-database-add", Noop },
{ LFUN_BIBDB_DEL, "bibtex-database-del", Noop },
{ LFUN_INSERT_LINE, "line-insert", Noop },
break;
}
+ case LFUN_INSERT_CITATION: {
+ FuncRequest fr(LFUN_INSET_INSERT, "citation");
+ enable = getStatus(fr).enabled();
+ break;
+ }
+
// this one is difficult to get right. As a half-baked
// solution, we consider only the first action of the sequence
case LFUN_SEQUENCE: {
owner->getDialogs().disconnect(argument);
break;
+
+ case LFUN_INSERT_CITATION: {
+ if (!argument.empty()) {
+ // we can have one optional argument, delimited by '|'
+ // citation-insert <key>|<text_before>
+ // this should be enhanced to also support text_after
+ // and citation style
+ string arg = argument;
+ string opt1;
+ if (contains(argument, "|")) {
+ arg = token(argument, '|', 0);
+ opt1 = '[' + token(argument, '|', 1) + ']';
+ }
+ std::ostringstream os;
+ os << "citation LatexCommand\n"
+ << "\\cite" << opt1 << "{" << arg << "}\n"
+ << "\\end_inset";
+ FuncRequest fr(LFUN_INSET_INSERT, os.str());
+ dispatch(fr);
+ } else
+ dispatch(FuncRequest(LFUN_DIALOG_SHOW, "citation"));
+ break;
+ }
+
case LFUN_CHILDOPEN: {
string const filename =
MakeAbsPath(argument, owner->buffer()->filePath());