Jean-Marc Lasgouttes wrote: >>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: > > Angus> Jean-Marc Lasgouttes wrote: >>> It cures the crash, but there is still a problem: template popup >>> shows an empty entry, but the help text is the chess one. >>> >>> We have to find out why the popup is not initialized correctly, >>> instead of trying to workaround bad values. > > Angus> Sure. I thought you wanted to try it out... > > So, it appears that when I enter QExternal::update_contents(), > params.templatename() is empty.
Either that, or it contains a file name that isn't in the list of recognized templates. See the comment in ControlExternal::getTemplateNumber. The question is, is this behaviour useful? I think 'yes', which means that the best way to proceed is to add the unrecognized name to the combox. Thoughts? Which doesn't solve your problem, however, because you're using a default-constructed params(), right? What is the content of 'data' passed here: (please don't bother answering this. I think I've found the problem, below). bool ControlExternal::initialiseParams(string const & data) { params_.reset(new InsetExternalParams); InsetExternalMailer::string2params(data, kernel().buf fer(), *params_); return true; } > Where is it supposed to get a > reasonable value when creating an inset? I guess that it should go in here, in LyXFunc::dispatch (but doesn't). case LFUN_DIALOG_SHOW_NEW_INSET: { string const & name = argument; string data; if (name == "bibitem" || name == "bibtex" || name == "include" || name == "index" || name == "ref" || name == "toc" || name == "url") { InsetCommandParams p(name); data = InsetCommandMailer::params2string(name, p); } else if (name == "citation") { InsetCommandParams p("cite"); data = InsetCommandMailer::params2string(name, p); } else if (name == "vspace") { VSpace space; data = InsetVSpaceMailer::params2string(space); } owner->getDialogs().show(name, data, 0); break; } Adding } else if (name == "external") { InsetExternalParams p; Buffer const & buffer = *owner->buffer(); data = InsetExternalMailer::params2string(p, buffer); Fixes things for me. I guess that all the 'insets-with-dialogs' need to be added to this block. > I guess it should default to the first one, or something. See my question about an unrecognized template, above. -- Angus