implemented message blocks

git-svn-id: trunk@4485 -
This commit is contained in:
mattias 2003-08-15 16:10:13 +00:00
parent b8131d303a
commit b49deecff8
4 changed files with 69 additions and 43 deletions

View File

@ -329,6 +329,8 @@ begin
CurMakeMode:=mmBuild; CurMakeMode:=mmBuild;
if CurMakeMode=mmNone then continue; if CurMakeMode=mmNone then continue;
Tool.Title:=CurItem.Description; Tool.Title:=CurItem.Description;
if (CurItem=Options.ItemIDE) and (blfWithoutLinkingIDE in Flags) then
Tool.Title:=lisCompileIDEWithoutLinking;
Tool.WorkingDirectory:='$(LazarusDir)/'+CurItem.Directory; Tool.WorkingDirectory:='$(LazarusDir)/'+CurItem.Directory;
Tool.CmdLineParams:=CurItem.Commands[CurItem.MakeMode]; Tool.CmdLineParams:=CurItem.Commands[CurItem.MakeMode];
// append extra options // append extra options

View File

@ -1238,6 +1238,7 @@ resourcestring
// Build lazarus dialog // Build lazarus dialog
lisCleanLazarusSource = 'Clean Lazarus Source'; lisCleanLazarusSource = 'Clean Lazarus Source';
lisCompileIDEWithoutLinking = 'Compile IDE (without linking)';
lisBuildLCL = 'Build LCL'; lisBuildLCL = 'Build LCL';
lisBuildComponent = 'Build Component'; lisBuildComponent = 'Build Component';
lisBuildCodeTools = 'Build CodeTools'; lisBuildCodeTools = 'Build CodeTools';

View File

@ -5563,49 +5563,54 @@ begin
// show messages // show messages
MessagesView.Clear; MessagesView.Clear;
DoArrangeSourceEditorAndMessageView(false); MessagesView.BeginBlock;
try
DoArrangeSourceEditorAndMessageView(false);
// warn ambigious files // warn ambigious files
DoWarnAmbigiousFiles; DoWarnAmbigiousFiles;
// execute compilation tool 'Before' // execute compilation tool 'Before'
Result:=DoExecuteCompilationTool(Project1.CompilerOptions.ExecuteBefore, Result:=DoExecuteCompilationTool(Project1.CompilerOptions.ExecuteBefore,
Project1.ProjectDirectory,
'Executing command before');
if (Result=mrOk)
and (not Project1.CompilerOptions.SkipCompiler) then begin
try
// change tool status
ToolStatus:=itBuilder;
TheOutputFilter.OnOutputString:=@MessagesView.AddMsg;
TheOutputFilter.OnReadLine:=@MessagesView.AddProgress;
// compile
Result:=TheCompiler.Compile(Project1,BuildAll,DefaultFilename);
if Result<>mrOk then
DoJumpToCompilerMessage(-1,true);
finally
ToolStatus:=itNone;
end;
end;
// execute compilation tool 'After'
if Result=mrOk then begin
Result:=DoExecuteCompilationTool(Project1.CompilerOptions.ExecuteAfter,
Project1.ProjectDirectory, Project1.ProjectDirectory,
'Executing command after'); 'Executing command before');
end;
// add success message if (Result=mrOk)
if Result=mrOk then begin and (not Project1.CompilerOptions.SkipCompiler) then begin
MessagesView.AddMsg( try
Format(lisProjectSuccessfullyBuilt, ['"', Project1.Title, '"']),''); // change tool status
end; ToolStatus:=itBuilder;
// check sources TheOutputFilter.OnOutputString:=@MessagesView.AddMsg;
DoCheckFilesOnDisk; TheOutputFilter.OnReadLine:=@MessagesView.AddProgress;
// compile
Result:=TheCompiler.Compile(Project1,BuildAll,DefaultFilename);
if Result<>mrOk then
DoJumpToCompilerMessage(-1,true);
finally
ToolStatus:=itNone;
end;
end;
// execute compilation tool 'After'
if Result=mrOk then begin
Result:=DoExecuteCompilationTool(Project1.CompilerOptions.ExecuteAfter,
Project1.ProjectDirectory,
'Executing command after');
end;
// add success message
if Result=mrOk then begin
MessagesView.AddMsg(
Format(lisProjectSuccessfullyBuilt, ['"', Project1.Title, '"']),'');
end;
// check sources
DoCheckFilesOnDisk;
finally
MessagesView.EndBlock;
end;
end; end;
function TMainIDE.DoAbortBuild: TModalResult; function TMainIDE.DoAbortBuild: TModalResult;
@ -5763,6 +5768,7 @@ begin
Result:=mrCancel; Result:=mrCancel;
exit; exit;
end; end;
MessagesView.BeginBlock;
try try
// first compile all lazarus components (LCL, SynEdit, CodeTools, ...) // first compile all lazarus components (LCL, SynEdit, CodeTools, ...)
SourceNotebook.ClearErrorLines; SourceNotebook.ClearErrorLines;
@ -5805,6 +5811,7 @@ begin
if Result<>mrOk then exit; if Result<>mrOk then exit;
finally finally
DoCheckFilesOnDisk; DoCheckFilesOnDisk;
MessagesView.EndBlock;
end; end;
end; end;
@ -9406,6 +9413,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.636 2003/08/15 16:10:12 mattias
implemented message blocks
Revision 1.635 2003/08/14 12:25:21 mattias Revision 1.635 2003/08/14 12:25:21 mattias
changed default visible of forms to false changed default visible of forms to false

View File

@ -41,7 +41,6 @@ uses
IDEOptionDefs, EnvironmentOpts, LazarusIDEStrConsts; IDEOptionDefs, EnvironmentOpts, LazarusIDEStrConsts;
type type
TMessagesView = class(TForm) TMessagesView = class(TForm)
MessageView : TListBox; MessageView : TListBox;
procedure MessageViewDblClicked(Sender: TObject); procedure MessageViewDblClicked(Sender: TObject);
@ -54,6 +53,7 @@ type
Function GetMessage: String; Function GetMessage: String;
procedure SetLastLineIsProgress(const AValue: boolean); procedure SetLastLineIsProgress(const AValue: boolean);
protected protected
fBlockCount: integer;
Function GetSelectedLineIndex: Integer; Function GetSelectedLineIndex: Integer;
procedure SetSelectedLineIndex(const AValue: Integer); procedure SetSelectedLineIndex(const AValue: Integer);
procedure SetMsgDirectory(Index: integer; const CurDir: string); procedure SetMsgDirectory(Index: integer; const CurDir: string);
@ -69,6 +69,8 @@ type
function MsgCount: integer; function MsgCount: integer;
procedure Clear; procedure Clear;
procedure GetMessageAt(Index: integer; var Msg, MsgDirectory: string); procedure GetMessageAt(Index: integer; var Msg, MsgDirectory: string);
procedure BeginBlock;
procedure EndBlock;
public public
property LastLineIsProgress: boolean read FLastLineIsProgress property LastLineIsProgress: boolean read FLastLineIsProgress
write SetLastLineIsProgress; write SetLastLineIsProgress;
@ -160,10 +162,9 @@ begin
while (LastSeparator>=0) and (Items[LastSeparator]<>SeparatorLine) do while (LastSeparator>=0) and (Items[LastSeparator]<>SeparatorLine) do
dec(LastSeparator); dec(LastSeparator);
if LastSeparator>=0 then begin if LastSeparator>=0 then begin
while (Items.Count>LastSeparator) do begin while (Items.Count>LastSeparator) do
Items.Delete(Items.Count-1); Items.Delete(Items.Count-1);
FLastLineIsProgress:=false; FLastLineIsProgress:=false;
end;
end; end;
end; end;
end; end;
@ -184,6 +185,7 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
Procedure TMessagesView.Clear; Procedure TMessagesView.Clear;
Begin Begin
if fBlockCount>0 then exit;
MessageView.Clear; MessageView.Clear;
FLastLineIsProgress:=false; FLastLineIsProgress:=false;
if not Assigned(MessagesView.MessageView.OnClick) then if not Assigned(MessagesView.MessageView.OnClick) then
@ -208,6 +210,17 @@ begin
MsgDirectory:=FDirectories[Index]; MsgDirectory:=FDirectories[Index];
end; end;
procedure TMessagesView.BeginBlock;
begin
inc(fBlockCount);
end;
procedure TMessagesView.EndBlock;
begin
if fBlockCount<=0 then RaiseException('TMessagesView.EndBlock Internal Error');
dec(fBlockCount);
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
TMessagesView.GetMessage TMessagesView.GetMessage
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}