#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
#include <algorithm>
#include "support/path.h"
#include "support/LAssert.h"
#include "support/filetools.h"
+#include "support/path_defines.h"
+
+using namespace lyx::support;
using std::endl;
using std::ostream;
using std::for_each;
-extern string user_lyxdir;
-
-
// We have to have dummy default commands for security reasons!
ExternalTemplate::ExternalTemplate()
+ : inputFormat("*")
{}
ExternalTemplateManager::ExternalTemplateManager()
{
// gimp gnuchess gnuplot ical netscape tetris xpaint
- readTemplates(user_lyxdir);
+ readTemplates(user_lyxdir());
if (lyxerr.debugging())
dumpTemplates();
}
<< "\tHelpText\n"
<< et.helpText
<< "\tHelpTextEnd\n"
+ << "\tInputFormat " << et.inputFormat << "\n"
<< "\tFileFilter " << et.fileRegExp << "\n"
- << "\tViewCommand " << et.viewCommand << "\n"
<< "\tEditCommand " << et.editCommand << "\n"
<< "\tAutomaticProduction " << et.automaticProduction << "\n";
et.dumpFormats(ost);
ExternalTemplate::FormatTemplate const & ft = vt.second;
ost << "\tFormat " << vt.first << "\n"
<< "\t\tProduct " << ft.product << "\n"
- << "\t\tUpdateCommand " << ft.updateCommand << "\n"
+ << "\t\tUpdateFormat " << ft.updateFormat << "\n"
<< "\t\tUpdateResult " << ft.updateResult << "\n"
<< "\t\tRequirement " << ft.requirement << "\n"
<< "\t\tPreamble\n"
enum TemplateOptionTags {
TO_GUINAME = 1,
TO_HELPTEXT,
+ TO_INPUTFORMAT,
TO_FILTER,
- TO_VIEWCMD,
TO_EDITCMD,
TO_AUTOMATIC,
TO_FORMAT,
{ "format", TO_FORMAT },
{ "guiname", TO_GUINAME },
{ "helptext", TO_HELPTEXT },
- { "templateend", TO_END },
- { "viewcommand", TO_VIEWCMD }
+ { "inputformat", TO_INPUTFORMAT },
+ { "templateend", TO_END }
};
pushpophelper pph(lex, templateoptiontags, TO_END);
helpText = lex.getLongString("HelpTextEnd");
break;
- case TO_FILTER:
+ case TO_INPUTFORMAT:
lex.next(true);
- fileRegExp = lex.getString();
+ inputFormat = lex.getString();
break;
- case TO_VIEWCMD:
+ case TO_FILTER:
lex.next(true);
- viewCommand = lex.getString();
+ fileRegExp = lex.getString();
break;
case TO_EDITCMD:
default:
lex.printError("ExternalTemplate::readTemplate: "
"Wrong tag: $$Token");
- lyx::Assert(false);
+ Assert(false);
break;
}
}
{
enum FormatTags {
FO_PRODUCT = 1,
- FO_UPDATECMD,
+ FO_UPDATEFORMAT,
FO_UPDATERESULT,
FO_REQUIREMENT,
FO_PREAMBLE,
{ "preamble", FO_PREAMBLE },
{ "product", FO_PRODUCT },
{ "requirement", FO_REQUIREMENT },
- { "updatecommand", FO_UPDATECMD },
+ { "updateformat", FO_UPDATEFORMAT },
{ "updateresult", FO_UPDATERESULT }
};
product = lex.getString();
break;
- case FO_UPDATECMD:
+ case FO_UPDATEFORMAT:
lex.next(true);
- updateCommand = lex.getString();
+ updateFormat = lex.getString();
break;
case FO_UPDATERESULT: