mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 06:20:45 +02:00
IDE: mode matrix: show diffs in modes diff dialog
git-svn-id: trunk@41515 -
This commit is contained in:
parent
17b483d20a
commit
a4af4b60b0
@ -20,7 +20,6 @@
|
||||
|
||||
Abstract:
|
||||
Modal dialog to show the differences between build modes.
|
||||
|
||||
}
|
||||
unit BuildModeDiffDlg;
|
||||
|
||||
@ -29,9 +28,9 @@ unit BuildModeDiffDlg;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LazUTF8, LazLogger, Forms, Controls, Graphics,
|
||||
Dialogs, ButtonPanel, StdCtrls, ComCtrls, LazarusIDEStrConsts, Project,
|
||||
CompilerOptions, CompOptsModes;
|
||||
Classes, LazUTF8, LazLogger, Forms, ButtonPanel, StdCtrls, ComCtrls,
|
||||
LazarusIDEStrConsts, EnvironmentOpts, Project,
|
||||
ModeMatrixOpts, CompOptsModes;
|
||||
|
||||
type
|
||||
|
||||
@ -57,7 +56,7 @@ type
|
||||
end;
|
||||
|
||||
function ShowBuildModeDiffDialog(AProject: TProject; aMode: TProjectBuildMode): TModalResult;
|
||||
|
||||
procedure AddDiff(MatrixOptions: TBuildMatrixOptions; OldMode, NewMode: string; Diff: TStrings);
|
||||
|
||||
implementation
|
||||
|
||||
@ -76,6 +75,33 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure AddDiff(MatrixOptions: TBuildMatrixOptions; OldMode, NewMode: string;
|
||||
Diff: TStrings);
|
||||
var
|
||||
i: Integer;
|
||||
Option: TBuildMatrixOption;
|
||||
HasOldMode: Boolean;
|
||||
HasNewMode: Boolean;
|
||||
s: String;
|
||||
begin
|
||||
if MatrixOptions=nil then exit;
|
||||
for i:=0 to MatrixOptions.Count-1 do begin
|
||||
Option:=MatrixOptions[i];
|
||||
HasOldMode:=Option.FitsMode(OldMode);
|
||||
HasNewMode:=Option.FitsMode(NewMode);
|
||||
if HasOldMode=HasNewMode then continue;
|
||||
if HasOldMode then
|
||||
s:=lisDoesNotHaveMatrixOption
|
||||
else
|
||||
s:=lisHasMatrixOption;
|
||||
s+=BuildMatrixOptionTypeNames[Option.Typ]+':';
|
||||
if Option.Typ=bmotIDEMacro then
|
||||
s+=dbgstr(Option.MacroName)+':=';
|
||||
s+=dbgstr(Option.Value);
|
||||
Diff.Add(s);
|
||||
end;
|
||||
end;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TBuildModeDiffDialog }
|
||||
@ -146,6 +172,12 @@ begin
|
||||
Diff:=TStringList.Create;
|
||||
DiffTool:=TCompilerDiffTool.Create(Diff);
|
||||
BaseMode.CreateDiff(CurMode,DiffTool);
|
||||
AddDiff(EnvironmentOptions.BuildMatrixOptions,
|
||||
CurMode.Identifier,BaseMode.Identifier,Diff);
|
||||
AddDiff(fProject.BuildModes.SharedMatrixOptions,
|
||||
CurMode.Identifier,BaseMode.Identifier,Diff);
|
||||
AddDiff(fProject.BuildModes.SessionMatrixOptions,
|
||||
CurMode.Identifier,BaseMode.Identifier,Diff);
|
||||
for j:=0 to Diff.Count-1 do
|
||||
DiffTreeView.Items.AddChild(ModeNode,Diff[j]);
|
||||
DiffTool.Free;
|
||||
|
@ -21,7 +21,7 @@
|
||||
Author: Mattias Gaertner
|
||||
|
||||
Abstract:
|
||||
Dialog for editing build modes: add, delete, reorder, rename
|
||||
Modal dialog for editing build modes: add, delete, reorder, rename, diff.
|
||||
}
|
||||
unit BuildModesManager;
|
||||
|
||||
|
@ -25,9 +25,6 @@
|
||||
|
||||
ToDo:
|
||||
- check modified
|
||||
- build modes diff
|
||||
- add button to ideoptionsdlg
|
||||
- add diffs for matrix options
|
||||
- wiki
|
||||
- undo: combine changes while editing a cell
|
||||
- remove old frame (idemacrovalues.pas,lfm)
|
||||
|
@ -145,25 +145,25 @@ object IDEOptionsDialog: TIDEOptionsDialog
|
||||
TabOrder = 0
|
||||
end
|
||||
object BuildModeManageButton: TButton
|
||||
AnchorSideLeft.Control = BuildModeComboBox
|
||||
AnchorSideLeft.Control = BuildModeInSessionCheckBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = BuildModeComboBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 242
|
||||
Left = 334
|
||||
Height = 25
|
||||
Top = 5
|
||||
Width = 27
|
||||
BorderSpacing.Left = 7
|
||||
Width = 25
|
||||
BorderSpacing.Left = 15
|
||||
Caption = '...'
|
||||
OnClick = BuildModeManageButtonClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object BuildModeInSessionCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = BuildModeManageButton
|
||||
AnchorSideLeft.Control = BuildModeComboBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = BuildModeComboBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 275
|
||||
Left = 241
|
||||
Height = 24
|
||||
Top = 5
|
||||
Width = 78
|
||||
|
@ -5386,6 +5386,8 @@ resourcestring
|
||||
|
||||
//Build mode differences dialog
|
||||
lisBuildModeDiffDifferencesBetweenBuildModes = 'Differences between build modes';
|
||||
lisDoesNotHaveMatrixOption = 'Does not have matrix option ';
|
||||
lisHasMatrixOption = 'Has matrix option ';
|
||||
lisBuildModeDiffMode = 'Mode:';
|
||||
lisBuildModeDiffDifferencesToOtherBuildModes = 'Differences to other build modes';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user