CsvToPmConvert.js 747 B

1234567891011121314151617181920212223
  1. include("scripts/simple.js");
  2. function CsvToPmConvert(filename) {
  3. this.filename = filename;
  4. }
  5. CsvToPmConvert.includeBasePath = includeBasePath;
  6. CsvToPmConvert.prototype.getPmFileName = function () {
  7. return this.filename.substring(0, this.filename.lastIndexOf(".")) + ".pm";
  8. }
  9. CsvToPmConvert.prototype.convert = function () {
  10. EAction.handleUserMessage(CsvToPmConvert.includeBasePath + "/csv2pm.exe");
  11. var process = new QProcess;
  12. process.setProgram(CsvToPmConvert.includeBasePath + "/csv2pm.exe");
  13. var args = [];
  14. args.push(this.filename);
  15. process.setArguments(args);
  16. process.start();
  17. process.waitForStarted(); //等待程序启动
  18. process.waitForFinished(-1);//等待程序关闭
  19. return true;
  20. }