mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 17:09:16 +02:00
* adapt to changes in fptools.pas unit
+ support $CAP_MSG() without filter
This commit is contained in:
parent
2c774736c5
commit
c6068c58c8
@ -50,11 +50,12 @@ var Title,ProgramPath,Params: string;
|
|||||||
Wo: word;
|
Wo: word;
|
||||||
Err: integer;
|
Err: integer;
|
||||||
CaptureFile: string;
|
CaptureFile: string;
|
||||||
ErrText : Text;
|
TextFile : Text;
|
||||||
ExecMode: TExecType;
|
ExecMode: TExecType;
|
||||||
Executed: boolean;
|
Executed: boolean;
|
||||||
begin
|
begin
|
||||||
if (Idx<1) or (Idx>GetToolCount) then Exit;
|
if (Idx<1) or (Idx>GetToolCount) then Exit;
|
||||||
|
InitToolProcessing;
|
||||||
GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
|
GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
|
||||||
InitToolTempFiles;
|
InitToolTempFiles;
|
||||||
Err:=ParseToolParams(Params,false);
|
Err:=ParseToolParams(Params,false);
|
||||||
@ -83,10 +84,13 @@ begin
|
|||||||
|
|
||||||
EraseFile(CaptureFile);
|
EraseFile(CaptureFile);
|
||||||
EraseFile(FilterCaptureName);
|
EraseFile(FilterCaptureName);
|
||||||
|
EraseFile(ToolCaptureErr);
|
||||||
|
|
||||||
if CaptureToolTo=capMessageWindow then
|
if CaptureToolTo=capMessageWindow then
|
||||||
begin
|
begin
|
||||||
|
Messages;
|
||||||
AddToolCommand(ProgramPath+' '+Params);
|
AddToolCommand(ProgramPath+' '+Params);
|
||||||
|
UpdateToolMessages;
|
||||||
ToFocus:=ToolMessages^.count-1;
|
ToFocus:=ToolMessages^.count-1;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -115,7 +119,9 @@ begin
|
|||||||
ErrorBox(msg_errorreadingoutput,nil);
|
ErrorBox(msg_errorreadingoutput,nil);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if ToolFilter<>'' then
|
else if (ToolFilter<>'') or (CaptureToolTo=capMessageWindow) then
|
||||||
|
begin
|
||||||
|
if ToolFilter<>'' then
|
||||||
begin
|
begin
|
||||||
ShowMessage(FormatStrStr(msg_executingfilterfor,KillTilde(Title)));
|
ShowMessage(FormatStrStr(msg_executingfilterfor,KillTilde(Title)));
|
||||||
DoExecute(ToolFilter,'',CaptureFile,FilterCaptureName,'',exNoSwap);
|
DoExecute(ToolFilter,'',CaptureFile,FilterCaptureName,'',exNoSwap);
|
||||||
@ -132,6 +138,24 @@ begin
|
|||||||
ErrorBox(FormatStrStr(msg_errorexecutingfilter,KillTilde(GetToolName(Idx-1))),nil) else
|
ErrorBox(FormatStrStr(msg_errorexecutingfilter,KillTilde(GetToolName(Idx-1))),nil) else
|
||||||
if DosExitCode<>0 then
|
if DosExitCode<>0 then
|
||||||
ErrorBox(FormatStrInt(msg_filterexecutionsuccessfulexitcodeis,DosExitCode),nil);
|
ErrorBox(FormatStrInt(msg_filterexecutionsuccessfulexitcodeis,DosExitCode),nil);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if ExistsFile(CaptureFile) then
|
||||||
|
begin
|
||||||
|
Assign(TextFile,CaptureFile);
|
||||||
|
Reset(TextFile);
|
||||||
|
while not eof(TextFile) do
|
||||||
|
begin
|
||||||
|
Readln(TextFile,Params);
|
||||||
|
AddToolCommand(Params);
|
||||||
|
end;
|
||||||
|
Close(TextFile);
|
||||||
|
UpdateToolMessages;
|
||||||
|
if Assigned(MessagesWindow) then
|
||||||
|
MessagesWindow^.MakeFirst;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
UpdateToolMessages;
|
UpdateToolMessages;
|
||||||
if (ToFocus<>-1) then
|
if (ToFocus<>-1) then
|
||||||
if Assigned(MessagesWindow) then
|
if Assigned(MessagesWindow) then
|
||||||
@ -141,20 +165,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if (DosError<>0) or (DosExitCode<>0) then
|
if (DosError<>0) or (DosExitCode<>0) or (SizeOfFile(ToolCaptureErr)>0) then
|
||||||
begin
|
begin
|
||||||
if (DosError<>0) then
|
if (DosError<>0) then
|
||||||
ErrorBox(FormatStrStr(msg_errorexecutingtool,KillTilde(GetToolName(Idx-1))),nil) else
|
ErrorBox(FormatStrStr(msg_errorexecutingtool,KillTilde(GetToolName(Idx-1))),nil) else
|
||||||
if DosExitCode<>0 then
|
if DosExitCode<>0 then
|
||||||
ErrorBox(FormatStrInt(msg_toolexecutionsuccessfulexitcodeis,DosExitCode),nil);
|
ErrorBox(FormatStrInt(msg_toolexecutionsuccessfulexitcodeis,DosExitCode),nil);
|
||||||
{$i-}
|
{$i-}
|
||||||
Assign(ErrText,ToolCaptureErr);
|
Assign(TextFile,ToolCaptureErr);
|
||||||
Reset(ErrText);
|
Reset(TextFile);
|
||||||
while not eof(ErrText) do
|
while not eof(TextFile) do
|
||||||
begin
|
begin
|
||||||
Readln(ErrText,Params);
|
Readln(TextFile,Params);
|
||||||
AddToolCommand(Params);
|
AddToolCommand(Params);
|
||||||
end;
|
end;
|
||||||
|
Close(TextFile);
|
||||||
|
UpdateToolMessages;
|
||||||
|
if Assigned(MessagesWindow) then
|
||||||
|
begin
|
||||||
|
MessagesWindow^.MakeFirst;
|
||||||
|
if (ToFocus<>-1) then
|
||||||
|
MessagesWindow^.FocusItem(ToFocus);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifndef DEBUG}
|
{$ifndef DEBUG}
|
||||||
if ToolOutput='' then
|
if ToolOutput='' then
|
||||||
@ -352,7 +384,11 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2002-05-29 22:38:13 pierre
|
Revision 1.4 2002-08-29 10:06:33 pierre
|
||||||
|
* adapt to changes in fptools.pas unit
|
||||||
|
+ support $CAP_MSG() without filter
|
||||||
|
|
||||||
|
Revision 1.3 2002/05/29 22:38:13 pierre
|
||||||
Asciitab now in fvision
|
Asciitab now in fvision
|
||||||
|
|
||||||
Revision 1.2 2001/08/05 12:23:00 peter
|
Revision 1.2 2001/08/05 12:23:00 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user