implemented ShowAll and hide hints for unused package units option

git-svn-id: trunk@4931 -
This commit is contained in:
mattias 2003-12-21 18:21:32 +00:00
parent b46f2be0d6
commit c8a8052bd5
10 changed files with 230 additions and 150 deletions

View File

@ -156,9 +156,8 @@ begin
TheProcess.CurrentDirectory:=ProjectDir; TheProcess.CurrentDirectory:=ProjectDir;
if OutputFilter<>nil then begin if OutputFilter<>nil then begin
OutputFilter.PrgSourceFilename:=ProjectFilename;
OutputFilter.Options:=[ofoSearchForFPCMessages,ofoExceptionOnError]; OutputFilter.Options:=[ofoSearchForFPCMessages,ofoExceptionOnError];
OutputFilter.Project:=AProject; OutputFilter.CompilerOptions:=AProject.CompilerOptions;
OutputFilter.Execute(TheProcess); OutputFilter.Execute(TheProcess);
end else begin end else begin
TheProcess.Execute; TheProcess.Execute;
@ -191,6 +190,9 @@ end.
{ {
$Log$ $Log$
Revision 1.43 2003/12/21 18:21:32 mattias
implemented ShowAll and hide hints for unused package units option
Revision 1.42 2003/12/20 01:20:52 mattias Revision 1.42 2003/12/20 01:20:52 mattias
splitted output directories for cross compilation splitted output directories for cross compilation

View File

@ -151,6 +151,7 @@ type
Command: string; Command: string;
ScanForFPCMessages: boolean; ScanForFPCMessages: boolean;
ScanForMakeMessages: boolean; ScanForMakeMessages: boolean;
ShowAllMessages: boolean;
procedure Clear; procedure Clear;
function IsEqual(Params: TCompilationTool): boolean; function IsEqual(Params: TCompilationTool): boolean;
procedure Assign(Src: TCompilationTool); procedure Assign(Src: TCompilationTool);
@ -248,7 +249,7 @@ type
fShowCompProc: Boolean; fShowCompProc: Boolean;
fShowCond: Boolean; fShowCond: Boolean;
fShowNothing: Boolean; fShowNothing: Boolean;
fShowHintsForUnusedProjectUnits: Boolean; fShowHintsForUnusedUnitsInMainSrc: Boolean;
fWriteFPCLogo: Boolean; fWriteFPCLogo: Boolean;
fStopAfterErrCount: integer; fStopAfterErrCount: integer;
@ -410,8 +411,8 @@ type
property ShowCompProc: Boolean read fShowCompProc write fShowCompProc; property ShowCompProc: Boolean read fShowCompProc write fShowCompProc;
property ShowCond: Boolean read fShowCond write fShowCond; property ShowCond: Boolean read fShowCond write fShowCond;
property ShowNothing: Boolean read fShowNothing write fShowNothing; property ShowNothing: Boolean read fShowNothing write fShowNothing;
property ShowHintsForUnusedProjectUnits: Boolean property ShowHintsForUnusedUnitsInMainSrc: Boolean
read fShowHintsForUnusedProjectUnits write fShowHintsForUnusedProjectUnits; read fShowHintsForUnusedUnitsInMainSrc write fShowHintsForUnusedUnitsInMainSrc;
property WriteFPCLogo: Boolean read fWriteFPCLogo write fWriteFPCLogo; property WriteFPCLogo: Boolean read fWriteFPCLogo write fWriteFPCLogo;
property StopAfterErrCount: integer property StopAfterErrCount: integer
read fStopAfterErrCount write fStopAfterErrCount; read fStopAfterErrCount write fStopAfterErrCount;
@ -612,7 +613,7 @@ type
chkCompiledProc: TCheckBox; chkCompiledProc: TCheckBox;
chkConditionals: TCheckBox; chkConditionals: TCheckBox;
chkNothing: TCheckBox; chkNothing: TCheckBox;
chkHintsForUnusedProjectUnits: TCheckBox; chkHintsForUnusedUnitsInMainSrc: TCheckBox;
chkFPCLogo: TCheckBox; chkFPCLogo: TCheckBox;
grpErrorCnt: TGroupBox; grpErrorCnt: TGroupBox;
@ -641,6 +642,7 @@ type
ExecuteBeforeCommandEdit: TEdit; ExecuteBeforeCommandEdit: TEdit;
ExecuteBeforeScanFPCCheckBox: TCheckBox; ExecuteBeforeScanFPCCheckBox: TCheckBox;
ExecuteBeforeScanMakeCheckBox: TCheckBox; ExecuteBeforeScanMakeCheckBox: TCheckBox;
ExecuteBeforeShowAllCheckBox: TCheckBox;
grpCompiler: TGroupBox; grpCompiler: TGroupBox;
edtCompiler: TEdit; edtCompiler: TEdit;
@ -652,6 +654,7 @@ type
ExecuteAfterCommandEdit: TEdit; ExecuteAfterCommandEdit: TEdit;
ExecuteAfterScanFPCCheckBox: TCheckBox; ExecuteAfterScanFPCCheckBox: TCheckBox;
ExecuteAfterScanMakeCheckBox: TCheckBox; ExecuteAfterScanMakeCheckBox: TCheckBox;
ExecuteAfterShowAllCheckBox: TCheckBox;
{ Buttons } { Buttons }
btnShowOptions: TButton; btnShowOptions: TButton;
@ -1255,7 +1258,7 @@ begin
ShowCompProc := XMLConfigFile.GetValue(p+'Verbosity/ShowCompProc/Value', false); ShowCompProc := XMLConfigFile.GetValue(p+'Verbosity/ShowCompProc/Value', false);
ShowCond := XMLConfigFile.GetValue(p+'Verbosity/ShowCond/Value', false); ShowCond := XMLConfigFile.GetValue(p+'Verbosity/ShowCond/Value', false);
ShowNothing := XMLConfigFile.GetValue(p+'Verbosity/ShowNothing/Value', false); ShowNothing := XMLConfigFile.GetValue(p+'Verbosity/ShowNothing/Value', false);
ShowHintsForUnusedProjectUnits := XMLConfigFile.GetValue(p+'Verbosity/ShowHintsForUnusedProjectUnits/Value', false); ShowHintsForUnusedUnitsInMainSrc := XMLConfigFile.GetValue(p+'Verbosity/ShowHintsForUnusedUnitsInMainSrc/Value', false);
WriteFPCLogo := XMLConfigFile.GetValue(p+'WriteFPCLogo/Value', true); WriteFPCLogo := XMLConfigFile.GetValue(p+'WriteFPCLogo/Value', true);
StopAfterErrCount := XMLConfigFile.GetValue(p+'ConfigFile/StopAfterErrCount/Value', 1); StopAfterErrCount := XMLConfigFile.GetValue(p+'ConfigFile/StopAfterErrCount/Value', 1);
@ -1390,7 +1393,7 @@ begin
XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowCompProc/Value', ShowCompProc,false); XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowCompProc/Value', ShowCompProc,false);
XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowCond/Value', ShowCond,false); XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowCond/Value', ShowCond,false);
XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowNothing/Value', ShowNothing,false); XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowNothing/Value', ShowNothing,false);
XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowHintsForUnusedProjectUnits/Value', ShowHintsForUnusedProjectUnits,false); XMLConfigFile.SetDeleteValue(p+'Verbosity/ShowHintsForUnusedUnitsInMainSrc/Value', ShowHintsForUnusedUnitsInMainSrc,false);
XMLConfigFile.SetDeleteValue(p+'WriteFPCLogo/Value', WriteFPCLogo,true); XMLConfigFile.SetDeleteValue(p+'WriteFPCLogo/Value', WriteFPCLogo,true);
XMLConfigFile.SetDeleteValue(p+'ConfigFile/StopAfterErrCount/Value', StopAfterErrCount,1); XMLConfigFile.SetDeleteValue(p+'ConfigFile/StopAfterErrCount/Value', StopAfterErrCount,1);
@ -2242,7 +2245,7 @@ begin
fShowCompProc := false; fShowCompProc := false;
fShowCond := false; fShowCond := false;
fShowNothing := false; fShowNothing := false;
fShowHintsForUnusedProjectUnits := false; fShowHintsForUnusedUnitsInMainSrc := false;
fWriteFPCLogo := true; fWriteFPCLogo := true;
fStopAfterErrCount := 1; fStopAfterErrCount := 1;
@ -2337,7 +2340,7 @@ begin
fShowCompProc := CompOpts.fShowCompProc; fShowCompProc := CompOpts.fShowCompProc;
fShowCond := CompOpts.fShowCond; fShowCond := CompOpts.fShowCond;
fShowNothing := CompOpts.fShowNothing; fShowNothing := CompOpts.fShowNothing;
fShowHintsForUnusedProjectUnits := CompOpts.fShowHintsForUnusedProjectUnits; fShowHintsForUnusedUnitsInMainSrc := CompOpts.fShowHintsForUnusedUnitsInMainSrc;
fWriteFPCLogo := CompOpts.fWriteFPCLogo; fWriteFPCLogo := CompOpts.fWriteFPCLogo;
fStopAfterErrCount := CompOpts.fStopAfterErrCount; fStopAfterErrCount := CompOpts.fStopAfterErrCount;
@ -2428,7 +2431,7 @@ begin
and (fShowCompProc = CompOpts.fShowCompProc) and (fShowCompProc = CompOpts.fShowCompProc)
and (fShowCond = CompOpts.fShowCond) and (fShowCond = CompOpts.fShowCond)
and (fShowNothing = CompOpts.fShowNothing) and (fShowNothing = CompOpts.fShowNothing)
and (fShowHintsForUnusedProjectUnits = CompOpts.fShowHintsForUnusedProjectUnits) and (fShowHintsForUnusedUnitsInMainSrc = CompOpts.fShowHintsForUnusedUnitsInMainSrc)
and (fWriteFPCLogo = CompOpts.fWriteFPCLogo) and (fWriteFPCLogo = CompOpts.fWriteFPCLogo)
// other // other
@ -2627,13 +2630,16 @@ begin
inc(y,Height+5); inc(y,Height+5);
end; end;
with ExecuteAfterScanFPCCheckBox do begin with ExecuteAfterScanFPCCheckBox do
SetBounds(x,y,w,Height); SetBounds(x,y,w div 2,Height);
with ExecuteAfterScanMakeCheckBox do begin
SetBounds(x+(w div 2),y,w div 2,Height);
inc(y,Height+5); inc(y,Height+5);
end; end;
with ExecuteAfterScanMakeCheckBox do with ExecuteAfterShowAllCheckBox do
SetBounds(x,y,w,Height); SetBounds(x,y,w div 2,Height);
end; end;
procedure TfrmCompilerOptions.ExecuteBeforeGroupBoxResize(Sender: TObject); procedure TfrmCompilerOptions.ExecuteBeforeGroupBoxResize(Sender: TObject);
@ -2654,13 +2660,16 @@ begin
inc(y,Height+5); inc(y,Height+5);
end; end;
with ExecuteBeforeScanFPCCheckBox do begin with ExecuteBeforeScanFPCCheckBox do
SetBounds(x,y,w,Height); SetBounds(x,y,w div 2,Height);
with ExecuteBeforeScanMakeCheckBox do begin
SetBounds(x+(w div 2),y,w div 2,Height);
inc(y,Height+5); inc(y,Height+5);
end; end;
with ExecuteBeforeScanMakeCheckBox do with ExecuteBeforeShowAllCheckBox do
SetBounds(x,y,w,Height); SetBounds(x,y,w div 2,Height);
end; end;
procedure TfrmCompilerOptions.FileBrowseBtnClick(Sender: TObject); procedure TfrmCompilerOptions.FileBrowseBtnClick(Sender: TObject);
@ -2864,8 +2873,8 @@ begin
chkCompiledProc.Checked := Options.ShowCompProc; chkCompiledProc.Checked := Options.ShowCompProc;
chkConditionals.Checked := Options.ShowCond; chkConditionals.Checked := Options.ShowCond;
chkNothing.Checked := Options.ShowNothing; chkNothing.Checked := Options.ShowNothing;
chkHintsForUnusedProjectUnits.Checked := chkHintsForUnusedUnitsInMainSrc.Checked :=
Options.ShowHintsForUnusedProjectUnits; Options.ShowHintsForUnusedUnitsInMainSrc;
chkFPCLogo.Checked := Options.WriteFPCLogo; chkFPCLogo.Checked := Options.WriteFPCLogo;
@ -2886,11 +2895,13 @@ begin
ExecuteBeforeScanFPCCheckBox.Checked:=Options.ExecuteBefore.ScanForFPCMessages; ExecuteBeforeScanFPCCheckBox.Checked:=Options.ExecuteBefore.ScanForFPCMessages;
ExecuteBeforeScanMakeCheckBox.Checked:= ExecuteBeforeScanMakeCheckBox.Checked:=
Options.ExecuteBefore.ScanForMakeMessages; Options.ExecuteBefore.ScanForMakeMessages;
ExecuteBeforeShowAllCheckBox.Checked:=Options.ExecuteBefore.ShowAllMessages;
edtCompiler.Text := Options.CompilerPath; edtCompiler.Text := Options.CompilerPath;
chkSkipCompiler.Checked := Options.SkipCompiler; chkSkipCompiler.Checked := Options.SkipCompiler;
ExecuteAfterCommandEdit.Text:=Options.ExecuteAfter.Command; ExecuteAfterCommandEdit.Text:=Options.ExecuteAfter.Command;
ExecuteAfterScanFPCCheckBox.Checked:=Options.ExecuteAfter.ScanForFPCMessages; ExecuteAfterScanFPCCheckBox.Checked:=Options.ExecuteAfter.ScanForFPCMessages;
ExecuteAfterScanMakeCheckBox.Checked:=Options.ExecuteAfter.ScanForMakeMessages; ExecuteAfterScanMakeCheckBox.Checked:=Options.ExecuteAfter.ScanForMakeMessages;
ExecuteAfterShowAllCheckBox.Checked:=Options.ExecuteAfter.ShowAllMessages;
end; end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
@ -3032,7 +3043,8 @@ begin
Options.ShowCompProc := chkCompiledProc.Checked; Options.ShowCompProc := chkCompiledProc.Checked;
Options.ShowCond := chkConditionals.Checked; Options.ShowCond := chkConditionals.Checked;
Options.ShowNothing := chkNothing.Checked; Options.ShowNothing := chkNothing.Checked;
Options.ShowHintsForUnusedProjectUnits := chkHintsForUnusedProjectUnits.Checked; Options.ShowHintsForUnusedUnitsInMainSrc :=
chkHintsForUnusedUnitsInMainSrc.Checked;
Options.WriteFPCLogo := chkFPCLogo.Checked; Options.WriteFPCLogo := chkFPCLogo.Checked;
@ -3056,6 +3068,7 @@ begin
ExecuteBeforeScanFPCCheckBox.Checked; ExecuteBeforeScanFPCCheckBox.Checked;
Options.ExecuteBefore.ScanForMakeMessages := Options.ExecuteBefore.ScanForMakeMessages :=
ExecuteBeforeScanMakeCheckBox.Checked; ExecuteBeforeScanMakeCheckBox.Checked;
Options.ExecuteBefore.ShowAllMessages:=ExecuteBeforeShowAllCheckBox.Checked;
Options.CompilerPath := edtCompiler.Text; Options.CompilerPath := edtCompiler.Text;
Options.SkipCompiler := chkSkipCompiler.Checked; Options.SkipCompiler := chkSkipCompiler.Checked;
Options.ExecuteAfter.Command := ExecuteAfterCommandEdit.Text; Options.ExecuteAfter.Command := ExecuteAfterCommandEdit.Text;
@ -3063,6 +3076,7 @@ begin
ExecuteAfterScanFPCCheckBox.Checked; ExecuteAfterScanFPCCheckBox.Checked;
Options.ExecuteAfter.ScanForMakeMessages := Options.ExecuteAfter.ScanForMakeMessages :=
ExecuteAfterScanMakeCheckBox.Checked; ExecuteAfterScanMakeCheckBox.Checked;
Options.ExecuteAfter.ShowAllMessages:=ExecuteAfterShowAllCheckBox.Checked;
// check for change and save // check for change and save
@ -4068,8 +4082,8 @@ begin
Width := chkDebugInfo.Width; Width := chkDebugInfo.Width;
end; end;
chkHintsForUnusedProjectUnits := TCheckBox.Create(Self); chkHintsForUnusedUnitsInMainSrc := TCheckBox.Create(Self);
with chkHintsForUnusedProjectUnits do with chkHintsForUnusedUnitsInMainSrc do
begin begin
Parent := grpVerbosity; Parent := grpVerbosity;
Caption := dlgHintsUnused; Caption := dlgHintsUnused;
@ -4259,6 +4273,13 @@ begin
Caption:=lisCOScanForMakeMessages; Caption:=lisCOScanForMakeMessages;
end; end;
ExecuteBeforeShowAllCheckBox:=TCheckBox.Create(Self);
with ExecuteBeforeShowAllCheckBox do begin
Name:='ExecuteBeforeShowAllCheckBox';
Parent:=ExecuteBeforeGroupBox;
Caption:=lisCOShowAllMessages;
end;
{------------------------------------------------------------} {------------------------------------------------------------}
grpCompiler := TGroupBox.Create(Self); grpCompiler := TGroupBox.Create(Self);
@ -4345,6 +4366,13 @@ begin
Caption:=lisCOScanForMakeMessages; Caption:=lisCOScanForMakeMessages;
end; end;
ExecuteAfterShowAllCheckBox:=TCheckBox.Create(Self);
with ExecuteAfterShowAllCheckBox do begin
Name:='ExecuteAfterShowAllCheckBox';
Parent:=ExecuteAfterGroupBox;
Caption:=lisCOShowAllMessages;
end;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -4996,6 +5024,7 @@ begin
Command:=''; Command:='';
ScanForFPCMessages:=false; ScanForFPCMessages:=false;
ScanForMakeMessages:=false; ScanForMakeMessages:=false;
ShowAllMessages:=false;
end; end;
function TCompilationTool.IsEqual(Params: TCompilationTool function TCompilationTool.IsEqual(Params: TCompilationTool
@ -5004,6 +5033,7 @@ begin
Result:= (Command=Params.Command) Result:= (Command=Params.Command)
and ScanForFPCMessages=Params.ScanForFPCMessages and ScanForFPCMessages=Params.ScanForFPCMessages
and ScanForMakeMessages=Params.ScanForMakeMessages and ScanForMakeMessages=Params.ScanForMakeMessages
and ShowAllMessages=Params.ShowAllMessages
; ;
end; end;
@ -5012,6 +5042,7 @@ begin
Command:=Src.Command; Command:=Src.Command;
ScanForFPCMessages:=Src.ScanForFPCMessages; ScanForFPCMessages:=Src.ScanForFPCMessages;
ScanForMakeMessages:=Src.ScanForMakeMessages; ScanForMakeMessages:=Src.ScanForMakeMessages;
ShowAllMessages:=Src.ShowAllMessages;
end; end;
procedure TCompilationTool.LoadFromXMLConfig(XMLConfig: TXMLConfig; procedure TCompilationTool.LoadFromXMLConfig(XMLConfig: TXMLConfig;
@ -5021,6 +5052,7 @@ begin
DoSwitchPathDelims); DoSwitchPathDelims);
ScanForFPCMessages:=XMLConfig.GetValue(Path+'ScanForFPCMsgs/Value',false); ScanForFPCMessages:=XMLConfig.GetValue(Path+'ScanForFPCMsgs/Value',false);
ScanForMakeMessages:=XMLConfig.GetValue(Path+'ScanForMakeMsgs/Value',false); ScanForMakeMessages:=XMLConfig.GetValue(Path+'ScanForMakeMsgs/Value',false);
ShowAllMessages:=XMLConfig.GetValue(Path+'ShowAllMessages/Value',false);
end; end;
procedure TCompilationTool.SaveToXMLConfig(XMLConfig: TXMLConfig; procedure TCompilationTool.SaveToXMLConfig(XMLConfig: TXMLConfig;
@ -5031,6 +5063,8 @@ begin
ScanForFPCMessages,false); ScanForFPCMessages,false);
XMLConfig.SetDeleteValue(Path+'ScanForMakeMsgs/Value', XMLConfig.SetDeleteValue(Path+'ScanForMakeMsgs/Value',
ScanForMakeMessages,false); ScanForMakeMessages,false);
XMLConfig.SetDeleteValue(Path+'ShowAllMessages/Value',
ShowAllMessages,false);
end; end;
{ TGlobalCompilerOptions } { TGlobalCompilerOptions }

View File

@ -124,6 +124,8 @@ begin
until Result<>mrRetry; until Result<>mrRetry;
if (ACodeBuffer=nil) and (lbfCreateClearOnError in Flags) then begin if (ACodeBuffer=nil) and (lbfCreateClearOnError in Flags) then begin
ACodeBuffer:=CodeToolBoss.CreateFile(AFilename); ACodeBuffer:=CodeToolBoss.CreateFile(AFilename);
if ACodeBuffer<>nil then
Result:=mrOk;
end; end;
end; end;

View File

@ -41,7 +41,7 @@ uses
{$ENDIF} {$ENDIF}
Classes, SysUtils, LCLType, Controls, Forms, Buttons, StdCtrls, ComCtrls, Classes, SysUtils, LCLType, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Dialogs, ExtCtrls, LResources, Laz_XMLCfg, ExtToolEditDlg, Process, Dialogs, ExtCtrls, LResources, Laz_XMLCfg, ExtToolEditDlg, Process,
KeyMapping, TransferMacros, IDEProcs, OutputFilter, FileCtrl, KeyMapping, TransferMacros, IDEProcs, CompilerOptions, OutputFilter, FileCtrl,
LazarusIDEStrConsts; LazarusIDEStrConsts;
const const
@ -79,7 +79,8 @@ type
Macros: TTransferMacroList): TModalResult; Macros: TTransferMacroList): TModalResult;
function Run(ExtTool: TExternalToolOptions; function Run(ExtTool: TExternalToolOptions;
Macros: TTransferMacroList; Macros: TTransferMacroList;
TheOutputFilter: TOutputFilter): TModalResult; TheOutputFilter: TOutputFilter;
CompilerOptions: TBaseCompilerOptions): TModalResult;
function Run(Index: integer; Macros: TTransferMacroList): TModalResult; function Run(Index: integer; Macros: TTransferMacroList): TModalResult;
function Save(XMLConfig: TXMLConfig; const Path: string): TModalResult; function Save(XMLConfig: TXMLConfig; const Path: string): TModalResult;
procedure SaveShortCuts(KeyCommandRelationList: TKeyCommandRelationList); procedure SaveShortCuts(KeyCommandRelationList: TKeyCommandRelationList);
@ -255,7 +256,7 @@ end;
function TExternalToolList.Run(ExtTool: TExternalToolOptions; function TExternalToolList.Run(ExtTool: TExternalToolOptions;
Macros: TTransferMacroList): TModalResult; Macros: TTransferMacroList): TModalResult;
begin begin
Result:=Run(ExtTool,Macros,nil); Result:=Run(ExtTool,Macros,nil,nil);
end; end;
function TExternalToolList.Run(Index: integer; function TExternalToolList.Run(Index: integer;
@ -267,7 +268,8 @@ begin
end; end;
function TExternalToolList.Run(ExtTool: TExternalToolOptions; function TExternalToolList.Run(ExtTool: TExternalToolOptions;
Macros: TTransferMacroList; TheOutputFilter: TOutputFilter): TModalResult; Macros: TTransferMacroList; TheOutputFilter: TOutputFilter;
CompilerOptions: TBaseCompilerOptions): TModalResult;
var WorkingDir, Filename, Params, CmdLine, Title: string; var WorkingDir, Filename, Params, CmdLine, Title: string;
TheProcess: TProcess; TheProcess: TProcess;
Abort, ErrorOccurred: boolean; Abort, ErrorOccurred: boolean;
@ -309,7 +311,7 @@ begin
if TheOutputFilter<>nil then begin if TheOutputFilter<>nil then begin
ErrorOccurred:=false; ErrorOccurred:=false;
try try
TheOutputFilter.PrgSourceFilename:=''; TheOutputFilter.CompilerOptions:=CompilerOptions;
TheOutputFilter.Options:=[ofoExceptionOnError, TheOutputFilter.Options:=[ofoExceptionOnError,
ofoMakeFilenamesAbsolute]; ofoMakeFilenamesAbsolute];
if ExtTool.ScanOutputForFPCMessages then if ExtTool.ScanOutputForFPCMessages then
@ -318,6 +320,8 @@ begin
if ExtTool.ScanOutputForMakeMessages then if ExtTool.ScanOutputForMakeMessages then
TheOutputFilter.Options:=TheOutputFilter.Options TheOutputFilter.Options:=TheOutputFilter.Options
+[ofoSearchForMakeMessages]; +[ofoSearchForMakeMessages];
if ExtTool.ShowAllOutput then
TheOutputFilter.Options:=TheOutputFilter.Options+[ofoShowAll];
try try
Result:=mrCancel; Result:=mrCancel;
try try

View File

@ -66,9 +66,11 @@ type
fScanOutputForFPCMessages: boolean; fScanOutputForFPCMessages: boolean;
fScanOutputForMakeMessages: boolean; fScanOutputForMakeMessages: boolean;
fShift: TShiftState; fShift: TShiftState;
FShowAllOutput: boolean;
fTitle: string; fTitle: string;
fWorkingDirectory: string; fWorkingDirectory: string;
procedure SetScanOutput(const AValue: boolean); procedure SetScanOutput(const AValue: boolean);
procedure SetShowAllOutput(const AValue: boolean);
public public
procedure Assign(Source: TExternalToolOptions); procedure Assign(Source: TExternalToolOptions);
constructor Create; constructor Create;
@ -93,6 +95,7 @@ type
read fWorkingDirectory write fWorkingDirectory; read fWorkingDirectory write fWorkingDirectory;
property EnvironmentOverrides: TStringList read FEnvironmentOverrides; property EnvironmentOverrides: TStringList read FEnvironmentOverrides;
property ScanOutput: boolean read FScanOutput write SetScanOutput; property ScanOutput: boolean read FScanOutput write SetScanOutput;
property ShowAllOutput: boolean read FShowAllOutput write SetShowAllOutput;
end; end;
{ {
@ -182,6 +185,12 @@ begin
FScanOutput:=AValue; FScanOutput:=AValue;
end; end;
procedure TExternalToolOptions.SetShowAllOutput(const AValue: boolean);
begin
if FShowAllOutput=AValue then exit;
FShowAllOutput:=AValue;
end;
procedure TExternalToolOptions.Assign(Source: TExternalToolOptions); procedure TExternalToolOptions.Assign(Source: TExternalToolOptions);
begin begin
if Source=Self then exit; if Source=Self then exit;
@ -196,6 +205,8 @@ begin
fShift:=Source.fShift; fShift:=Source.fShift;
fScanOutputForFPCMessages:=Source.fScanOutputForFPCMessages; fScanOutputForFPCMessages:=Source.fScanOutputForFPCMessages;
fScanOutputForMakeMessages:=Source.fScanOutputForMakeMessages; fScanOutputForMakeMessages:=Source.fScanOutputForMakeMessages;
FScanOutput:=Source.FScanOutput;
FShowAllOutput:=Source.FShowAllOutput;
end; end;
end; end;
@ -222,23 +233,25 @@ begin
fShift:=[]; fShift:=[];
fScanOutputForFPCMessages:=false; fScanOutputForFPCMessages:=false;
fScanOutputForMakeMessages:=false; fScanOutputForMakeMessages:=false;
FScanOutput:=false;
FShowAllOutput:=false;
end; end;
function TExternalToolOptions.Load(XMLConfig: TXMLConfig; function TExternalToolOptions.Load(XMLConfig: TXMLConfig;
const Path: string): TModalResult; const Path: string): TModalResult;
begin begin
Clear; Clear;
fTitle:=XMLConfig.GetValue(Path+'Title/Value',fTitle); fTitle:=XMLConfig.GetValue(Path+'Title/Value','');
fFilename:=XMLConfig.GetValue(Path+'Filename/Value',fFilename); fFilename:=XMLConfig.GetValue(Path+'Filename/Value','');
fCmdLineParams:=XMLConfig.GetValue(Path+'CmdLineParams/Value',fCmdLineParams); fCmdLineParams:=XMLConfig.GetValue(Path+'CmdLineParams/Value','');
fWorkingDirectory:=XMLConfig.GetValue( fWorkingDirectory:=XMLConfig.GetValue(Path+'WorkingDirectory/Value','');
Path+'WorkingDirectory/Value',fWorkingDirectory);
fScanOutputForFPCMessages:=XMLConfig.GetValue( fScanOutputForFPCMessages:=XMLConfig.GetValue(
Path+'ScanOutputForFPCMessages/Value',fScanOutputForFPCMessages); Path+'ScanOutputForFPCMessages/Value',false);
fScanOutputForMakeMessages:=XMLConfig.GetValue( fScanOutputForMakeMessages:=XMLConfig.GetValue(
Path+'ScanOutputForMakeMessages/Value',fScanOutputForMakeMessages); Path+'ScanOutputForMakeMessages/Value',false);
FShowAllOutput:=XMLConfig.GetValue(Path+'ShowAllOutput/Value',false);
LoadStringList(XMLConfig,FEnvironmentOverrides,Path+'EnvironmentOverrides/'); LoadStringList(XMLConfig,FEnvironmentOverrides,Path+'EnvironmentOverrides/');
// key and shift are saved with the keymapping in the editoroptions // key and shift are loaded with the keymapping in the editoroptions
Result:=mrOk; Result:=mrOk;
end; end;
@ -246,14 +259,17 @@ function TExternalToolOptions.Save(XMLConfig: TXMLConfig;
const Path: string): TModalResult; const Path: string): TModalResult;
begin begin
XMLConfig.SetValue(Path+'Format/Version',ExternalToolOptionsFormat); XMLConfig.SetValue(Path+'Format/Version',ExternalToolOptionsFormat);
XMLConfig.SetValue(Path+'Title/Value',fTitle); XMLConfig.SetDeleteValue(Path+'Title/Value',fTitle,'');
XMLConfig.SetValue(Path+'Filename/Value',fFilename); XMLConfig.SetDeleteValue(Path+'Filename/Value',fFilename,'');
XMLConfig.SetValue(Path+'CmdLineParams/Value',fCmdLineParams); XMLConfig.SetDeleteValue(Path+'CmdLineParams/Value',fCmdLineParams,'');
XMLConfig.SetValue(Path+'WorkingDirectory/Value',fWorkingDirectory); XMLConfig.SetDeleteValue(Path+'WorkingDirectory/Value',fWorkingDirectory,'');
XMLConfig.SetValue( XMLConfig.SetDeleteValue(
Path+'ScanOutputForFPCMessages/Value',fScanOutputForFPCMessages); Path+'ScanOutputForFPCMessages/Value',fScanOutputForFPCMessages,
XMLConfig.SetValue( false);
Path+'ScanOutputForMakeMessages/Value',fScanOutputForMakeMessages); XMLConfig.SetDeleteValue(
Path+'ScanOutputForMakeMessages/Value',fScanOutputForMakeMessages,
false);
XMLConfig.SetDeleteValue(Path+'ShowAllOutput/Value',FShowAllOutput,false);
SaveStringList(XMLConfig,FEnvironmentOverrides,Path+'EnvironmentOverrides/'); SaveStringList(XMLConfig,FEnvironmentOverrides,Path+'EnvironmentOverrides/');
// key and shift are saved with the keymapping in the editoroptions // key and shift are saved with the keymapping in the editoroptions
Result:=mrOk; Result:=mrOk;
@ -271,7 +287,8 @@ end;
function TExternalToolOptions.NeedsOutputFilter: boolean; function TExternalToolOptions.NeedsOutputFilter: boolean;
begin begin
Result:=ScanOutput or ScanOutputForFPCMessages or ScanOutputForMakeMessages; Result:=ScanOutput or ScanOutputForFPCMessages or ScanOutputForMakeMessages
or ShowAllOutput;
end; end;

View File

@ -869,7 +869,7 @@ resourcestring
dlgShowConditionals = 'Show Conditionals'; dlgShowConditionals = 'Show Conditionals';
dlgShowNothing = 'Show Nothing (only errors)'; dlgShowNothing = 'Show Nothing (only errors)';
dlgWriteFPCLogo = 'Write an FPC Logo'; dlgWriteFPCLogo = 'Write an FPC Logo';
dlgHintsUnused = 'Show Hints for unused project units'; dlgHintsUnused = 'Show Hints for unused units in main source';
dlgConfigFiles = 'Config Files:'; dlgConfigFiles = 'Config Files:';
dlgUseFpcCfg = 'Use Compiler Config File (fpc.cfg)'; dlgUseFpcCfg = 'Use Compiler Config File (fpc.cfg)';
dlgUseAdditionalConfig = 'Use Additional Compiler Config File'; dlgUseAdditionalConfig = 'Use Additional Compiler Config File';
@ -886,6 +886,7 @@ resourcestring
lisCOCommand = 'Command:'; lisCOCommand = 'Command:';
lisCOScanForFPCMessages = 'Scan for FPC messages'; lisCOScanForFPCMessages = 'Scan for FPC messages';
lisCOScanForMakeMessages = 'Scan for Make messages'; lisCOScanForMakeMessages = 'Scan for Make messages';
lisCOShowAllMessages = 'Show all messages';
dlgUnitOutp = 'Unit output directory:'; dlgUnitOutp = 'Unit output directory:';
dlgLCLWidgetType = 'LCL Widget Type'; dlgLCLWidgetType = 'LCL Widget Type';
lisCOdefault = 'default (%s)'; lisCOdefault = 'default (%s)';

View File

@ -6116,6 +6116,7 @@ begin
ExtTool.ScanOutputForFPCMessages:=Tool.ScanForFPCMessages; ExtTool.ScanOutputForFPCMessages:=Tool.ScanForFPCMessages;
ExtTool.ScanOutputForMakeMessages:=Tool.ScanForMakeMessages; ExtTool.ScanOutputForMakeMessages:=Tool.ScanForMakeMessages;
ExtTool.ScanOutput:=true; ExtTool.ScanOutput:=true;
ExtTool.ShowAllOutput:=Tool.ShowAllMessages;
ExtTool.Title:=ToolTitle; ExtTool.Title:=ToolTitle;
ExtTool.WorkingDirectory:=WorkingDir; ExtTool.WorkingDirectory:=WorkingDir;
ExtTool.CmdLineParams:=Params; ExtTool.CmdLineParams:=Params;
@ -9705,7 +9706,6 @@ procedure TMainIDE.OnExtToolNeedsOutputFilter(var OutputFilter: TOutputFilter;
var Abort: boolean); var Abort: boolean);
begin begin
OutputFilter:=TheOutputFilter; OutputFilter:=TheOutputFilter;
OutputFilter.Project:=Project1;
if ToolStatus<>itNone then begin if ToolStatus<>itNone then begin
Abort:=true; Abort:=true;
exit; exit;
@ -10250,6 +10250,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.685 2003/12/21 18:21:32 mattias
implemented ShowAll and hide hints for unused package units option
Revision 1.684 2003/12/21 18:14:29 micha Revision 1.684 2003/12/21 18:14:29 micha
fix openfile popupmenu to appear at correct position fix openfile popupmenu to appear at correct position

View File

@ -37,6 +37,7 @@ type
TOnGetIncludePath = function(const Directory: string): string of object; TOnGetIncludePath = function(const Directory: string): string of object;
TOuputFilterOption = ( TOuputFilterOption = (
ofoShowAll, // don't filter
ofoSearchForFPCMessages, // scan for freepascal compiler messages ofoSearchForFPCMessages, // scan for freepascal compiler messages
ofoSearchForMakeMessages,// scan for make/gmake messages ofoSearchForMakeMessages,// scan for make/gmake messages
ofoExceptionOnError, // raise exception on panic, fatal errors ofoExceptionOnError, // raise exception on panic, fatal errors
@ -50,6 +51,7 @@ type
TOutputFilter = class TOutputFilter = class
private private
FCompilerOptions: TBaseCompilerOptions;
fCurrentDirectory: string; fCurrentDirectory: string;
fFilteredOutput: TStringList; fFilteredOutput: TStringList;
fOnReadLine: TOnOutputString; fOnReadLine: TOnOutputString;
@ -61,8 +63,6 @@ type
fOnGetIncludePath: TOnGetIncludePath; fOnGetIncludePath: TOnGetIncludePath;
fOnOutputString: TOnOutputString; fOnOutputString: TOnOutputString;
fOptions: TOuputFilterOptions; fOptions: TOuputFilterOptions;
fProject: TProject;
fPrgSourceFilename: string;
FStopExecute: boolean; FStopExecute: boolean;
procedure DoAddFilteredLine(const s: string); procedure DoAddFilteredLine(const s: string);
procedure DoAddLastLinkerMessages(SkipLastLine: boolean); procedure DoAddLastLinkerMessages(SkipLastLine: boolean);
@ -79,8 +79,8 @@ type
procedure Clear; procedure Clear;
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
function IsHintForUnusedProjectUnit(const OutputLine, function IsHintForUnusedUnit(const OutputLine,
ProgramSrcFile: string): boolean; MainSrcFile: string): boolean;
function IsParsing: boolean; function IsParsing: boolean;
procedure ReadLine(const s: string; DontFilterLine: boolean); procedure ReadLine(const s: string; DontFilterLine: boolean);
function ReadFPCompilerLine(const s: string): boolean; function ReadFPCompilerLine(const s: string): boolean;
@ -92,15 +92,14 @@ type
property Lines: TStringList read fOutput; property Lines: TStringList read fOutput;
property LastErrorType: TErrorType read fLastErrorType; property LastErrorType: TErrorType read fLastErrorType;
property LastMessageType: TOutputMessageType read fLastMessageType; property LastMessageType: TOutputMessageType read fLastMessageType;
property PrgSourceFilename: string
read fPrgSourceFilename write fPrgSourceFilename;
property OnGetIncludePath: TOnGetIncludePath property OnGetIncludePath: TOnGetIncludePath
read fOnGetIncludePath write fOnGetIncludePath; read fOnGetIncludePath write fOnGetIncludePath;
property OnReadLine: TOnOutputString read fOnReadLine write fOnReadLine; property OnReadLine: TOnOutputString read fOnReadLine write fOnReadLine;
property OnOutputString: TOnOutputString property OnOutputString: TOnOutputString
read fOnOutputString write fOnOutputString; read fOnOutputString write fOnOutputString;
property Options: TOuputFilterOptions read fOptions write fOptions; property Options: TOuputFilterOptions read fOptions write fOptions;
property Project: TProject read fProject write fProject; property CompilerOptions: TBaseCompilerOptions read FCompilerOptions
write FCompilerOptions;
end; end;
EOutputFilterError = class(Exception) EOutputFilterError = class(Exception)
@ -208,8 +207,10 @@ begin
fLastMessageType:=omtNone; fLastMessageType:=omtNone;
fLastErrorType:=etNone; fLastErrorType:=etNone;
fOutput.Add(s); fOutput.Add(s);
if Assigned(OnReadLine) then OnReadLine(s,fCurrentDirectory); if Assigned(OnReadLine) then
if DontFilterLine then begin OnReadLine(s,fCurrentDirectory);
if DontFilterLine or (ofoShowAll in Options) then begin
DoAddFilteredLine(s); DoAddFilteredLine(s);
end else if (ofoSearchForFPCMessages in Options) and (ReadFPCompilerLine(s)) end else if (ofoSearchForFPCMessages in Options) and (ReadFPCompilerLine(s))
then begin then begin
@ -239,6 +240,7 @@ var i, j, FilenameEndPos: integer;
CurCompHistory: string; CurCompHistory: string;
CurFilenameLen: Integer; CurFilenameLen: Integer;
CurCompHistLen: Integer; CurCompHistLen: Integer;
MainSrcFilename: String;
function CheckForCompilingState: boolean; function CheckForCompilingState: boolean;
var var
@ -387,31 +389,34 @@ begin
fLastMessageType:=omtFPC; fLastMessageType:=omtFPC;
SkipMessage:=true; SkipMessage:=true;
if Project<>nil then begin if CompilerOptions<>nil then begin
case MsgType of case MsgType of
etHint: etHint:
begin begin
SkipMessage:=not (Project.CompilerOptions.ShowHints SkipMessage:=not (CompilerOptions.ShowHints
or Project.CompilerOptions.ShowAll); or CompilerOptions.ShowAll);
if (not SkipMessage) if (not SkipMessage)
and (not Project.CompilerOptions.ShowAll) and (not CompilerOptions.ShowAll)
and (not Project.CompilerOptions.ShowHintsForUnusedProjectUnits) and (not CompilerOptions.ShowHintsForUnusedUnitsInMainSrc) then
and (PrgSourceFilename<>'') begin
and (IsHintForUnusedProjectUnit(s,PrgSourceFilename)) then MainSrcFilename:=CompilerOptions.GetDefaultMainSourceFileName;
if (MainSrcFilename<>'')
and (IsHintForUnusedUnit(s,MainSrcFilename)) then
SkipMessage:=true; SkipMessage:=true;
end; end;
end;
etNote: etNote:
begin begin
SkipMessage:=not (Project.CompilerOptions.ShowNotes SkipMessage:=not (CompilerOptions.ShowNotes
or Project.CompilerOptions.ShowAll); or CompilerOptions.ShowAll);
end; end;
etError: etError:
begin begin
SkipMessage:=not (Project.CompilerOptions.ShowErrors SkipMessage:=not (CompilerOptions.ShowErrors
or Project.CompilerOptions.ShowAll); or CompilerOptions.ShowAll);
if copy(s,j+2,length(s)-j-1)='Error while linking' then begin if copy(s,j+2,length(s)-j-1)='Error while linking' then begin
DoAddLastLinkerMessages(true); DoAddLastLinkerMessages(true);
end end
@ -422,8 +427,8 @@ begin
etWarning: etWarning:
begin begin
SkipMessage:=not (Project.CompilerOptions.ShowWarn SkipMessage:=not (CompilerOptions.ShowWarn
or Project.CompilerOptions.ShowAll); or CompilerOptions.ShowAll);
end; end;
etPanic, etFatal: etPanic, etFatal:
@ -569,8 +574,8 @@ begin
end; end;
end; end;
function TOutputFilter.IsHintForUnusedProjectUnit(const OutputLine, function TOutputFilter.IsHintForUnusedUnit(const OutputLine,
ProgramSrcFile: string): boolean; MainSrcFile: string): boolean;
{ recognizes hints of the form { recognizes hints of the form
mainprogram.pp(5,35) Hint: Unit UNUSEDUNIT not used in mainprogram mainprogram.pp(5,35) Hint: Unit UNUSEDUNIT not used in mainprogram
@ -578,7 +583,7 @@ function TOutputFilter.IsHintForUnusedProjectUnit(const OutputLine,
var Filename: string; var Filename: string;
begin begin
Result:=false; Result:=false;
Filename:=ExtractFilename(ProgramSrcFile); Filename:=ExtractFilename(MainSrcFile);
if CompareFilenames(Filename,copy(OutputLine,1,length(Filename)))<>0 then if CompareFilenames(Filename,copy(OutputLine,1,length(Filename)))<>0 then
exit; exit;
if (pos(') Hint: Unit ',OutputLine)<>0) if (pos(') Hint: Unit ',OutputLine)<>0)

View File

@ -231,6 +231,7 @@ const
LM_MOUSEENTER = LM_MOUSEFIRST2 +6; LM_MOUSEENTER = LM_MOUSEFIRST2 +6;
LM_MOUSELEAVE = LM_MOUSEFIRST2 +7; LM_MOUSELEAVE = LM_MOUSEFIRST2 +7;
LM_MOUSELAST2 = LM_MOUSELEAVE; LM_MOUSELAST2 = LM_MOUSELEAVE;
// for triple and quad clicks see below
LM_GRABFOCUS = LM_USER+79; LM_GRABFOCUS = LM_USER+79;
@ -359,12 +360,11 @@ const
LM_MBUTTONDBLCLK = $0209; LM_MBUTTONDBLCLK = $0209;
LM_MOUSEWHEEL = $020A; LM_MOUSEWHEEL = $020A;
LM_MOUSELAST = $020A; LM_MOUSELAST = $020A;
// for triple and quad clicks see below
LM_PARENTNOTIFY = $0210;
LM_CAPTURECHANGED = $0215; LM_CAPTURECHANGED = $0215;
LM_DROPFILES = $0233; LM_DROPFILES = $0233;
LM_PARENTNOTIFY = $0210;
//------------- //-------------
// End of Windows Compatability and messages // End of Windows Compatability and messages
@ -1092,6 +1092,9 @@ end.
{ {
$Log$ $Log$
Revision 1.57 2003/12/21 18:21:32 mattias
implemented ShowAll and hide hints for unused package units option
Revision 1.56 2003/11/15 13:07:09 mattias Revision 1.56 2003/11/15 13:07:09 mattias
added ambigious unit check for IDE added ambigious unit check for IDE

View File

@ -2117,7 +2117,7 @@ begin
// compile package // compile package
Result:=EnvironmentOptions.ExternalTools.Run(PkgCompileTool, Result:=EnvironmentOptions.ExternalTools.Run(PkgCompileTool,
MainIDE.MacroList); MainIDE.MacroList,nil,APackage.CompilerOptions);
if Result<>mrOk then exit; if Result<>mrOk then exit;
// compilation succeded -> write state file // compilation succeded -> write state file
Result:=DoSavePackageCompiledState(APackage, Result:=DoSavePackageCompiledState(APackage,
@ -2182,7 +2182,10 @@ begin
// delete ambigious files // delete ambigious files
Result:=MainIDE.DoDeleteAmbigiousFiles(SrcFilename); Result:=MainIDE.DoDeleteAmbigiousFiles(SrcFilename);
if Result=mrAbort then exit; if Result=mrAbort then begin
writeln('TPkgManager.DoSavePackageMainSource DoDeleteAmbigiousFiles failed');
exit;
end;
// collect unitnames // collect unitnames
e:=EndOfLine; e:=EndOfLine;
@ -2258,7 +2261,10 @@ begin
// check if old code is already uptodate // check if old code is already uptodate
Result:=LoadCodeBuffer(CodeBuffer,SrcFilename,[lbfQuiet,lbfCheckIfText, Result:=LoadCodeBuffer(CodeBuffer,SrcFilename,[lbfQuiet,lbfCheckIfText,
lbfUpdateFromDisk,lbfCreateClearOnError]); lbfUpdateFromDisk,lbfCreateClearOnError]);
if Result<>mrOk then exit; if Result<>mrOk then begin
writeln('TPkgManager.DoSavePackageMainSource LoadCodeBuffer ',SrcFilename,' failed');
exit;
end;
OldSrc:=CodeToolBoss.ExtractCodeWithoutComments(CodeBuffer); OldSrc:=CodeToolBoss.ExtractCodeWithoutComments(CodeBuffer);
if CompareTextIgnoringSpace(OldSrc,Src,true)=0 then begin if CompareTextIgnoringSpace(OldSrc,Src,true)=0 then begin
Result:=mrOk; Result:=mrOk;
@ -2268,7 +2274,10 @@ begin
// save source // save source
Result:=MainIDE.DoSaveStringToFile(SrcFilename, Src, Result:=MainIDE.DoSaveStringToFile(SrcFilename, Src,
lisPkgMangpackageMainSourceFile); lisPkgMangpackageMainSourceFile);
if Result<>mrOk then exit; if Result<>mrOk then begin
writeln('TPkgManager.DoSavePackageMainSource DoSaveStringToFile ',SrcFilename,' failed');
exit;
end;
Result:=mrOk; Result:=mrOk;
end; end;