IDE: handle fpc message Fatal: Unable to open file, bug #16687

git-svn-id: trunk@26008 -
This commit is contained in:
mattias 2010-06-09 20:46:40 +00:00
parent 450e7aa727
commit 37a7255199
2 changed files with 8 additions and 3 deletions

View File

@ -7,7 +7,7 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, Unit1, SimpleFrm, anchordockpkg
Forms, Unit1, SimpleFrm, AnchorDocking, anchordockpkg
{ you can add units after this };
{$R *.res}
@ -15,7 +15,7 @@ uses
begin
Application.Initialize;
Application.CreateForm(TMainIDE, MainIDE);
Application.CreateForm(TSimpleForm, SimpleForm);
DockMaster.MakeDockable(MainIDE);
Application.Run;
end.

View File

@ -734,6 +734,8 @@ var i, j, FilenameEndPos: integer;
end;
function CheckForUrgentMessages(p: integer): boolean;
const
UnableToOpen = 'Fatal: Unable to open file ';
var
NewLine: String;
LastFile: string;
@ -770,7 +772,10 @@ var i, j, FilenameEndPos: integer;
if fLastErrorType in [etPanic,etFatal] then begin
// fatal and panic errors are not very informative
// -> prepend current file
if (fCompilingHistory<>nil) and (fCompilingHistory.Count>0) then begin
if CompStr(UnableToOpen, NewLine, 1) then
CurrentMessageParts.Values['Filename']:=
TrimFilename(SetDirSeparators(Copy(NewLine,Length(UnableToOpen)+1,Length(NewLine))))
else if (fCompilingHistory<>nil) and (fCompilingHistory.Count>0) then begin
LastFile:=fCompilingHistory[fCompilingHistory.Count-1];
if not FilenameIsAbsolute(LastFile) then
FullFilename:=TrimFilename(fCurrentDirectory+LastFile)