IDE: DoAddActiveUnitToProject: removed auto renaming lowercase

git-svn-id: trunk@22304 -
This commit is contained in:
mattias 2009-10-27 11:36:16 +00:00
parent 7a349faa5d
commit 8a800ead9f

View File

@ -9293,9 +9293,17 @@ var
s, ShortUnitName: string;
begin
Result:=mrCancel;
if BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[])
and (ActiveUnitInfo<>nil) then begin
if not ActiveUnitInfo.IsPartOfProject then begin
if not BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]) then exit;
if (ActiveUnitInfo=nil) then exit;
if ActiveUnitInfo.IsPartOfProject then begin
if not ActiveUnitInfo.IsVirtual then
s:=Format(lisTheFile, ['"', ActiveUnitInfo.Filename, '"'])
else
s:=Format(lisTheFile, ['"', ActiveSourceEditor.PageName, '"']);
s:=Format(lisisAlreadyPartOfTheProject, [s]);
MessageDlg(s,mtInformation,[mbOk],0);
exit;
end;
if not ActiveUnitInfo.IsVirtual then
s:='"'+ActiveUnitInfo.Filename+'"'
else
@ -9311,14 +9319,6 @@ begin
if MessageDlg(Format(lisAddToProject, [s]), mtConfirmation, [mbYes,
mbCancel], 0) in [mrOk,mrYes]
then begin
if FilenameIsPascalUnit(ActiveUnitInfo.Filename) then begin
Result:=DoRenameUnitLowerCase(ActiveUnitInfo,true);
if Result=mrIgnore then Result:=mrOk;
if Result<>mrOk then begin
debugln('TMainIDE.DoAddActiveUnitToProject A DoRenameUnitLowerCase failed ',ActiveUnitInfo.Filename);
exit;
end;
end;
ActiveUnitInfo.IsPartOfProject:=true;
Project1.Modified:=true;
if (FilenameIsPascalUnit(ActiveUnitInfo.Filename))
@ -9336,17 +9336,6 @@ begin
CheckUnitDirIsInSearchPath(ActiveUnitInfo);
end;
end;
end else begin
if not ActiveUnitInfo.IsVirtual then
s:=Format(lisTheFile, ['"', ActiveUnitInfo.Filename, '"'])
else
s:=Format(lisTheFile, ['"', ActiveSourceEditor.PageName, '"']);
s:=Format(lisisAlreadyPartOfTheProject, [s]);
MessageDlg(s,mtInformation,[mbOk],0);
end;
end else begin
Result:=mrOk;
end;
end;
function TMainIDE.DoRemoveFromProjectDialog: TModalResult;