Example #1
0
void reconfigureUserLyXDir()
{
	string const configure_command = package().configure_command();

	lyxerr << to_utf8(_("LyX: reconfiguring user directory")) << endl;
	PathChanger p(package().user_support());
	Systemcall one;
	one.startscript(Systemcall::Wait, configure_command);
	lyxerr << "LyX: " << to_utf8(_("Done!")) << endl;
}
Example #2
0
bool SpecialisedMover::do_copy(FileName const & from, FileName const & to,
			       string const & latex) const
{
	if (command_.empty())
		return Mover::do_copy(from, to, latex);

	string command = command_;
	command = subst(command, "$$i", quoteName(from.toFilesystemEncoding()));
	command = subst(command, "$$o", quoteName(to.toFilesystemEncoding()));
	command = subst(command, "$$l", quoteName(latex));

	Systemcall one;
	return one.startscript(Systemcall::Wait, command) == 0;
}
Example #3
0
void rescanTexStyles(string const & arg)
{
	// Run rescan in user lyx directory
	PathChanger p(package().user_support());
	FileName const prog = support::libFileSearch("scripts", "TeXFiles.py");
	Systemcall one;
	string const command = os::python() + ' ' +
	    quoteName(prog.toFilesystemEncoding()) + ' ' +
	    arg;
	int const status = one.startscript(Systemcall::Wait, command);
	if (status == 0)
		return;
	// FIXME UNICODE
	frontend::Alert::error(_("Could not update TeX information"),
		bformat(_("The script `%1$s' failed."), from_utf8(prog.absFileName())));
}
Example #4
0
bool tex2tex(string const & infilename, FileName const & outfilename,
             string const & encoding)
{
	if (!tex2lyx(infilename, outfilename, encoding))
		return false;
	string command = quoteName(package().lyx_binary().toFilesystemEncoding());
	if (overwrite_files)
		command += " -f main";
	else
		command += " -f none";
	if (pdflatex)
		command += " -e pdflatex ";
	else
		command += " -e latex ";
	command += quoteName(outfilename.toFilesystemEncoding());
	Systemcall one;
	if (one.startscript(Systemcall::Wait, command) == 0)
		return true;
	cerr << "Error: Running '" << command << "' failed." << endl;
	return false;
}