custom tools: use new TCEProcess

see b911e10e93
This commit is contained in:
Basile Burg 2015-07-15 15:38:57 +02:00
parent 207f0ec066
commit 8f01388d0a
1 changed files with 6 additions and 6 deletions

View File

@ -5,14 +5,14 @@ unit ce_tools;
interface interface
uses uses
Classes, SysUtils, FileUtil, process, menus, Classes, SysUtils, FileUtil, process, menus, ce_processes,
ce_common, ce_writableComponent, ce_interfaces, ce_observer, ce_inspectors; ce_common, ce_writableComponent, ce_interfaces, ce_observer, ce_inspectors;
type type
TCEToolItem = class(TCollectionItem) TCEToolItem = class(TCollectionItem)
private private
fProcess: TCheckedAsyncProcess; fProcess: TCEProcess;
fExecutable: TCEFilename; fExecutable: TCEFilename;
fWorkingDir: TCEPathname; fWorkingDir: TCEPathname;
fShowWin: TShowWindowOptions; fShowWin: TShowWindowOptions;
@ -102,7 +102,7 @@ begin
fParameters.Free; fParameters.Free;
fChainAfter.Free; fChainAfter.Free;
fChainBefore.Free; fChainBefore.Free;
killProcess(fProcess); ce_processes.killProcess(fProcess);
inherited; inherited;
end; end;
@ -157,12 +157,12 @@ var
i: Integer; i: Integer;
prms: string; prms: string;
begin begin
killProcess(fProcess); ce_processes.killProcess(fProcess);
// //
if fClearMessages then if fClearMessages then
getMessageDisplay(fMsgs).clearByContext(amcMisc); getMessageDisplay(fMsgs).clearByContext(amcMisc);
// //
fProcess := TCheckedAsyncProcess.Create(nil); fProcess := TCEProcess.Create(nil);
fProcess.OnReadData:= @processOutput; fProcess.OnReadData:= @processOutput;
fProcess.OnTerminate:= @processOutput; fProcess.OnTerminate:= @processOutput;
fProcess.Options := fOpts; fProcess.Options := fOpts;
@ -188,7 +188,7 @@ begin
getMessageDisplay(fMsgs); getMessageDisplay(fMsgs);
lst := TStringList.Create; lst := TStringList.Create;
try try
processOutputToStrings(fProcess, lst); fProcess.getFullLines(lst);
for str in lst do for str in lst do
fMsgs.message(str, nil, amcMisc, amkAuto); fMsgs.message(str, nil, amcMisc, amkAuto);
finally finally