From a5e41fe16cf8a1a4960a2879c1ada2dfd4b017a0 Mon Sep 17 00:00:00 2001 From: marc Date: Fri, 18 Dec 2009 22:31:23 +0000 Subject: [PATCH] * IDE: Renamed InfoBuilder routines to more understandable name * IDE: Only show buildprogress if there is really something compiled git-svn-id: trunk@23191 - --- ide/compiler.pp | 5 +- ide/exttooldialog.pas | 10 +-- ide/infobuild.lfm | 32 ++++---- ide/infobuild.lrs | 172 +++++++++++++++++++++--------------------- ide/infobuild.pp | 133 ++++++++++++++++++++------------ ide/main.pp | 43 +++++------ ide/msgview.pp | 2 +- 7 files changed, 216 insertions(+), 181 deletions(-) diff --git a/ide/compiler.pp b/ide/compiler.pp index eadb20e653..667a164351 100644 --- a/ide/compiler.pp +++ b/ide/compiler.pp @@ -39,7 +39,7 @@ unit Compiler; interface uses - Classes, SysUtils, Process, LCLProc, Forms, Controls, FileUtil, + Classes, SysUtils, Process, LCLProc, Forms, Controls, FileUtil, InfoBuild, LazarusIDEStrConsts, CompilerOptions, Project, OutputFilter, UTF8Process; type @@ -103,6 +103,9 @@ begin Result:=mrCancel; DebugLn('TCompiler.Compile WorkingDir="',WorkingDir,'" CompilerFilename="',CompilerFilename,'" CompilerParams="',CompilerParams,'"'); + // if we want to show the compile progress, it's now time to show the dialog + CompileProgress.Show; + // change working directory OldCurDir:=GetCurrentDirUTF8; if not SetCurrentDirUTF8(WorkingDir) then begin diff --git a/ide/exttooldialog.pas b/ide/exttooldialog.pas index e603f6383f..a17af76cc4 100644 --- a/ide/exttooldialog.pas +++ b/ide/exttooldialog.pas @@ -319,8 +319,9 @@ begin ), mtError,[mbIgnore,mbAbort],0); if Result=mrIgnore then Result:=mrCancel; - PutExitInfoBuilder(Format(lisExtToolUnableToRunTheTool, ['"', Title, '"', #13, - 'Program '+Filename+' not found'])); + + CompileProgress.Ready(lisExtToolUnableToRunTheTool, ['"', Title, '"', #13, + 'Program '+Filename+' not found']); exit; end; Filename:=NewFilename; @@ -347,7 +348,7 @@ begin Abort:=false; OnNeedsOutputFilter(TheOutputFilter,Abort); if Abort then begin - PutExitInfoBuilder(lisInfoBuildAbort); + CompileProgress.Ready(lisInfoBuildAbort); Result:=mrAbort; exit; end; @@ -417,8 +418,7 @@ begin DebugLn(['TExternalToolList.Run AAA2']); if Result=mrIgnore then Result:=mrCancel; DebugLn(['TExternalToolList.Run AAA3']); - PutExitInfoBuilder(Format(lisExtToolUnableToRunTheTool, - ['"', Title, '"', #13, e.Message])); + CompileProgress.Ready(lisExtToolUnableToRunTheTool, ['"', Title, '"', #13, e.Message]); DebugLn(['TExternalToolList.Run AAA4']); end; end; diff --git a/ide/infobuild.lfm b/ide/infobuild.lfm index f447972e5a..75a10a046a 100644 --- a/ide/infobuild.lfm +++ b/ide/infobuild.lfm @@ -1,4 +1,4 @@ -object FInfoCompile: TFInfoCompile +object CompileInfoDlg: TCompileInfoDlg Left = 628 Height = 200 Top = 372 @@ -125,10 +125,10 @@ object FInfoCompile: TFInfoCompile ClientWidth = 122 TabOrder = 0 object LNLines: TLabel - Left = 49 + Left = 47 Height = 46 Top = 2 - Width = 66 + Width = 68 Align = alClient Alignment = taRightJustify AutoSize = False @@ -141,7 +141,7 @@ object FInfoCompile: TFInfoCompile Left = 6 Height = 46 Top = 2 - Width = 43 + Width = 41 Align = alLeft BorderSpacing.Left = 4 Caption = 'Lines:' @@ -178,10 +178,10 @@ object FInfoCompile: TFInfoCompile ClientWidth = 114 TabOrder = 0 object LNHint: TLabel - Left = 45 + Left = 43 Height = 18 Top = 0 - Width = 67 + Width = 69 Align = alClient Alignment = taRightJustify AutoSize = False @@ -195,7 +195,7 @@ object FInfoCompile: TFInfoCompile Left = 0 Height = 18 Top = 0 - Width = 43 + Width = 41 Align = alLeft Caption = 'Hints:' ParentColor = False @@ -218,16 +218,16 @@ object FInfoCompile: TFInfoCompile Left = 0 Height = 18 Top = 0 - Width = 71 + Width = 65 Align = alLeft Caption = 'Warnings:' ParentColor = False end object LNWarning: TLabel - Left = 73 + Left = 67 Height = 18 Top = 0 - Width = 39 + Width = 45 Align = alClient Alignment = taRightJustify AutoSize = False @@ -270,16 +270,16 @@ object FInfoCompile: TFInfoCompile Left = 0 Height = 18 Top = 0 - Width = 48 + Width = 47 Align = alLeft Caption = 'Notes:' ParentColor = False end object LNNote: TLabel - Left = 50 + Left = 49 Height = 18 Top = 0 - Width = 62 + Width = 63 Align = alClient Alignment = taRightJustify AutoSize = False @@ -307,16 +307,16 @@ object FInfoCompile: TFInfoCompile Left = 0 Height = 18 Top = 0 - Width = 49 + Width = 45 Align = alLeft Caption = 'Errors:' ParentColor = False end object LNError: TLabel - Left = 51 + Left = 47 Height = 18 Top = 0 - Width = 61 + Width = 65 Align = alClient Alignment = taRightJustify AutoSize = False diff --git a/ide/infobuild.lrs b/ide/infobuild.lrs index c9bae27ed3..6e16754660 100644 --- a/ide/infobuild.lrs +++ b/ide/infobuild.lrs @@ -1,90 +1,90 @@ { This is an automatically generated lazarus resource file } -LazarusResources.Add('TFInfoCompile','FORMDATA',[ - 'TPF0'#13'TFInfoCompile'#12'FInfoCompile'#4'Left'#3't'#2#6'Height'#3#200#0#3 - +'Top'#3't'#1#5'Width'#3#130#1#13'ActiveControl'#7#8'PnlTitle'#11'BorderIcons' - +#11#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#15'Compile project'#28'Chil' - +'dSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'Child' - +'Sizing.HorizontalSpacing'#2#6#27'ChildSizing.VerticalSpacing'#2#6#12'Client' - +'Height'#3#200#0#11'ClientWidth'#3#130#1#9'FormStyle'#7#11'fsStayOnTop'#8'On' - +'Create'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6 - +'0.9.29'#0#6'TPanel'#8'PnlTitle'#4'Left'#2#6#6'Height'#2#24#3'Top'#2#6#5'Wid' - +'th'#3'v'#1#5'Align'#7#5'alTop'#10'BevelInner'#7#8'bvRaised'#10'BevelOuter'#7 - +#9'bvLowered'#12'ClientHeight'#2#24#11'ClientWidth'#3'v'#1#10'Font.Style'#11 - +#6'fsBold'#0#10'ParentFont'#8#8'TabOrder'#2#0#0#6'TLabel'#6'lbInfo'#4'Left'#2 - +#7#6'Height'#2#20#3'Top'#2#2#5'Width'#3'h'#1#5'Align'#7#8'alClient'#9'Alignm' - +'ent'#7#8'taCenter'#18'BorderSpacing.Left'#2#5#19'BorderSpacing.Right'#2#5#6 - +'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#0#6'TPanel'#6'Panel1'#4'Left'#2 - +#6#6'Height'#2'>'#3'Top'#2'$'#5'Width'#3'v'#1#5'Align'#7#8'alClient'#10'Beve' - +'lInner'#7#8'bvRaised'#10'BevelOuter'#7#9'bvLowered'#12'ClientHeight'#2'>'#11 - +'ClientWidth'#3'v'#1#11'ParentColor'#8#8'TabOrder'#2#1#0#6'TLabel'#14'PCurre' - +'ntStatus'#4'Left'#2#4#6'Height'#2'6'#3'Top'#2#4#5'Width'#3'n'#1#5'Align'#7#8 - +'alClient'#9'Alignment'#7#8'taCenter'#8'AutoSize'#8#18'BorderSpacing.Left'#2 - +#2#17'BorderSpacing.Top'#2#2#19'BorderSpacing.Right'#2#2#20'BorderSpacing.Bo' - +'ttom'#2#2#5'Color'#7#9'clBtnFace'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8 - +#11'Transparent'#8#8'WordWrap'#9#0#0#0#6'TPanel'#9'pnlButton'#4'Left'#2#6#6 - +'Height'#2'"'#3'Top'#3#160#0#5'Width'#3'v'#1#5'Align'#7#8'alBottom'#10'Bevel' - +'Outer'#7#6'bvNone'#12'ClientHeight'#2'"'#11'ClientWidth'#3'v'#1#8'TabOrder' - +#2#2#0#7'TBitBtn'#6'BClose'#24'AnchorSideBottom.Control'#7#5'Owner'#21'Ancho' - +'rSideBottom.Side'#7#9'asrBottom'#4'Left'#3#134#0#6'Height'#2'"'#3'Top'#2#0#5 - +'Width'#2'k'#7'Anchors'#11#5'akTop'#0#7'Caption'#6#3'&OK'#7'Default'#9#4'Kin' - +'d'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#7'OnClick'#7#11'BCloseCli' - +'ck'#8'TabOrder'#2#0#0#0#0#6'TPanel'#7'pnlInfo'#4'Left'#2#6#6'Height'#2'2'#3 - +'Top'#2'h'#5'Width'#3'v'#1#5'Align'#7#8'alBottom'#10'BevelOuter'#7#6'bvNone' - +#12'ClientHeight'#2'2'#11'ClientWidth'#3'v'#1#8'TabOrder'#2#3#0#6'TPanel'#8 - +'pnlLines'#22'AnchorSideLeft.Control'#7#5'Owner'#18'AnchorSideTop.Side'#7#9 - +'asrCenter'#4'Left'#2#0#6'Height'#2'2'#3'Top'#2#0#5'Width'#2'z'#5'Align'#7#6 - +'alLeft'#10'BevelInner'#7#8'bvRaised'#10'BevelOuter'#7#9'bvLowered'#12'Clien' - +'tHeight'#2'2'#11'ClientWidth'#2'z'#8'TabOrder'#2#0#0#6'TLabel'#7'LNLines'#4 - +'Left'#2'1'#6'Height'#2'.'#3'Top'#2#2#5'Width'#2'B'#5'Align'#7#8'alClient'#9 - +'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#19'BorderSpacing.Right'#2#5#7 - +'Caption'#6#1'0'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#10 - +'LInfoLines'#4'Left'#2#6#6'Height'#2'.'#3'Top'#2#2#5'Width'#2'+'#5'Align'#7#6 - +'alLeft'#18'BorderSpacing.Left'#2#4#7'Caption'#6#6'Lines:'#6'Layout'#7#8'tlC' - +'enter'#11'ParentColor'#8#0#0#0#6'TPanel'#6'Panel3'#22'AnchorSideLeft.Contro' - +'l'#7#5'Owner'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2'~'#6'Height'#2 - +'2'#3'Top'#2#0#5'Width'#2'z'#5'Align'#7#8'alClient'#18'BorderSpacing.Left'#2 - +#4#19'BorderSpacing.Right'#2#4#10'BevelInner'#7#8'bvRaised'#10'BevelOuter'#7 - +#9'bvLowered'#12'ClientHeight'#2'2'#11'ClientWidth'#2'z'#8'TabOrder'#2#1#0#6 - +'TPanel'#16'pnlHintsWarnings'#4'Left'#2#4#6'Height'#2#18#3'Top'#2#6#5'Width' - +#2'r'#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#2#17'BorderSpacing.Top'#2 - +#4#19'BorderSpacing.Right'#2#2#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2 - +#18#11'ClientWidth'#2'r'#8'TabOrder'#2#0#0#6'TLabel'#6'LNHint'#4'Left'#2'-'#6 - +'Height'#2#18#3'Top'#2#0#5'Width'#2'C'#5'Align'#7#8'alClient'#9'Alignment'#7 - +#14'taRightJustify'#8'AutoSize'#8#18'BorderSpacing.Left'#2#2#19'BorderSpacin' - +'g.Right'#2#2#7'Caption'#6#1'0'#11'ParentColor'#8#10'ParentFont'#8#0#0#6'TLa' - +'bel'#9'LInfoHint'#4'Left'#2#0#6'Height'#2#18#3'Top'#2#0#5'Width'#2'+'#5'Ali' - +'gn'#7#6'alLeft'#7'Caption'#6#6'Hints:'#11'ParentColor'#8#0#0#0#6'TPanel'#17 - +'pnlHintsWarnings1'#4'Left'#2#4#6'Height'#2#18#3'Top'#2#26#5'Width'#2'r'#5'A' - +'lign'#7#5'alTop'#18'BorderSpacing.Left'#2#2#17'BorderSpacing.Top'#2#2#19'Bo' - +'rderSpacing.Right'#2#2#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2#18#11 - +'ClientWidth'#2'r'#8'TabOrder'#2#1#0#6'TLabel'#12'LInfoWarning'#4'Left'#2#0#6 - +'Height'#2#18#3'Top'#2#0#5'Width'#2'G'#5'Align'#7#6'alLeft'#7'Caption'#6#9'W' - +'arnings:'#11'ParentColor'#8#0#0#6'TLabel'#9'LNWarning'#4'Left'#2'I'#6'Heigh' - +'t'#2#18#3'Top'#2#0#5'Width'#2''''#5'Align'#7#8'alClient'#9'Alignment'#7#14 - +'taRightJustify'#8'AutoSize'#8#18'BorderSpacing.Left'#2#2#19'BorderSpacing.R' - +'ight'#2#2#7'Caption'#6#1'0'#11'ParentColor'#8#10'ParentFont'#8#0#0#0#0#6'TP' - +'anel'#14'pnlNotesErrors'#22'AnchorSideLeft.Control'#7#5'Owner'#18'AnchorSid' - ,'eTop.Side'#7#9'asrCenter'#4'Left'#3#252#0#6'Height'#2'2'#3'Top'#2#0#5'Width' - +#2'z'#5'Align'#7#7'alRight'#18'BorderSpacing.Left'#2#4#10'BevelInner'#7#8'bv' - +'Raised'#10'BevelOuter'#7#9'bvLowered'#12'ClientHeight'#2'2'#11'ClientWidth' - +#2'z'#8'TabOrder'#2#2#0#6'TPanel'#17'pnlHintsWarnings2'#4'Left'#2#4#6'Height' - +#2#18#3'Top'#2#6#5'Width'#2'r'#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#2 - +#17'BorderSpacing.Top'#2#4#19'BorderSpacing.Right'#2#2#10'BevelOuter'#7#6'bv' - +'None'#12'ClientHeight'#2#18#11'ClientWidth'#2'r'#8'TabOrder'#2#0#0#6'TLabel' - +#9'LInfoNote'#4'Left'#2#0#6'Height'#2#18#3'Top'#2#0#5'Width'#2'0'#5'Align'#7 - +#6'alLeft'#7'Caption'#6#6'Notes:'#11'ParentColor'#8#0#0#6'TLabel'#6'LNNote'#4 - +'Left'#2'2'#6'Height'#2#18#3'Top'#2#0#5'Width'#2'>'#5'Align'#7#8'alClient'#9 - +'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#18'BorderSpacing.Left'#2#2#19 +LazarusResources.Add('TCompileInfoDlg','FORMDATA',[ + 'TPF0'#15'TCompileInfoDlg'#14'CompileInfoDlg'#4'Left'#3't'#2#6'Height'#3#200#0 + +#3'Top'#3't'#1#5'Width'#3#130#1#13'ActiveControl'#7#8'PnlTitle'#11'BorderIco' + +'ns'#11#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#15'Compile project'#28 + +'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'C' + +'hildSizing.HorizontalSpacing'#2#6#27'ChildSizing.VerticalSpacing'#2#6#12'Cl' + +'ientHeight'#3#200#0#11'ClientWidth'#3#130#1#9'FormStyle'#7#11'fsStayOnTop'#8 + +'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6 + +#6'0.9.29'#0#6'TPanel'#8'PnlTitle'#4'Left'#2#6#6'Height'#2#24#3'Top'#2#6#5'W' + +'idth'#3'v'#1#5'Align'#7#5'alTop'#10'BevelInner'#7#8'bvRaised'#10'BevelOuter' + +#7#9'bvLowered'#12'ClientHeight'#2#24#11'ClientWidth'#3'v'#1#10'Font.Style' + +#11#6'fsBold'#0#10'ParentFont'#8#8'TabOrder'#2#0#0#6'TLabel'#6'lbInfo'#4'Lef' + +'t'#2#7#6'Height'#2#20#3'Top'#2#2#5'Width'#3'h'#1#5'Align'#7#8'alClient'#9'A' + +'lignment'#7#8'taCenter'#18'BorderSpacing.Left'#2#5#19'BorderSpacing.Right'#2 + +#5#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#0#6'TPanel'#6'Panel1'#4'Lef' + +'t'#2#6#6'Height'#2'>'#3'Top'#2'$'#5'Width'#3'v'#1#5'Align'#7#8'alClient'#10 + +'BevelInner'#7#8'bvRaised'#10'BevelOuter'#7#9'bvLowered'#12'ClientHeight'#2 + +'>'#11'ClientWidth'#3'v'#1#11'ParentColor'#8#8'TabOrder'#2#1#0#6'TLabel'#14 + +'PCurrentStatus'#4'Left'#2#4#6'Height'#2'6'#3'Top'#2#4#5'Width'#3'n'#1#5'Ali' + +'gn'#7#8'alClient'#9'Alignment'#7#8'taCenter'#8'AutoSize'#8#18'BorderSpacing' + +'.Left'#2#2#17'BorderSpacing.Top'#2#2#19'BorderSpacing.Right'#2#2#20'BorderS' + +'pacing.Bottom'#2#2#5'Color'#7#9'clBtnFace'#6'Layout'#7#8'tlCenter'#11'Paren' + +'tColor'#8#11'Transparent'#8#8'WordWrap'#9#0#0#0#6'TPanel'#9'pnlButton'#4'Le' + +'ft'#2#6#6'Height'#2'"'#3'Top'#3#160#0#5'Width'#3'v'#1#5'Align'#7#8'alBottom' + +#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'"'#11'ClientWidth'#3'v'#1#8'T' + +'abOrder'#2#2#0#7'TBitBtn'#6'BClose'#24'AnchorSideBottom.Control'#7#5'Owner' + +#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#134#0#6'Height'#2'"'#3'T' + +'op'#2#0#5'Width'#2'k'#7'Anchors'#11#5'akTop'#0#7'Caption'#6#3'&OK'#7'Defaul' + +'t'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#7'OnClick'#7#11 + +'BCloseClick'#8'TabOrder'#2#0#0#0#0#6'TPanel'#7'pnlInfo'#4'Left'#2#6#6'Heigh' + +'t'#2'2'#3'Top'#2'h'#5'Width'#3'v'#1#5'Align'#7#8'alBottom'#10'BevelOuter'#7 + +#6'bvNone'#12'ClientHeight'#2'2'#11'ClientWidth'#3'v'#1#8'TabOrder'#2#3#0#6 + +'TPanel'#8'pnlLines'#22'AnchorSideLeft.Control'#7#5'Owner'#18'AnchorSideTop.' + +'Side'#7#9'asrCenter'#4'Left'#2#0#6'Height'#2'2'#3'Top'#2#0#5'Width'#2'z'#5 + +'Align'#7#6'alLeft'#10'BevelInner'#7#8'bvRaised'#10'BevelOuter'#7#9'bvLowere' + +'d'#12'ClientHeight'#2'2'#11'ClientWidth'#2'z'#8'TabOrder'#2#0#0#6'TLabel'#7 + +'LNLines'#4'Left'#2'/'#6'Height'#2'.'#3'Top'#2#2#5'Width'#2'D'#5'Align'#7#8 + +'alClient'#9'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#19'BorderSpacing.' + +'Right'#2#5#7'Caption'#6#1'0'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6 + +'TLabel'#10'LInfoLines'#4'Left'#2#6#6'Height'#2'.'#3'Top'#2#2#5'Width'#2')'#5 + +'Align'#7#6'alLeft'#18'BorderSpacing.Left'#2#4#7'Caption'#6#6'Lines:'#6'Layo' + +'ut'#7#8'tlCenter'#11'ParentColor'#8#0#0#0#6'TPanel'#6'Panel3'#22'AnchorSide' + +'Left.Control'#7#5'Owner'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2'~' + +#6'Height'#2'2'#3'Top'#2#0#5'Width'#2'z'#5'Align'#7#8'alClient'#18'BorderSpa' + +'cing.Left'#2#4#19'BorderSpacing.Right'#2#4#10'BevelInner'#7#8'bvRaised'#10 + +'BevelOuter'#7#9'bvLowered'#12'ClientHeight'#2'2'#11'ClientWidth'#2'z'#8'Tab' + +'Order'#2#1#0#6'TPanel'#16'pnlHintsWarnings'#4'Left'#2#4#6'Height'#2#18#3'To' + +'p'#2#6#5'Width'#2'r'#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#2#17'Bord' + +'erSpacing.Top'#2#4#19'BorderSpacing.Right'#2#2#10'BevelOuter'#7#6'bvNone'#12 + +'ClientHeight'#2#18#11'ClientWidth'#2'r'#8'TabOrder'#2#0#0#6'TLabel'#6'LNHin' + +'t'#4'Left'#2'+'#6'Height'#2#18#3'Top'#2#0#5'Width'#2'E'#5'Align'#7#8'alClie' + +'nt'#9'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#18'BorderSpacing.Left'#2 + +#2#19'BorderSpacing.Right'#2#2#7'Caption'#6#1'0'#11'ParentColor'#8#10'Parent' + +'Font'#8#0#0#6'TLabel'#9'LInfoHint'#4'Left'#2#0#6'Height'#2#18#3'Top'#2#0#5 + +'Width'#2')'#5'Align'#7#6'alLeft'#7'Caption'#6#6'Hints:'#11'ParentColor'#8#0 + +#0#0#6'TPanel'#17'pnlHintsWarnings1'#4'Left'#2#4#6'Height'#2#18#3'Top'#2#26#5 + +'Width'#2'r'#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#2#17'BorderSpacing' + +'.Top'#2#2#19'BorderSpacing.Right'#2#2#10'BevelOuter'#7#6'bvNone'#12'ClientH' + +'eight'#2#18#11'ClientWidth'#2'r'#8'TabOrder'#2#1#0#6'TLabel'#12'LInfoWarnin' + +'g'#4'Left'#2#0#6'Height'#2#18#3'Top'#2#0#5'Width'#2'A'#5'Align'#7#6'alLeft' + +#7'Caption'#6#9'Warnings:'#11'ParentColor'#8#0#0#6'TLabel'#9'LNWarning'#4'Le' + +'ft'#2'C'#6'Height'#2#18#3'Top'#2#0#5'Width'#2'-'#5'Align'#7#8'alClient'#9'A' + +'lignment'#7#14'taRightJustify'#8'AutoSize'#8#18'BorderSpacing.Left'#2#2#19 +'BorderSpacing.Right'#2#2#7'Caption'#6#1'0'#11'ParentColor'#8#10'ParentFont' - +#8#0#0#0#6'TPanel'#9'pnlErrors'#4'Left'#2#4#6'Height'#2#18#3'Top'#2#26#5'Wid' - +'th'#2'r'#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#2#17'BorderSpacing.To' - +'p'#2#2#19'BorderSpacing.Right'#2#2#10'BevelOuter'#7#6'bvNone'#12'ClientHeig' - +'ht'#2#18#11'ClientWidth'#2'r'#8'TabOrder'#2#1#0#6'TLabel'#10'LInfoError'#4 - +'Left'#2#0#6'Height'#2#18#3'Top'#2#0#5'Width'#2'1'#5'Align'#7#6'alLeft'#7'Ca' - +'ption'#6#7'Errors:'#11'ParentColor'#8#0#0#6'TLabel'#7'LNError'#4'Left'#2'3' - +#6'Height'#2#18#3'Top'#2#0#5'Width'#2'='#5'Align'#7#8'alClient'#9'Alignment' - +#7#14'taRightJustify'#8'AutoSize'#8#18'BorderSpacing.Left'#2#2#19'BorderSpac' - +'ing.Right'#2#2#7'Caption'#6#1'0'#11'ParentColor'#8#10'ParentFont'#8#0#0#0#0 - +#0#0 + +#8#0#0#0#0#6'TPanel'#14'pnlNotesErrors'#22'AnchorSideLeft.Control'#7#5'Owner' + ,#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#3#252#0#6'Height'#2'2'#3'Top' + +#2#0#5'Width'#2'z'#5'Align'#7#7'alRight'#18'BorderSpacing.Left'#2#4#10'Bevel' + +'Inner'#7#8'bvRaised'#10'BevelOuter'#7#9'bvLowered'#12'ClientHeight'#2'2'#11 + +'ClientWidth'#2'z'#8'TabOrder'#2#2#0#6'TPanel'#17'pnlHintsWarnings2'#4'Left' + +#2#4#6'Height'#2#18#3'Top'#2#6#5'Width'#2'r'#5'Align'#7#5'alTop'#18'BorderSp' + +'acing.Left'#2#2#17'BorderSpacing.Top'#2#4#19'BorderSpacing.Right'#2#2#10'Be' + +'velOuter'#7#6'bvNone'#12'ClientHeight'#2#18#11'ClientWidth'#2'r'#8'TabOrder' + +#2#0#0#6'TLabel'#9'LInfoNote'#4'Left'#2#0#6'Height'#2#18#3'Top'#2#0#5'Width' + +#2'/'#5'Align'#7#6'alLeft'#7'Caption'#6#6'Notes:'#11'ParentColor'#8#0#0#6'TL' + +'abel'#6'LNNote'#4'Left'#2'1'#6'Height'#2#18#3'Top'#2#0#5'Width'#2'?'#5'Alig' + +'n'#7#8'alClient'#9'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#18'BorderS' + +'pacing.Left'#2#2#19'BorderSpacing.Right'#2#2#7'Caption'#6#1'0'#11'ParentCol' + +'or'#8#10'ParentFont'#8#0#0#0#6'TPanel'#9'pnlErrors'#4'Left'#2#4#6'Height'#2 + +#18#3'Top'#2#26#5'Width'#2'r'#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#2 + +#17'BorderSpacing.Top'#2#2#19'BorderSpacing.Right'#2#2#10'BevelOuter'#7#6'bv' + +'None'#12'ClientHeight'#2#18#11'ClientWidth'#2'r'#8'TabOrder'#2#1#0#6'TLabel' + +#10'LInfoError'#4'Left'#2#0#6'Height'#2#18#3'Top'#2#0#5'Width'#2'-'#5'Align' + +#7#6'alLeft'#7'Caption'#6#7'Errors:'#11'ParentColor'#8#0#0#6'TLabel'#7'LNErr' + +'or'#4'Left'#2'/'#6'Height'#2#18#3'Top'#2#0#5'Width'#2'A'#5'Align'#7#8'alCli' + +'ent'#9'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#18'BorderSpacing.Left' + +#2#2#19'BorderSpacing.Right'#2#2#7'Caption'#6#1'0'#11'ParentColor'#8#10'Pare' + +'ntFont'#8#0#0#0#0#0#0 ]); diff --git a/ide/infobuild.pp b/ide/infobuild.pp index 83643c3b0a..b059e8d0ae 100644 --- a/ide/infobuild.pp +++ b/ide/infobuild.pp @@ -31,15 +31,13 @@ interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, - LCLProc, ExtCtrls, StdCtrls, ExtDlgs, - LazIDEIntf, - LazarusIDEStrConsts; + LCLProc, ExtCtrls, StdCtrls, ExtDlgs, LazIDEIntf, LazarusIDEStrConsts; type - { TFInfoCompile } + { TCompileInfoDlg } - TFInfoCompile = class ( TForm ) + TCompileInfoDlg = class (TForm) BClose: TBitBtn; lbInfo: TLabel; LInfoError: TLabel; @@ -64,8 +62,8 @@ type PCurrentStatus : TLabel; Panel1 : TPanel; PnlTitle : TPanel; - procedure BCloseClick ( Sender : TObject ) ; - procedure FormCreate ( Sender : TObject ) ; + procedure BCloseClick(Sender: TObject); + procedure FormCreate(Sender: TObject); private NHints : Integer; NWarnings : Integer; @@ -74,30 +72,42 @@ type NLines : Integer; ToAbort : Boolean; public - Procedure SetProjectName(Const Sname : String); - Procedure SetStatus(Const SStatus : String); - Procedure SetCanClose; - Procedure MakeBold; + procedure SetProjectName(const Sname: String); + procedure SetStatus(const SStatus: String); + procedure SetCanClose; + procedure MakeBold; + end; + + TCompileProgressClass = class of TCompileProgress; + + { TCompileProgress } + + TCompileProgress = class + class procedure CreateDialog(AOwner: TComponent; const AProject, AStatus: String); + class procedure Close; + class procedure Show; + class procedure Hide; + class procedure SetEnabled(AValue: Boolean); + class procedure SetStatus(const AStatus: String); + class procedure SetProject(const AProject: String); + class procedure Ready(const AMessage: String = ''); + class procedure Ready(const AMessage: String; const AParams: array of const); end; var - FInfoCompile : TFInfoCompile; - ShowCompileDialog: Boolean = false; - -Procedure CreateInfoBuilder(Owner: TComponent); -Procedure DestroyInfoBuilder; -Procedure PutInfoBuilderStatus(Const Info : String); -Procedure PutInfoBuilderProject(Const Info : String); -Procedure AbleInfoBuilderExit; -Procedure PutExitInfoBuilder(Const Info : String); + CompileProgress: TCompileProgressClass = TCompileProgress; implementation -{ TFInfoCompile } +var + MCompileInfoDlg: TCompileInfoDlg; + MCompileDialogEnabled: Boolean = False; -procedure TFInfoCompile.BCloseClick ( Sender : TObject ) ; +{ TCompileInfoDlg } + +procedure TCompileInfoDlg.BCloseClick(Sender: TObject); begin - If ToAbort then + if ToAbort then begin LazarusIDE.AbortBuild; SetStatus('Aborted...!'); @@ -107,7 +117,7 @@ begin Close; end; -procedure TFInfoCompile.FormCreate ( Sender : TObject ) ; +procedure TCompileInfoDlg.FormCreate (Sender: TObject); begin NHints := 0; NWarnings := 0; @@ -133,12 +143,12 @@ begin end; -Procedure TFInfoCompile.SetProjectName(Const Sname : String); +procedure TCompileInfoDlg.SetProjectName(const Sname : String); begin lbInfo.Caption := lisInfoBuildBuild + ' '+ ExtractFileName(Sname); end; -Procedure TFInfoCompile.SetStatus(Const SStatus : String); +procedure TCompileInfoDlg.SetStatus(const SStatus : String); Var S : String; Ok : Boolean; @@ -196,58 +206,83 @@ begin pnlInfo.Refresh; end; -Procedure TFInfoCompile.SetCanClose; +procedure TCompileInfoDlg.SetCanClose; begin ToAbort := False; BClose.Kind := bkOk; BClose.Caption := lisMenuClose; end; -Procedure TFInfoCompile.MakeBold; +procedure TCompileInfoDlg.MakeBold; begin PCurrentStatus.Font.Style:= PCurrentStatus.Font.Style + [fsBold]; end; -Procedure PutInfoBuilderStatus(Const Info : String); + +{ TCompileProgress } + +class procedure TCompileProgress.Close; begin - if Assigned(FInfoCompile) then FInfoCompile.SetStatus(Info); + FreeAndNil(MCompileInfoDlg); end; -Procedure DestroyInfoBuilder; +class procedure TCompileProgress.CreateDialog(AOwner: TComponent; const AProject, AStatus: String); begin - if Assigned(FInfoCompile) then + Close; + if MCompileDialogEnabled then begin - FInfoCompile.Free; - FinfoCompile := Nil; + MCompileInfoDlg := TCompileInfoDlg.Create(AOwner); + MCompileInfoDlg.SetProjectName(AProject); + MCompileInfoDlg.SetStatus(AStatus); + // delay show til actual compile + //MCompileInfoDlg.Show; end; end; -Procedure CreateInfoBuilder(Owner: TComponent); +class procedure TCompileProgress.Hide; begin - //DebugLn(['CreateInfoBuilder ',ShowCompileDialog]); - DestroyInfoBuilder; - if ShowCompileDialog then - begin - FInfoCompile := TFInfoCompile.Create(Owner); - FInfoCompile.Show; + if MCompileInfoDlg = nil then Exit; + MCompileInfoDlg.Hide; +end; + +class procedure TCompileProgress.SetEnabled(AValue: Boolean); +begin + MCompileDialogEnabled := AValue; +end; + +class procedure TCompileProgress.SetProject(const AProject: String); +begin + if MCompileInfoDlg = nil then Exit; + MCompileInfoDlg.SetProjectName(AProject); +end; + +class procedure TCompileProgress.Ready(const AMessage: String); +begin + if MCompileInfoDlg = nil then Exit; + if AMessage <> '' + then begin + MCompileInfoDlg.SetStatus(AMessage); + MCompileInfoDlg.MakeBold; end; + MCompileInfoDlg.SetCanClose; end; -Procedure PutInfoBuilderProject(Const Info : String); +class procedure TCompileProgress.Ready(const AMessage: String; const AParams: array of const); begin - if Assigned(FInfoCompile) then FInfoCompile.SetProjectName(Info); + if MCompileInfoDlg = nil then Exit; + Ready(Format(AMessage, AParams)); end; -Procedure AbleInfoBuilderExit; +class procedure TCompileProgress.SetStatus(const AStatus: String); begin - if Assigned(FInfoCompile) then FInfoCompile.SetCanClose; + if MCompileInfoDlg = nil then Exit; + MCompileInfoDlg.SetStatus(AStatus); end; -Procedure PutExitInfoBuilder(Const Info : String); +class procedure TCompileProgress.Show; begin - PutInfoBuilderStatus(Info); - if Assigned(FInfoCompile) then FInfoCompile.MakeBold; - AbleInfoBuilderExit; + if MCompileInfoDlg = nil then Exit; + MCompileInfoDlg.Show; end; initialization diff --git a/ide/main.pp b/ide/main.pp index ee8380cd90..896275db5f 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -1160,7 +1160,7 @@ begin CodeExplorerOptions.Load; MainBuildBoss.SetupInputHistories; - ShowCompileDialog:=EnvironmentOptions.ShowCompileDialog; + CompileProgress.SetEnabled(EnvironmentOptions.ShowCompileDialog); CreateDirUTF8(GetProjectSessionsConfigPath); end; @@ -4240,7 +4240,7 @@ begin OldCompilerFilename:=EnvironmentOptions.CompilerFilename; OldLanguage:=EnvironmentOptions.LanguageID; IDEOptionsDialog.WriteAll; - ShowCompileDialog := EnvironmentOptions.ShowCompileDialog; + CompileProgress.SetEnabled(EnvironmentOptions.ShowCompileDialog); UpdateDefaultPascalFileExtensions; @@ -9964,9 +9964,7 @@ begin end; end; - CreateInfoBuilder(OwningComponent); - PutInfoBuilderProject(Project1.MainFilename); - PutInfoBuilderStatus(lisInfoBuildComplile); + CompileProgress.CreateDialog(OwningComponent, Project1.MainFilename, lisInfoBuildComplile); // clear old error lines SourceNotebook.ClearErrorLines; @@ -9995,7 +9993,7 @@ begin Result:=PkgBoss.DoCompileProjectDependencies(Project1,PkgFlags); if Result <> mrOk then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; Result:=DoCallModalFunctionHandler(lihtOnProjectDependenciesCompiled); @@ -10014,7 +10012,7 @@ begin Result:=DoWarnAmbiguousFiles; if Result<>mrOk then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; @@ -10028,13 +10026,13 @@ begin if (pbfOnlyIfNeeded in Flags) and (not (pfAlwaysBuild in Project1.Flags)) then begin if Result=mrNo then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); Result:=mrOk; exit; end; if Result<>mrYes then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; end; @@ -10097,7 +10095,7 @@ begin Project1.ProjectDirectory,lisExecutingCommandBefore); if Result<>mrOk then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; end; @@ -10126,20 +10124,20 @@ begin Project1.LastCompilerParams:=CompilerParams; Project1.LastCompilerFileDate:=FileAgeUTF8(CompilerFilename); DoJumpToCompilerMessage(-1,true); - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; // compilation succeded -> write state file Result:=Project1.SaveStateFile(CompilerFilename,CompilerParams); if Result<>mrOk then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; // update project .po file Result:=UpdateProjectPOFile(Project1); if Result<>mrOk then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; @@ -10158,7 +10156,7 @@ begin Project1.ProjectDirectory,lisExecutingCommandAfter); if Result<>mrOk then begin - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); exit; end; end; @@ -10167,7 +10165,7 @@ begin // add success message MessagesView.AddMsg(Format(lisProjectSuccessfullyBuilt, ['"', Project1.ShortDescription, '"']),'',-1); - PutExitInfoBuilder(lisInfoBuildSuccess); + CompileProgress.Ready(lisInfoBuildSuccess); finally // check sources @@ -10525,8 +10523,7 @@ begin // first compile all lazarus components (LCL, SynEdit, CodeTools, ...) // but not the IDE SourceNotebook.ClearErrorLines; - CreateInfoBuilder(OwningComponent); - PutInfoBuilderProject('Lazarus...'); + CompileProgress.CreateDialog(OwningComponent, 'Lazarus...', ''); Result:=BuildLazarus(MiscellaneousOptions.BuildLazOpts, EnvironmentOptions.ExternalTools,GlobalMacroList, '',EnvironmentOptions.CompilerFilename, @@ -10540,7 +10537,7 @@ begin // then compile the 'installed' packages if ([blfWithStaticPackages,blfOnlyIDE]*Flags=[]) and (MiscellaneousOptions.BuildLazOpts.ItemIDE.MakeMode=mmNone) then begin - AbleInfoBuilderExit; + CompileProgress.Ready; exit; end; @@ -10608,13 +10605,13 @@ begin MessagesView.EndBlock; if Result = mrOK then - PutExitInfoBuilder(lisinfoBuildSuccess) + CompileProgress.Ready(lisinfoBuildSuccess) else - PutExitInfoBuilder(lisInfoBuildError); + CompileProgress.Ready(lisInfoBuildError); end; if (Result=mrOK) and MiscellaneousOptions.BuildLazOpts.RestartAfterBuild then begin - DestroyInfoBuilder; + CompileProgress.Close; mnuRestartClicked(nil); end; end; @@ -10698,9 +10695,9 @@ begin Result:=mrOk; {if AReason <> crRun then - AbleInfoBuilderExit + CompileProgress.Ready else} - DestroyInfoBuilder; + CompileProgress.Close; end; function TMainIDE.DoRunFile: TModalResult; diff --git a/ide/msgview.pp b/ide/msgview.pp index bb85e2e861..fc5b51163a 100644 --- a/ide/msgview.pp +++ b/ide/msgview.pp @@ -437,7 +437,7 @@ begin end; end; - if ToStoreMessage then PutInfoBuilderStatus(Msg); + if ToStoreMessage then CompileProgress.SetStatus(Msg); if NewMsg=nil then begin NewMsg := TLazMessageLine.Create;