mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 01:57:57 +02:00
IDE: newfile: check if there is a directory with this file name
git-svn-id: trunk@33417 -
This commit is contained in:
parent
df5611a7ff
commit
7095e599e7
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user