diff --git a/ide/buildlazdialog.lfm b/ide/buildlazdialog.lfm index d625353920..7537b7bf98 100644 --- a/ide/buildlazdialog.lfm +++ b/ide/buildlazdialog.lfm @@ -1,13 +1,13 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg - Left = 282 - Height = 549 - Top = 262 - Width = 543 + Left = 333 + Height = 658 + Top = 113 + Width = 653 VertScrollBar.Visible = False BorderIcons = [biSystemMenu] Caption = 'ConfigureBuildLazarusDlg' - ClientHeight = 549 - ClientWidth = 543 + ClientHeight = 658 + ClientWidth = 653 Constraints.MinHeight = 400 Constraints.MinWidth = 305 OnCreate = FormCreate @@ -17,12 +17,12 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg LCLVersion = '0.9.29' object DetailsPanel: TPanel Left = 0 - Height = 505 + Height = 614 Top = 0 - Width = 543 + Width = 653 Align = alClient - ClientHeight = 505 - ClientWidth = 543 + ClientHeight = 614 + ClientWidth = 653 TabOrder = 0 object BuildProfileLabel: TLabel Left = 8 @@ -42,9 +42,9 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideBottom.Control = MakeModeListBox AnchorSideBottom.Side = asrBottom Left = 326 - Height = 230 + Height = 254 Top = 50 - Width = 216 + Width = 326 Anchors = [akTop, akLeft, akRight, akBottom] AutoFill = True Caption = 'LCLInterfaceRadioGroup' @@ -60,24 +60,22 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg end object DetailSettingPanel: TPanel Left = 1 - Height = 226 - Top = 278 - Width = 541 + Height = 310 + Top = 303 + Width = 651 Align = alBottom - ClientHeight = 226 - ClientWidth = 541 + ClientHeight = 310 + ClientWidth = 651 TabOrder = 1 object OptionsLabel: TLabel AnchorSideLeft.Control = DetailSettingPanel - AnchorSideTop.Control = DetailSettingPanel - AnchorSideRight.Control = OptionsEdit + AnchorSideTop.Control = OptionsMemo Left = 8 Height = 16 - Top = 20 + Top = 14 Width = 49 Alignment = taRightJustify BorderSpacing.Left = 7 - BorderSpacing.Top = 19 Caption = 'Options' Layout = tlBottom ParentColor = False @@ -88,7 +86,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideTop.Side = asrCenter Left = 8 Height = 16 - Top = 42 + Top = 95 Width = 63 Alignment = taRightJustify Caption = 'Target OS' @@ -100,7 +98,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideTop.Side = asrCenter Left = 8 Height = 16 - Top = 69 + Top = 122 Width = 102 Alignment = taRightJustify Caption = 'Target Directory' @@ -112,27 +110,12 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideTop.Side = asrCenter Left = 8 Height = 16 - Top = 96 + Top = 149 Width = 69 Alignment = taRightJustify Caption = 'Target CPU' ParentColor = False end - object OptionsEdit: TEdit - AnchorSideLeft.Control = DetailSettingPanel - AnchorSideTop.Control = DetailSettingPanel - AnchorSideRight.Control = DetailSettingPanel - AnchorSideRight.Side = asrBottom - Left = 151 - Height = 21 - Top = 13 - Width = 383 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Left = 150 - BorderSpacing.Top = 12 - BorderSpacing.Right = 6 - TabOrder = 0 - end object TargetDirectoryComboBox: TComboBox AnchorSideLeft.Control = TargetOSComboBox AnchorSideTop.Control = TargetOSComboBox @@ -140,21 +123,21 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideRight.Control = TargetDirectoryButton Left = 151 Height = 21 - Top = 67 - Width = 351 + Top = 120 + Width = 461 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 6 ItemHeight = 0 - TabOrder = 1 + TabOrder = 0 end object TargetDirectoryButton: TButton AnchorSideTop.Control = TargetDirectoryComboBox AnchorSideRight.Side = asrBottom AnchorSideBottom.Control = TargetDirectoryComboBox AnchorSideBottom.Side = asrBottom - Left = 508 + Left = 618 Height = 23 - Top = 68 + Top = 121 Width = 22 Anchors = [akTop, akRight] BorderSpacing.Left = 6 @@ -162,7 +145,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg BorderSpacing.Right = 6 Caption = '...' OnClick = TargetDirectoryButtonClick - TabOrder = 2 + TabOrder = 1 end object TargetCPUComboBox: TComboBox AnchorSideLeft.Control = TargetDirectoryComboBox @@ -172,39 +155,37 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideRight.Side = asrBottom Left = 151 Height = 21 - Top = 94 - Width = 383 + Top = 147 + Width = 493 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 6 BorderSpacing.Right = 6 ItemHeight = 0 - TabOrder = 3 + TabOrder = 2 end object RestartAfterBuildCheckBox: TCheckBox - AnchorSideLeft.Control = DetailSettingPanel - AnchorSideTop.Control = TargetCPUComboBox + AnchorSideLeft.Control = SelectedCheckBox + AnchorSideTop.Control = CommonsDividerBevel AnchorSideTop.Side = asrBottom Left = 8 Height = 20 - Top = 125 + Top = 268 Width = 189 - BorderSpacing.Left = 7 BorderSpacing.Top = 10 BorderSpacing.Bottom = 6 Caption = 'RestartAfterBuildCheckBox' - TabOrder = 4 + TabOrder = 3 end object ConfirmBuildCheckBox: TCheckBox - AnchorSideLeft.Control = RestartAfterBuildCheckBox + AnchorSideLeft.Control = WithStaticPackagesCheckBox AnchorSideTop.Control = RestartAfterBuildCheckBox - AnchorSideTop.Side = asrBottom - Left = 8 + AnchorSideTop.Side = asrCenter + Left = 302 Height = 20 - Top = 151 + Top = 268 Width = 159 - BorderSpacing.Top = 6 Caption = 'ConfirmBuildCheckBox' - TabOrder = 5 + TabOrder = 4 end object CleanAllCheckBox: TCheckBox AnchorSideLeft.Control = DetailSettingPanel @@ -213,13 +194,13 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideRight.Side = asrBottom Left = 302 Height = 20 - Top = 125 - Width = 76 + Top = 178 + Width = 132 BorderSpacing.Left = 301 BorderSpacing.Top = 10 BorderSpacing.Bottom = 6 - Caption = 'Clean All' - TabOrder = 6 + Caption = 'CleanAllCheckBox' + TabOrder = 5 end object WithStaticPackagesCheckBox: TCheckBox AnchorSideLeft.Control = CleanAllCheckBox @@ -228,51 +209,79 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideBottom.Side = asrBottom Left = 302 Height = 20 - Top = 151 + Top = 204 Width = 206 BorderSpacing.Top = 6 Caption = 'WithStaticPackagesCheckBox' - TabOrder = 7 + TabOrder = 6 end object TargetOSComboBox: TComboBox - AnchorSideLeft.Control = OptionsEdit - AnchorSideTop.Control = OptionsEdit + AnchorSideLeft.Control = OptionsMemo + AnchorSideTop.Control = OptionsMemo AnchorSideTop.Side = asrBottom AnchorSideRight.Control = DetailSettingPanel AnchorSideRight.Side = asrBottom Left = 151 Height = 21 - Top = 40 - Width = 383 + Top = 93 + Width = 493 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 6 BorderSpacing.Right = 6 ItemHeight = 0 - TabOrder = 8 + TabOrder = 7 end object UpdateRevisionIncCheckBox: TCheckBox - AnchorSideLeft.Control = CleanAllCheckBox - AnchorSideTop.Control = WithStaticPackagesCheckBox + AnchorSideLeft.Control = TargetCPULabel + AnchorSideTop.Control = TargetCPUComboBox AnchorSideTop.Side = asrBottom AnchorSideBottom.Side = asrBottom - Left = 302 + Left = 8 Height = 20 - Top = 177 + Top = 178 Width = 198 - BorderSpacing.Top = 6 + BorderSpacing.Top = 10 Caption = 'UpdateRevisionIncCheckBox' - TabOrder = 9 + TabOrder = 8 end - object BuildWithAllCheckBox: TCheckBox - AnchorSideLeft.Control = ConfirmBuildCheckBox - AnchorSideTop.Control = ConfirmBuildCheckBox + object SelectedCheckBox: TCheckBox + AnchorSideLeft.Control = UpdateRevisionIncCheckBox + AnchorSideTop.Control = UpdateRevisionIncCheckBox AnchorSideTop.Side = asrBottom Left = 8 Height = 20 - Top = 177 - Width = 241 + Top = 204 + Width = 139 BorderSpacing.Top = 6 - Caption = 'Include this profile when building all' + Caption = 'SelectedCheckBox' + TabOrder = 9 + end + object CommonsDividerBevel: TDividerBevel + AnchorSideLeft.Control = DetailSettingPanel + AnchorSideTop.Control = WithStaticPackagesCheckBox + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 17 + Top = 241 + Width = 636 + Caption = 'CommonsDividerBevel' + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 7 + BorderSpacing.Top = 17 + Font.Style = [fsBold] + ParentFont = False + end + object OptionsMemo: TMemo + AnchorSideTop.Control = DetailSettingPanel + Left = 151 + Height = 73 + Top = 14 + Width = 493 + BorderSpacing.Top = 13 + Lines.Strings = ( + 'Memo1' + ) + ScrollBars = ssAutoBoth TabOrder = 10 end end @@ -296,7 +305,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideRight.Control = MakeModeListHeader AnchorSideRight.Side = asrBottom Left = 1 - Height = 205 + Height = 229 Top = 75 Width = 325 Anchors = [akTop, akLeft, akRight, akBottom] @@ -319,7 +328,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg Height = 21 Hint = 'Name of the active profile.' Top = 15 - Width = 369 + Width = 479 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 6 BorderSpacing.Right = 6 @@ -336,7 +345,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideRight.Control = DetailsPanel AnchorSideRight.Side = asrBottom AnchorSideBottom.Side = asrBottom - Left = 461 + Left = 571 Height = 25 Hint = 'Manage profiles' Top = 13 @@ -356,16 +365,16 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg AnchorSideTop.Side = asrBottom Left = 0 Height = 44 - Top = 505 - Width = 543 + Top = 614 + Width = 653 Align = alBottom AutoSize = True BevelOuter = bvNone ClientHeight = 44 - ClientWidth = 543 + ClientWidth = 653 TabOrder = 1 object CancelButton: TBitBtn - Left = 460 + Left = 570 Height = 32 Top = 6 Width = 77 @@ -380,7 +389,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg TabOrder = 0 end object SaveSettingsButton: TBitBtn - Left = 359 + Left = 469 Height = 32 Top = 6 Width = 95 @@ -393,7 +402,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg TabOrder = 1 end object CompileButton: TBitBtn - Left = 278 + Left = 264 Height = 32 Top = 6 Width = 75 @@ -419,17 +428,17 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg OnClick = HelpButtonClick TabOrder = 3 end - object CompileAllButton: TBitBtn - Left = 195 + object CompileSelectedButton: TBitBtn + Left = 345 Height = 32 Top = 6 - Width = 77 + Width = 118 Align = alRight AutoSize = True BorderSpacing.Around = 6 - Caption = 'Compile All' + Caption = 'Compile Selected' NumGlyphs = 0 - OnClick = CompileAllButtonClick + OnClick = CompileSelectedButtonClick TabOrder = 4 end end diff --git a/ide/buildlazdialog.pas b/ide/buildlazdialog.pas index 0e299e309f..ff716d2bbe 100644 --- a/ide/buildlazdialog.pas +++ b/ide/buildlazdialog.pas @@ -47,7 +47,7 @@ uses Classes, SysUtils, LCLProc, LConvEncoding, Forms, Controls, LCLType, LCLIntf, Graphics, GraphType, StdCtrls, ExtCtrls, Buttons, FileUtil, Dialogs, Types, InterfaceBase, Themes, ComCtrls, - DefineTemplates, Laz_XMLCfg, + DefineTemplates, Laz_XMLCfg, DividerBevel, LazarusIDEStrConsts, TransferMacros, LazConf, IDEProcs, DialogProcs, IDEMsgIntf, IDEContextHelpEdit, IDEImagesIntf, MainBar, InputHistory, ExtToolDialog, ExtToolEditDlg, EnvironmentOpts, @@ -76,16 +76,17 @@ type CleanAllCheckBox: TCheckBox; BuildProfileComboBox: TComboBox; CompileButton: TBitBtn; - CompileAllButton: TBitBtn; + CompileSelectedButton: TBitBtn; ConfirmBuildCheckBox: TCheckBox; - BuildWithAllCheckBox: TCheckBox; + OptionsMemo: TMemo; + SelectedCheckBox: TCheckBox; DetailsPanel: TPanel; + CommonsDividerBevel: TDividerBevel; HelpButton: TBitBtn; BuildProfileLabel: TLabel; MakeModeListBox: TListBox; MakeModeListHeader: THeaderControl; LCLInterfaceRadioGroup: TRadioGroup; - OptionsEdit: TEdit; OptionsLabel: TLabel; DetailSettingPanel: TPanel; RestartAfterBuildCheckBox: TCheckBox; @@ -103,7 +104,7 @@ type WithStaticPackagesCheckBox: TCheckBox; procedure BuildProfileButtonClick(Sender: TObject); procedure BuildProfileComboBoxSelect(Sender: TObject); - procedure CompileAllButtonClick(Sender: TObject); + procedure CompileSelectedButtonClick(Sender: TObject); procedure CompileButtonClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -410,7 +411,7 @@ begin MMDef:=Profiles.MakeModeDefs[ItemIndex]; // create extra options - ExtraOptions:=Options.ExtraOptions; + ExtraOptions:=Options.ExOptions; if MMDef=Profiles.MakeModeDefs.ItemIDE then begin // check for special IDE config file @@ -752,32 +753,33 @@ begin end; // Show Build target names in radiogroup. - with LCLInterfaceRadioGroup do - begin - Caption := lisLazBuildLCLInterface; - for LCLInterface := Low(TLCLPlatform) to High(TLCLPlatform) do - Items.Add(LCLPlatformDisplayNames[LCLInterface]); - end; + LCLInterfaceRadioGroup.Caption := lisLazBuildLCLInterface; + for LCLInterface := Low(TLCLPlatform) to High(TLCLPlatform) do + LCLInterfaceRadioGroup.Items.Add(LCLPlatformDisplayNames[LCLInterface]); BuildProfileLabel.Caption:=lisLazBuildProfile; - CleanAllCheckBox.Caption := lisLazBuildCleanAll; OptionsLabel.Caption := lisLazBuildOptions; - WithStaticPackagesCheckBox.Caption := lisLazBuildWithStaticPackages; - UpdateRevisionIncCheckBox.Caption := lisUpdateRevisionInc; - RestartAfterBuildCheckBox.Caption := lisLazBuildRestartAfterBuild; - ConfirmBuildCheckBox.Caption := lisLazBuildConfirmBuild; - BuildWithAllCheckBox.Caption := lisLazBuildWithAll; - CompileButton.Caption := lisMenuBuild; - CompileAllButton.Caption := lisMenuBuildAll; - SaveSettingsButton.Caption := lisLazBuildSaveSettings; - CancelButton.Caption := lisLazBuildCancel; - HelpButton.Caption := lisMenuHelp; TargetOSLabel.Caption := lisLazBuildTargetOS; TargetCPULabel.Caption := lisLazBuildTargetCPU; TargetDirectoryLabel.Caption := lisLazBuildTargetDirectory; + CleanAllCheckBox.Caption := lisLazBuildCleanAll; + WithStaticPackagesCheckBox.Caption := lisLazBuildWithStaticPackages; + UpdateRevisionIncCheckBox.Caption := lisLazBuildUpdateRevInc; + SelectedCheckBox.Caption := lisLazBuildSelected; + + CommonsDividerBevel.Caption := lisLazBuildCommonSettings; + RestartAfterBuildCheckBox.Caption := lisLazBuildRestartAfterBuild; + ConfirmBuildCheckBox.Caption := lisLazBuildConfirmBuild; + + CompileButton.Caption := lisMenuBuild; + CompileSelectedButton.Caption := lisMenuBuildAll; + SaveSettingsButton.Caption := lisLazBuildSaveSettings; + CancelButton.Caption := lisLazBuildCancel; + HelpButton.Caption := lisMenuHelp; + CompileButton.LoadGlyphFromLazarusResource('menu_build'); - CompileAllButton.LoadGlyphFromLazarusResource('menu_build_all'); + CompileSelectedButton.LoadGlyphFromLazarusResource('menu_build_all'); SaveSettingsButton.LoadGlyphFromStock(idButtonSave); if SaveSettingsButton.Glyph.Empty then SaveSettingsButton.LoadGlyphFromLazarusResource('laz_save'); @@ -993,13 +995,11 @@ end; procedure TConfigureBuildLazarusDlg.CopyProfileToUI(AProfile: TBuildLazarusProfile); begin CleanAllCheckBox.Checked :=AProfile.CleanAll; - OptionsEdit.Text :=AProfile.ExtraOptions; + OptionsMemo.Text :=AProfile.ExOptions; LCLInterfaceRadioGroup.ItemIndex :=ord(AProfile.TargetPlatform); WithStaticPackagesCheckBox.Checked:=AProfile.WithStaticPackages; UpdateRevisionIncCheckBox.Checked :=AProfile.UpdateRevisionInc; - RestartAfterBuildCheckBox.Checked :=AProfile.RestartAfterBuild; - ConfirmBuildCheckBox.Checked :=AProfile.ConfirmBuild; - BuildWithAllCheckBox.Checked :=AProfile.BuildWithAll; + SelectedCheckBox.Checked :=AProfile.Selected; TargetOSComboBox.Text :=AProfile.TargetOS; TargetDirectoryComboBox.Text :=AProfile.TargetDirectory; TargetCPUComboBox.Text :=AProfile.TargetCPU; @@ -1008,13 +1008,11 @@ end; procedure TConfigureBuildLazarusDlg.CopyUIToProfile(AProfile: TBuildLazarusProfile); begin AProfile.CleanAll :=CleanAllCheckBox.Checked; - AProfile.ExtraOptions :=OptionsEdit.Text; + AProfile.ExOptions :=OptionsMemo.Text; AProfile.TargetPlatform :=TLCLPlatform(LCLInterfaceRadioGroup.ItemIndex); AProfile.WithStaticPackages:=WithStaticPackagesCheckBox.Checked; AProfile.UpdateRevisionInc :=UpdateRevisionIncCheckBox.Checked; - AProfile.RestartAfterBuild :=RestartAfterBuildCheckBox.Checked; - AProfile.ConfirmBuild :=ConfirmBuildCheckBox.Checked; - AProfile.BuildWithAll :=BuildWithAllCheckBox.Checked; + AProfile.Selected :=SelectedCheckBox.Checked; AProfile.TargetOS :=TargetOSComboBox.Text; AProfile.TargetDirectory :=TargetDirectoryComboBox.Text; AProfile.TargetCPU :=TargetCPUComboBox.Text; @@ -1034,6 +1032,8 @@ begin CopyProfileToUI(fProfiles.Current); // Copy current selection to UI. BuildProfileComboBox.Items.EndUpdate; fUpdatingProfileCombo:=False; + RestartAfterBuildCheckBox.Checked:=fProfiles.RestartAfterBuild; + ConfirmBuildCheckBox.Checked :=fProfiles.ConfirmBuild; MakeModeListBox.Invalidate; end; @@ -1075,11 +1075,13 @@ end; procedure TConfigureBuildLazarusDlg.PrepareClose; begin CopyUIToProfile(Profiles.Current); + fProfiles.RestartAfterBuild :=RestartAfterBuildCheckBox.Checked; + fProfiles.ConfirmBuild :=ConfirmBuildCheckBox.Checked; MainIDEBar.itmToolBuildLazarus.Caption:= Format(lisMenuBuildLazarusProf, [Profiles.Current.Name]); end; -procedure TConfigureBuildLazarusDlg.CompileAllButtonClick(Sender: TObject); +procedure TConfigureBuildLazarusDlg.CompileSelectedButtonClick(Sender: TObject); begin PrepareClose; ModalResult:=mrAll; diff --git a/ide/buildmanager.pas b/ide/buildmanager.pas index 6ec2e924ef..a7c163c2a9 100644 --- a/ide/buildmanager.pas +++ b/ide/buildmanager.pas @@ -681,7 +681,7 @@ begin ADefTempl:=CreateLazarusSourceTemplate( '$('+ExternalMacroStart+'LazarusDir)', '$('+ExternalMacroStart+'LCLWidgetType)', - MiscellaneousOptions.BuildLazOpts.ExtraOptions,nil); + MiscellaneousOptions.BuildLazOpts.ExOptions,nil); AddTemplate(ADefTempl,true, lisNOTECouldNotCreateDefineTemplateForLazarusSources); end; @@ -1366,7 +1366,7 @@ begin if (MiscellaneousOptions<>nil) and (MiscellaneousOptions.BuildLazOpts<>nil) then - Result:=MiscellaneousOptions.BuildLazOpts.ExtraOptions + Result:=MiscellaneousOptions.BuildLazOpts.ExOptions else Result:=''; end; diff --git a/ide/buildprofilemanager.pas b/ide/buildprofilemanager.pas index d1801c083b..d3cc4fa3bb 100644 --- a/ide/buildprofilemanager.pas +++ b/ide/buildprofilemanager.pas @@ -113,20 +113,19 @@ type fOwnerCnt: TBuildLazarusProfiles; fName: string; fCleanAll: boolean; - fExtraOptions: string; + fExOptions: string; fTargetOS: string; fTargetDirectory: string; fTargetCPU: string; fTargetPlatform: TLCLPlatform; fWithStaticPackages: boolean; fUpdateRevisionInc: boolean; - fRestartAfterBuild: boolean; - fConfirmBuild: boolean; - fBuildWithAll: boolean; + fSelected: boolean; // MakeModeSettings is Synchronised with TMakeModeDefs, same indexes. fMakeModes: TMakeModeSettings; function GetTargetPlatform: TLCLPlatform; + procedure SetExOptions(const AValue: string); procedure SetTargetCPU(const AValue: string); procedure SetTargetOS(const AValue: string); procedure SetTargetPlatform(const AValue: TLCLPlatform); @@ -141,16 +140,14 @@ type public property Name: string read fName; property CleanAll: boolean read fCleanAll write fCleanAll; - property ExtraOptions: string read fExtraOptions write fExtraOptions; + property ExOptions: string read fExOptions write SetExOptions; property TargetOS: string read fTargetOS write SetTargetOS; property TargetDirectory: string read fTargetDirectory write fTargetDirectory; property TargetCPU: string read fTargetCPU write SetTargetCPU; property TargetPlatform: TLCLPlatform read GetTargetPlatform write SetTargetPlatform; property WithStaticPackages: boolean read fWithStaticPackages write fWithStaticPackages; property UpdateRevisionInc: boolean read fUpdateRevisionInc write fUpdateRevisionInc; - property RestartAfterBuild: boolean read fRestartAfterBuild write fRestartAfterBuild; - property ConfirmBuild: boolean read fConfirmBuild write fConfirmBuild; - property BuildWithAll: boolean read fBuildWithAll write fBuildWithAll; + property Selected: boolean read fSelected write fSelected; property MakeModes: TMakeModeSettings read fMakeModes; end; @@ -160,6 +157,8 @@ type private fGlobals: TGlobalCompilerOptions; fMakeModeDefs: TMakeModeDefs; + fRestartAfterBuild: boolean; + fConfirmBuild: boolean; fStaticAutoInstallPackages: TStringList; fCurrentIndex: integer; function GetCurrentIdeMode: TMakeMode; @@ -178,6 +177,8 @@ type public property Globals: TGlobalCompilerOptions read fGlobals; property MakeModeDefs: TMakeModeDefs read fMakeModeDefs; + property RestartAfterBuild: boolean read fRestartAfterBuild write fRestartAfterBuild; + property ConfirmBuild: boolean read fConfirmBuild write fConfirmBuild; property StaticAutoInstallPackages: TStringList read fStaticAutoInstallPackages; property CurrentIndex: integer read fCurrentIndex write fCurrentIndex; property Current: TBuildLazarusProfile read GetCurrentProfile; @@ -386,30 +387,6 @@ end; { TBuildLazarusProfile } -procedure TBuildLazarusProfile.SetTargetCPU(const AValue: string); -begin - if FTargetCPU=AValue then exit; - FTargetCPU:=AValue; -end; - -procedure TBuildLazarusProfile.SetTargetOS(const AValue: string); -begin - if fTargetOS=AValue then exit; - fTargetOS:=AValue; -end; - -function TBuildLazarusProfile.GetTargetPlatform: TLCLPlatform; -begin - Result:=fTargetPlatform; -// if Result=lpDefault then -// Result:=GetDefaultLCLWidgetType; -end; - -procedure TBuildLazarusProfile.SetTargetPlatform(const AValue: TLCLPlatform); -begin - fTargetPlatform:=AValue; -end; - constructor TBuildLazarusProfile.Create(AOwnerCnt: TBuildLazarusProfiles; AName: string); var @@ -441,7 +418,7 @@ begin Path+'Build'+fMakeModeDefs[i].Name+'/Value', MakeModeNames[fMakeModeDefs[i].DefaultMakeMode])); FCleanAll :=XMLConfig.GetValue(Path+'CleanAll/Value',false); - FExtraOptions :=XMLConfig.GetValue(Path+'ExtraOptions/Value',''); + fExOptions :=XMLConfig.GetValue(Path+'ExtraOptions/Value',''); TargetOS :=XMLConfig.GetValue(Path+'TargetOS/Value',''); TargetCPU :=XMLConfig.GetValue(Path+'TargetCPU/Value',''); LCLPlatformStr :=XMLConfig.GetValue(Path+'LCLPlatform/Value',''); @@ -453,9 +430,7 @@ begin XMLConfig.GetValue(Path+'TargetDirectory/Value', DefaultTargetDirectory))); FWithStaticPackages:=XMLConfig.GetValue(Path+'WithStaticPackages/Value',true); FUpdateRevisionInc :=XMLConfig.GetValue(Path+'UpdateRevisionInc/Value',true); - FRestartAfterBuild :=XMLConfig.GetValue(Path+'RestartAfterBuild/Value',true); - FConfirmBuild :=XMLConfig.GetValue(Path+'ConfirmBuild/Value',true); - fBuildWithAll :=XMLConfig.GetValue(Path+'BuildWithAll/Value',true); + fSelected :=XMLConfig.GetValue(Path+'BuildWithAll/Value',true); end; procedure TBuildLazarusProfile.Save(XMLConfig: TXMLConfig; const Path: string); @@ -469,7 +444,7 @@ begin MakeModeNames[fMakeModeDefs[i].DefaultMakeMode]); end; XMLConfig.SetDeleteValue(Path+'CleanAll/Value',FCleanAll,false); - XMLConfig.SetDeleteValue(Path+'ExtraOptions/Value',FExtraOptions,''); + XMLConfig.SetDeleteValue(Path+'ExtraOptions/Value',fExOptions,''); XMLConfig.SetDeleteValue(Path+'TargetOS/Value',TargetOS,''); XMLConfig.SetDeleteValue(Path+'TargetCPU/Value',TargetCPU,''); XMLConfig.SetDeleteValue(Path+'LCLPlatform/Value', @@ -479,9 +454,7 @@ begin FTargetDirectory,DefaultTargetDirectory); XMLConfig.SetDeleteValue(Path+'WithStaticPackages/Value',FWithStaticPackages,true); XMLConfig.SetDeleteValue(Path+'UpdateRevisionInc/Value',FUpdateRevisionInc,true); - XMLConfig.SetDeleteValue(Path+'RestartAfterBuild/Value',FRestartAfterBuild,true); - XMLConfig.SetDeleteValue(Path+'ConfirmBuild/Value',FConfirmBuild,true); - XMLConfig.SetDeleteValue(Path+'BuildWithAll/Value',FBuildWithAll,true); + XMLConfig.SetDeleteValue(Path+'BuildWithAll/Value',fSelected,true); end; procedure TBuildLazarusProfile.Assign(Source: TBuildLazarusProfile; ACopyName: Boolean); @@ -492,16 +465,14 @@ begin if ACopyName then fName :=Source.Name; CleanAll :=Source.CleanAll; - ExtraOptions :=Source.ExtraOptions; + ExOptions :=Source.ExOptions; TargetOS :=Source.TargetOS; TargetDirectory :=Source.TargetDirectory; TargetCPU :=Source.TargetCPU; TargetPlatform :=Source.TargetPlatform; WithStaticPackages:=Source.WithStaticPackages; UpdateRevisionInc :=Source.UpdateRevisionInc; - RestartAfterBuild :=Source.RestartAfterBuild; - ConfirmBuild :=Source.ConfirmBuild; - BuildWithAll :=Source.BuildWithAll; + Selected :=Source.Selected; for i:=0 to Length(fMakeModes)-1 do fMakeModes[i]:=Source.MakeModes[i]; end; @@ -516,6 +487,35 @@ begin Result:=GetFPCTargetCPU(TargetCPU); end; +procedure TBuildLazarusProfile.SetTargetCPU(const AValue: string); +begin + if FTargetCPU=AValue then exit; + FTargetCPU:=AValue; +end; + +procedure TBuildLazarusProfile.SetTargetOS(const AValue: string); +begin + if fTargetOS=AValue then exit; + fTargetOS:=AValue; +end; + +function TBuildLazarusProfile.GetTargetPlatform: TLCLPlatform; +begin + Result:=fTargetPlatform; +// if Result=lpDefault then +// Result:=GetDefaultLCLWidgetType; +end; + +procedure TBuildLazarusProfile.SetTargetPlatform(const AValue: TLCLPlatform); +begin + fTargetPlatform:=AValue; +end; + +procedure TBuildLazarusProfile.SetExOptions(const AValue: string); +begin + fExOptions:=Trim(StringReplace(AValue, sLineBreak, ' ', [rfReplaceAll])); +end; + { TBuildLazarusProfiles } @@ -524,6 +524,8 @@ begin inherited Create; fGlobals:=TGlobalCompilerOptions.Create; fMakeModeDefs:=TMakeModeDefs.Create; + fRestartAfterBuild:=True; + fConfirmBuild:=True; fStaticAutoInstallPackages:=TStringList.Create; end; @@ -551,6 +553,8 @@ begin fGlobals.TargetCPU:=Source.fGlobals.TargetCPU; fGlobals.TargetOS:=Source.fGlobals.TargetOS; fMakeModeDefs.Assign(Source.MakeModeDefs); + RestartAfterBuild :=Source.RestartAfterBuild; + ConfirmBuild :=Source.ConfirmBuild; fStaticAutoInstallPackages.Assign(Source.fStaticAutoInstallPackages); fCurrentIndex:=Source.fCurrentIndex; for i:=0 to Source.Count-1 do begin @@ -573,15 +577,9 @@ begin Profile:=TBuildLazarusProfile.Create(Self, lisLazBuildQBOBuildLCL); with Profile, fOwnerCnt do begin fCleanAll:=False; -// fExtraOptions: string; -// fTargetOS: string; -// fTargetDirectory: string; -// fTargetCPU: string; fTargetPlatform:=Platfrm; fWithStaticPackages:=False; - fRestartAfterBuild:=True; - fConfirmBuild:=True; - fBuildWithAll:=True; + fSelected:=True; for i:=0 to fMakeModeDefs.Count-1 do if fMakeModeDefs[i].Description=lisLCL then fMakeModes[i]:=mmBuild @@ -596,9 +594,7 @@ begin fCleanAll:=False; fTargetPlatform:=Platfrm; fWithStaticPackages:=True; - fRestartAfterBuild:=True; - fConfirmBuild:=True; - fBuildWithAll:=False; + fSelected:=False; for i:=0 to fMakeModeDefs.Count-1 do if fMakeModeDefs[i].Description=lisIDE then fMakeModes[i]:=mmBuild @@ -613,9 +609,7 @@ begin fCleanAll:=False; fTargetPlatform:=Platfrm; fWithStaticPackages:=False; - fRestartAfterBuild:=True; - fConfirmBuild:=True; - fBuildWithAll:=False; + fSelected:=False; for i:=0 to fMakeModeDefs.Count-1 do if fMakeModeDefs[i].Description=lisIDE then fMakeModes[i]:=mmBuild @@ -630,9 +624,7 @@ begin fCleanAll:=False; fTargetPlatform:=Platfrm; fWithStaticPackages:=True; - fRestartAfterBuild:=True; - fConfirmBuild:=True; - fBuildWithAll:=False; + fSelected:=False; for i:=0 to fMakeModeDefs.Count-1 do if fMakeModeDefs[i].Description=lisExamples then fMakeModes[i]:=mmNone // All exept for examples. @@ -647,9 +639,7 @@ begin fCleanAll:=False; fTargetPlatform:=Platfrm; fWithStaticPackages:=True; - fRestartAfterBuild:=True; - fConfirmBuild:=True; - fBuildWithAll:=False; + fSelected:=False; for i:=0 to fMakeModeDefs.Count-1 do fMakeModes[i]:=mmCleanBuild; end; @@ -672,6 +662,8 @@ begin Profile:=TBuildLazarusProfile.Create(Self, 'MyProfile'); Profile.Load(XMLConfig, Path); Add(Profile); + FRestartAfterBuild:=XMLConfig.GetValue(Path+'RestartAfterBuild/Value',true); + FConfirmBuild :=XMLConfig.GetValue(Path+'ConfirmBuild/Value',true); ProfInd:=Count-1; // Go to last MyProfile. end; // Latest config file version. @@ -692,6 +684,9 @@ begin end; // Current profile ItemIndex. ProfInd:=XMLConfig.GetValue(Path+'ProfileIndex/Value',0); + // Other global build values. + FRestartAfterBuild:=XMLConfig.GetValue(Path+'RestartAfterBuild/Value',true); + FConfirmBuild :=XMLConfig.GetValue(Path+'ConfirmBuild/Value',true); end end; // A missing (or invalid) config file. @@ -721,6 +716,9 @@ begin end; // Current profile ItemIndex. XMLConfig.SetDeleteValue(Path+'ProfileIndex/Value',CurrentIndex,0); + // Other global build values. + XMLConfig.SetDeleteValue(Path+'RestartAfterBuild/Value',FRestartAfterBuild,true); + XMLConfig.SetDeleteValue(Path+'ConfirmBuild/Value',FConfirmBuild,true); // Save auto install packages SaveStringList(XMLConfig,fStaticAutoInstallPackages, Path+'StaticAutoInstallPackages/'); diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 898c125c1a..39eec40188 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -329,7 +329,7 @@ resourcestring lisBFWorkingDirectoryLeaveEmptyForFilePath = 'Working directory (Leave ' +'empty for file path)'; lisBFBuildCommand = 'Build Command'; - lisMenuBuildAll = 'Build all'; + lisMenuBuildAll = 'Build selected'; lisMenuQuickCompile = 'Quick compile'; lisMenuAbortBuild = 'Abort Build'; lisMenuProjectRun = 'Run'; @@ -2781,10 +2781,11 @@ resourcestring lisLazBuildLCLInterface = 'Widgetset'; lisLazBuildBuildJITForm = 'Build JITForm'; lisLazBuildWithStaticPackages = 'With packages'; - lisLazBuildRestartAfterBuild = 'Restart after successful Build'; - lisUpdateRevisionInc = 'Update revision.inc'; + lisLazBuildRestartAfterBuild = 'Restart after building the IDE'; + lisLazBuildUpdateRevInc = 'Update revision.inc'; + lisLazBuildSelected = 'Selected'; + lisLazBuildCommonSettings = 'Common Settings'; lisLazBuildConfirmBuild = 'Confirm before rebuilding Lazarus'; - lisLazBuildWithAll = 'Include this profile when building all'; lisLazBuildOk = 'Ok'; lisLazBuildAdd = 'Add'; lisLazBuildNewProf = 'Add New Profile'; diff --git a/ide/main.pp b/ide/main.pp index 56ce8ed8a2..0b6ef4aea6 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -4233,7 +4233,7 @@ end; procedure TMainIDE.mnuToolBuildLazarusClicked(Sender: TObject); begin with MiscellaneousOptions do - if BuildLazProfiles.Current.ConfirmBuild then + if BuildLazProfiles.ConfirmBuild then if MessageDlg(Format(lisConfirmLazarusRebuild, [BuildLazProfiles.Current.Name]), mtConfirmation, mbYesNo, 0)<>mrYes then exit; @@ -4266,7 +4266,7 @@ begin if Assigned(LazSrcDirTemplate) then begin CmdLineDefines:=CodeToolBoss.DefinePool.CreateFPCCommandLineDefines( StdDefTemplLazarusBuildOpts, - MiscellaneousOptions.BuildLazProfiles.Current.ExtraOptions, + MiscellaneousOptions.BuildLazProfiles.Current.ExOptions, true,CodeToolsOpts); CodeToolBoss.DefineTree.ReplaceChild(LazSrcDirTemplate,CmdLineDefines, StdDefTemplLazarusBuildOpts); @@ -11507,7 +11507,7 @@ end; function TMainIDE.DoBuildLazarus(Flags: TBuildLazarusFlags): TModalResult; begin Result:=DoBuildLazarusSub(Flags); - if (Result=mrOK) and MiscellaneousOptions.BuildLazOpts.RestartAfterBuild then + if (Result=mrOK) and MiscellaneousOptions.BuildLazProfiles.RestartAfterBuild then begin CompileProgress.Close; mnuRestartClicked(nil); @@ -11523,17 +11523,17 @@ var LazSrcDirTemplate: TDefineTemplate; BuildResult: TModalResult; i, RealCurInd: Integer; - NeedRestart, FoundProfToBuild: Boolean; + MayNeedRestart, FoundProfToBuild: Boolean; s: String; begin with MiscellaneousOptions do begin - NeedRestart:=False; + MayNeedRestart:=False; RealCurInd:=BuildLazProfiles.CurrentIndex; try FoundProfToBuild:=False; s:=sLineBreak+sLineBreak; for i:=0 to BuildLazProfiles.Count-1 do - if BuildLazProfiles[i].BuildWithAll then begin + if BuildLazProfiles[i].Selected then begin s:=s+BuildLazProfiles[i].Name+sLineBreak; FoundProfToBuild:=True; end; @@ -11541,11 +11541,12 @@ begin ShowMessage(lisNoBuildProfilesSelected); exit; end; - if MessageDlg(Format(lisConfirmBuildAllProfiles, [s+sLineBreak]), - mtConfirmation, mbYesNo, 0)<>mrYes then - exit; + if BuildLazProfiles.ConfirmBuild then + if MessageDlg(Format(lisConfirmBuildAllProfiles, [s+sLineBreak]), + mtConfirmation, mbYesNo, 0)<>mrYes then + exit; for i:=0 to BuildLazProfiles.Count-1 do begin - if BuildLazProfiles[i].BuildWithAll then begin + if BuildLazProfiles[i].Selected then begin // does not show message: IDEMessagesWindow.AddMsg('Building: '+BuildLazProfiles.Current.Name,'',-1); BuildLazProfiles.CurrentIndex:=i; // Set current profile temporarily. LazSrcTemplate:= @@ -11555,7 +11556,7 @@ begin if Assigned(LazSrcDirTemplate) then begin CmdLineDefines:=CodeToolBoss.DefinePool.CreateFPCCommandLineDefines( StdDefTemplLazarusBuildOpts, - BuildLazProfiles.Current.ExtraOptions,true,CodeToolsOpts); + BuildLazProfiles.Current.ExOptions,true,CodeToolsOpts); CodeToolBoss.DefineTree.ReplaceChild(LazSrcDirTemplate,CmdLineDefines, StdDefTemplLazarusBuildOpts); end @@ -11568,8 +11569,8 @@ begin +'StdDefTemplLazarusSources,true) returned Nil for profile ' +BuildLazProfiles.Current.Name); BuildResult:=DoBuildLazarusSub([]); - if (BuildResult=mrOK) and BuildLazProfiles.Current.RestartAfterBuild then - NeedRestart:=True + if BuildResult=mrOK then + MayNeedRestart:=True else if BuildResult<>mrIgnore then exit; end; @@ -11577,7 +11578,7 @@ begin finally BuildLazProfiles.CurrentIndex:=RealCurInd; end; - if NeedRestart then begin + if MayNeedRestart and BuildLazProfiles.RestartAfterBuild then begin CompileProgress.Close; mnuRestartClicked(nil); end;