mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 05:58:14 +02:00
IDE: Remove the useless "Use Buildmodes" setting and CheckBox.
git-svn-id: trunk@58873 -
This commit is contained in:
parent
9347bbad86
commit
d151af12fb
@ -548,7 +548,6 @@ type
|
||||
FTestBuildDirHistory: TStringList;
|
||||
FCompilerMessagesFileHistory: TStringList;
|
||||
FBuildMatrixOptions: TBuildMatrixOptions;
|
||||
FUseBuildModes: Boolean;
|
||||
FIsGlobalMode: TStrToBoolEvent;
|
||||
|
||||
// Clean build project dialog
|
||||
@ -815,7 +814,6 @@ type
|
||||
|
||||
// global build options
|
||||
property BuildMatrixOptions: TBuildMatrixOptions read FBuildMatrixOptions;
|
||||
property UseBuildModes: Boolean read FUseBuildModes write FUseBuildModes;
|
||||
|
||||
// Clean build project dialog
|
||||
property CleanBuildProjOut: Boolean read FCleanBuildProjOut write FCleanBuildProjOut;
|
||||
@ -1938,7 +1936,6 @@ begin
|
||||
FConfigStore.AppendBasePath('BuildMatrix');
|
||||
FBuildMatrixOptions.LoadFromConfig(FConfigStore);
|
||||
FConfigStore.UndoAppendBasePath;
|
||||
FUseBuildModes:=FXMLCfg.GetValue(Path+'Build/UseBuildModes',false);
|
||||
|
||||
// Clean build project dialog
|
||||
FCleanBuildProjOut:=FXMLCfg.GetValue(Path+'CleanBuild/ProjOut',true);
|
||||
@ -2320,7 +2317,6 @@ begin
|
||||
FConfigStore.AppendBasePath('BuildMatrix');
|
||||
FBuildMatrixOptions.SaveToConfig(FConfigStore,IsGlobalMode);
|
||||
FConfigStore.UndoAppendBasePath;
|
||||
FXMLCfg.SetDeleteValue(Path+'Build/UseBuildModes',FUseBuildModes,false);
|
||||
|
||||
// Clean build project dialog
|
||||
FXMLCfg.SetDeleteValue(Path+'CleanBuild/ProjOut',FCleanBuildProjOut,true);
|
||||
|
@ -753,10 +753,7 @@ end;
|
||||
|
||||
function TCompOptModeMatrixFrame.ActiveModeAsText: string;
|
||||
begin
|
||||
if EnvironmentOptions.UseBuildModes then
|
||||
Result:=Grid.Modes[Grid.ActiveMode].Caption
|
||||
else
|
||||
Result:=LazProject.BuildModes[0].GetCaption;
|
||||
Result:=Grid.Modes[Grid.ActiveMode].Caption;
|
||||
end;
|
||||
|
||||
procedure TCompOptModeMatrixFrame.CreateNewOption(aTyp, aValue: string);
|
||||
@ -996,41 +993,35 @@ var
|
||||
aMode: TGroupedMatrixMode;
|
||||
BuildMode: TProjectBuildMode;
|
||||
BuildModes: TProjectBuildModes;
|
||||
BuildModeCount: integer;
|
||||
begin
|
||||
GridHasChanged:=false;
|
||||
ValuesHaveChanged:=false;
|
||||
|
||||
// add/update build modes
|
||||
BuildModes:=LazProject.BuildModes;
|
||||
if EnvironmentOptions.UseBuildModes then begin
|
||||
for i:=0 to BuildModes.Count-1 do begin
|
||||
BuildMode:=BuildModes[i];
|
||||
aColor:=clDefault;
|
||||
if BuildMode.InSession then aColor:=SessionColor;
|
||||
if i=Grid.Modes.Count then begin
|
||||
Grid.Modes.Add(BuildMode.Identifier,aColor);
|
||||
for i:=0 to BuildModes.Count-1 do begin
|
||||
BuildMode:=BuildModes[i];
|
||||
aColor:=clDefault;
|
||||
if BuildMode.InSession then aColor:=SessionColor;
|
||||
if i=Grid.Modes.Count then begin
|
||||
Grid.Modes.Add(BuildMode.Identifier,aColor);
|
||||
GridHasChanged:=true;
|
||||
end
|
||||
else begin
|
||||
aMode:=Grid.Modes[i];
|
||||
//debugln(['TCompOptModeMatrix.UpdateModes aMode.Caption=',aMode.Caption,' BuildMode.Identifier=',BuildMode.Identifier]);
|
||||
if aMode.Caption<>BuildMode.Identifier then begin
|
||||
aMode.Caption:=BuildMode.Identifier;
|
||||
GridHasChanged:=true;
|
||||
end
|
||||
else begin
|
||||
aMode:=Grid.Modes[i];
|
||||
//debugln(['TCompOptModeMatrix.UpdateModes aMode.Caption=',aMode.Caption,' BuildMode.Identifier=',BuildMode.Identifier]);
|
||||
if aMode.Caption<>BuildMode.Identifier then begin
|
||||
aMode.Caption:=BuildMode.Identifier;
|
||||
GridHasChanged:=true;
|
||||
end;
|
||||
if aMode.Color<>aColor then begin
|
||||
ValuesHaveChanged:=true;
|
||||
aMode.Color:=aColor;
|
||||
end;
|
||||
end;
|
||||
if aMode.Color<>aColor then begin
|
||||
ValuesHaveChanged:=true;
|
||||
aMode.Color:=aColor;
|
||||
end;
|
||||
end;
|
||||
BuildModeCount:=BuildModes.Count;
|
||||
end
|
||||
else
|
||||
BuildModeCount:=0;
|
||||
end;
|
||||
// delete leftover build modes
|
||||
while Grid.Modes.Count>BuildModeCount do begin
|
||||
while Grid.Modes.Count>BuildModes.Count do begin
|
||||
Grid.Modes.Delete(Grid.Modes.Count-1);
|
||||
GridHasChanged:=true;
|
||||
end;
|
||||
@ -1052,10 +1043,7 @@ procedure TCompOptModeMatrixFrame.UpdateActiveMode;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if EnvironmentOptions.UseBuildModes then
|
||||
i:=LazProject.BuildModes.IndexOf(LazProject.ActiveBuildMode)
|
||||
else
|
||||
i:=-1;
|
||||
i:=LazProject.BuildModes.IndexOf(LazProject.ActiveBuildMode);
|
||||
if i>=Grid.Modes.Count then exit;
|
||||
Grid.ActiveMode:=i;
|
||||
end;
|
||||
|
@ -12,6 +12,7 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
Constraints.MinWidth = 500
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.9.0.0'
|
||||
object ButtonPanel: TButtonPanel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideRight.Control = Owner
|
||||
@ -64,8 +65,8 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = SettingsPanel
|
||||
Left = 6
|
||||
Height = 407
|
||||
Top = 33
|
||||
Height = 417
|
||||
Top = 37
|
||||
Width = 249
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 6
|
||||
@ -83,7 +84,7 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
AnchorSideTop.Control = CategoryPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 21
|
||||
Height = 25
|
||||
Top = 6
|
||||
Width = 249
|
||||
OnFilterItem = FilterEditFilterItem
|
||||
@ -98,8 +99,8 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
end
|
||||
object SettingsPanel: TPanel
|
||||
Left = 0
|
||||
Height = 20
|
||||
Top = 440
|
||||
Height = 6
|
||||
Top = 454
|
||||
Width = 255
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
@ -124,16 +125,16 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
ClientWidth = 535
|
||||
TabOrder = 3
|
||||
object BuildModeComboBox: TComboBox
|
||||
AnchorSideLeft.Control = UseBuildModeCheckBox
|
||||
AnchorSideLeft.Control = BuildModesLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = UseBuildModeCheckBox
|
||||
AnchorSideTop.Control = BuildModesLabel
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 93
|
||||
Height = 21
|
||||
Top = 5
|
||||
Left = 125
|
||||
Height = 35
|
||||
Top = -1
|
||||
Width = 175
|
||||
BorderSpacing.Left = 7
|
||||
ItemHeight = 13
|
||||
BorderSpacing.Left = 6
|
||||
ItemHeight = 0
|
||||
OnSelect = BuildModeComboBoxSelect
|
||||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
@ -144,9 +145,9 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
AnchorSideTop.Control = BuildModeComboBox
|
||||
AnchorSideBottom.Control = BuildModeComboBox
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 269
|
||||
Height = 21
|
||||
Top = 5
|
||||
Left = 301
|
||||
Height = 35
|
||||
Top = -1
|
||||
Width = 23
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
BorderSpacing.Left = 1
|
||||
@ -154,18 +155,13 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
OnClick = BuildModeManageButtonClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object UseBuildModeCheckBox: TCheckBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
object BuildModesLabel: TLabel
|
||||
Left = 12
|
||||
Height = 17
|
||||
Height = 19
|
||||
Top = 7
|
||||
Width = 74
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Build modes'
|
||||
OnChange = UseBuildModeCheckBoxChange
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 2
|
||||
Width = 107
|
||||
Caption = 'BuildModesLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
object EditorsPanel: TScrollBox
|
||||
|
@ -58,7 +58,6 @@ type
|
||||
|
||||
TIDEOptionsDialog = class(TAbstractOptionsEditorDialog)
|
||||
BuildModeComboBox: TComboBox;
|
||||
UseBuildModeCheckBox: TCheckBox;
|
||||
BuildModeManageButton: TButton;
|
||||
BuildModeSelectPanel: TPanel;
|
||||
ButtonPanel: TButtonPanel;
|
||||
@ -67,8 +66,8 @@ type
|
||||
CatTVSplitter: TSplitter;
|
||||
EditorsPanel: TScrollBox;
|
||||
FilterEdit: TTreeFilterEdit;
|
||||
BuildModesLabel: TLabel;
|
||||
SettingsPanel: TPanel;
|
||||
procedure UseBuildModeCheckBoxChange(Sender: TObject);
|
||||
procedure BuildModeComboBoxSelect(Sender: TObject);
|
||||
procedure BuildModeManageButtonClick(Sender: TObject);
|
||||
procedure CategoryTreeChange(Sender: TObject; Node: TTreeNode);
|
||||
@ -131,27 +130,6 @@ implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
|
||||
const
|
||||
LazUtilsPkg = 'LazUtils';
|
||||
|
||||
function HasLazUtilsDependency: Boolean;
|
||||
begin
|
||||
Result := Assigned(Project1.FindDependencyByName('LCL'))
|
||||
or Assigned(Project1.FindDependencyByName(LazUtilsPkg));
|
||||
end;
|
||||
|
||||
procedure AddLazUtilsDependency;
|
||||
var
|
||||
Dep: TPkgDependency;
|
||||
begin
|
||||
if HasLazUtilsDependency then Exit;
|
||||
Project1.AddPackageDependency(LazUtilsPkg);
|
||||
Dep:=Project1.FindDependencyByName(LazUtilsPkg);
|
||||
if Assigned(Dep) then
|
||||
PackageGraph.OpenDependency(Dep,false);
|
||||
end;
|
||||
|
||||
{ TIDEOptionsDialog }
|
||||
|
||||
constructor TIDEOptionsDialog.Create(AOwner: TComponent);
|
||||
@ -161,10 +139,8 @@ begin
|
||||
FEditorsCreated := False;
|
||||
FEditorToOpen := nil;
|
||||
SetBuildModeVisibility(False);
|
||||
UseBuildModeCheckBox.Caption:=lisBuildModes;
|
||||
|
||||
IDEDialogLayoutList.ApplyLayout(Self);
|
||||
Caption := dlgIDEOptions;
|
||||
BuildModesLabel.Caption := lisBuildModes;
|
||||
ButtonPanel.OKButton.Caption := lisMenuOk;
|
||||
ButtonPanel.OKButton.OnClick := @OKButtonClick;
|
||||
ButtonPanel.OKButton.ModalResult := mrNone;
|
||||
@ -172,6 +148,7 @@ begin
|
||||
ButtonPanel.CancelButton.OnClick := @CancelButtonClick;
|
||||
ButtonPanel.HelpButton.Caption:= lisMenuHelp;
|
||||
ButtonPanel.HelpButton.OnClick := @HelpButtonClick;
|
||||
IDEDialogLayoutList.ApplyLayout(Self);
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsDialog.FormShow(Sender: TObject);
|
||||
@ -232,17 +209,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsDialog.UseBuildModeCheckBoxChange(Sender: TObject);
|
||||
begin
|
||||
EnvironmentOptions.UseBuildModes:=(Sender as TCheckBox).Checked;
|
||||
UpdateBuildModeButtons;
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsDialog.BuildModeComboBoxSelect(Sender: TObject);
|
||||
begin
|
||||
if AllBuildModes then begin
|
||||
ShowMessage(lisThisWillAllowChangingAllBuildModesAtOnceNotImpleme);
|
||||
end
|
||||
if AllBuildModes then
|
||||
ShowMessage(lisThisWillAllowChangingAllBuildModesAtOnceNotImpleme)
|
||||
else begin
|
||||
Assert(BuildModeSelectPanel.Visible, 'BuildModeComboBoxSelect: BuildModeSelectPanel not Visible');
|
||||
SwitchBuildMode(BuildModeComboBox.Text);
|
||||
@ -644,17 +614,8 @@ end;
|
||||
|
||||
procedure TIDEOptionsDialog.UpdateBuildModeButtons;
|
||||
var
|
||||
ManyBuildModes: Boolean;
|
||||
ModeMatrix: TCompOptModeMatrixFrame;
|
||||
begin
|
||||
ManyBuildModes:=Project1.BuildModes.Count > 1;
|
||||
if ManyBuildModes then
|
||||
EnvironmentOptions.UseBuildModes := True;
|
||||
UseBuildModeCheckBox.Checked:=EnvironmentOptions.UseBuildModes;
|
||||
UseBuildModeCheckBox.Enabled := not ManyBuildModes;
|
||||
BuildModeComboBox.Visible := EnvironmentOptions.UseBuildModes;
|
||||
BuildModeManageButton.Visible := EnvironmentOptions.UseBuildModes;
|
||||
|
||||
ModeMatrix:=TCompOptModeMatrixFrame(FindEditor(TCompOptModeMatrixFrame));
|
||||
if Assigned(ModeMatrix) then
|
||||
ModeMatrix.UpdateModes;
|
||||
|
Loading…
Reference in New Issue
Block a user