added write check

git-svn-id: trunk@5223 -
This commit is contained in:
mattias 2004-02-22 18:33:03 +00:00
parent 71dd6ba928
commit 1e6a416750
3 changed files with 21 additions and 2 deletions

View File

@ -3206,7 +3206,8 @@ begin
+';'+Dir+'rtl'+DS+'objpas'+DS
+';'+Dir+'rtl'+DS+'objpas'+DS+'sysutils'
+';'+Dir+'rtl'+DS+'objpas'+DS+'classes'
+';'+Dir+'rtl'+DS+'inc'+DS;
+';'+Dir+'rtl'+DS+'inc'+DS
+';'+Dir+'rtl'+DS+'inc'+DS+'graph'+DS;
if (TargetOS<>'') and (TargetOS<>SrcOS) then
s:=s+';'+Dir+'rtl'+DS+TargetOS+DS;
s:=s+

View File

@ -58,7 +58,8 @@ function LoadCodeBuffer(var ACodeBuffer: TCodeBuffer; const AFilename: string;
Flags: TLoadBufferFlags): TModalResult;
function CreateEmptyFile(const Filename: string;
ErrorButtons: TMsgDlgButtons): TModalResult;
function CheckFileIsWritable(const Filename: string;
ErrorButtons: TMsgDlgButtons): TModalResult;
implementation
@ -158,5 +159,17 @@ begin
Result:=mrOk;
end;
function CheckFileIsWritable(const Filename: string;
ErrorButtons: TMsgDlgButtons): TModalResult;
begin
Result:=mrOk;
while not FileIsWritable(Filename) do begin
Result:=MessageDlg('File is not writable',
'Unable to write to file "'+Filename+'"',
mtError,ErrorButtons+[mbCancel],0);
if Result<>mrRetry then exit;
end;
end;
end.

View File

@ -6519,6 +6519,8 @@ begin
writeln('TMainIDE.DoConvertDelphiUnit A ',DelphiFilename);
Result:=CheckDelphiFileExt(DelphiFilename);
if Result<>mrOk then exit;
Result:=CheckFileIsWritable(DelphiFilename,[mbAbort]);
if Result<>mrOk then exit;
Result:=CheckFilenameForLCLPaths(DelphiFilename);
if Result<>mrOk then exit;
// close Delphi files in editor
@ -10335,6 +10337,9 @@ end.
{ =============================================================================
$Log$
Revision 1.713 2004/02/22 18:33:03 mattias
added write check
Revision 1.712 2004/02/21 15:37:32 mattias
moved compiler options to project menu, added -CX for smartlinking