IDE: newfile: check if there is a directory with this file name

git-svn-id: trunk@33417 -
This commit is contained in:
mattias 2011-11-08 14:07:01 +00:00
parent df5611a7ff
commit 7095e599e7
2 changed files with 11 additions and 0 deletions

View File

@ -5366,6 +5366,9 @@ resourcestring
lisDiscardChangesAndQuit = 'Discard changes and quit';
dbgBreakPropertyGroupNotFound = 'Some groups in the Enable/Disable list do not exist.%0:s'
+'Create them?%0:s%0:s%1:s';
lisFileIsDirectory = 'File is directory';
lisUnableToCreateNewFileBecauseThereIsAlreadyADirecto = 'Unable to create '
+'new file, because there is already a directory with this name.';
implementation

View File

@ -8542,6 +8542,14 @@ begin
end;
end;
if FilenameIsAbsolute(NewFilename) and DirectoryExistsUTF8(NewFilename) then
begin
IDEMessageDialog(lisFileIsDirectory,
lisUnableToCreateNewFileBecauseThereIsAlreadyADirecto,
mtError,[mbCancel]);
exit(mrCancel);
end;
if NewOwner is TProject then
AProject:=TProject(NewOwner)
else