#include "LyXRC.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "output_latex.h"
#include "frontends/alert.h"
#include "frontends/Application.h"
if (defaultTemplateName.empty()) {
external::TemplateManager const & etm =
external::TemplateManager::get();
- templatename_ = etm.getTemplates().begin()->first;
+ if (!etm.getTemplates().empty())
+ templatename_ = etm.getTemplates().begin()->first;
} else
templatename_ = defaultTemplateName;
}
}
-InsetExternal::InsetExternal(Buffer & buf)
- : renderer_(new RenderButton)
+InsetExternal::InsetExternal(Buffer * buf)
+ : Inset(buf), renderer_(new RenderButton)
{
- Inset::setBuffer(buf);
}
params2string(params(), cur.bv().buffer()));
break;
- case LFUN_MOUSE_RELEASE:
- if (!cur.selection() && cmd.button() == mouse_button::button1)
- cur.bv().showDialog("external",
- params2string(params(), cur.bv().buffer()),
- this);
- break;
-
default:
Inset::doDispatch(cur, cmd);
}
}
-void InsetExternal::edit(Cursor & cur, bool, EntryDirection)
+bool InsetExternal::showInsetDialog(BufferView * bv) const
{
- cur.bv().showDialog("external",
- params2string(params(), cur.bv().buffer()),
- this);
+ bv->showDialog("external", params2string(params(), bv->buffer()),
+ const_cast<InsetExternal *>(this));
+ return true;
}
}
+void InsetExternal::updatePreview()
+{
+ setParams(params_);
+}
+
+
void InsetExternal::setParams(InsetExternalParams const & p)
{
params_ = p;
}
+docstring InsetExternal::xhtml(XHTMLStream & /*xs*/,
+ OutputParams const & /*rp*/) const
+{
+// external::writeExternal(params_, "XHTML", buffer(), os,
+// *(runparams.exportdata), false,
+// runparams.dryrun || runparams.inComment);
+ return docstring();
+}
+
+
void InsetExternal::validate(LaTeXFeatures & features) const
{
if (params_.draft)
format = "LaTeX";
break;
case OutputParams::PDFLATEX:
+ case OutputParams::XETEX:
format = "PDFLaTeX";
break;
case OutputParams::XML:
format = "DocBook";
break;
+ case OutputParams::HTML:
+ format = "html";
+ break;
+ case OutputParams::TEXT:
+ format = "text";
+ break;
}
external::Template::Formats::const_iterator cit =
et.formats.find(format);
}
-void InsetExternal::addPreview(graphics::PreviewLoader & ploader) const
+void InsetExternal::addPreview(DocIterator const & /*inset_pos*/,
+ graphics::PreviewLoader & ploader) const
{
RenderMonitoredPreview * const ptr = renderer_->asMonitoredPreview();
if (!ptr)