mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-24 07:19:34 +01:00
IDE: project options: fixed build modes diff showing modes
git-svn-id: trunk@41492 -
This commit is contained in:
parent
430543d215
commit
e43d2c2e7c
@ -29,8 +29,8 @@ unit BuildModeDiffDlg;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LazUTF8, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, LazUTF8, LazLogger, Forms, Controls, Graphics,
|
||||||
ButtonPanel, StdCtrls, ComCtrls, LazarusIDEStrConsts, Project,
|
Dialogs, ButtonPanel, StdCtrls, ComCtrls, LazarusIDEStrConsts, Project,
|
||||||
CompilerOptions, CompOptsModes;
|
CompilerOptions, CompOptsModes;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -52,22 +52,23 @@ type
|
|||||||
procedure FillDiffTreeView;
|
procedure FillDiffTreeView;
|
||||||
public
|
public
|
||||||
procedure SetBuildMode(aMode: TProjectBuildMode);
|
procedure SetBuildMode(aMode: TProjectBuildMode);
|
||||||
property aProject: TProject read fProject;
|
property LazProject: TProject read fProject;
|
||||||
property BaseMode: TProjectBuildMode read FBaseMode;
|
property BaseMode: TProjectBuildMode read FBaseMode;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ShowBuildModeDiffDialog(aMode: TProjectBuildMode): TModalResult;
|
function ShowBuildModeDiffDialog(AProject: TProject; aMode: TProjectBuildMode): TModalResult;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|
||||||
function ShowBuildModeDiffDialog(aMode: TProjectBuildMode): TModalResult;
|
function ShowBuildModeDiffDialog(AProject: TProject; aMode: TProjectBuildMode): TModalResult;
|
||||||
var
|
var
|
||||||
BuildModeDiffDialog: TBuildModeDiffDialog;
|
BuildModeDiffDialog: TBuildModeDiffDialog;
|
||||||
begin
|
begin
|
||||||
BuildModeDiffDialog:=TBuildModeDiffDialog.Create(nil);
|
BuildModeDiffDialog:=TBuildModeDiffDialog.Create(nil);
|
||||||
try
|
try
|
||||||
|
BuildModeDiffDialog.fProject:=AProject;
|
||||||
BuildModeDiffDialog.SetBuildMode(aMode);
|
BuildModeDiffDialog.SetBuildMode(aMode);
|
||||||
Result:=BuildModeDiffDialog.ShowModal;
|
Result:=BuildModeDiffDialog.ShowModal;
|
||||||
finally
|
finally
|
||||||
@ -113,8 +114,10 @@ begin
|
|||||||
for i:=0 to fProject.BuildModes.Count-1 do
|
for i:=0 to fProject.BuildModes.Count-1 do
|
||||||
sl.Add(fProject.BuildModes[i].GetCaption);
|
sl.Add(fProject.BuildModes[i].GetCaption);
|
||||||
ModeComboBox.Items.Assign(sl);
|
ModeComboBox.Items.Assign(sl);
|
||||||
if BaseMode<>nil then
|
if BaseMode<>nil then begin
|
||||||
ModeComboBox.ItemIndex:=BaseMode.GetIndex
|
ModeComboBox.Text:=BaseMode.GetCaption;
|
||||||
|
ModeComboBox.ItemIndex:=sl.IndexOf(BaseMode.GetCaption);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
ModeComboBox.Text:='(none)';
|
ModeComboBox.Text:='(none)';
|
||||||
finally
|
finally
|
||||||
@ -157,11 +160,11 @@ procedure TBuildModeDiffDialog.SetBuildMode(aMode: TProjectBuildMode);
|
|||||||
begin
|
begin
|
||||||
if aMode<>nil then
|
if aMode<>nil then
|
||||||
begin
|
begin
|
||||||
fProject:=aMode.LazProject;
|
if aMode.LazProject<>nil then
|
||||||
|
fProject:=aMode.LazProject;
|
||||||
FBaseMode:=aMode;
|
FBaseMode:=aMode;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
fProject:=nil;
|
|
||||||
FBaseMode:=nil;
|
FBaseMode:=nil;
|
||||||
end;
|
end;
|
||||||
FillModeComboBox;
|
FillModeComboBox;
|
||||||
|
|||||||
@ -9,6 +9,7 @@ object BuildModesForm: TBuildModesForm
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.1'
|
LCLVersion = '1.1'
|
||||||
object BuildModesGroupBox: TGroupBox
|
object BuildModesGroupBox: TGroupBox
|
||||||
Left = 6
|
Left = 6
|
||||||
@ -19,16 +20,16 @@ object BuildModesForm: TBuildModesForm
|
|||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'BuildModesGroupBox'
|
Caption = 'BuildModesGroupBox'
|
||||||
ClientHeight = 276
|
ClientHeight = 288
|
||||||
ClientWidth = 594
|
ClientWidth = 596
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object BuildModesStringGrid: TStringGrid
|
object BuildModesStringGrid: TStringGrid
|
||||||
AnchorSideTop.Control = BuildModeAddSpeedButton
|
AnchorSideTop.Control = BuildModeAddSpeedButton
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 254
|
Height = 266
|
||||||
Top = 22
|
Top = 22
|
||||||
Width = 594
|
Width = 596
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
AutoFillColumns = True
|
AutoFillColumns = True
|
||||||
@ -38,19 +39,19 @@ object BuildModesForm: TBuildModesForm
|
|||||||
ButtonStyle = cbsCheckboxColumn
|
ButtonStyle = cbsCheckboxColumn
|
||||||
MaxSize = 50
|
MaxSize = 50
|
||||||
Title.Caption = 'Active'
|
Title.Caption = 'Active'
|
||||||
Width = 196
|
Width = 198
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
ButtonStyle = cbsCheckboxColumn
|
ButtonStyle = cbsCheckboxColumn
|
||||||
MaxSize = 50
|
MaxSize = 50
|
||||||
Title.Caption = 'InSession'
|
Title.Caption = 'InSession'
|
||||||
Width = 196
|
Width = 198
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
MaxSize = 500
|
MaxSize = 500
|
||||||
SizePriority = 100
|
SizePriority = 100
|
||||||
Title.Caption = 'Title'
|
Title.Caption = 'Title'
|
||||||
Width = 196
|
Width = 198
|
||||||
end>
|
end>
|
||||||
FixedCols = 0
|
FixedCols = 0
|
||||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
|
||||||
@ -59,9 +60,9 @@ object BuildModesForm: TBuildModesForm
|
|||||||
OnSelection = BuildModesStringGridSelection
|
OnSelection = BuildModesStringGridSelection
|
||||||
OnValidateEntry = BuildModesStringGridValidateEntry
|
OnValidateEntry = BuildModesStringGridValidateEntry
|
||||||
ColWidths = (
|
ColWidths = (
|
||||||
196
|
198
|
||||||
196
|
198
|
||||||
196
|
198
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
object BuildModeAddSpeedButton: TSpeedButton
|
object BuildModeAddSpeedButton: TSpeedButton
|
||||||
@ -127,8 +128,8 @@ object BuildModesForm: TBuildModesForm
|
|||||||
end
|
end
|
||||||
object ButtonPanel1: TButtonPanel
|
object ButtonPanel1: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 34
|
Height = 36
|
||||||
Top = 326
|
Top = 324
|
||||||
Width = 600
|
Width = 600
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
|
|||||||
@ -59,7 +59,7 @@ type
|
|||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function GetSelectedBuildMode: TProjectBuildMode;
|
function GetSelectedBuildMode: TProjectBuildMode;
|
||||||
procedure SetActiveBuildModeByID(AValue: TProjectBuildMode);
|
procedure SetActiveBuildModeByID(const Identifier: string);
|
||||||
public
|
public
|
||||||
property ActiveBuildMode: TProjectBuildMode read GetActiveBuildMode write SetActiveBuildMode;
|
property ActiveBuildMode: TProjectBuildMode read GetActiveBuildMode write SetActiveBuildMode;
|
||||||
property BuildModes: TProjectBuildModes read fBuildModes;
|
property BuildModes: TProjectBuildModes read fBuildModes;
|
||||||
@ -90,7 +90,7 @@ begin
|
|||||||
OnSaveIDEOptionsHook(Nil, Project1.CompilerOptions);
|
OnSaveIDEOptionsHook(Nil, Project1.CompilerOptions);
|
||||||
// Copy to dialog
|
// Copy to dialog
|
||||||
frm.fBuildModes.Assign(Project1.BuildModes, True);
|
frm.fBuildModes.Assign(Project1.BuildModes, True);
|
||||||
frm.SetActiveBuildModeByID(Project1.ActiveBuildMode);
|
frm.SetActiveBuildModeByID(Project1.ActiveBuildMode.Identifier);
|
||||||
frm.fShowSession:=aShowSession;
|
frm.fShowSession:=aShowSession;
|
||||||
// Show the form. Let user add / edit / delete.
|
// Show the form. Let user add / edit / delete.
|
||||||
Result := frm.ShowModal;
|
Result := frm.ShowModal;
|
||||||
@ -187,8 +187,7 @@ end;
|
|||||||
procedure TBuildModesForm.BuildModeDiffSpeedButtonClick(Sender: TObject);
|
procedure TBuildModesForm.BuildModeDiffSpeedButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
// show diff dialog
|
// show diff dialog
|
||||||
ShowBuildModeDiffDialog(GetSelectedBuildMode);
|
ShowBuildModeDiffDialog(Project1,GetSelectedBuildMode);
|
||||||
IncreaseBuildMacroChangeStamp;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildModesForm.BuildModeAddSpeedButtonClick(Sender: TObject);
|
procedure TBuildModesForm.BuildModeAddSpeedButtonClick(Sender: TObject);
|
||||||
@ -519,13 +518,13 @@ begin
|
|||||||
fActiveBuildMode := AValue;
|
fActiveBuildMode := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildModesForm.SetActiveBuildModeByID(AValue: TProjectBuildMode);
|
procedure TBuildModesForm.SetActiveBuildModeByID(const Identifier: string);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
for i:=0 to fBuildModes.Count-1 do
|
for i:=0 to fBuildModes.Count-1 do
|
||||||
begin
|
begin
|
||||||
if fBuildModes[i].Identifier=AValue.Identifier then
|
if fBuildModes[i].Identifier=Identifier then
|
||||||
begin
|
begin
|
||||||
ActiveBuildMode:=fBuildModes[i];
|
ActiveBuildMode:=fBuildModes[i];
|
||||||
Break;
|
Break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user