mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-05 15:39:25 +01:00
IDE: mode matrix: do not store session info in project and ide
git-svn-id: trunk@41390 -
This commit is contained in:
parent
ecd140c985
commit
d97e869846
@ -137,11 +137,12 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// assign
|
// assign
|
||||||
function IsEqual(Options: TBuildMatrixOptions; StorageGroup: TGroupedMatrixGroup): boolean;
|
function IsEqual(Options: TBuildMatrixOptions; StorageGroup: TGroupedMatrixGroup;
|
||||||
|
NotStoredModes: TStrings): boolean;
|
||||||
procedure AssignBuildMatrixOptionsToGroup(Options: TBuildMatrixOptions;
|
procedure AssignBuildMatrixOptionsToGroup(Options: TBuildMatrixOptions;
|
||||||
Matrix: TGroupedMatrix; StorageGroup: TGroupedMatrixGroup);
|
Matrix: TGroupedMatrix; StorageGroup: TGroupedMatrixGroup; NotStoredModes: TStrings);
|
||||||
procedure AssignBuildMatrixGroupToOptions(StorageGroup: TGroupedMatrixGroup;
|
procedure AssignBuildMatrixGroupToOptions(StorageGroup: TGroupedMatrixGroup;
|
||||||
Options: TBuildMatrixOptions; InvalidateBuildMacros: boolean);
|
Options: TBuildMatrixOptions; InvalidateBuildMacros: boolean; NotStoredModes: TStrings);
|
||||||
|
|
||||||
// targets, see BuildMatrixTargetFits
|
// targets, see BuildMatrixTargetFits
|
||||||
function TargetsPrefix: string;
|
function TargetsPrefix: string;
|
||||||
@ -195,8 +196,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsEqual(Options: TBuildMatrixOptions; StorageGroup: TGroupedMatrixGroup
|
function IsEqual(Options: TBuildMatrixOptions; StorageGroup: TGroupedMatrixGroup;
|
||||||
): boolean;
|
NotStoredModes: TStrings): boolean;
|
||||||
// ignore empty targets
|
// ignore empty targets
|
||||||
var
|
var
|
||||||
OptIndex: Integer;
|
OptIndex: Integer;
|
||||||
@ -226,7 +227,8 @@ begin
|
|||||||
// compare option
|
// compare option
|
||||||
Option:=Options[OptIndex];
|
Option:=Options[OptIndex];
|
||||||
if Option.Targets<>Target.Value then exit;
|
if Option.Targets<>Target.Value then exit;
|
||||||
if Option.Modes<>ValueRow.GetNormalizedModes then exit;
|
if Option.Modes[bmmtActive]<>ValueRow.GetNormalizedModes(nil) then exit;
|
||||||
|
if Option.Modes[bmmtStored]<>ValueRow.GetNormalizedModes(NotStoredModes) then exit;
|
||||||
if Option.Typ<>CaptionToBuildMatrixOptionType(ValueRow.Typ) then exit;
|
if Option.Typ<>CaptionToBuildMatrixOptionType(ValueRow.Typ) then exit;
|
||||||
if Option.Typ=bmotIDEMacro then begin
|
if Option.Typ=bmotIDEMacro then begin
|
||||||
SplitMatrixMacro(ValueRow.Value,MacroName,MacroValue,false);
|
SplitMatrixMacro(ValueRow.Value,MacroName,MacroValue,false);
|
||||||
@ -242,14 +244,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure AssignBuildMatrixOptionsToGroup(Options: TBuildMatrixOptions;
|
procedure AssignBuildMatrixOptionsToGroup(Options: TBuildMatrixOptions;
|
||||||
Matrix: TGroupedMatrix; StorageGroup: TGroupedMatrixGroup);
|
Matrix: TGroupedMatrix; StorageGroup: TGroupedMatrixGroup;
|
||||||
|
NotStoredModes: TStrings);
|
||||||
var
|
var
|
||||||
OptIndex: Integer;
|
OptIndex: Integer;
|
||||||
Option: TBuildMatrixOption;
|
Option: TBuildMatrixOption;
|
||||||
TargetGrp: TGroupedMatrixGroup;
|
TargetGrp: TGroupedMatrixGroup;
|
||||||
Value: String;
|
Value: String;
|
||||||
begin
|
begin
|
||||||
if IsEqual(Options,StorageGroup) then exit;
|
if IsEqual(Options,StorageGroup,NotStoredModes) then exit;
|
||||||
StorageGroup.Clear;
|
StorageGroup.Clear;
|
||||||
TargetGrp:=nil;
|
TargetGrp:=nil;
|
||||||
for OptIndex:=0 to Options.Count-1 do begin
|
for OptIndex:=0 to Options.Count-1 do begin
|
||||||
@ -259,13 +262,14 @@ begin
|
|||||||
Value:=Option.Value;
|
Value:=Option.Value;
|
||||||
if Option.Typ=bmotIDEMacro then
|
if Option.Typ=bmotIDEMacro then
|
||||||
Value:=Option.MacroName+':='+Value;
|
Value:=Option.MacroName+':='+Value;
|
||||||
Matrix.AddValue(TargetGrp,Option.Modes,
|
Matrix.AddValue(TargetGrp,Option.Modes[bmmtActive],
|
||||||
BuildMatrixOptionTypeCaption(Option.Typ),Value,Option.ID);
|
BuildMatrixOptionTypeCaption(Option.Typ),Value,Option.ID);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure AssignBuildMatrixGroupToOptions(StorageGroup: TGroupedMatrixGroup;
|
procedure AssignBuildMatrixGroupToOptions(StorageGroup: TGroupedMatrixGroup;
|
||||||
Options: TBuildMatrixOptions; InvalidateBuildMacros: boolean);
|
Options: TBuildMatrixOptions; InvalidateBuildMacros: boolean;
|
||||||
|
NotStoredModes: TStrings);
|
||||||
var
|
var
|
||||||
GrpIndex: Integer;
|
GrpIndex: Integer;
|
||||||
Target: TGroupedMatrixGroup;
|
Target: TGroupedMatrixGroup;
|
||||||
@ -275,7 +279,7 @@ var
|
|||||||
MacroName: string;
|
MacroName: string;
|
||||||
MacroValue: string;
|
MacroValue: string;
|
||||||
begin
|
begin
|
||||||
if IsEqual(Options,StorageGroup) then exit;
|
if IsEqual(Options,StorageGroup,NotStoredModes) then exit;
|
||||||
Options.Clear;
|
Options.Clear;
|
||||||
for GrpIndex:=0 to StorageGroup.Count-1 do begin
|
for GrpIndex:=0 to StorageGroup.Count-1 do begin
|
||||||
Target:=TGroupedMatrixGroup(StorageGroup[GrpIndex]);
|
Target:=TGroupedMatrixGroup(StorageGroup[GrpIndex]);
|
||||||
@ -291,7 +295,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
Option:=Options.Add(CaptionToBuildMatrixOptionType(ValueRow.Typ),
|
Option:=Options.Add(CaptionToBuildMatrixOptionType(ValueRow.Typ),
|
||||||
Target.Value);
|
Target.Value);
|
||||||
Option.Modes:=ValueRow.GetNormalizedModes;
|
Option.Modes[bmmtActive]:=ValueRow.GetNormalizedModes(nil);
|
||||||
|
Option.Modes[bmmtStored]:=ValueRow.GetNormalizedModes(NotStoredModes);
|
||||||
Option.ID:=ValueRow.ID;
|
Option.ID:=ValueRow.ID;
|
||||||
if Option.Typ=bmotIDEMacro then begin
|
if Option.Typ=bmotIDEMacro then begin
|
||||||
SplitMatrixMacro(ValueRow.Value,MacroName,MacroValue,false);
|
SplitMatrixMacro(ValueRow.Value,MacroName,MacroValue,false);
|
||||||
@ -905,16 +910,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompOptModeMatrix.DoWriteSettings;
|
procedure TCompOptModeMatrix.DoWriteSettings;
|
||||||
|
var
|
||||||
|
SessionModes: TStringList;
|
||||||
begin
|
begin
|
||||||
// write IDE options
|
SessionModes:=LazProject.BuildModes.GetSessionModes;
|
||||||
AssignBuildMatrixGroupToOptions(GroupIDE,
|
try
|
||||||
EnvironmentOptions.BuildMatrixOptions, true);
|
// write IDE options
|
||||||
// write Project options
|
AssignBuildMatrixGroupToOptions(GroupIDE,
|
||||||
AssignBuildMatrixGroupToOptions(GroupProject,
|
EnvironmentOptions.BuildMatrixOptions,true,SessionModes);
|
||||||
LazProject.BuildModes.SharedMatrixOptions, true);
|
// write Project options
|
||||||
// write Session options
|
AssignBuildMatrixGroupToOptions(GroupProject,
|
||||||
AssignBuildMatrixGroupToOptions(GroupSession,
|
LazProject.BuildModes.SharedMatrixOptions,true,SessionModes);
|
||||||
LazProject.BuildModes.SessionMatrixOptions, true);
|
// write Session options
|
||||||
|
AssignBuildMatrixGroupToOptions(GroupSession,
|
||||||
|
LazProject.BuildModes.SessionMatrixOptions,true,nil);
|
||||||
|
finally
|
||||||
|
SessionModes.Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TCompOptModeMatrix.Create(TheOwner: TComponent);
|
constructor TCompOptModeMatrix.Create(TheOwner: TComponent);
|
||||||
@ -1019,6 +1031,7 @@ end;
|
|||||||
procedure TCompOptModeMatrix.ReadSettings(AOptions: TAbstractIDEOptions);
|
procedure TCompOptModeMatrix.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||||
var
|
var
|
||||||
CompOptions: TProjectCompilerOptions;
|
CompOptions: TProjectCompilerOptions;
|
||||||
|
SessionModes: TStringList;
|
||||||
begin
|
begin
|
||||||
//debugln(['TCompOptModeMatrix.ReadSettings ',DbgSName(AOptions)]);
|
//debugln(['TCompOptModeMatrix.ReadSettings ',DbgSName(AOptions)]);
|
||||||
if not (AOptions is TProjectCompilerOptions) then exit;
|
if not (AOptions is TProjectCompilerOptions) then exit;
|
||||||
@ -1033,18 +1046,23 @@ begin
|
|||||||
|
|
||||||
UpdateModes(false);
|
UpdateModes(false);
|
||||||
|
|
||||||
// read IDE options
|
SessionModes:=LazProject.BuildModes.GetSessionModes;
|
||||||
AssignBuildMatrixOptionsToGroup(EnvironmentOptions.BuildMatrixOptions,
|
try
|
||||||
Grid.Matrix,GroupIDE);
|
// read IDE options
|
||||||
fOldIDEOptions.Assign(EnvironmentOptions.BuildMatrixOptions);
|
AssignBuildMatrixOptionsToGroup(EnvironmentOptions.BuildMatrixOptions,
|
||||||
// read Project options
|
Grid.Matrix,GroupIDE,SessionModes);
|
||||||
AssignBuildMatrixOptionsToGroup(LazProject.BuildModes.SharedMatrixOptions,
|
fOldIDEOptions.Assign(EnvironmentOptions.BuildMatrixOptions);
|
||||||
Grid.Matrix,GroupProject);
|
// read Project options
|
||||||
fOldSharedOptions.Assign(LazProject.BuildModes.SharedMatrixOptions);
|
AssignBuildMatrixOptionsToGroup(LazProject.BuildModes.SharedMatrixOptions,
|
||||||
// read Session options
|
Grid.Matrix,GroupProject,SessionModes);
|
||||||
AssignBuildMatrixOptionsToGroup(LazProject.BuildModes.SessionMatrixOptions,
|
fOldSharedOptions.Assign(LazProject.BuildModes.SharedMatrixOptions);
|
||||||
Grid.Matrix,GroupSession);
|
// read Session options
|
||||||
fOldSessionOptions.Assign(LazProject.BuildModes.SessionMatrixOptions);
|
AssignBuildMatrixOptionsToGroup(LazProject.BuildModes.SessionMatrixOptions,
|
||||||
|
Grid.Matrix,GroupSession,nil);
|
||||||
|
fOldSessionOptions.Assign(LazProject.BuildModes.SessionMatrixOptions);
|
||||||
|
finally
|
||||||
|
SessionModes.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
// update Grid
|
// update Grid
|
||||||
Grid.MatrixChanged;
|
Grid.MatrixChanged;
|
||||||
|
|||||||
@ -122,7 +122,7 @@ type
|
|||||||
property Value: string read FValue write SetValue;
|
property Value: string read FValue write SetValue;
|
||||||
property Typ: string read FTyp write SetTyp;
|
property Typ: string read FTyp write SetTyp;
|
||||||
property Modes: TStrings read FModes write SetModes;
|
property Modes: TStrings read FModes write SetModes;
|
||||||
function GetNormalizedModes: string;
|
function GetNormalizedModes(IgnoreModes: TStrings = nil): string;
|
||||||
function AsString: string; override;
|
function AsString: string; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -673,7 +673,7 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGroupedMatrixValue.GetNormalizedModes: string;
|
function TGroupedMatrixValue.GetNormalizedModes(IgnoreModes: TStrings): string;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
m: String;
|
m: String;
|
||||||
@ -682,6 +682,9 @@ begin
|
|||||||
for i:=0 to Modes.Count-1 do begin
|
for i:=0 to Modes.Count-1 do begin
|
||||||
m:=Modes[i];
|
m:=Modes[i];
|
||||||
if m='' then continue;
|
if m='' then continue;
|
||||||
|
if (IgnoreModes<>nil)
|
||||||
|
and (IndexInStringList(IgnoreModes,cstCaseInsensitive,m)>=0) then
|
||||||
|
continue;
|
||||||
if Result<>'' then Result+=#10;
|
if Result<>'' then Result+=#10;
|
||||||
Result+=m;
|
Result+=m;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -59,6 +59,12 @@ const
|
|||||||
type
|
type
|
||||||
TBuildMatrixOptions = class;
|
TBuildMatrixOptions = class;
|
||||||
|
|
||||||
|
TBMModesType = (
|
||||||
|
bmmtStored,
|
||||||
|
bmmtActive
|
||||||
|
);
|
||||||
|
TBMModesTypes = set of TBMModesType;
|
||||||
|
|
||||||
{ TBuildMatrixOption }
|
{ TBuildMatrixOption }
|
||||||
|
|
||||||
TBuildMatrixOption = class(TPersistent)
|
TBuildMatrixOption = class(TPersistent)
|
||||||
@ -66,12 +72,13 @@ type
|
|||||||
FID: string;
|
FID: string;
|
||||||
FList: TBuildMatrixOptions;
|
FList: TBuildMatrixOptions;
|
||||||
FMacroName: string;
|
FMacroName: string;
|
||||||
FModes: string;
|
FModes: array[TBMModesType] of string;
|
||||||
FTargets: string;
|
FTargets: string;
|
||||||
FTyp: TBuildMatrixOptionType;
|
FTyp: TBuildMatrixOptionType;
|
||||||
FValue: string;
|
FValue: string;
|
||||||
|
function GetModes(Typ: TBMModesType): string;
|
||||||
procedure SetMacroName(AValue: string);
|
procedure SetMacroName(AValue: string);
|
||||||
procedure SetModes(AValue: string);
|
procedure SetModes(Typ: TBMModesType; AValue: string);
|
||||||
procedure SetTargets(AValue: string);
|
procedure SetTargets(AValue: string);
|
||||||
procedure SetTyp(AValue: TBuildMatrixOptionType);
|
procedure SetTyp(AValue: TBuildMatrixOptionType);
|
||||||
procedure SetValue(AValue: string);
|
procedure SetValue(AValue: string);
|
||||||
@ -80,17 +87,17 @@ type
|
|||||||
constructor Create(aList: TBuildMatrixOptions);
|
constructor Create(aList: TBuildMatrixOptions);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function FitsTarget(const Target: string): boolean;
|
function FitsTarget(const Target: string): boolean;
|
||||||
function FitsMode(const Mode: string): boolean;
|
function FitsMode(const Mode: string; aTyp: TBMModesType): boolean;
|
||||||
property List: TBuildMatrixOptions read FList;
|
property List: TBuildMatrixOptions read FList;
|
||||||
property ID: string read FID write FID;
|
property ID: string read FID write FID;
|
||||||
property Targets: string read FTargets write SetTargets;
|
property Targets: string read FTargets write SetTargets;
|
||||||
property Modes: string read FModes write SetModes; // modes separated by line breaks, case insensitive
|
property Modes[Typ: TBMModesType]: string read GetModes write SetModes; // modes separated by line breaks, case insensitive
|
||||||
property Typ: TBuildMatrixOptionType read FTyp write SetTyp;
|
property Typ: TBuildMatrixOptionType read FTyp write SetTyp;
|
||||||
property MacroName: string read FMacroName write SetMacroName;
|
property MacroName: string read FMacroName write SetMacroName;
|
||||||
property Value: string read FValue write SetValue;
|
property Value: string read FValue write SetValue;
|
||||||
function Equals(Obj: TObject): boolean; override;
|
function Equals(Obj: TObject): boolean; override;
|
||||||
function GetModesSeparatedByComma: string;
|
function GetModesSeparatedByComma(aTyp: TBMModesType): string;
|
||||||
procedure SetModesFromCommaSeparatedList(aList: string);
|
procedure SetModesFromCommaSeparatedList(aList: string; aTyp: TBMModesType);
|
||||||
procedure LoadFromConfig(Cfg: TConfigStorage);
|
procedure LoadFromConfig(Cfg: TConfigStorage);
|
||||||
procedure SaveToConfig(Cfg: TConfigStorage);
|
procedure SaveToConfig(Cfg: TConfigStorage);
|
||||||
procedure LoadFromXMLConfig(Cfg: TXMLConfig; const aPath: string);
|
procedure LoadFromXMLConfig(Cfg: TXMLConfig; const aPath: string);
|
||||||
@ -562,7 +569,7 @@ begin
|
|||||||
Value:=Trim(Option.Value);
|
Value:=Trim(Option.Value);
|
||||||
if Value='' then continue;
|
if Value='' then continue;
|
||||||
if not Option.FitsTarget(Target) then continue;
|
if not Option.FitsTarget(Target) then continue;
|
||||||
if not Option.FitsMode(ActiveMode) then continue;
|
if not Option.FitsMode(ActiveMode,bmmtActive) then continue;
|
||||||
if Options<>'' then Options+=' ';
|
if Options<>'' then Options+=' ';
|
||||||
Options+=Value;
|
Options+=Value;
|
||||||
end;
|
end;
|
||||||
@ -578,7 +585,7 @@ begin
|
|||||||
Option:=Items[i];
|
Option:=Items[i];
|
||||||
if Option.Typ<>bmotOutDir then continue;
|
if Option.Typ<>bmotOutDir then continue;
|
||||||
if not Option.FitsTarget(Target) then continue;
|
if not Option.FitsTarget(Target) then continue;
|
||||||
if not Option.FitsMode(ActiveMode) then continue;
|
if not Option.FitsMode(ActiveMode,bmmtActive) then continue;
|
||||||
OutDir:=Option.Value;
|
OutDir:=Option.Value;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -592,11 +599,17 @@ begin
|
|||||||
List.IncreaseChangeStep;
|
List.IncreaseChangeStep;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildMatrixOption.SetModes(AValue: string);
|
function TBuildMatrixOption.GetModes(Typ: TBMModesType): string;
|
||||||
begin
|
begin
|
||||||
if FModes=AValue then Exit;
|
Result:=FModes[Typ];
|
||||||
FModes:=AValue;
|
end;
|
||||||
List.IncreaseChangeStep;
|
|
||||||
|
procedure TBuildMatrixOption.SetModes(Typ: TBMModesType; AValue: string);
|
||||||
|
begin
|
||||||
|
if FModes[Typ]=AValue then exit;
|
||||||
|
FModes[Typ]:=AValue;
|
||||||
|
if Typ=bmmtStored then
|
||||||
|
List.IncreaseChangeStep;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildMatrixOption.SetTargets(AValue: string);
|
procedure TBuildMatrixOption.SetTargets(AValue: string);
|
||||||
@ -623,12 +636,14 @@ end;
|
|||||||
procedure TBuildMatrixOption.Assign(Source: TPersistent);
|
procedure TBuildMatrixOption.Assign(Source: TPersistent);
|
||||||
var
|
var
|
||||||
aSource: TBuildMatrixOption;
|
aSource: TBuildMatrixOption;
|
||||||
|
mt: TBMModesType;
|
||||||
begin
|
begin
|
||||||
if Source is TBuildMatrixOption then
|
if Source is TBuildMatrixOption then
|
||||||
begin
|
begin
|
||||||
aSource:=TBuildMatrixOption(Source);
|
aSource:=TBuildMatrixOption(Source);
|
||||||
Targets:=aSource.Targets;
|
Targets:=aSource.Targets;
|
||||||
Modes:=aSource.Modes;
|
for mt:=Low(TBMModesType) to high(TBMModesType) do
|
||||||
|
Modes[mt]:=aSource.Modes[mt];
|
||||||
Typ:=aSource.Typ;
|
Typ:=aSource.Typ;
|
||||||
MacroName:=aSource.MacroName;
|
MacroName:=aSource.MacroName;
|
||||||
Value:=aSource.Value;
|
Value:=aSource.Value;
|
||||||
@ -655,32 +670,35 @@ begin
|
|||||||
Result:=BuildMatrixTargetFits(Target,Targets);
|
Result:=BuildMatrixTargetFits(Target,Targets);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildMatrixOption.FitsMode(const Mode: string): boolean;
|
function TBuildMatrixOption.FitsMode(const Mode: string; aTyp: TBMModesType
|
||||||
|
): boolean;
|
||||||
begin
|
begin
|
||||||
Result:=BuildMatrixModeFits(Mode,Modes);
|
Result:=BuildMatrixModeFits(Mode,Modes[aTyp]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildMatrixOption.Equals(Obj: TObject): boolean;
|
function TBuildMatrixOption.Equals(Obj: TObject): boolean;
|
||||||
var
|
var
|
||||||
Src: TBuildMatrixOption;
|
Src: TBuildMatrixOption;
|
||||||
|
mt: TBMModesType;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if Obj=Self then exit;
|
if Obj=Self then exit;
|
||||||
if not (Obj is TBuildMatrixOption) then exit;
|
if not (Obj is TBuildMatrixOption) then exit;
|
||||||
Src:=TBuildMatrixOption(Obj);
|
Src:=TBuildMatrixOption(Obj);
|
||||||
if Src.Targets<>Targets then exit;
|
if Src.Targets<>Targets then exit;
|
||||||
if Src.Modes<>Modes then exit;
|
for mt:=Low(TBMModesType) to high(TBMModesType) do
|
||||||
|
if Src.Modes[mt]<>Modes[mt] then exit;
|
||||||
if Src.Typ<>Typ then exit;
|
if Src.Typ<>Typ then exit;
|
||||||
if Src.MacroName<>MacroName then exit;
|
if Src.MacroName<>MacroName then exit;
|
||||||
if Src.Value<>Value then exit;
|
if Src.Value<>Value then exit;
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildMatrixOption.GetModesSeparatedByComma: string;
|
function TBuildMatrixOption.GetModesSeparatedByComma(aTyp: TBMModesType): string;
|
||||||
var
|
var
|
||||||
p: Integer;
|
p: Integer;
|
||||||
begin
|
begin
|
||||||
Result:=Modes;
|
Result:=Modes[aTyp];
|
||||||
p:=1;
|
p:=1;
|
||||||
while p<=length(Result) do begin
|
while p<=length(Result) do begin
|
||||||
case Result[p] of
|
case Result[p] of
|
||||||
@ -700,7 +718,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildMatrixOption.SetModesFromCommaSeparatedList(aList: string);
|
procedure TBuildMatrixOption.SetModesFromCommaSeparatedList(aList: string;
|
||||||
|
aTyp: TBMModesType);
|
||||||
var
|
var
|
||||||
p: Integer;
|
p: Integer;
|
||||||
begin
|
begin
|
||||||
@ -718,14 +737,14 @@ begin
|
|||||||
inc(p);
|
inc(p);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Modes:=aList;
|
Modes[aTyp]:=aList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildMatrixOption.LoadFromConfig(Cfg: TConfigStorage);
|
procedure TBuildMatrixOption.LoadFromConfig(Cfg: TConfigStorage);
|
||||||
begin
|
begin
|
||||||
ID:=Cfg.GetValue('ID','');
|
ID:=Cfg.GetValue('ID','');
|
||||||
Targets:=Cfg.GetValue('Targets','*');
|
Targets:=Cfg.GetValue('Targets','*');
|
||||||
SetModesFromCommaSeparatedList(Cfg.GetValue('Modes','*'));
|
SetModesFromCommaSeparatedList(Cfg.GetValue('Modes','*'),bmmtStored);
|
||||||
Typ:=Str2BuildMatrixOptionType(Cfg.GetValue('Type',''));
|
Typ:=Str2BuildMatrixOptionType(Cfg.GetValue('Type',''));
|
||||||
MacroName:=Cfg.GetValue('MacroName','');
|
MacroName:=Cfg.GetValue('MacroName','');
|
||||||
Value:=Cfg.GetValue('Value','');
|
Value:=Cfg.GetValue('Value','');
|
||||||
@ -735,7 +754,7 @@ procedure TBuildMatrixOption.SaveToConfig(Cfg: TConfigStorage);
|
|||||||
begin
|
begin
|
||||||
Cfg.SetDeleteValue('ID',ID,'');
|
Cfg.SetDeleteValue('ID',ID,'');
|
||||||
Cfg.SetDeleteValue('Targets',Targets,'*');
|
Cfg.SetDeleteValue('Targets',Targets,'*');
|
||||||
Cfg.SetDeleteValue('Modes',GetModesSeparatedByComma,'*');
|
Cfg.SetDeleteValue('Modes',GetModesSeparatedByComma(bmmtStored),'*');
|
||||||
Cfg.SetDeleteValue('Type',BuildMatrixOptionTypeNames[Typ],BuildMatrixOptionTypeNames[bmotCustom]);
|
Cfg.SetDeleteValue('Type',BuildMatrixOptionTypeNames[Typ],BuildMatrixOptionTypeNames[bmotCustom]);
|
||||||
Cfg.SetDeleteValue('MacroName',MacroName,'');
|
Cfg.SetDeleteValue('MacroName',MacroName,'');
|
||||||
Cfg.SetDeleteValue('Value',Value,'');
|
Cfg.SetDeleteValue('Value',Value,'');
|
||||||
@ -746,7 +765,7 @@ procedure TBuildMatrixOption.LoadFromXMLConfig(Cfg: TXMLConfig;
|
|||||||
begin
|
begin
|
||||||
ID:=Cfg.GetValue(aPath+'ID','');
|
ID:=Cfg.GetValue(aPath+'ID','');
|
||||||
Targets:=Cfg.GetValue(aPath+'Targets','*');
|
Targets:=Cfg.GetValue(aPath+'Targets','*');
|
||||||
SetModesFromCommaSeparatedList(Cfg.GetValue(aPath+'Modes','*'));
|
SetModesFromCommaSeparatedList(Cfg.GetValue(aPath+'Modes','*'),bmmtStored);
|
||||||
Typ:=Str2BuildMatrixOptionType(Cfg.GetValue(aPath+'Type',''));
|
Typ:=Str2BuildMatrixOptionType(Cfg.GetValue(aPath+'Type',''));
|
||||||
MacroName:=Cfg.GetValue(aPath+'MacroName','');
|
MacroName:=Cfg.GetValue(aPath+'MacroName','');
|
||||||
Value:=Cfg.GetValue(aPath+'Value','');
|
Value:=Cfg.GetValue(aPath+'Value','');
|
||||||
@ -757,7 +776,7 @@ procedure TBuildMatrixOption.SaveToXMLConfig(Cfg: TXMLConfig;
|
|||||||
begin
|
begin
|
||||||
Cfg.SetDeleteValue(aPath+'ID',ID,'');
|
Cfg.SetDeleteValue(aPath+'ID',ID,'');
|
||||||
Cfg.SetDeleteValue(aPath+'Targets',Targets,'*');
|
Cfg.SetDeleteValue(aPath+'Targets',Targets,'*');
|
||||||
Cfg.SetDeleteValue(aPath+'Modes',GetModesSeparatedByComma,'*');
|
Cfg.SetDeleteValue(aPath+'Modes',GetModesSeparatedByComma(bmmtStored),'*');
|
||||||
Cfg.SetDeleteValue(aPath+'Type',BuildMatrixOptionTypeNames[Typ],BuildMatrixOptionTypeNames[bmotCustom]);
|
Cfg.SetDeleteValue(aPath+'Type',BuildMatrixOptionTypeNames[Typ],BuildMatrixOptionTypeNames[bmotCustom]);
|
||||||
Cfg.SetDeleteValue(aPath+'MacroName',MacroName,'');
|
Cfg.SetDeleteValue(aPath+'MacroName',MacroName,'');
|
||||||
Cfg.SetDeleteValue(aPath+'Value',Value,'');
|
Cfg.SetDeleteValue(aPath+'Value',Value,'');
|
||||||
|
|||||||
@ -734,6 +734,7 @@ type
|
|||||||
procedure AddOnChangedHandler(const Handler: TNotifyEvent);
|
procedure AddOnChangedHandler(const Handler: TNotifyEvent);
|
||||||
procedure RemoveOnChangedHandler(const Handler: TNotifyEvent);
|
procedure RemoveOnChangedHandler(const Handler: TNotifyEvent);
|
||||||
function IsModified(InSession: boolean): boolean;
|
function IsModified(InSession: boolean): boolean;
|
||||||
|
function GetSessionModes: TStringList;
|
||||||
public
|
public
|
||||||
property Items[Index: integer]: TProjectBuildMode read GetItems; default;
|
property Items[Index: integer]: TProjectBuildMode read GetItems; default;
|
||||||
property ChangeStamp: integer read FChangeStamp;
|
property ChangeStamp: integer read FChangeStamp;
|
||||||
@ -7260,6 +7261,19 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TProjectBuildModes.GetSessionModes: TStringList;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
BuildMode: TProjectBuildMode;
|
||||||
|
begin
|
||||||
|
Result:=TStringList.Create;
|
||||||
|
for i:=0 to Count-1 do begin
|
||||||
|
BuildMode:=Items[i];
|
||||||
|
if BuildMode.InSession then
|
||||||
|
Result.Add(BuildMode.Identifier);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterIDEOptionsGroup(GroupProject, TProject);
|
RegisterIDEOptionsGroup(GroupProject, TProject);
|
||||||
RegisterIDEOptionsGroup(GroupCompiler, TProjectCompilerOptions);
|
RegisterIDEOptionsGroup(GroupCompiler, TProjectCompilerOptions);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user