mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 13:39:24 +02:00
IDE: Move Extend..SearchPath functions from MainIDE to Project.
git-svn-id: trunk@52697 -
This commit is contained in:
parent
814b6b1395
commit
339d0f841f
@ -158,10 +158,6 @@ type
|
|||||||
function DoPublishModule(Options: TPublishModuleOptions;
|
function DoPublishModule(Options: TPublishModuleOptions;
|
||||||
const SrcDirectory, DestDirectory: string
|
const SrcDirectory, DestDirectory: string
|
||||||
): TModalResult; virtual; abstract;
|
): TModalResult; virtual; abstract;
|
||||||
|
|
||||||
function ExtendProjectUnitSearchPath(AProject: TProject; NewUnitPaths: string): boolean;
|
|
||||||
function ExtendProjectIncSearchPath(AProject: TProject; NewIncPaths: string): boolean;
|
|
||||||
|
|
||||||
function DoFixupComponentReferences(RootComponent: TComponent;
|
function DoFixupComponentReferences(RootComponent: TComponent;
|
||||||
OpenFlags: TOpenFlags): TModalResult; virtual; abstract;
|
OpenFlags: TOpenFlags): TModalResult; virtual; abstract;
|
||||||
|
|
||||||
@ -352,50 +348,6 @@ begin
|
|||||||
UpdateCaption;
|
UpdateCaption;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMainIDEInterface.ExtendProjectUnitSearchPath(AProject: TProject;
|
|
||||||
NewUnitPaths: string): boolean;
|
|
||||||
var
|
|
||||||
CurUnitPaths: String;
|
|
||||||
r: TModalResult;
|
|
||||||
begin
|
|
||||||
CurUnitPaths:=AProject.CompilerOptions.ParsedOpts.GetParsedValue(pcosUnitPath);
|
|
||||||
NewUnitPaths:=RemoveSearchPaths(NewUnitPaths,CurUnitPaths);
|
|
||||||
if NewUnitPaths<>'' then begin
|
|
||||||
NewUnitPaths:=CreateRelativeSearchPath(NewUnitPaths,AProject.ProjectDirectory);
|
|
||||||
r:=IDEMessageDialog(lisExtendUnitPath,
|
|
||||||
Format(lisExtendUnitSearchPathOfProjectWith, [#13, NewUnitPaths]),
|
|
||||||
mtConfirmation, [mbYes, mbNo, mbCancel]);
|
|
||||||
case r of
|
|
||||||
mrYes: AProject.CompilerOptions.MergeToUnitPaths(NewUnitPaths);
|
|
||||||
mrNo: ;
|
|
||||||
else exit(false);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
Result:=true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMainIDEInterface.ExtendProjectIncSearchPath(AProject: TProject;
|
|
||||||
NewIncPaths: string): boolean;
|
|
||||||
var
|
|
||||||
CurIncPaths: String;
|
|
||||||
r: TModalResult;
|
|
||||||
begin
|
|
||||||
CurIncPaths:=AProject.CompilerOptions.ParsedOpts.GetParsedValue(pcosIncludePath);
|
|
||||||
NewIncPaths:=RemoveSearchPaths(NewIncPaths,CurIncPaths);
|
|
||||||
if NewIncPaths<>'' then begin
|
|
||||||
NewIncPaths:=CreateRelativeSearchPath(NewIncPaths,AProject.ProjectDirectory);
|
|
||||||
r:=IDEMessageDialog(lisExtendIncludePath,
|
|
||||||
Format(lisExtendIncludeFilesSearchPathOfProjectWith, [#13, NewIncPaths]),
|
|
||||||
mtConfirmation, [mbYes, mbNo, mbCancel]);
|
|
||||||
case r of
|
|
||||||
mrYes: AProject.CompilerOptions.MergeToIncludePaths(NewIncPaths);
|
|
||||||
mrNo: ;
|
|
||||||
else exit(false);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
Result:=true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMainIDEInterface.DoJumpToSourcePosition(const Filename: string; NewX, NewY,
|
function TMainIDEInterface.DoJumpToSourcePosition(const Filename: string; NewX, NewY,
|
||||||
NewTopLine: integer; AddJumpPoint: boolean; MarkLine: Boolean): TModalResult;
|
NewTopLine: integer; AddJumpPoint: boolean; MarkLine: Boolean): TModalResult;
|
||||||
var
|
var
|
||||||
|
@ -1014,6 +1014,8 @@ type
|
|||||||
function GetStateFilename: string;
|
function GetStateFilename: string;
|
||||||
function GetCompileSourceFilename: string;
|
function GetCompileSourceFilename: string;
|
||||||
procedure AutoAddOutputDirToIncPath;
|
procedure AutoAddOutputDirToIncPath;
|
||||||
|
function ExtendUnitSearchPath(NewUnitPaths: string): boolean;
|
||||||
|
function ExtendIncSearchPath(NewIncPaths: string): boolean;
|
||||||
|
|
||||||
// compile state file
|
// compile state file
|
||||||
function LoadStateFile(IgnoreErrors: boolean): TModalResult;
|
function LoadStateFile(IgnoreErrors: boolean): TModalResult;
|
||||||
@ -4883,6 +4885,48 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TProject.ExtendUnitSearchPath(NewUnitPaths: string): boolean;
|
||||||
|
var
|
||||||
|
CurUnitPaths: String;
|
||||||
|
r: TModalResult;
|
||||||
|
begin
|
||||||
|
CurUnitPaths:=CompilerOptions.ParsedOpts.GetParsedValue(pcosUnitPath);
|
||||||
|
NewUnitPaths:=RemoveSearchPaths(NewUnitPaths,CurUnitPaths);
|
||||||
|
if NewUnitPaths<>'' then begin
|
||||||
|
NewUnitPaths:=CreateRelativeSearchPath(NewUnitPaths,ProjectDirectory);
|
||||||
|
r:=IDEMessageDialog(lisExtendUnitPath,
|
||||||
|
Format(lisExtendUnitSearchPathOfProjectWith, [#13, NewUnitPaths]),
|
||||||
|
mtConfirmation, [mbYes, mbNo, mbCancel]);
|
||||||
|
case r of
|
||||||
|
mrYes: CompilerOptions.MergeToUnitPaths(NewUnitPaths);
|
||||||
|
mrNo: ;
|
||||||
|
else exit(false);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TProject.ExtendIncSearchPath(NewIncPaths: string): boolean;
|
||||||
|
var
|
||||||
|
CurIncPaths: String;
|
||||||
|
r: TModalResult;
|
||||||
|
begin
|
||||||
|
CurIncPaths:=CompilerOptions.ParsedOpts.GetParsedValue(pcosIncludePath);
|
||||||
|
NewIncPaths:=RemoveSearchPaths(NewIncPaths,CurIncPaths);
|
||||||
|
if NewIncPaths<>'' then begin
|
||||||
|
NewIncPaths:=CreateRelativeSearchPath(NewIncPaths,ProjectDirectory);
|
||||||
|
r:=IDEMessageDialog(lisExtendIncludePath,
|
||||||
|
Format(lisExtendIncludeFilesSearchPathOfProjectWith, [#13, NewIncPaths]),
|
||||||
|
mtConfirmation, [mbYes, mbNo, mbCancel]);
|
||||||
|
case r of
|
||||||
|
mrYes: CompilerOptions.MergeToIncludePaths(NewIncPaths);
|
||||||
|
mrNo: ;
|
||||||
|
else exit(false);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
function TProject.LoadStateFile(IgnoreErrors: boolean): TModalResult;
|
function TProject.LoadStateFile(IgnoreErrors: boolean): TModalResult;
|
||||||
var
|
var
|
||||||
XMLConfig: TXMLConfig;
|
XMLConfig: TXMLConfig;
|
||||||
|
@ -1252,12 +1252,12 @@ end;
|
|||||||
|
|
||||||
function TProjectInspectorForm.ExtendIncSearchPath(NewIncPaths: string): boolean;
|
function TProjectInspectorForm.ExtendIncSearchPath(NewIncPaths: string): boolean;
|
||||||
begin
|
begin
|
||||||
Result:=MainIDEInterface.ExtendProjectIncSearchPath(LazProject,NewIncPaths);
|
Result:=LazProject.ExtendIncSearchPath(NewIncPaths);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProjectInspectorForm.ExtendUnitSearchPath(NewUnitPaths: string): boolean;
|
function TProjectInspectorForm.ExtendUnitSearchPath(NewUnitPaths: string): boolean;
|
||||||
begin
|
begin
|
||||||
Result:=MainIDEInterface.ExtendProjectUnitSearchPath(LazProject,NewUnitPaths);
|
Result:=LazProject.ExtendUnitSearchPath(NewUnitPaths);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProjectInspectorForm.FilesBaseDirectory: string;
|
function TProjectInspectorForm.FilesBaseDirectory: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user