mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 05:39:17 +02:00
IDE: Improve renaming project files to lowercase further. Issue #10370.
This commit is contained in:
parent
3d47bef87e
commit
ff3175bce6
@ -462,7 +462,7 @@ resourcestring
|
|||||||
lisKMViewProjectSource = 'View Project Source';
|
lisKMViewProjectSource = 'View Project Source';
|
||||||
lisMenuAddToProject = 'Add Editor File to Project';
|
lisMenuAddToProject = 'Add Editor File to Project';
|
||||||
lisMenuRemoveFromProject = 'Remove from Project ...';
|
lisMenuRemoveFromProject = 'Remove from Project ...';
|
||||||
lisMenuRenameLowerCase = 'Rename Units to LowerCase ...';
|
lisMenuRenameLowerCase = 'Rename Unit Files to LowerCase ...';
|
||||||
lisMenuViewProjectSource = '&View Project Source';
|
lisMenuViewProjectSource = '&View Project Source';
|
||||||
lisMenuProjectOptions = 'Project Options ...';
|
lisMenuProjectOptions = 'Project Options ...';
|
||||||
|
|
||||||
|
@ -1270,7 +1270,7 @@ begin
|
|||||||
ParentMI:=itmProjectAddRemoveSection;
|
ParentMI:=itmProjectAddRemoveSection;
|
||||||
CreateMenuItem(ParentMI,itmProjectAddTo,'itmProjectAddTo',lisMenuAddToProject, 'menu_project_add');
|
CreateMenuItem(ParentMI,itmProjectAddTo,'itmProjectAddTo',lisMenuAddToProject, 'menu_project_add');
|
||||||
CreateMenuItem(ParentMI,itmProjectRemoveFrom,'itmProjectRemoveFrom',lisMenuRemoveFromProject, 'menu_project_remove');
|
CreateMenuItem(ParentMI,itmProjectRemoveFrom,'itmProjectRemoveFrom',lisMenuRemoveFromProject, 'menu_project_remove');
|
||||||
CreateMenuItem(ParentMI,itmProjectRenameLowerCase,'itmProjectRenameLowerCase',lisMenuRenameLowerCase, 'menu_search_replace');
|
CreateMenuItem(ParentMI,itmProjectRenameLowerCase,'itmProjectRenameLowerCase',lisMenuRenameLowerCase, 'menu_edit_lowercase');
|
||||||
CreateMenuItem(ParentMI,itmProjectViewUnits,'itmProjectViewUnits',lisMenuViewUnits, 'menu_view_units');
|
CreateMenuItem(ParentMI,itmProjectViewUnits,'itmProjectViewUnits',lisMenuViewUnits, 'menu_view_units');
|
||||||
CreateMenuItem(ParentMI,itmProjectViewForms,'itmProjectViewForms',lisMenuViewForms, 'menu_view_forms');
|
CreateMenuItem(ParentMI,itmProjectViewForms,'itmProjectViewForms',lisMenuViewForms, 'menu_view_forms');
|
||||||
CreateMenuItem(ParentMI,itmProjectViewSource,'itmProjectViewSource',lisMenuViewProjectSource, 'item_project_source');
|
CreateMenuItem(ParentMI,itmProjectViewSource,'itmProjectViewSource',lisMenuViewProjectSource, 'item_project_source');
|
||||||
|
@ -1935,12 +1935,15 @@ begin
|
|||||||
AnUnitInfo:=TUnitInfo(fUnitInfos[i]);
|
AnUnitInfo:=TUnitInfo(fUnitInfos[i]);
|
||||||
Assert(AnUnitInfo.IsPartOfProject, 'TRenameFilesSelector.ActionForFiles: '
|
Assert(AnUnitInfo.IsPartOfProject, 'TRenameFilesSelector.ActionForFiles: '
|
||||||
+ AnUnitInfo.Unit_Name + ' is not part of project');
|
+ AnUnitInfo.Unit_Name + ' is not part of project');
|
||||||
|
if AnUnitInfo.Source=nil then
|
||||||
|
AnUnitInfo.ReadUnitSource(false,false);
|
||||||
// Marked here means to remove old files silently.
|
// Marked here means to remove old files silently.
|
||||||
AnUnitInfo.Marked:=True;
|
AnUnitInfo.Marked:=True;
|
||||||
Result:=RenameUnitLowerCase(AnUnitInfo, false);
|
Result:=RenameUnitLowerCase(AnUnitInfo, false);
|
||||||
AnUnitInfo.Marked:=False;
|
AnUnitInfo.Marked:=False;
|
||||||
if Result<>mrOK then exit;
|
if Result<>mrOK then exit;
|
||||||
end;
|
end;
|
||||||
|
ShowMessage(Format('%d files were renamed to lowercase.', [fUnitInfos.Count]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
Loading…
Reference in New Issue
Block a user