IDE: added confirmation for deleting publish directory

git-svn-id: trunk@15899 -
This commit is contained in:
mattias 2008-07-28 09:06:49 +00:00
parent ac3ef48d2b
commit 1437e4026d
2 changed files with 22 additions and 8 deletions

View File

@ -3812,6 +3812,16 @@ resourcestring
+'not be deleted, because it is not owned by %s.';
lisFilter2 = '(filter)';
lisFindKeyCombination = 'Find key combination';
lisInvalidPublishingDirectory = 'Invalid publishing Directory';
lisSourceDirectoryAndDestinationDirectoryAreTheSameMa = 'Source directory %'
+'s%s%s%sand destination directory %s%s%s%sare the same.%s%sMaybe you '
+'misunderstand this feature.%sIt will clean/recreate the destination '
+'directory%sand copies the package/project into it.';
lisClearDirectory = 'Clear Directory?';
lisInOrderToCreateACleanCopyOfTheProjectPackageAllFil = 'In order to create '
+'a clean copy of the project/package, all files in the following '
+'directory will be deleted and all its content will be lost.%s%sDelete '
+'all files in %s%s%s?';
implementation

View File

@ -10496,14 +10496,10 @@ begin
if CompareFilenames(CleanAndExpandDirectory(SrcDir),
CleanAndExpandDirectory(DestDir))=0
then begin
MessageDlg('Invalid publishing Directory',
'Source directory "'+SrcDir+'"'#13
+'and destination directory "'+DestDir+'"'#13
+'are the same.'#13
+#13
+'Maybe you misunderstand this feature.'#13
+'It will clean/recreate the destination directory'#13
+'and copies the package/project into it.',mtError,[mbCancel],0);
MessageDlg(lisInvalidPublishingDirectory,
Format(lisSourceDirectoryAndDestinationDirectoryAreTheSameMa, ['"',
SrcDir, '"', #13, '"', DestDir, '"', #13, #13, #13, #13, #13]),
mtError, [mbCancel], 0);
Result:=mrCancel;
exit;
end;
@ -10539,6 +10535,14 @@ begin
// clear destination directory
if DirPathExists(DestDir) then begin
// ask user, if destination can be delete
if MessageDlg(lisClearDirectory,
Format(lisInOrderToCreateACleanCopyOfTheProjectPackageAllFil, [#13, #13,
'"', DestDir, '"']), mtConfirmation,
[mbYes,mbNo],0)<>mrYes
then
exit(mrCancel);
if (not DeleteDirectory(ChompPathDelim(DestDir),true)) then begin
MessageDlg(lisUnableToCleanUpDestinationDirectory,
Format(lisUnableToCleanUpPleaseCheckPermissions, ['"', DestDir, '"', #13]