#include "dispatchresult.h"
#include "exporter.h"
#include "funcrequest.h"
+#include "FuncStatus.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
#include "lyx_main.h"
using lyx::support::GetFileContents;
using lyx::support::IsFileReadable;
using lyx::support::IsLyXFilename;
+using lyx::support::latex_path;
using lyx::support::MakeAbsPath;
using lyx::support::MakeDisplayPath;
using lyx::support::MakeRelPath;
params_(other.params_),
include_label(other.include_label),
preview_(new RenderMonitoredPreview(this)),
- set_label_(other.set_label_)
+ set_label_(false)
{
preview_->fileChanged(boost::bind(&InsetInclude::fileChanged, this));
}
case LFUN_INSET_MODIFY: {
InsetCommandParams p;
InsetIncludeMailer::string2params(cmd.argument, p);
- if (!p.getCmdName().empty()) {
+ if (!p.getCmdName().empty())
set(p, cur.buffer());
- cur.bv().update();
- }
+ else
+ cur.noUpdate();
break;
}
}
+bool InsetInclude::getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const
+{
+ switch (cmd.action) {
+
+ case LFUN_INSET_MODIFY:
+ case LFUN_INSET_DIALOG_UPDATE:
+ case LFUN_INSET_DIALOG_SHOW:
+ flag.enabled(true);
+ return true;
+
+ default:
+ return InsetBase::getStatus(cur, cmd, flag);
+ }
+}
+
+
InsetCommandParams const & InsetInclude::params() const
{
return params_;
}
if (isVerbatim(params_)) {
+ incfile = latex_path(incfile);
os << '\\' << params_.getCmdName() << '{' << incfile << '}';
} else if (type(params_) == INPUT) {
runparams.exportdata->addExternalFile("latex", writefile,
// \input wants file with extension (default is .tex)
if (!IsLyXFilename(included_file)) {
+ incfile = latex_path(incfile);
os << '\\' << params_.getCmdName() << '{' << incfile << '}';
} else {
+ incfile = ChangeExtension(incfile, ".tex");
+ incfile = latex_path(incfile);
os << '\\' << params_.getCmdName() << '{'
- << ChangeExtension(incfile, ".tex")
+ << incfile
<< '}';
}
} else {
// \include don't want extension and demands that the
// file really have .tex
+ incfile = ChangeExtension(incfile, string());
+ incfile = latex_path(incfile);
os << '\\' << params_.getCmdName() << '{'
- << ChangeExtension(incfile, string())
+ << incfile
<< '}';
}
string id;
lex >> id;
if (!lex || id != "Include")
- return print_mailer_error("InsetBoxMailer", in, 2, "Include");
+ return print_mailer_error("InsetIncludeMailer", in, 2, "Include");
InsetInclude inset(params);
inset.read(lex);