From 37a7255199f4428ad1c270c492da958c7f3609b8 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 9 Jun 2010 20:46:40 +0000 Subject: [PATCH] IDE: handle fpc message Fatal: Unable to open file, bug #16687 git-svn-id: trunk@26008 - --- examples/anchordocking/minide/miniide1.lpr | 4 ++-- ide/outputfilter.pas | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/anchordocking/minide/miniide1.lpr b/examples/anchordocking/minide/miniide1.lpr index 434d86e0e0..a38b52fba5 100644 --- a/examples/anchordocking/minide/miniide1.lpr +++ b/examples/anchordocking/minide/miniide1.lpr @@ -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. diff --git a/ide/outputfilter.pas b/ide/outputfilter.pas index 5f131dae09..63954f9cad 100644 --- a/ide/outputfilter.pas +++ b/ide/outputfilter.pas @@ -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)