IDE: do not open lpr on codetools changes, bug #14693

git-svn-id: trunk@22135 -
This commit is contained in:
mattias 2009-10-13 08:44:56 +00:00
parent 41ff845357
commit e9a1e8f8a1
2 changed files with 12 additions and 3 deletions

View File

@ -12330,6 +12330,13 @@ begin
// open all sources in editor
for i:=0 to Manager.SourceChangeCache.BuffersToModifyCount-1 do begin
CodeBuf:=Manager.SourceChangeCache.BuffersToModify[i];
// do not open lpr file
if (not OpenMainSourceOnCodeToolChange)
and (Project1<>nil) and (Project1.MainUnitInfo<>nil)
and (CompareFilenames(Project1.MainFilename,CodeBuf.Filename)=0) then
continue;
//DebugLn(['TMainIDE.OnBeforeCodeToolBossApplyChanges i=',i,' ',CodeBUf.Filename]);
Flags:=[ofOnlyIfExists,ofDoNotLoadResource];
if CodeBuf.IsVirtual then

View File

@ -140,6 +140,7 @@ type
FLazarusIDEHandlers: array[TLazarusIDEHandlerType] of TMethodList;
FMainBarSubTitle: string;
FOpenEditorsOnCodeToolChange: boolean;
FOpenMainSourceOnCodeToolChange: boolean;
procedure AddHandler(HandlerType: TLazarusIDEHandlerType;
const AMethod: TMethod; AsLast: boolean = false);
procedure RemoveHandler(HandlerType: TLazarusIDEHandlerType;
@ -223,9 +224,10 @@ type
procedure DoJumpToCodeToolBossError; virtual; abstract;
function NeedSaveSourceEditorChangesToCodeCache(PageIndex: integer): boolean; virtual; abstract;
function SaveSourceEditorChangesToCodeCache(PageIndex: integer): boolean; virtual; abstract; // true if something was saved
property OpenEditorsOnCodeToolChange: boolean
read FOpenEditorsOnCodeToolChange
write FOpenEditorsOnCodeToolChange;
property OpenEditorsOnCodeToolChange: boolean read FOpenEditorsOnCodeToolChange
write FOpenEditorsOnCodeToolChange;
property OpenMainSourceOnCodeToolChange: boolean read FOpenMainSourceOnCodeToolChange
write FOpenMainSourceOnCodeToolChange;
// progress and error messages
function ShowProgress(const SomeText: string;