From d4abf907f25f18991021dd020d1dd7b789410396 Mon Sep 17 00:00:00 2001 From: juha Date: Fri, 12 Mar 2021 10:08:59 +0000 Subject: [PATCH] =?UTF-8?q?IDE:=20Improve=20project->version=20info.=20Iss?= =?UTF-8?q?ue=20#32899,=20patch=20from=20Lutz=20M=C3=A4ndle.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: trunk@64790 - --- ide/frames/project_versioninfo_options.lfm | 4 +++ ide/frames/project_versioninfo_options.pas | 30 +++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ide/frames/project_versioninfo_options.lfm b/ide/frames/project_versioninfo_options.lfm index abadf7aa9f..ab7cd273f5 100644 --- a/ide/frames/project_versioninfo_options.lfm +++ b/ide/frames/project_versioninfo_options.lfm @@ -93,6 +93,7 @@ object ProjectVersionInfoOptionsFrame: TProjectVersionInfoOptionsFrame Top = 24 Width = 70 MaxValue = 65535 + OnChange = VersionSpinEditChange TabOrder = 0 end object MinorVersionSpinEdit: TSpinEdit @@ -104,6 +105,7 @@ object ProjectVersionInfoOptionsFrame: TProjectVersionInfoOptionsFrame Top = 24 Width = 70 MaxValue = 65535 + OnChange = VersionSpinEditChange TabOrder = 1 end object RevisionSpinEdit: TSpinEdit @@ -115,6 +117,7 @@ object ProjectVersionInfoOptionsFrame: TProjectVersionInfoOptionsFrame Top = 24 Width = 70 MaxValue = 65535 + OnChange = VersionSpinEditChange TabOrder = 2 end object AutomaticallyIncreaseBuildCheckBox: TCheckBox @@ -141,6 +144,7 @@ object ProjectVersionInfoOptionsFrame: TProjectVersionInfoOptionsFrame Top = 24 Width = 70 MaxValue = 65535 + OnChange = VersionSpinEditChange TabOrder = 3 end end diff --git a/ide/frames/project_versioninfo_options.pas b/ide/frames/project_versioninfo_options.pas index f587910cf1..38860bc468 100644 --- a/ide/frames/project_versioninfo_options.pas +++ b/ide/frames/project_versioninfo_options.pas @@ -41,6 +41,7 @@ type MajorVersionLabel: TLabel; MajorVersionSpinEdit: TSpinEdit; procedure clbAttributesClickCheck(Sender: TObject); + procedure VersionSpinEditChange(Sender: TObject); procedure UseVersionInfoCheckBoxChange(Sender: TObject); private FVersionInfo: TProjectVersionInfo; @@ -95,13 +96,30 @@ end; procedure TProjectVersionInfoOptionsFrame.clbAttributesClickCheck(Sender: TObject); begin if clbAttributes.Checked[Ord(pvaPrivateBuild)] then - DeleteKey('PrivateBuild') + AddKey('PrivateBuild') else - AddKey('PrivateBuild'); + DeleteKey('PrivateBuild'); if clbAttributes.Checked[Ord(pvaSpecialBuild)] then - DeleteKey('SpecialBuild') + AddKey('SpecialBuild') else - AddKey('SpecialBuild'); + DeleteKey('SpecialBuild'); +end; + +procedure TProjectVersionInfoOptionsFrame.VersionSpinEditChange( + Sender: TObject); +var + I: Integer; +begin + for I := 0 to StringInfo.RowCount - 1 do + if UTF8LowerCase(StringInfo.Cells[0, I]) = UTF8LowerCase('FileVersion') then + begin + StringInfo.Cells[1, I] := + IntToStr(MajorVersionSpinEdit.Value) + '.' + + IntToStr(MinorVersionSpinEdit.Value) + '.' + + IntToStr(RevisionSpinEdit.Value) + '.' + + IntToStr(BuildSpinEdit.Value); + Exit; + end; end; procedure TProjectVersionInfoOptionsFrame.EnableVersionInfo(UseVersionInfo: boolean); @@ -112,7 +130,7 @@ begin AttributesGroupBox.Enabled := UseVersionInfo; end; -procedure TProjectVersionInfoOptionsFrame.AddKey(AKey: String); +procedure TProjectVersionInfoOptionsFrame.DeleteKey(AKey: String); var I: Integer; begin @@ -121,7 +139,7 @@ begin StringInfo.DeleteRow(I); end; -procedure TProjectVersionInfoOptionsFrame.DeleteKey(AKey: String); +procedure TProjectVersionInfoOptionsFrame.AddKey(AKey: String); var I: Integer; begin