+ case LFUN_INSET_MODIFY: {
+ InsetCommandParams p(INCLUDE_CODE);
+ InsetCommandMailer::string2params("include", to_utf8(cmd.argument()), p);
+ if (!p.getCmdName().empty()) {
+ if (isListings(p)){
+ InsetListingsParams par_old(to_utf8(params()["lstparams"]));
+ InsetListingsParams par_new(to_utf8(p["lstparams"]));
+ if (par_old.getParamValue("label") !=
+ par_new.getParamValue("label")
+ && !par_new.getParamValue("label").empty())
+ cur.bv().buffer().changeRefsIfUnique(
+ from_utf8(par_old.getParamValue("label")),
+ from_utf8(par_new.getParamValue("label")),
+ REF_CODE);
+ }
+ try {
+ // the embed parameter passed back from the dialog
+ // is "true" or "false", we need to change it.
+ if (p["embed"] == _("false"))
+ p["embed"].clear();
+ else
+ p["embed"] = from_utf8(EmbeddedFile(to_utf8(p["filename"]),
+ onlyPath(parentFilename(cur.buffer()))).inzipName());
+ // test parameter
+ includedFilename(cur.buffer(), p);
+ } catch (ExceptionMessage const & message) {
+ Alert::error(message.title_, message.details_);
+ // do not set parameter if an error happens
+ break;
+ }
+ set(p, cur.buffer());
+ cur.buffer().updateBibfilesCache();
+ } else
+ cur.noUpdate();
+ break;
+ }
+
+ //pass everything else up the chain
+ default:
+ InsetCommand::doDispatch(cur, cmd);
+ break;
+ }
+}