dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd)
{
- if (cmd.action != LFUN_BIBTEX_APPLY)
- return UNDISPATCHED;
+ switch (cmd.action) {
- InsetCommandParams p;
- InsetCommandMailer::string2params(cmd.argument, p);
- if (p.getCmdName().empty())
- return UNDISPATCHED;
+ case LFUN_INSET_EDIT:
+ InsetCommandMailer("bibtex", *this).showDialog(cmd.view());
+ return DISPATCHED;
- if (view() && p.getContents() != params().getContents()) {
- view()->ChangeCitationsIfUnique(params().getContents(),
- p.getContents());
+ case LFUN_INSET_MODIFY: {
+ InsetCommandParams p;
+ InsetCommandMailer::string2params(cmd.argument, p);
+ if (p.getCmdName().empty())
+ return DISPATCHED;
+
+ if (view() && p.getContents() != params().getContents()) {
+ view()->ChangeCitationsIfUnique(params().getContents(),
+ p.getContents());
+ }
+
+ setParams(p);
+ cmd.view()->updateInset(this);
+ return DISPATCHED;
}
- setParams(p);
- if (view())
- view()->updateInset(this, true);
+ default:
+ return InsetCommand::localDispatch(cmd);
+ }
- return DISPATCHED;
}
string const InsetBibtex::getScreenLabel(Buffer const *) const
}
-void InsetBibtex::edit(BufferView *, int, int, mouse_button::state)
-{
- InsetCommandMailer mailer("bibtex", *this);
- mailer.showDialog();
-}
-
-
-void InsetBibtex::edit(BufferView * bv, bool)
-{
- edit(bv, 0, 0, mouse_button::none);
-}
-
-
bool InsetBibtex::addDatabase(string const & db)
{
string contents(getContents());