Merged revision(s) 59374 #1313ae2b9b, 59378 #a957005cad from trunk:

IDE: Update unit path for all build modes also when creating a new unit. Issue #34413.
........
IDE: Add high-dpi icons for images and images/codeexplorer (provided by Roland Hahn)
........

git-svn-id: branches/fixes_2_0@59389 -
This commit is contained in:
maxim 2018-10-29 23:02:44 +00:00
parent fc586c14b9
commit 9212530685
70 changed files with 108 additions and 63 deletions

42
.gitattributes vendored
View File

@ -7279,24 +7279,62 @@ images/codecompletion/cc_variable.png -text
images/codecompletion/cc_variable_150.png -text
images/codecompletion/cc_variable_200.png -text
images/codeexplorer/ce_classinterface.png -text svneol=unset#image/png
images/codeexplorer/ce_classinterface_150.png -text svneol=unset#image/png
images/codeexplorer/ce_classinterface_200.png -text svneol=unset#image/png
images/codeexplorer/ce_cycleimplementation.png -text svneol=unset#image/png
images/codeexplorer/ce_cycleimplementation_150.png -text svneol=unset#image/png
images/codeexplorer/ce_cycleimplementation_200.png -text svneol=unset#image/png
images/codeexplorer/ce_cycleinterface.png -text svneol=unset#image/png
images/codeexplorer/ce_cycleinterface_150.png -text svneol=unset#image/png
images/codeexplorer/ce_cycleinterface_200.png -text svneol=unset#image/png
images/codeexplorer/ce_default.png -text
images/codeexplorer/ce_default_150.png -text svneol=unset#image/png
images/codeexplorer/ce_default_200.png -text svneol=unset#image/png
images/codeexplorer/ce_deprecated.png -text
images/codeexplorer/ce_deprecated_150.png -text svneol=unset#image/png
images/codeexplorer/ce_deprecated_200.png -text svneol=unset#image/png
images/codeexplorer/ce_experimental.png -text
images/codeexplorer/ce_experimental_150.png -text svneol=unset#image/png
images/codeexplorer/ce_experimental_200.png -text svneol=unset#image/png
images/codeexplorer/ce_finalization.png -text
images/codeexplorer/ce_finalization_150.png -text svneol=unset#image/png
images/codeexplorer/ce_finalization_200.png -text svneol=unset#image/png
images/codeexplorer/ce_helper.png -text svneol=unset#image/png
images/codeexplorer/ce_helper_150.png -text svneol=unset#image/png
images/codeexplorer/ce_helper_200.png -text svneol=unset#image/png
images/codeexplorer/ce_implementation.png -text
images/codeexplorer/ce_implementation_150.png -text svneol=unset#image/png
images/codeexplorer/ce_implementation_200.png -text svneol=unset#image/png
images/codeexplorer/ce_initialization.png -text
images/codeexplorer/ce_initialization_150.png -text svneol=unset#image/png
images/codeexplorer/ce_initialization_200.png -text svneol=unset#image/png
images/codeexplorer/ce_interface.png -text
images/codeexplorer/ce_interface_150.png -text svneol=unset#image/png
images/codeexplorer/ce_interface_200.png -text svneol=unset#image/png
images/codeexplorer/ce_library.png -text
images/codeexplorer/ce_library_150.png -text svneol=unset#image/png
images/codeexplorer/ce_library_200.png -text svneol=unset#image/png
images/codeexplorer/ce_platform.png -text
images/codeexplorer/ce_platform_150.png -text svneol=unset#image/png
images/codeexplorer/ce_platform_200.png -text svneol=unset#image/png
images/codeexplorer/ce_program.png -text
images/codeexplorer/ce_program_150.png -text svneol=unset#image/png
images/codeexplorer/ce_program_200.png -text svneol=unset#image/png
images/codeexplorer/ce_property_readonly.png -text svneol=unset#image/png
images/codeexplorer/ce_property_readonly_150.png -text svneol=unset#image/png
images/codeexplorer/ce_property_readonly_200.png -text svneol=unset#image/png
images/codeexplorer/ce_section.png -text svneol=unset#image/png
images/codeexplorer/ce_section_150.png -text svneol=unset#image/png
images/codeexplorer/ce_section_200.png -text svneol=unset#image/png
images/codeexplorer/ce_unimplemented.png -text
images/codeexplorer/ce_unimplemented_150.png -text svneol=unset#image/png
images/codeexplorer/ce_unimplemented_200.png -text svneol=unset#image/png
images/codeexplorer/show_category.png -text
images/codeexplorer/show_category_150.png -text svneol=unset#image/png
images/codeexplorer/show_category_200.png -text svneol=unset#image/png
images/codeexplorer/show_source.png -text
images/codeexplorer/show_source_150.png -text svneol=unset#image/png
images/codeexplorer/show_source_200.png -text svneol=unset#image/png
images/codetoolsdefines/da_block.png -text svneol=unset#image/png
images/codetoolsdefines/da_define.png -text svneol=unset#image/png
images/codetoolsdefines/da_definerecurse.png -text svneol=unset#image/png
@ -7870,6 +7908,8 @@ images/designer/tab_order.png -text
images/designer/tab_order_150.png -text
images/designer/tab_order_200.png -text
images/folder.png -text
images/folder_150.png -text svneol=unset#image/png
images/folder_200.png -text svneol=unset#image/png
images/icon-naming-spec.xml svneol=native#text/plain
images/icons/aqua.ico -text
images/icons/blue.ico -text svneol=unset#image/ico
@ -8564,6 +8604,8 @@ images/states/state_warning_200.png -text
images/states/state_warning_69.png -text
images/states/state_warning_75.png -text
images/template.png -text svneol=unset#image/png
images/template_150.png -text svneol=unset#image/png
images/template_200.png -text svneol=unset#image/png
images/vase_trans.xpm -text svneol=native#image/x-xpixmap
images/windows/win_formeditor.ico -text
images/windows/win_main.ico -text

Binary file not shown.

View File

@ -123,14 +123,14 @@ procedure SwitchBuildMode(aBuildModeID: string);
procedure UpdateBuildModeCombo(aCombo: TComboBox);
// Functions dealing with many BuildModes. They depend on TBuildModesCheckList.
function AddPathToBuildModes(aPath, CurDirectory: string; IsIncludeFile: Boolean): Boolean;
function AddPathToBuildModes(aDir: string; IsIncludeFile: Boolean): Boolean;
procedure RemovePathFromBuildModes(ObsoletePaths: String; pcos: TParsedCompilerOptString);
function BuildManyModes: Boolean;
// Check if UnitDirectory is part of the Unit Search Paths.
// If not, ask user if he wants to extend dependencies or the Unit Search Paths.
// Not strictly for many BuildModes but it adds a path to them all.
function CheckDirIsInSearchPath(UnitInfo: TUnitInfo; AllowAddingDependencies, IsIncludeFile: Boolean): Boolean;
function CheckDirIsInSearchPath(UnitInfo: TUnitInfo; IsIncludeFile: Boolean): Boolean;
var
OnLoadIDEOptionsHook: TOnLoadIDEOptions;
@ -208,7 +208,7 @@ begin
end;
end;
function AddPathToBuildModes(aPath, CurDirectory: string; IsIncludeFile: Boolean): Boolean;
function AddPathToBuildModes(aDir: string; IsIncludeFile: Boolean): Boolean;
var
DlgCapt, DlgMsg: String;
i: Integer;
@ -229,17 +229,20 @@ begin
if Project1.BuildModes.Count > 1 then
Ok:=BMList.Show
else begin
Ok:=IDEMessageDialog(DlgCapt, Format(DlgMsg,[LineEnding,CurDirectory]),
Ok:=IDEMessageDialog(DlgCapt, Format(DlgMsg,[LineEnding,aDir]),
mtConfirmation,[mbYes,mbNo]) = mrYes;
BMList.SelectFirst; // The only (Default) build mode must be selected.
end;
if not Ok then Exit(False);
if not Project1.IsVirtual then
aDir:=CreateRelativePath(aDir, Project1.Directory);
for i:=0 to Project1.BuildModes.Count-1 do
if BMList.IsSelected(i) then
if IsIncludeFile then
Project1.BuildModes[i].CompilerOptions.MergeToIncludePaths(aPath)
else
Project1.BuildModes[i].CompilerOptions.MergeToUnitPaths(aPath);
with Project1.BuildModes[i].CompilerOptions do
if IsIncludeFile then
MergeToIncludePaths(aDir)
else
MergeToUnitPaths(aDir);
finally
BMList.Free;
end;
@ -374,15 +377,11 @@ begin
end;
end;
function CheckDirIsInSearchPath(UnitInfo: TUnitInfo;
AllowAddingDependencies, IsIncludeFile: Boolean): Boolean;
function CheckDirIsInSearchPath(UnitInfo: TUnitInfo; IsIncludeFile: Boolean): Boolean;
// Check if the given unit's path is on Unit- or Include-search path.
// Returns true if it is OK to add the unit to current project.
var
CurDirectory, CurPath, ShortDir: String;
Owners: TFPList;
APackage: TLazPackage;
i: Integer;
UnitDir, CurPath: String;
begin
Result:=True;
if UnitInfo.IsVirtual then exit;
@ -390,36 +389,10 @@ begin
CurPath:=Project1.CompilerOptions.GetIncludePath(false)
else
CurPath:=Project1.CompilerOptions.GetUnitPath(false);
CurDirectory:=AppendPathDelim(UnitInfo.GetDirectory);
if SearchDirectoryInSearchPath(CurPath,CurDirectory)<1 then
begin
if AllowAddingDependencies then begin
Owners:=PkgBoss.GetPossibleOwnersOfUnit(UnitInfo.Filename,[]);
try
if (Owners<>nil) then begin
for i:=0 to Owners.Count-1 do begin
if TObject(Owners[i]) is TLazPackage then begin
APackage:=TLazPackage(Owners[i]);
if IDEMessageDialog(lisAddPackageRequirement,
Format(lisAddPackageToProject, [APackage.IDAsString]),
mtConfirmation,[mbYes,mbCancel],'')<>mrYes
then
Exit(True);
PkgBoss.AddProjectDependency(Project1,APackage);
Exit(False);
end;
end;
end;
finally
Owners.Free;
end;
end;
// unit is not in a package => extend unit path
ShortDir:=CurDirectory;
if (not Project1.IsVirtual) then
ShortDir:=CreateRelativePath(ShortDir,Project1.Directory);
Result:=AddPathToBuildModes(ShortDir,CurDirectory,IsIncludeFile);
end;
UnitDir:=AppendPathDelim(UnitInfo.GetDirectory);
if SearchDirectoryInSearchPath(CurPath,UnitDir)<1 then
// unit is not in search path => extend it
Result:=AddPathToBuildModes(UnitDir,IsIncludeFile);
end;
{ TBuildModesForm }

View File

@ -12352,7 +12352,7 @@ begin
BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]);
OkToAdd:=True;
if FilenameIsPascalUnit(AnUnitInfo.Filename) then begin
OkToAdd:=CheckDirIsInSearchPath(AnUnitInfo,False,False);
OkToAdd:=CheckDirIsInSearchPath(AnUnitInfo,False);
if (pfMainUnitHasUsesSectionForAllUnits in Project1.Flags) then begin
AnUnitInfo.ReadUnitNameFromSource(false);
ShortUnitName:=AnUnitInfo.Unit_Name;
@ -12369,7 +12369,7 @@ begin
end;
end
else if CompareFileExt(AnUnitInfo.Filename,'inc',false)=0 then
OkToAdd:=CheckDirIsInSearchPath(AnUnitInfo,False,True);
OkToAdd:=CheckDirIsInSearchPath(AnUnitInfo,True);
if OkToAdd then
;
Project1.Modified:=true;

View File

@ -1851,9 +1851,9 @@ begin
then begin
OkToAdd:=True;
if FilenameIsPascalUnit(ActiveUnitInfo.Filename) then
OkToAdd:=CheckDirIsInSearchPath(ActiveUnitInfo,False,False)
OkToAdd:=CheckDirIsInSearchPath(ActiveUnitInfo,False)
else if CompareFileExt(ActiveUnitInfo.Filename,'inc',false)=0 then
OkToAdd:=CheckDirIsInSearchPath(ActiveUnitInfo,False,True);
OkToAdd:=CheckDirIsInSearchPath(ActiveUnitInfo,True);
if OkToAdd then begin
ActiveUnitInfo.IsPartOfProject:=true;
Project1.Modified:=true;
@ -5309,22 +5309,11 @@ begin
// add new path to unit path
if AnUnitInfo.IsPartOfProject
and (not Project1.IsVirtual)
and (FilenameIsPascalUnit(NewFilename))
and (CompareFilenames(NewFilePath,Project1.Directory)<>0) then begin
OldUnitPath:=Project1.CompilerOptions.GetUnitPath(false);
if SearchDirectoryInSearchPath(OldUnitPath,NewFilePath,1)<1 then begin
//DebugLn('RenameUnit NewFilePath="',NewFilePath,'" OldUnitPath="',OldUnitPath,'"');
if IDEMessageDialog(lisExtendUnitPath,
Format(lisTheDirectoryIsNotYetInTheUnitPathAddIt,[NewFilePath,LineEnding]),
mtConfirmation,[mbYes,mbNo])=mrYes then
begin
Project1.CompilerOptions.OtherUnitFiles:=
Project1.CompilerOptions.OtherUnitFiles+';'
+CreateRelativePath(NewFilePath,Project1.Directory);
end;
end;
if SearchDirectoryInSearchPath(OldUnitPath,NewFilePath,1)<1 then
AddPathToBuildModes(NewFilePath, False);
end;
// rename lfm file
@ -5383,8 +5372,7 @@ begin
Result:=ForceDirectoryInteractive(ExtractFilePath(NewLRSFilename),[mbRetry,mbIgnore]);
if Result=mrCancel then exit;
if Result=mrOk then begin
if not CodeToolBoss.SaveBufferAs(LRSCode,NewLRSFilename,LRSCode)
then
if not CodeToolBoss.SaveBufferAs(LRSCode,NewLRSFilename,LRSCode) then
DebugLn(['RenameUnit CodeToolBoss.SaveBufferAs failed: NewResFilename="',NewLRSFilename,'"']);
end;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 B

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 B

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 B

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 475 B

BIN
images/folder_150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

BIN
images/folder_200.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

View File

@ -1,8 +1,12 @@
btn_downarrow.png
folder.png
folder_150.png
folder_200.png
ide_icon48x48.png
mainiconproject.ico
template.png
template_150.png
template_200.png
actions/arrow_down.png
actions/arrow_down_150.png
actions/arrow_down_200.png
@ -139,24 +143,62 @@ codecompletion/cc_variable.png
codecompletion/cc_variable_150.png
codecompletion/cc_variable_200.png
codeexplorer/ce_classinterface.png
codeexplorer/ce_classinterface_150.png
codeexplorer/ce_classinterface_200.png
codeexplorer/ce_cycleimplementation.png
codeexplorer/ce_cycleimplementation_150.png
codeexplorer/ce_cycleimplementation_200.png
codeexplorer/ce_cycleinterface.png
codeexplorer/ce_cycleinterface_150.png
codeexplorer/ce_cycleinterface_200.png
codeexplorer/ce_default.png
codeexplorer/ce_default_150.png
codeexplorer/ce_default_200.png
codeexplorer/ce_deprecated.png
codeexplorer/ce_deprecated_150.png
codeexplorer/ce_deprecated_200.png
codeexplorer/ce_experimental.png
codeexplorer/ce_experimental_150.png
codeexplorer/ce_experimental_200.png
codeexplorer/ce_finalization.png
codeexplorer/ce_finalization_150.png
codeexplorer/ce_finalization_200.png
codeexplorer/ce_helper.png
codeexplorer/ce_helper_150.png
codeexplorer/ce_helper_200.png
codeexplorer/ce_implementation.png
codeexplorer/ce_implementation_150.png
codeexplorer/ce_implementation_200.png
codeexplorer/ce_initialization.png
codeexplorer/ce_initialization_150.png
codeexplorer/ce_initialization_200.png
codeexplorer/ce_interface.png
codeexplorer/ce_interface_150.png
codeexplorer/ce_interface_200.png
codeexplorer/ce_library.png
codeexplorer/ce_library_150.png
codeexplorer/ce_library_200.png
codeexplorer/ce_platform.png
codeexplorer/ce_platform_150.png
codeexplorer/ce_platform_200.png
codeexplorer/ce_program.png
codeexplorer/ce_program_150.png
codeexplorer/ce_program_200.png
codeexplorer/ce_property_readonly.png
codeexplorer/ce_property_readonly_150.png
codeexplorer/ce_property_readonly_200.png
codeexplorer/ce_section.png
codeexplorer/ce_section_150.png
codeexplorer/ce_section_200.png
codeexplorer/ce_unimplemented.png
codeexplorer/ce_unimplemented_150.png
codeexplorer/ce_unimplemented_200.png
codeexplorer/show_category.png
codeexplorer/show_category_150.png
codeexplorer/show_category_200.png
codeexplorer/show_source.png
codeexplorer/show_source_150.png
codeexplorer/show_source_200.png
codetoolsdefines/da_block.png
codetoolsdefines/da_define.png
codetoolsdefines/da_definerecurse.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 380 B

BIN
images/template_150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

BIN
images/template_200.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B