From c1b073f40f29c2e734734c2044e8a014469c61cd Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 2 Jan 2022 10:40:32 +0000 Subject: [PATCH 01/28] Update 3rd party PJSysInfo to v5.8.0 Fixes #43 --- Src/3rdParty/PJSysInfo.pas | 162 +++++++++++++++---------------------- 1 file changed, 63 insertions(+), 99 deletions(-) diff --git a/Src/3rdParty/PJSysInfo.pas b/Src/3rdParty/PJSysInfo.pas index 4b0a2dbd3..fa4cd593b 100644 --- a/Src/3rdParty/PJSysInfo.pas +++ b/Src/3rdParty/PJSysInfo.pas @@ -1,12 +1,12 @@ { * This Source Code Form is subject to the terms of the Mozilla Public License, * v. 2.0. If a copy of the MPL was not distributed with this file, You can - * obtain one at https://mozilla.org/MPL/2.0/ + * obtain one at http://mozilla.org/MPL/2.0/ * * Copyright (C) 2001-2021, Peter Johnson (@delphidabbler). * - * $Rev: 2079 $ - * $Date: 2021-11-27 14:29:47 +0000 (Sat, 27 Nov 2021) $ + * $Rev: 2082 $ + * $Date: 2022-01-01 10:12:03 +0000 (Sat, 01 Jan 2022) $ * * This unit contains various static classes, constants, type definitions and * global variables for use in providing information about the host computer and @@ -1247,6 +1247,18 @@ implementation // - 10.0.22463.1000 (RSPRERELEASE) Win11v21H2PreRel5Build = 22468; // Windows 11 version 21H2 // - 10.0.22468.1000 (RSPRERELEASE) + Win11v21H2PreRel6Build = 22471; // Windows 11 version 21H2 + // - 10.0.22471.1000 (RSPRERELEASE) + Win11v21H2PreRel7Build = 22478; // Windows 11 version 21H2 + // - 10.0.22478.1000 (RSPRERELEASE) + Win11v21H2PreRel8Build = 22483; // Windows 11 version 21H2 + // - 10.0.22483.1000 (RSPRERELEASE) + Win11v21H2PreRel9Build = 22489; // Windows 11 version 21H2 + // - 10.0.22489.1000 (RSPRERELEASE) + Win11v21H2PreRel10Build = 22494;// Windows 11 version 21H2 + // - 10.0.22494.1000 (RSPRERELEASE) + Win11v21H2PreRel11Build = 22509;// Windows 11 version 21H2 + // - 10.0.22509.1000 (RSPRERELEASE) Win11FirstBuild = Win11DevBuild; // First build number of Windows 11 @@ -1398,6 +1410,28 @@ function IsBuildNumber(BuildNumber: DWORD): Boolean; Result := VerifyVersionInfo(POSVI, VER_BUILDNUMBER, ConditionalMask); end; +// Checks if any of the given build numbers match that of the current OS. +// If current build number is in the list, FoundBN is set to the found build +// number and True is returned. Otherwise False is returned and FoundBN is set +// to zero. +function FindBuildNumberFrom(const BNs: array of Integer; var FoundBN: Integer): + Boolean; +var + I: Integer; +begin + FoundBN := 0; + Result := False; + for I := Low(BNs) to High(BNs) do + begin + if IsBuildNumber(BNs[I]) then + begin + FoundBN := BNs[I]; + Result := True; + Break; + end; + end; +end; + // Checks if the OS has the given product type. // Assumes VerifyVersionInfo & VerSetConditionMask APIs functions are available function IsWindowsProductType(ProductType: Byte): Boolean; @@ -1631,13 +1665,6 @@ procedure InitPlatformIdEx; GetProductInfo: TGetProductInfo; // pointer to GetProductInfo API function SI: TSystemInfo; // structure from GetSystemInfo API call - // Return name of Windows Server 2019 insider preview release for given build - // number. Build must be a valid insider preview release number - function Win2019IPExtra(const Build: Integer): string; - begin - Result := Format('Insider Preview Build %d', [Build]); - end; - // Get OS's revision number from registry. function GetOSRevisionNumber(const IsNT: Boolean): Integer; begin @@ -1824,8 +1851,8 @@ procedure InitPlatformIdEx; // release of Win 11 -- well hidden eh?! InternalBuildNumber := Win11v21H2Build; case InternalBuildNumber of - 194: - // First public release of Windows 11 + 194..MaxInt: + // Public releases of Windows 11 have build number >= 194 InternalExtraUpdateInfo := 'Version 21H2'; 51, 65, 71, 100, 120, 132, 168: InternalExtraUpdateInfo := Format( @@ -1844,41 +1871,18 @@ procedure InitPlatformIdEx; ); end; end - else if IsBuildNumber(Win11v21H2PreRel1Build) then - begin - InternalBuildNumber := Win11v21H2PreRel1Build; - InternalExtraUpdateInfo := Format( - 'Version 21H2 [RSPRERELEASE v10.0.%d.%d]', - [InternalBuildNumber, InternalRevisionNumber] - ); - end - else if IsBuildNumber(Win11v21H2PreRel2Build) then - begin - InternalBuildNumber := Win11v21H2PreRel2Build; - InternalExtraUpdateInfo := Format( - 'Version 21H2 [RSPRERELEASE v10.0.%d.%d]', - [InternalBuildNumber, InternalRevisionNumber] - ); - end - else if IsBuildNumber(Win11v21H2PreRel3Build) then - begin - InternalBuildNumber := Win11v21H2PreRel3Build; - InternalExtraUpdateInfo := Format( - 'Version 21H2 [RSPRERELEASE v10.0.%d.%d]', - [InternalBuildNumber, InternalRevisionNumber] - ); - end - else if IsBuildNumber(Win11v21H2PreRel4Build) then - begin - InternalBuildNumber := Win11v21H2PreRel4Build; - InternalExtraUpdateInfo := Format( - 'Version 21H2 [RSPRERELEASE v10.0.%d.%d]', - [InternalBuildNumber, InternalRevisionNumber] - ); - end - else if IsBuildNumber(Win11v21H2PreRel5Build) then + else if FindBuildNumberFrom( + [ + Win11v21H2PreRel1Build, Win11v21H2PreRel2Build, + Win11v21H2PreRel3Build, Win11v21H2PreRel4Build, + Win11v21H2PreRel5Build, Win11v21H2PreRel6Build, + Win11v21H2PreRel7Build, Win11v21H2PreRel8Build, + Win11v21H2PreRel9Build, Win11v21H2PreRel10Build, + Win11v21H2PreRel11Build + ], + InternalBuildNumber + ) then begin - InternalBuildNumber := Win11v21H2PreRel5Build; InternalExtraUpdateInfo := Format( 'Version 21H2 [RSPRERELEASE v10.0.%d.%d]', [InternalBuildNumber, InternalRevisionNumber] @@ -1925,60 +1929,20 @@ procedure InitPlatformIdEx; InternalBuildNumber := Win2016v1803Build; InternalExtraUpdateInfo := 'Version 1803'; end - else if IsBuildNumber(Win2019IP180320Build) then - begin - InternalBuildNumber := Win2019IP180320Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180320Build); - end - else if IsBuildNumber(Win2019IP180324Build) then - begin - InternalBuildNumber := Win2019IP180324Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180324Build); - end - else if IsBuildNumber(Win2019IP180515Build) then - begin - InternalBuildNumber := Win2019IP180515Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180515Build); - end - else if IsBuildNumber(Win2019IP180619Build) then - begin - InternalBuildNumber := Win2019IP180619Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180619Build); - end - else if IsBuildNumber(Win2019IP180710Build) then + else if FindBuildNumberFrom( + [ + Win2019IP180320Build, Win2019IP180324Build, + Win2019IP180515Build, Win2019IP180619Build, + Win2019IP180710Build, Win2019IP180716Build, + Win2019IP180731Build, Win2019IP180814Build, + Win2019IP180821Build, Win2019IP180828Build + ], + InternalBuildNumber + ) then begin - InternalBuildNumber := Win2019IP180710Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180710Build); - end - else if IsBuildNumber(Win2019IP180716Build) then - begin - InternalBuildNumber := Win2019IP180716Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180716Build); - end - else if IsBuildNumber(Win2019IP180716Build) then - begin - InternalBuildNumber := Win2019IP180716Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180716Build); - end - else if IsBuildNumber(Win2019IP180731Build) then - begin - InternalBuildNumber := Win2019IP180731Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180731Build); - end - else if IsBuildNumber(Win2019IP180814Build) then - begin - InternalBuildNumber := Win2019IP180814Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180814Build); - end - else if IsBuildNumber(Win2019IP180821Build) then - begin - InternalBuildNumber := Win2019IP180821Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180821Build); - end - else if IsBuildNumber(Win2019IP180828Build) then - begin - InternalBuildNumber := Win2019IP180828Build; - InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180828Build); + InternalExtraUpdateInfo := Format( + 'Insider Preview Build %d', [InternalBuildNumber] + ); end else if IsBuildNumber(Win2019v1809Build) then begin From 4887bd176baef2db74a20d13fb661abf8f7eb9e0 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 2 Jan 2022 16:27:50 +0000 Subject: [PATCH 02/28] Add new methods to get default font sizes. --- Src/UFontHelper.pas | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Src/UFontHelper.pas b/Src/UFontHelper.pas index a149d6ada..5e40c0296 100644 --- a/Src/UFontHelper.pas +++ b/Src/UFontHelper.pas @@ -80,6 +80,8 @@ TFontHelper = class(TNoConstructObject) @return Handle to cloned font. Caller is responsible for releasing the handle. } + class function GetDefaultFontSize: Integer; + class function GetDefaultContentFontSize: Integer; strict private const FallbackFontName = 'Arial'; // Fallback font name @@ -158,6 +160,32 @@ class function TFontHelper.FontExists(const FontName: string): Boolean; Result := Screen.Fonts.IndexOf(FontName) >= 0; end; +class function TFontHelper.GetDefaultContentFontSize: Integer; +var + Font: TFont; +begin + Font := TFont.Create; + try + SetContentFont(Font); + Result := Font.Size; + finally + Font.Free; + end; +end; + +class function TFontHelper.GetDefaultFontSize: Integer; +var + Font: TFont; +begin + Font := TFont.Create; + try + SetDefaultFont(Font); + Result := Font.Size; + finally + Font.Free; + end; +end; + class function TFontHelper.IsInCommonFontSizeRange( const FontSize: Integer): Boolean; begin From 042dd8a6f2c8ad7b1e7ac7b579681864915bdc0d Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 2 Jan 2022 16:31:21 +0000 Subject: [PATCH 03/28] Add DetailFontSize preference & change font size defaults Change font size defaults for overview pane and detail pane to get defaults that apply to underlying OS, rather than hard wiring them. Setting either detail pane or overview pane font size preferences to an out of range value resets the preference to its default value. --- Src/UPreferences.pas | 63 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/Src/UPreferences.pas b/Src/UPreferences.pas index dc843214f..59bd8e09a 100644 --- a/Src/UPreferences.pas +++ b/Src/UPreferences.pas @@ -183,6 +183,14 @@ interface property OverviewFontSize: Integer read GetOverviewFontSize write SetOverviewFontSize; + /// Gets size of base font used in detail pane. + function GetDetailFontSize: Integer; + /// Sets size of base font used in detail pane. + procedure SetDetailFontSize(const Value: Integer); + /// Size of base font used in detail pane. + property DetailFontSize: Integer + read GetDetailFontSize write SetDetailFontSize; + /// Gets colour used for background of source code in main /// display. function GetSourceCodeBGColour: TColor; @@ -289,7 +297,7 @@ implementation SysUtils, // Project Hiliter.UAttrs, Hiliter.UPersist, IntfCommon, UExceptions, UColours, - USettings; + UFontHelper, USettings; type @@ -342,6 +350,8 @@ TPreferences = class(TInterfacedObject, /// Records size of font used in overview pane tree view. /// fOverviewFontSize: Integer; + /// Records size of font used in details pane. + fDetailFontSize: Integer; /// Records colour used for background of source code in main /// display. fSourceCodeBGColour: TColor; @@ -366,6 +376,11 @@ TPreferences = class(TInterfacedObject, /// Information describing snippet detail page customisations. /// fPageStructures: TSnippetPageStructures; + /// Returns default font size for overview pane tree view. + /// + function DefaultOverviewFontSize: Integer; + /// Returns default font size for details pane. + function DefaultDetailFontSize: Integer; public /// Constructs a new object instance. constructor Create; @@ -510,6 +525,14 @@ TPreferences = class(TInterfacedObject, /// Method of IPreferences. procedure SetOverviewFontSize(const Value: Integer); + /// Gets size of base font used in detail pane. + /// Method of IPreferences. + function GetDetailFontSize: Integer; + + /// Sets size of base font used in detail pane. + /// Method of IPreferences. + procedure SetDetailFontSize(const Value: Integer); + /// Gets colour used for background of source code in main /// display. /// Method of IPreferences. @@ -677,6 +700,7 @@ procedure TPreferences.Assign(const Src: IInterface); Self.fDBHeadingColours[True] := SrcPref.DBHeadingColours[True]; Self.fDBHeadingCustomColours[True] := SrcPref.DBHeadingCustomColours[True]; Self.fOverviewFontSize := SrcPref.OverviewFontSize; + Self.fDetailFontSize := SrcPref.DetailFontSize; Self.fSourceCodeBGColour := SrcPref.SourceCodeBGColour; Self.fSourceCodeBGCustomColours := SrcPref.SourceCodeBGCustomColours; Self.fPrinterOptions := SrcPref.PrinterOptions; @@ -701,6 +725,16 @@ constructor TPreferences.Create; TDefaultPageStructures.SetDefaults(fPageStructures); end; +function TPreferences.DefaultDetailFontSize: Integer; +begin + Result := TFontHelper.GetDefaultContentFontSize; +end; + +function TPreferences.DefaultOverviewFontSize: Integer; +begin + Result := TFontHelper.GetDefaultFontSize; +end; + destructor TPreferences.Destroy; begin fPageStructures.Free; @@ -723,6 +757,11 @@ function TPreferences.GetDBHeadingCustomColours( Result := fDBHeadingCustomColours[UserDefined]; end; +function TPreferences.GetDetailFontSize: Integer; +begin + Result := fDetailFontSize; +end; + function TPreferences.GetHiliteAttrs: IHiliteAttrs; begin Result := fHiliteAttrs; @@ -830,6 +869,14 @@ procedure TPreferences.SetDBHeadingCustomColours(UserDefined: Boolean; fDBHeadingCustomColours[UserDefined] := Value; end; +procedure TPreferences.SetDetailFontSize(const Value: Integer); +begin + if TFontHelper.IsInCommonFontSizeRange(Value) then + fDetailFontSize := Value + else + fDetailFontSize := DefaultDetailFontSize; +end; + procedure TPreferences.SetHiliteAttrs(const Attrs: IHiliteAttrs); begin (fHiliteAttrs as IAssignable).Assign(Attrs); @@ -852,7 +899,10 @@ procedure TPreferences.SetNamedHiliteAttrs(NamedHiliteAttrs: INamedHiliteAttrs); procedure TPreferences.SetOverviewFontSize(const Value: Integer); begin - fOverviewFontSize := Value; + if TFontHelper.IsInCommonFontSizeRange(Value) then + fOverviewFontSize := Value + else + fOverviewFontSize := DefaultOverviewFontSize; end; procedure TPreferences.SetOverviewStartState(const Value: TOverviewStartState); @@ -945,6 +995,7 @@ function TPreferencesPersist.Clone: IInterface; NewPref.DBHeadingColours[True] := Self.fDBHeadingColours[True]; NewPref.DBHeadingCustomColours[True] := Self.fDBHeadingCustomColours[True]; NewPref.OverviewFontSize := Self.fOverviewFontSize; + NewPref.DetailFontSize := Self.fDetailFontSize; NewPref.SourceCodeBGColour := Self.fSourceCodeBGColour; NewPref.SourceCodeBGCustomColours := Self.fSourceCodeBGCustomColours; NewPref.PrinterOptions := Self.fPrinterOptions; @@ -999,7 +1050,12 @@ constructor TPreferencesPersist.Create; fDBHeadingCustomColours[True] := Storage.GetStrings( 'UserDBHeadingCustomColourCount', 'UserDBHeadingCustomColour%d' ); - fOverviewFontSize := Storage.GetInteger('OverviewFontSize', 9); + fOverviewFontSize := Storage.GetInteger( + 'OverviewFontSize', DefaultOverviewFontSize + ); + fDetailFontSize := Storage.GetInteger( + 'DetailFontSize', DefaultDetailFontSize + ); fSourceCodeBGCustomColours := Storage.GetStrings( 'SourceCodeBGCustomColourCount', 'SourceCodeBGCustomColour%d' ); @@ -1071,6 +1127,7 @@ destructor TPreferencesPersist.Destroy; Storage.SetInteger('MainDBHeadingColour', fDBHeadingColours[False]); Storage.SetInteger('UserDBHeadingColour', fDBHeadingColours[True]); Storage.SetInteger('OverviewFontSize', fOverviewFontSize); + Storage.SetInteger('DetailFontSize', fDetailFontSize); Storage.SetInteger('SourceCodeBGColour', fSourceCodeBGColour); Storage.SetStrings( 'MainDBHeadingCustomColourCount', From 410543eaa8a446a9a99aca9f227f8e94cff9f3d6 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 2 Jan 2022 16:33:33 +0000 Subject: [PATCH 04/28] Add detail pane font size option & refactor font size code OnChange event handler for font size combo boxes is now shared between the two. This required that current font size was store in each combo box's Tag property rather than in separate field of frame. --- Src/FrDisplayPrefs.dfm | 18 ++++++- Src/FrDisplayPrefs.pas | 115 +++++++++++++++++++++++------------------ 2 files changed, 83 insertions(+), 50 deletions(-) diff --git a/Src/FrDisplayPrefs.dfm b/Src/FrDisplayPrefs.dfm index 5f060c451..e28212e79 100644 --- a/Src/FrDisplayPrefs.dfm +++ b/Src/FrDisplayPrefs.dfm @@ -40,6 +40,14 @@ inherited DisplayPrefsFrame: TDisplayPrefsFrame Caption = 'Overview tree view &font size: ' FocusControl = cbOverviewFontSize end + object lblDetailFontSize: TLabel + Left = 16 + Top = 232 + Width = 105 + Height = 13 + Caption = 'Detail pane font si&ze: ' + FocusControl = cbDetailFontSize + end object cbOverviewTree: TComboBox Left = 192 Top = 2 @@ -80,6 +88,14 @@ inherited DisplayPrefsFrame: TDisplayPrefsFrame Width = 57 Height = 21 TabOrder = 4 - OnChange = cbOverviewFontSizeChange + OnChange = FontSizeChange + end + object cbDetailFontSize: TComboBox + Left = 192 + Top = 229 + Width = 57 + Height = 21 + TabOrder = 5 + OnChange = FontSizeChange end end diff --git a/Src/FrDisplayPrefs.pas b/Src/FrDisplayPrefs.pas index de3b90943..0109107c2 100644 --- a/Src/FrDisplayPrefs.pas +++ b/Src/FrDisplayPrefs.pas @@ -37,14 +37,15 @@ TDisplayPrefsFrame = class(TPrefsBaseFrame) lblSourceBGColour: TLabel; lblOverviewFontSize: TLabel; cbOverviewFontSize: TComboBox; + lblDetailFontSize: TLabel; + cbDetailFontSize: TComboBox; procedure chkHideEmptySectionsClick(Sender: TObject); procedure btnDefColoursClick(Sender: TObject); - procedure cbOverviewFontSizeChange(Sender: TObject); + procedure FontSizeChange(Sender: TObject); strict private var /// Flag indicating if changes affect UI. fUIChanged: Boolean; - fOverviewFontSize: Integer; fMainColourBox: TColorBoxEx; fMainColourDlg: TColorDialogEx; fUserColourBox: TColorBoxEx; @@ -63,7 +64,7 @@ TDisplayPrefsFrame = class(TPrefsBaseFrame) function CreateCustomColourBox(const ColourDlg: TColorDialogEx): TColorBoxEx; procedure ColourBoxChangeHandler(Sender: TObject); - procedure PopulateFontSizeCombo; + procedure PopulateFontSizeCombos; public constructor Create(AOwner: TComponent); override; {Class constructor. Sets up frame and populates controls. @@ -137,8 +138,10 @@ procedure TDisplayPrefsFrame.Activate(const Prefs: IPreferences; Prefs.DBHeadingCustomColours[False].CopyTo(fMainColourDlg.CustomColors, True); Prefs.DBHeadingCustomColours[True].CopyTo(fUserColourDlg.CustomColors, True); Prefs.SourceCodeBGCustomColours.CopyTo(fSourceBGColourDlg.CustomColors, True); - fOverviewFontSize := Prefs.OverviewFontSize; - cbOverviewFontSize.Text := IntToStr(fOverviewFontSize); + cbOverviewFontSize.Tag := Prefs.OverviewFontSize; // store font size in .Tag + cbOverviewFontSize.Text := IntToStr(Prefs.OverviewFontSize); + cbDetailFontSize.Tag := Prefs.DetailFontSize; // store font size in .Tag + cbDetailFontSize.Text := IntToStr(Prefs.DetailFontSize); end; procedure TDisplayPrefsFrame.ArrangeControls; @@ -149,14 +152,14 @@ procedure TDisplayPrefsFrame.ArrangeControls; [ lblOverviewTree, chkHideEmptySections, chkSnippetsInNewTab, lblMainColour, lblUserColour, lblSourceBGColour, btnDefColours, - lblOverviewFontSize + lblOverviewFontSize, lblDetailFontSize ], 0 ); TCtrlArranger.AlignLefts( [ cbOverviewTree, fMainColourBox, fUserColourBox, fSourceBGColourBox, - cbOverviewFontSize + cbOverviewFontSize, cbDetailFontSize ], TCtrlArranger.RightOf( [lblOverviewTree, lblMainColour, lblUserColour, lblSourceBGColour], @@ -165,11 +168,11 @@ procedure TDisplayPrefsFrame.ArrangeControls; ); TCtrlArranger.AlignVCentres(3, [lblOverviewTree, cbOverviewTree]); TCtrlArranger.MoveBelow( - [lblOverviewTree, cbOverviewTree], chkSnippetsInNewTab, 24 + [lblOverviewTree, cbOverviewTree], chkSnippetsInNewTab, 12 ); TCtrlArranger.MoveBelow(chkSnippetsInNewTab, chkHideEmptySections, 8); TCtrlArranger.AlignVCentres( - TCtrlArranger.BottomOf(chkHideEmptySections, 24), + TCtrlArranger.BottomOf(chkHideEmptySections, 12), [lblMainColour, fMainColourBox] ); TCtrlArranger.AlignVCentres( @@ -187,6 +190,10 @@ procedure TDisplayPrefsFrame.ArrangeControls; TCtrlArranger.BottomOf(btnDefColours, 12), [lblOverviewFontSize, cbOverviewFontSize] ); + TCtrlArranger.AlignVCentres( + TCtrlArranger.BottomOf(cbOverviewFontSize, 8), + [lblDetailFontSize, cbDetailFontSize] + ); chkHideEmptySections.Width := Self.Width - 16; chkSnippetsInNewTab.Width := Self.Width - 16; end; @@ -201,43 +208,6 @@ procedure TDisplayPrefsFrame.btnDefColoursClick(Sender: TObject); fUIChanged := True; end; -procedure TDisplayPrefsFrame.cbOverviewFontSizeChange(Sender: TObject); -var - Size: Integer; // font size entered by user -begin - inherited; - // Do nothing if combo box text field cleared - if cbOverviewFontSize.Text = '' then - Exit; - if TryStrToInt(cbOverviewFontSize.Text, Size) then - begin - if TFontHelper.IsInCommonFontSizeRange(Size) then - begin - // Combo has valid value entered: update - fOverviewFontSize := Size; - fUIChanged := True; - end - else - begin - // Font size out of range - TMessageBox.Error( - ParentForm, - Format( - sErrBadOverviewFontRange, - [TFontHelper.CommonFontSizes.Min, TFontHelper.CommonFontSizes.Max] - ) - ); - cbOverviewFontSize.Text := IntToStr(fOverviewFontSize); - end; - end - else - begin - // Combo has invalid value: say so - TMessageBox.Error(ParentForm, sErrBadOverviewFontSize); - cbOverviewFontSize.Text := IntToStr(fOverviewFontSize); - end; -end; - procedure TDisplayPrefsFrame.chkHideEmptySectionsClick(Sender: TObject); {Handles clicks on "Hide Empty Sections" check box. Flags UI preferences has having changed. @@ -287,7 +257,7 @@ constructor TDisplayPrefsFrame.Create(AOwner: TComponent); fSourceBGColourBox.TabOrder := 5; lblSourceBGColour.FocusControl := fSourceBGColourBox; - PopulateFontSizeCombo; + PopulateFontSizeCombos; end; function TDisplayPrefsFrame.CreateCustomColourBox( @@ -330,7 +300,10 @@ procedure TDisplayPrefsFrame.Deactivate(const Prefs: IPreferences); Prefs.SourceCodeBGCustomColours.CopyFrom( fSourceBGColourDlg.CustomColors, True ); - Prefs.OverviewFontSize := StrToIntDef(cbOverviewFontSize.Text, 8); + // Setting following properties to -1 causes preferences object to use their + // default font size + Prefs.OverviewFontSize := StrToIntDef(cbOverviewFontSize.Text, -1); + Prefs.DetailFontSize := StrToIntDef(cbDetailFontSize.Text, -1); end; function TDisplayPrefsFrame.DisplayName: string; @@ -344,6 +317,47 @@ function TDisplayPrefsFrame.DisplayName: string; Result := sDisplayName; end; +procedure TDisplayPrefsFrame.FontSizeChange(Sender: TObject); +var + Size: Integer; // font size entered by user + CB: TComboBox; // combo box that triggered event +begin + inherited; + Assert(Sender is TComboBox, + ClassName + '.FontSizeChange: Sender not TComboBox'); + CB := Sender as TComboBox; + // Do nothing if combo box text field cleared + if CB.Text = '' then + Exit; + if TryStrToInt(CB.Text, Size) then + begin + if TFontHelper.IsInCommonFontSizeRange(Size) then + begin + // Combo has valid value entered: update + CB.Tag := Size; + fUIChanged := True; + end + else + begin + // Font size out of range + TMessageBox.Error( + ParentForm, + Format( + sErrBadOverviewFontRange, + [TFontHelper.CommonFontSizes.Min, TFontHelper.CommonFontSizes.Max] + ) + ); + CB.Text := IntToStr(CB.Tag); + end; + end + else + begin + // Combo has invalid value: say so + TMessageBox.Error(ParentForm, sErrBadOverviewFontSize); + CB.Text := IntToStr(CB.Tag); + end; +end; + class function TDisplayPrefsFrame.Index: Byte; {Index number that determines the location of the tab containing this frame when displayed in the preferences dialog box. @@ -372,9 +386,12 @@ function TDisplayPrefsFrame.OverviewTreeStateDesc( Result := cOTSStartStates[State]; end; -procedure TDisplayPrefsFrame.PopulateFontSizeCombo; +procedure TDisplayPrefsFrame.PopulateFontSizeCombos; begin + cbOverviewFontSize.Clear; TFontHelper.ListCommonFontSizes(cbOverviewFontSize.Items); + cbDetailFontSize.Clear; + TFontHelper.ListCommonFontSizes(cbDetailFontSize.Items); end; procedure TDisplayPrefsFrame.SelectOverviewTreeState( From c7a09ed992bbc5d72ba263bf05c3f8295019c627 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 2 Jan 2022 16:37:41 +0000 Subject: [PATCH 05/28] Modify CSS generation to enable user specified font size. Adjustments had to be made to preserve ratio of sizes of baseline content font in relation to heading a mono font styles. --- Src/FrDetailView.pas | 76 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 13 deletions(-) diff --git a/Src/FrDetailView.pas b/Src/FrDetailView.pas index 06da2e9bf..78d56a712 100644 --- a/Src/FrDetailView.pas +++ b/Src/FrDetailView.pas @@ -107,7 +107,7 @@ implementation uses // Delphi - SysUtils, Graphics, Menus, + SysUtils, Graphics, Menus, Math, // Project ActiveText.UHTMLRenderer, Browser.UHighlighter, Hiliter.UAttrs, Hiliter.UCSS, Hiliter.UGlobals, UColours, UCSSUtils, UFontHelper, UPreferences, UQuery, @@ -119,27 +119,53 @@ implementation procedure TDetailViewFrame.BuildCSS(const CSSBuilder: TCSSBuilder); var - HiliteAttrs: IHiliteAttrs; // syntax highlighter used to build CSS - CSSFont: TFont; // font used to set CSS properties + HiliteAttrs: IHiliteAttrs; // syntax highlighter used to build CSS + ContentFont: TFont; // default content font sized per preferences + MonoFont: TFont; // default mono font sized per preferences + CSSFont: TFont; // font used to set CSS properties + ContentFontScaleFactor: Single; // amount to increase font size by to get + // proportionally same increase as adding 1 to + // default content font size + MonoToContentFontRatio: Single; // ratio of size of mono font to content font + DefContentFontSize: Integer; // default size of content font + DefMonoFontSize: Integer; // default size of mono font begin // NOTE: // We only set CSS properties that may need to use system colours or fonts // that may be changed by user or changing program defaults. CSS that controls // layout remains in a CSS file embedded in resources. inherited; + ContentFont := nil; + MonoFont := nil; CSSFont := TFont.Create; try + MonoFont := TFont.Create; + ContentFont := TFont.Create; + TFontHelper.SetDefaultMonoFont(MonoFont); + TFontHelper.SetContentFont(ContentFont); + // Must do next two lines before changing content & mono font sizes + DefContentFontSize := ContentFont.Size; + DefMonoFontSize := MonoFont.Size; + ContentFontScaleFactor := 1.0 / DefContentFontSize; + MonoToContentFontRatio := DefMonoFontSize / DefContentFontSize; + ContentFont.Size := Preferences.DetailFontSize; + MonoFont.Size := Round(ContentFont.Size * MonoToContentFontRatio); // Set body style to use program's font and window colour with CSSBuilder.AddSelector('body') do begin - TFontHelper.SetContentFont(CSSFont); + CSSFont.Assign(ContentFont); AddProperty(TCSS.FontProps(CSSFont)); AddProperty(TCSS.BackgroundColorProp(clWindow)); end; + with CSSBuilder.Selectors['code'] do + begin + CSSFont.Assign(MonoFont); + AddProperty(TCSS.FontProps(CSSFont)); + end; // Set table to use required font with CSSBuilder.AddSelector('table') do begin - TFontHelper.SetContentFont(CSSFont); + CSSFont.Assign(ContentFont); AddProperty(TCSS.FontProps(CSSFont)); AddProperty(TCSS.BackgroundColorProp(clBorder)); end; @@ -149,8 +175,10 @@ procedure TDetailViewFrame.BuildCSS(const CSSBuilder: TCSSBuilder); // Sets H1 heading font size and border with CSSBuilder.AddSelector('h1') do begin - TFontHelper.SetContentFont(CSSFont); - CSSFont.Size := CSSFont.Size + 2; + CSSFont.Assign(ContentFont); + CSSFont.Size := CSSFont.Size + Max( + Round(2 * ContentFontScaleFactor * CSSFont.Size), 2 + ); CSSFont.Style := [fsBold]; AddProperty(TCSS.FontProps(CSSFont)); AddProperty(TCSS.BorderProp(cssBottom, 1, cbsSolid, clBorder)); @@ -158,22 +186,42 @@ procedure TDetailViewFrame.BuildCSS(const CSSBuilder: TCSSBuilder); // Sets H2 heading font size and border with CSSBuilder.AddSelector('h2') do begin - TFontHelper.SetContentFont(CSSFont); + CSSFont.Assign(ContentFont); CSSFont.Style := [fsBold]; AddProperty(TCSS.FontProps(CSSFont)); end; // Set H2 heading font for use in rendered active text with CSSBuilder.AddSelector('.active-text h2') do begin - TFontHelper.SetContentFont(CSSFont); + CSSFont.Assign(ContentFont); CSSFont.Style := [fsBold]; - CSSFont.Size := CSSFont.Size + 1; + CSSFont.Size := CSSFont.Size + Max( + Round(ContentFontScaleFactor * CSSFont.Size), 1 + ); + AddProperty(TCSS.FontProps(CSSFont)); + end; + // Set CODE tag within H2 heading for use in rendered active text + with CSSBuilder.AddSelector('.active-text h2 code') do + begin + CSSFont.Assign(MonoFont); + CSSFont.Style := [fsBold]; + CSSFont.Size := CSSFont.Size + Max( + Round(ContentFontScaleFactor * CSSFont.Size), 1 + ); AddProperty(TCSS.FontProps(CSSFont)); end; // Set H2 heading font for use in rendered active text in snippet list table with CSSBuilder.AddSelector('.snippet-list .active-text h2') do begin - TFontHelper.SetContentFont(CSSFont); + CSSFont.Assign(ContentFont); + CSSFont.Style := [fsBold]; + AddProperty(TCSS.FontProps(CSSFont)); + end; + // Set CODE within H2 heading font for use in rendered active text in + // snippet list table + with CSSBuilder.AddSelector('.snippet-list .active-text h2 code') do + begin + CSSFont.Assign(MonoFont); CSSFont.Style := [fsBold]; AddProperty(TCSS.FontProps(CSSFont)); end; @@ -187,8 +235,8 @@ procedure TDetailViewFrame.BuildCSS(const CSSBuilder: TCSSBuilder); // Sets CSS for style of New Tab text with CSSBuilder.AddSelector('#newtab') do begin - TFontHelper.SetContentFont(CSSFont); - CSSFont.Size := 36; + CSSFont.Assign(ContentFont); + CSSFont.Size := 36 + Round(36 * ContentFontScaleFactor); CSSFont.Color := clNewTabText; AddProperty(TCSS.FontProps(CSSFont)); end; @@ -218,6 +266,8 @@ procedure TDetailViewFrame.BuildCSS(const CSSBuilder: TCSSBuilder); AddProperty(TCSS.FontWeightProp(cfwNormal)); end; finally + ContentFont.Free; + MonoFont.Free; CSSFont.Free; end; end; From 3771b42880e6962f33aa967b2868ef7aaf465a09 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 2 Jan 2022 17:19:21 +0000 Subject: [PATCH 06/28] Change to restore default font size when bad value assigned. Setting highlighter font size preference to an out of range value resets the preference to its default value. --- Src/Hiliter.UAttrs.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Src/Hiliter.UAttrs.pas b/Src/Hiliter.UAttrs.pas index b137e6f9e..24a91dd25 100644 --- a/Src/Hiliter.UAttrs.pas +++ b/Src/Hiliter.UAttrs.pas @@ -107,7 +107,11 @@ THiliteAttrs = class(TInterfacedObject, /// Method of IHiliteAttrs. function GetFontSize: Integer; /// Sets size of highlighter font. - /// Method of IHiliteAttrs. + /// + /// If font size is out of range of supported sizes then the + /// highlighter font is reset to its default value. + /// Method of IHiliteAttrs. + /// procedure SetFontSize(const AFontSize: Integer); /// Resets highlighter font name and size to default values. /// @@ -307,7 +311,10 @@ procedure THiliteAttrs.SetFontName(const AFontName: string); procedure THiliteAttrs.SetFontSize(const AFontSize: Integer); begin - fFontSize := AFontSize; + if TFontHelper.IsInCommonFontSizeRange(AFontSize) then + fFontSize := AFontSize + else + fFontSize := cDefFontSize; end; { THiliteElemAttrs } From 6d58923d2e5b773eee560a63e8c8ff73abcd406f Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 2 Jan 2022 17:21:08 +0000 Subject: [PATCH 07/28] Condense dialogue controls & add info label Add an information label explaining that Syntax Highlighter preferences page must be used to set source code font size. --- Src/FrDisplayPrefs.dfm | 13 +++++++++++++ Src/FrDisplayPrefs.pas | 14 ++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Src/FrDisplayPrefs.dfm b/Src/FrDisplayPrefs.dfm index e28212e79..80a7370ef 100644 --- a/Src/FrDisplayPrefs.dfm +++ b/Src/FrDisplayPrefs.dfm @@ -48,6 +48,19 @@ inherited DisplayPrefsFrame: TDisplayPrefsFrame Caption = 'Detail pane font si&ze: ' FocusControl = cbDetailFontSize end + object lblHiliterInfo: TLabel + Left = 16 + Top = 256 + Width = 370 + Height = 36 + Caption = + 'To change the size of the source code font use the the Syntax Hi' + + 'ghlighter options page.' + Color = clBtnFace + ParentColor = False + Transparent = True + WordWrap = True + end object cbOverviewTree: TComboBox Left = 192 Top = 2 diff --git a/Src/FrDisplayPrefs.pas b/Src/FrDisplayPrefs.pas index 0109107c2..83ed29e2c 100644 --- a/Src/FrDisplayPrefs.pas +++ b/Src/FrDisplayPrefs.pas @@ -39,6 +39,7 @@ TDisplayPrefsFrame = class(TPrefsBaseFrame) cbOverviewFontSize: TComboBox; lblDetailFontSize: TLabel; cbDetailFontSize: TComboBox; + lblHiliterInfo: TLabel; procedure chkHideEmptySectionsClick(Sender: TObject); procedure btnDefColoursClick(Sender: TObject); procedure FontSizeChange(Sender: TObject); @@ -152,7 +153,7 @@ procedure TDisplayPrefsFrame.ArrangeControls; [ lblOverviewTree, chkHideEmptySections, chkSnippetsInNewTab, lblMainColour, lblUserColour, lblSourceBGColour, btnDefColours, - lblOverviewFontSize, lblDetailFontSize + lblOverviewFontSize, lblDetailFontSize, lblHiliterInfo ], 0 ); @@ -176,15 +177,15 @@ procedure TDisplayPrefsFrame.ArrangeControls; [lblMainColour, fMainColourBox] ); TCtrlArranger.AlignVCentres( - TCtrlArranger.BottomOf([lblMainColour, fMainColourBox], 8), + TCtrlArranger.BottomOf([lblMainColour, fMainColourBox], 6), [lblUserColour, fUserColourBox] ); TCtrlArranger.AlignVCentres( - TCtrlArranger.BottomOf([lblUserColour, fUserColourBox], 8), + TCtrlArranger.BottomOf([lblUserColour, fUserColourBox], 6), [lblSourceBGColour, fSourceBGColourBox] ); TCtrlArranger.MoveBelow( - [lblSourceBGColour, fSourceBGColourBox], btnDefColours, 12 + [lblSourceBGColour, fSourceBGColourBox], btnDefColours, 6 ); TCtrlArranger.AlignVCentres( TCtrlArranger.BottomOf(btnDefColours, 12), @@ -194,6 +195,11 @@ procedure TDisplayPrefsFrame.ArrangeControls; TCtrlArranger.BottomOf(cbOverviewFontSize, 8), [lblDetailFontSize, cbDetailFontSize] ); + TCtrlArranger.MoveBelow( + [lblDetailFontSize, cbDetailFontSize], lblHiliterInfo, 12 + ); + lblHiliterInfo.Width := Self.ClientWidth; + TCtrlArranger.SetLabelHeight(lblHiliterInfo); chkHideEmptySections.Width := Self.Width - 16; chkSnippetsInNewTab.Width := Self.Width - 16; end; From f5a2b5f8ef268f935fbd0cddd56409f1951cc776 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Mon, 3 Jan 2022 10:37:46 +0000 Subject: [PATCH 08/28] Update help file re Display Preference Page changes Noted new Display pane font size combo box --- Src/Help/HTML/dlg_prefs_display.htm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Src/Help/HTML/dlg_prefs_display.htm b/Src/Help/HTML/dlg_prefs_display.htm index 425181740..0dbb43732 100644 --- a/Src/Help/HTML/dlg_prefs_display.htm +++ b/Src/Help/HTML/dlg_prefs_display.htm @@ -97,6 +97,21 @@

>overview pane's tree view using the Overview tree font size combo box. +
  • +

    + Similarly, the size of font used in the details pane is set using the Detail pane font size + combo box. +

    +

    + Note: this combo box does + not affect the size of the font used to display source code + – this can be changed on the Syntax Highlighter Preferences page. +

    +
  • From c79be6c466d0dae01c20b8977a91c536e39ad998 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:52:46 +0000 Subject: [PATCH 09/28] Add feature to delete user database. New dialogue box unit to get permission to delete, with associated HTML frame contents. Update UUserDBMgr to add new method to perform deletion. Add new "Delete User Database" action and menu option to main form. Fixes #15 --- Src/CodeSnip.dpr | 5 +- Src/CodeSnip.dproj | 3 + Src/FmDeleteUserDBDlg.dfm | 48 +++++++++++++++ Src/FmDeleteUserDBDlg.pas | 108 +++++++++++++++++++++++++++++++++ Src/FmMain.dfm | 18 +++++- Src/FmMain.pas | 14 ++++- Src/HTML.hrc | 5 +- Src/Res/HTML/dlg-dbdelete.html | 48 +++++++++++++++ Src/UUserDBMgr.pas | 19 +++++- 9 files changed, 258 insertions(+), 10 deletions(-) create mode 100644 Src/FmDeleteUserDBDlg.dfm create mode 100644 Src/FmDeleteUserDBDlg.pas create mode 100644 Src/Res/HTML/dlg-dbdelete.html diff --git a/Src/CodeSnip.dpr b/Src/CodeSnip.dpr index da093abaa..d608babf8 100644 --- a/Src/CodeSnip.dpr +++ b/Src/CodeSnip.dpr @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * CodeSnip application project file. } @@ -369,7 +369,8 @@ uses UWindowSettings in 'UWindowSettings.pas', UXMLDocConsts in 'UXMLDocConsts.pas', UXMLDocHelper in 'UXMLDocHelper.pas', - UXMLDocumentEx in 'UXMLDocumentEx.pas'; + UXMLDocumentEx in 'UXMLDocumentEx.pas', + FmDeleteUserDBDlg in 'FmDeleteUserDBDlg.pas' {DeleteUserDBDlg}; // Include resources {$Resource ExternalObj.tlb} // Type library file diff --git a/Src/CodeSnip.dproj b/Src/CodeSnip.dproj index f1ccf4093..e1a91d26d 100644 --- a/Src/CodeSnip.dproj +++ b/Src/CodeSnip.dproj @@ -572,6 +572,9 @@ + +
    DeleteUserDBDlg
    +
    Base diff --git a/Src/FmDeleteUserDBDlg.dfm b/Src/FmDeleteUserDBDlg.dfm new file mode 100644 index 000000000..9f30a2285 --- /dev/null +++ b/Src/FmDeleteUserDBDlg.dfm @@ -0,0 +1,48 @@ +inherited DeleteUserDBDlg: TDeleteUserDBDlg + Caption = 'DeleteUserDBDlg' + ExplicitWidth = 474 + ExplicitHeight = 375 + PixelsPerInch = 96 + TextHeight = 13 + inherited pnlBody: TPanel + object edConfirm: TEdit + Left = 0 + Top = 216 + Width = 201 + Height = 21 + TabOrder = 0 + end + inline frmWarning: TFixedHTMLDlgFrame + Left = 0 + Top = 0 + Width = 369 + Height = 210 + Align = alTop + TabOrder = 1 + TabStop = True + ExplicitWidth = 369 + ExplicitHeight = 210 + inherited pnlBrowser: TPanel + Width = 369 + Height = 210 + ExplicitWidth = 369 + ExplicitHeight = 210 + inherited wbBrowser: TWebBrowser + Width = 369 + Height = 210 + ExplicitWidth = 369 + ExplicitHeight = 210 + ControlData = { + 4C00000023260000B41500000000000000000000000000000000000000000000 + 000000004C000000000000000000000001000000E0D057007335CF11AE690800 + 2B2E126208000000000000004C0000000114020000000000C000000000000046 + 8000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000100000000000000000000000000000000000000} + end + end + end + end + inherited btnOK: TButton + OnClick = btnOKClick + end +end diff --git a/Src/FmDeleteUserDBDlg.pas b/Src/FmDeleteUserDBDlg.pas new file mode 100644 index 000000000..3aee061a4 --- /dev/null +++ b/Src/FmDeleteUserDBDlg.pas @@ -0,0 +1,108 @@ +{ + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at https://mozilla.org/MPL/2.0/ + * + * Copyright (C) 2022, Peter Johnson (gravatar.com/delphidabbler). + * + * Implements a dialogue box that asks user to confirm deletion of user-defined + * snippets database. +} + + +unit FmDeleteUserDBDlg; + +interface + +uses + // Delphi + Forms, StdCtrls, Controls, ExtCtrls, Classes, + // Project + FmGenericOKDlg, + FrBrowserBase, FrHTMLDlg, FrFixedHTMLDlg, + UBaseObjects; + +type + TDeleteUserDBDlg = class(TGenericOKDlg, INoPublicConstruct) + edConfirm: TEdit; + frmWarning: TFixedHTMLDlgFrame; + procedure btnOKClick(Sender: TObject); + strict private + const + cConfirmText = 'DELETE MY SNIPPETS'; + var + fPermissionGranted: Boolean; + strict protected + /// Protected constructor that sets up form. + constructor InternalCreate(AOwner: TComponent); override; + procedure ConfigForm; override; + procedure ArrangeForm; override; + function IsValidPassword: Boolean; + public + class function Execute(AOwner: TComponent): Boolean; + end; + +implementation + +uses + // Delphi + SysUtils, + // Project + UCtrlArranger, UMessageBox; + +{$R *.dfm} + +procedure TDeleteUserDBDlg.ArrangeForm; +begin + frmWarning.Height := frmWarning.DocHeight; + edConfirm.Left := 0; + TCtrlArranger.MoveBelow(frmWarning, edConfirm, 12); + TCtrlArranger.AlignHCentresTo([frmWarning], [edConfirm]); + pnlBody.ClientHeight := TCtrlArranger.TotalControlHeight(pnlBody) + 8; + inherited; +end; + +procedure TDeleteUserDBDlg.btnOKClick(Sender: TObject); +resourcestring + sBadPassword = 'Invalid confirmation text entered: not deleting'; +begin + inherited; + fPermissionGranted := IsValidPassword; + if not fPermissionGranted then + begin + TMessageBox.Error(Self, sBadPassword); + ModalResult := mrNone; + end; +end; + +procedure TDeleteUserDBDlg.ConfigForm; +begin + inherited; +// frmWarning.OnBuildCSS := BuildCSS; + frmWarning.Initialise('dlg-dbdelete.html'); +end; + +class function TDeleteUserDBDlg.Execute(AOwner: TComponent): Boolean; +begin + with InternalCreate(AOwner) do + try + ShowModal; + Result := fPermissionGranted; + finally + Free; + end; +end; + +constructor TDeleteUserDBDlg.InternalCreate(AOwner: TComponent); +begin + Assert(Supports(Self, INoPublicConstruct), ClassName + '.InternalCreate: ' + + 'Form''s protected constructor can''t be called'); + inherited InternalCreate(AOwner); +end; + +function TDeleteUserDBDlg.IsValidPassword: Boolean; +begin + Result := edConfirm.Text = cConfirmText; +end; + +end. diff --git a/Src/FmMain.dfm b/Src/FmMain.dfm index 0128f4c4f..e2441f840 100644 --- a/Src/FmMain.dfm +++ b/Src/FmMain.dfm @@ -8,8 +8,8 @@ inherited MainForm: TMainForm Constraints.MinWidth = 480 Menu = mnuMain OnResize = FormResize - ExplicitWidth = 613 - ExplicitHeight = 495 + ExplicitWidth = 621 + ExplicitHeight = 503 PixelsPerInch = 96 TextHeight = 13 object sbStatusBar: TStatusBar @@ -866,6 +866,14 @@ inherited MainForm: TMainForm ' default web browser' ImageIndex = 6 end + object actDeleteUserDatabase: TAction + Category = 'Database' + Caption = 'Delete User Database...' + Hint = + 'Delete User Database|Deletes the user'#39's snippets database - USE ' + + 'WITH CAUTION' + OnExecute = actDeleteUserDatabaseExecute + end end object mnuMain: TMainMenu Images = ilMain @@ -1093,6 +1101,12 @@ inherited MainForm: TMainForm object miMoveUserDatabase: TMenuItem Action = actMoveUserDatabase end + object miSpacer21: TMenuItem + Caption = '-' + end + object miDeleteUserDatabase: TMenuItem + Action = actDeleteUserDatabase + end end object miCompile: TMenuItem Caption = 'Compile' diff --git a/Src/FmMain.pas b/Src/FmMain.pas index eb1ed4992..16a67871b 100644 --- a/Src/FmMain.pas +++ b/Src/FmMain.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * Application's main form. Handles the program's main window display and user * interaction. @@ -69,6 +69,7 @@ TMainForm = class(THelpAwareForm) actCopySource: TAction; actDeleteCategory: TAction; actDeleteSnippet: TAction; + actDeleteUserDatabase: TAction; actDuplicateSnippet: TAction; actEditSnippet: TAction; actExit: TFileExit; @@ -138,6 +139,7 @@ TMainForm = class(THelpAwareForm) miDatabase: TMenuItem; miDeleteCategory: TMenuItem; miDeleteSnippet: TMenuItem; + miDeleteUserDatabase: TMenuItem; miDuplicateSnippet: TMenuItem; miEdit: TMenuItem; miEditSnippet: TMenuItem; @@ -195,6 +197,7 @@ TMainForm = class(THelpAwareForm) miSpacer17: TMenuItem; miSpacer18: TMenuItem; miSpacer20: TMenuItem; + miSpacer21: TMenuItem; miSWAGImport: TMenuItem; miTestCompile: TMenuItem; miTools: TMenuItem; @@ -294,6 +297,9 @@ TMainForm = class(THelpAwareForm) /// Attempts to delete the current user defined snippet from the /// database. procedure actDeleteSnippetExecute(Sender: TObject); + /// Requests permission then attempts to delete the user defined + /// snippets database. + procedure actDeleteUserDatabaseExecute(Sender: TObject); /// Displays a dialogue box that can be used to duplicate the /// selected snippet. procedure actDuplicateSnippetExecute(Sender: TObject); @@ -713,6 +719,12 @@ procedure TMainForm.actDeleteSnippetExecute(Sender: TObject); // display update is handled by snippets change event handler end; +procedure TMainForm.actDeleteUserDatabaseExecute(Sender: TObject); +begin + if TUserDBMgr.DeleteDatabase then + ReloadDatabase; +end; + procedure TMainForm.actDuplicateSnippetExecute(Sender: TObject); begin TUserDBMgr.DuplicateSnippet(fMainDisplayMgr.CurrentView); diff --git a/Src/HTML.hrc b/Src/HTML.hrc index 8bae1d50b..a731c26f2 100644 --- a/Src/HTML.hrc +++ b/Src/HTML.hrc @@ -2,7 +2,7 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/ # -# Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). +# Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). # # Manifest file used to generate HTML.res resource file. @@ -38,9 +38,10 @@ Res\HTML\dlg-dbupdate-load.html Res\HTML\dlg-dbupdate-finish.html # what's new dialogue -# ------------------- Res\HTML\dlg-whatsnew.html +# delete database dialogue +Res\HTML\dlg-dbdelete.html # Detail pane pages, scripts and CSS diff --git a/Src/Res/HTML/dlg-dbdelete.html b/Src/Res/HTML/dlg-dbdelete.html new file mode 100644 index 000000000..92e7f7c2f --- /dev/null +++ b/Src/Res/HTML/dlg-dbdelete.html @@ -0,0 +1,48 @@ + + + + + + + + + + dlg-dbdelete.html + + + + +

    + ARE YOU SURE? +

    + +

    + Before going any further you are strongly advised to take a backup of your snippets database. Use the Database | Backup User Database menu option to do this. +

    + +

    + This action cannot be undone: you will loose all your user-defined snippets. +

    + +

    + To confirm enter DELETE MY SNIPPETS (in capital letters) in the box below then click OK. +

    + +

    + There will be no further chances to change your mind. +

    + + + + diff --git a/Src/UUserDBMgr.pas b/Src/UUserDBMgr.pas index 84b43f8c3..48ce2ecd8 100644 --- a/Src/UUserDBMgr.pas +++ b/Src/UUserDBMgr.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2008-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2008-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements a static class that manages user's interaction with user database. } @@ -96,6 +96,8 @@ TUserDBMgr = class(TNoConstructObject) /// Moves the user database to a new location specified by the /// user. class procedure MoveDatabase; + /// Deletes the user database, with permission. + class function DeleteDatabase: Boolean; end; @@ -104,7 +106,7 @@ implementation uses // Delphi - SysUtils, Dialogs, Windows {for inlining}, + SysUtils, Dialogs, Windows {for inlining}, IOUtils, // Project DB.UMain, DB.USnippet, FmAddCategoryDlg, FmDeleteCategoryDlg, FmDuplicateSnippetDlg, @@ -112,7 +114,8 @@ implementation {$IFNDEF PORTABLE} FmUserDataPathDlg, {$ENDIF} - FmWaitDlg, + FmDeleteUserDBDlg, FmWaitDlg, + UAppInfo, UConsts, UExceptions, UIStringList, UMessageBox, UOpenDialogEx, UOpenDialogHelper, UReservedCategories, USaveDialogEx, USnippetIDs, UUserDBBackup, UWaitForThreadUI; @@ -377,6 +380,16 @@ class procedure TUserDBMgr.DeleteACategory; end; end; +class function TUserDBMgr.DeleteDatabase: Boolean; +begin + if not TDeleteUserDBDlg.Execute(nil) then + Exit(False); + if not TDirectory.Exists(TAppInfo.UserDataDir) then + Exit(False); + TDirectory.Delete(TAppInfo.UserDataDir, True); + Result := True; +end; + class procedure TUserDBMgr.DeleteSnippet(ViewItem: IView); // Builds a list of snippet names from a given snippet ID list. From 3616165e376523c6186a0d210d1fdff63a7d03b9 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:53:09 +0000 Subject: [PATCH 10/28] Tidy main form published fields --- Src/FmMain.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FmMain.pas b/Src/FmMain.pas index 16a67871b..6e56de410 100644 --- a/Src/FmMain.pas +++ b/Src/FmMain.pas @@ -56,6 +56,7 @@ TMainForm = class(THelpAwareForm) actAddFavourite: TAction; actAddSnippet: TAction; actBackupDatabase: TAction; + actBlog: TBrowseURL; actBugReport: TAction; actCloseAllDetailsTabs: TAction; actCloseDetailsTab: TAction; @@ -126,6 +127,7 @@ TMainForm = class(THelpAwareForm) miAddFavourite: TMenuItem; miAddSnippet: TMenuItem; miBackupDatabase: TMenuItem; + miBlog: TMenuItem; miCategories: TMenuItem; miCloseAllDetailsTabs: TMenuItem; miCloseDetailsTab: TMenuItem; @@ -239,8 +241,6 @@ TMainForm = class(THelpAwareForm) tbSpacer7: TToolButton; tbSpacer8: TToolButton; tbTestCompile: TToolButton; - actBlog: TBrowseURL; - miBlog: TMenuItem; /// Displays About Box. procedure actAboutExecute(Sender: TObject); /// Gets a new category from user and adds to database. From a2a0d2de886afe43b694bc3643a315c9e37ec722 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Thu, 6 Jan 2022 10:07:46 +0000 Subject: [PATCH 11/28] Fix caption of "delete user database" dialogue box --- Src/FmDeleteUserDBDlg.dfm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FmDeleteUserDBDlg.dfm b/Src/FmDeleteUserDBDlg.dfm index 9f30a2285..1bd52b82a 100644 --- a/Src/FmDeleteUserDBDlg.dfm +++ b/Src/FmDeleteUserDBDlg.dfm @@ -1,5 +1,5 @@ inherited DeleteUserDBDlg: TDeleteUserDBDlg - Caption = 'DeleteUserDBDlg' + Caption = 'Delete User Database' ExplicitWidth = 474 ExplicitHeight = 375 PixelsPerInch = 96 From 4040a56aa349f5b692e655ba0db43765b2ba7c82 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:24:44 +0000 Subject: [PATCH 12/28] Add new help topics re user database deletion One new topic for Delete User Database dialogue box. One new topic re related "common" task. Update help index, TOC and project file as required. --- Src/Help/CodeSnip.hhp | 2 + Src/Help/HTML/dlg_deleteuserdb.htm | 82 +++++++++++++++++++++++++++++ Src/Help/HTML/menu_database.htm | 14 ++++- Src/Help/HTML/task_deleteuserdb.htm | 34 ++++++++++++ Src/Help/Index.hhk | 7 +++ Src/Help/TOC.hhc | 4 ++ 6 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 Src/Help/HTML/dlg_deleteuserdb.htm create mode 100644 Src/Help/HTML/task_deleteuserdb.htm diff --git a/Src/Help/CodeSnip.hhp b/Src/Help/CodeSnip.hhp index 272bac8f8..1bde50619 100644 --- a/Src/Help/CodeSnip.hhp +++ b/Src/Help/CodeSnip.hhp @@ -25,6 +25,7 @@ HTML\dlg_addcategory.htm HTML\dlg_backup.htm HTML\dlg_configcompilers.htm HTML\dlg_deletecategory.htm +HTML\dlg_deleteuserdb.htm HTML\dlg_dependencies.htm HTML\dlg_dependencies_edit.htm HTML\dlg_duplicatesnippet.htm @@ -96,6 +97,7 @@ HTML\task_addsnippets.htm HTML\task_backup.htm HTML\task_copysnippet.htm HTML\task_customise.htm +HTML\task_deleteuserdb.htm HTML\task_export.htm HTML\task_generateunit.htm HTML\task_printroutine.htm diff --git a/Src/Help/HTML/dlg_deleteuserdb.htm b/Src/Help/HTML/dlg_deleteuserdb.htm new file mode 100644 index 000000000..86cd27a83 --- /dev/null +++ b/Src/Help/HTML/dlg_deleteuserdb.htm @@ -0,0 +1,82 @@ + + + + + + + Delete User Database Dialogue Box + + + + + + + +

    + Delete User Database Dialogue Box +

    +

    + This dialogue box is displayed when you choose the Database | Delete + User Database menu option. +

    +

    + Proceed with caution. If you give + permission here, all your user-defined snippets will be + deleted without further confirmation. This action + can't be undone. +

    +

    + Click Cancel to back out of this dialogue box. +

    +

    + If you decide you really want to do this you must enter the upper case + text DELETE MY SNIPPETS in the edit + box, then press OK. You will get an error message, and the + snippets won't be deleted, if the text you entered is incorrect. +

    +

    + Once you enter the required text and click OK all user-defined + snippets will be deleted straight away and the main display will be + re-loaded. +

    +

    + You are strongly advised to take a backup of your + snippets before deleting them, in case you change you mind. To do this + first cancel this dialogue box then use the Database | Backup User + Database menu option. +

    +

    + Why would you do this? +

    +

    + It's very unlikely you will need to delete all your snippets, but there + is one use case where this facility is useful. That is when you are moving + snippets from the standard version of CodeSnip to a portable version, or + vice versa. +

    +

    + For further details, see this FAQ. +

    + + \ No newline at end of file diff --git a/Src/Help/HTML/menu_database.htm b/Src/Help/HTML/menu_database.htm index 92f236ee6..303a0d8c4 100644 --- a/Src/Help/HTML/menu_database.htm +++ b/Src/Help/HTML/menu_database.htm @@ -4,7 +4,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2008-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2008-2022, Peter Johnson (gravatar.com/delphidabbler). * * Help topic describing Database menu. --> @@ -96,6 +96,18 @@

    such as a DropBox or Google Drive sub-directory. + + +   + + + Delete User Database + + + Displays the Delete User Database dialogue box that asks for permission to delete ALL the snippets created by the user. If permission is granted then all snippets user defined snippets will be deleted without any further warning. +
    Use with caution – this action can't be undone. + +

    † The Move User Database option is not available in the diff --git a/Src/Help/HTML/task_deleteuserdb.htm b/Src/Help/HTML/task_deleteuserdb.htm new file mode 100644 index 000000000..a6264cef9 --- /dev/null +++ b/Src/Help/HTML/task_deleteuserdb.htm @@ -0,0 +1,34 @@ + + + + + + + Delete User Defined Database + + + + +

    + Delete the User-Defined Snippets Database +

    +

    + In the unlikely event you need to delete all of the user defined snippets from CodeSnip you can use the Database | Delete User Database menu option, which will display the Delete User Database dialogue box. +

    +

    + There are very few use cases where you will want to delete the whole database, but one such case is where you want to move your snippets from a portable version of CodeSnip to a standard version, or vice-versa. For more information about this, see this FAQ. +

    + + diff --git a/Src/Help/Index.hhk b/Src/Help/Index.hhk index 148b650e4..9b3a0f57a 100644 --- a/Src/Help/Index.hhk +++ b/Src/Help/Index.hhk @@ -75,6 +75,10 @@ +
  • + + +
  • @@ -383,6 +387,9 @@
  • +
  • + + diff --git a/Src/Help/TOC.hhc b/Src/Help/TOC.hhc index de429d3fe..f206f44bc 100644 --- a/Src/Help/TOC.hhc +++ b/Src/Help/TOC.hhc @@ -144,6 +144,10 @@
  • +
  • + + +
  • From ed8becf4c39299a992676e110af97c8d6e31890b Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:30:53 +0000 Subject: [PATCH 13/28] Minor changes to Delete User Database dialogue box Punctuation & spacing changes Confirmation text string now cleared when invalid text entered --- Src/FmDeleteUserDBDlg.pas | 3 ++- Src/Res/HTML/dlg-dbdelete.html | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Src/FmDeleteUserDBDlg.pas b/Src/FmDeleteUserDBDlg.pas index 3aee061a4..d6c04b056 100644 --- a/Src/FmDeleteUserDBDlg.pas +++ b/Src/FmDeleteUserDBDlg.pas @@ -64,13 +64,14 @@ procedure TDeleteUserDBDlg.ArrangeForm; procedure TDeleteUserDBDlg.btnOKClick(Sender: TObject); resourcestring - sBadPassword = 'Invalid confirmation text entered: not deleting'; + sBadPassword = 'Invalid confirmation text entered'; begin inherited; fPermissionGranted := IsValidPassword; if not fPermissionGranted then begin TMessageBox.Error(Self, sBadPassword); + edConfirm.Text := ''; ModalResult := mrNone; end; end; diff --git a/Src/Res/HTML/dlg-dbdelete.html b/Src/Res/HTML/dlg-dbdelete.html index 92e7f7c2f..b21cfb4c7 100644 --- a/Src/Res/HTML/dlg-dbdelete.html +++ b/Src/Res/HTML/dlg-dbdelete.html @@ -34,11 +34,11 @@

    This action cannot be undone: you will loose all your user-defined snippets.

    - +

    - To confirm enter DELETE MY SNIPPETS (in capital letters) in the box below then click OK. + To confirm enter DELETE MY SNIPPETS (in capital letters) in the box below, then click OK.

    - +

    There will be no further chances to change your mind.

    From 830a888e44cfb831fe99ab3a0a64bfa1b4bc1157 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:45:52 +0000 Subject: [PATCH 14/28] Add new TSnippetList.IsEmpty(Boolean) method override; The Boolean parameter specifies whether we're checking User defined database (True) or main database (False) for emptiness. --- Src/DB.USnippet.pas | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Src/DB.USnippet.pas b/Src/DB.USnippet.pas index 15b33452c..5af498162 100644 --- a/Src/DB.USnippet.pas +++ b/Src/DB.USnippet.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2011-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2011-2022, Peter Johnson (gravatar.com/delphidabbler). * * Objects, records etc that encapsulate a code snippet, its data and lists of * code snippets. @@ -328,10 +328,17 @@ TSnippetList = class(TObject) {Counts number of snippets in list. @return Number of snippets in list. } - function IsEmpty: Boolean; inline; + function IsEmpty: Boolean; overload; inline; {Checks if list is empty. @return True if list is empty, False otehrwise. } + function IsEmpty(const UserDefined: Boolean): Boolean; overload; inline; + {Checks if sub-set of list from either from or not from use defined + database is empty. + @param UserDefined [in] Flags whether to check for snippets in user + database (True) or in main database (False). + @return True if required subset is empty, False if not empty. + } property Items[Idx: Integer]: TSnippet read GetItem; default; {List of snippets} end; @@ -764,6 +771,11 @@ function TSnippetList.IsEmpty: Boolean; Result := Count = 0; end; +function TSnippetList.IsEmpty(const UserDefined: Boolean): Boolean; +begin + Result := Count(UserDefined) = 0; +end; + function TSnippetList.IsEqual(const AList: TSnippetList): Boolean; {Checks if this list contains same snippets as another list. @param AList [in] List of snippets to compare. From d1593988f0caf02a81b2e0a21003494188e9f8a6 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:50:51 +0000 Subject: [PATCH 15/28] Fix bug in accessing some database operations from main menu. Database menu's Backup User Database, Move User Database & Delete User Database options are now disabled if user database is empty. Additionally, new, un-saved snippets are now saved to user database before the database operations take place. Fixes #45 --- Src/FmMain.dfm | 3 +++ Src/FmMain.pas | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Src/FmMain.dfm b/Src/FmMain.dfm index e2441f840..343bc0d9b 100644 --- a/Src/FmMain.dfm +++ b/Src/FmMain.dfm @@ -619,6 +619,7 @@ inherited MainForm: TMainForm Hint = 'Backup user database|Backup the user-defined snippet database' ImageIndex = 33 OnExecute = actBackupDatabaseExecute + OnUpdate = ActNonEmptyUserDBUpdate end object actRestoreDatabase: TAction Category = 'Database' @@ -849,6 +850,7 @@ inherited MainForm: TMainForm 'Move user database|Move the user-defined snippet database to a n' + 'ew directory' OnExecute = actMoveUserDatabaseExecute + OnUpdate = ActNonEmptyUserDBUpdate end object actSWAGImport: TAction Category = 'Snippets' @@ -873,6 +875,7 @@ inherited MainForm: TMainForm 'Delete User Database|Deletes the user'#39's snippets database - USE ' + 'WITH CAUTION' OnExecute = actDeleteUserDatabaseExecute + OnUpdate = ActNonEmptyUserDBUpdate end end object mnuMain: TMainMenu diff --git a/Src/FmMain.pas b/Src/FmMain.pas index 6e56de410..1342be28c 100644 --- a/Src/FmMain.pas +++ b/Src/FmMain.pas @@ -495,6 +495,7 @@ TMainForm = class(THelpAwareForm) /// position is permitted and blocks the move if not. procedure splitVertCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); + procedure ActNonEmptyUserDBUpdate(Sender: TObject); strict private var /// Object that notifies user-initiated events by triggering @@ -621,7 +622,10 @@ procedure TMainForm.actAddSnippetExecute(Sender: TObject); procedure TMainForm.actBackupDatabaseExecute(Sender: TObject); begin + if (Database as IDatabaseEdit).Updated then + TUserDBMgr.Save(Self); TUserDBMgr.BackupDatabase(Self); + fStatusBarMgr.Update; end; procedure TMainForm.actBugReportExecute(Sender: TObject); @@ -721,8 +725,13 @@ procedure TMainForm.actDeleteSnippetExecute(Sender: TObject); procedure TMainForm.actDeleteUserDatabaseExecute(Sender: TObject); begin + if (Database as IDatabaseEdit).Updated then + TUserDBMgr.Save(Self); if TUserDBMgr.DeleteDatabase then + begin ReloadDatabase; + fStatusBarMgr.Update; + end; end; procedure TMainForm.actDuplicateSnippetExecute(Sender: TObject); @@ -902,6 +911,8 @@ procedure TMainForm.actLoadSelectionExecute(Sender: TObject); procedure TMainForm.actMoveUserDatabaseExecute(Sender: TObject); begin + if (Database as IDatabaseEdit).Updated then + TUserDBMgr.Save(Self); TUserDBMgr.MoveDatabase; end; @@ -920,6 +931,11 @@ procedure TMainForm.ActNonEmptyDBUpdate(Sender: TObject); (Sender as TAction).Enabled := not Database.Snippets.IsEmpty; end; +procedure TMainForm.ActNonEmptyUserDBUpdate(Sender: TObject); +begin + (Sender as TAction).Enabled := not Database.Snippets.IsEmpty(True); +end; + procedure TMainForm.ActOverviewTabExecute(Sender: TObject); begin // Action's Tag property specifies index of tab being selected @@ -979,7 +995,10 @@ procedure TMainForm.actRenameCategoryUpdate(Sender: TObject); procedure TMainForm.actRestoreDatabaseExecute(Sender: TObject); begin if TUserDBMgr.RestoreDatabase(Self) then + begin ReloadDatabase; + fStatusBarMgr.Update; + end; end; procedure TMainForm.actSaveDatabaseExecute(Sender: TObject); From 81e6df5ba32ae7005dd1fdacb3e445d962ed0e43 Mon Sep 17 00:00:00 2001 From: Peter Johnson <5164283+delphidabbler@users.noreply.github.com> Date: Sat, 22 Jan 2022 15:26:50 +0000 Subject: [PATCH 16/28] Update README.md Overhaul and update "Source Code" section --- README.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index be346abbd..d3ec8ce78 100644 --- a/README.md +++ b/README.md @@ -43,14 +43,15 @@ There's also plenty of info available on how to compile CodeSnip from source - s CodeSnip's source code is maintained in the [`delphidabbler/codesnip`](https://github.com/delphidabbler/codesnip) Git repository on GitHub†. -[Git Flow](https://nvie.com/posts/a-successful-git-branching-model/) methodology has been adopted, with the exception of some branches that have been used in various attempts to start work on CodeSnip 5. +The [Git Flow](https://nvie.com/posts/a-successful-git-branching-model/) methodology has been adopted, with the exception of some branches that have been used in various attempts to start work on CodeSnip 5. -The following branches existed at the time when CodeSnip v4.16.0 was released: +The following branches existed as of 2022/01/01: * `master`: Always reflects the state of the source code as of the latest release.‡ -* `develop`: Main development branch. The head of this branch contains the latest development code. +* `develop`: Main development branch. The head of this branch contains the latest v4 development code. +* `belvedere`: The latest attempt to develop CodeSnip 5. See the [Belvedere Readme file](https://github.com/delphidabbler/codesnip/blob/belvedere/README.md) for a full explanation. * `pagoda`: An abortive attempt at developing CodeSnip 5. Work on this branch has halted. It does not follow GitFlow methodology. ***Do not use this branch: it may be pruned.*** -* `pavilion`: Another attempt at working on CodeSnip 5. It branched off `pagoda` and it's future is uncertain. Again it does not follow GitFlow methodology. +* `pavilion`: Another attempt at working on CodeSnip 5. It branched off `pagoda` and work on it has halted. Again it does not follow GitFlow methodology. ***Do not use this branch: it may be pruned.*** New features and most bug fixes are worked on in `feature/xxxx` branches that are branched off `develop` locally. They are merged into `develop` as they are completed and the branches are deleted. @@ -62,7 +63,17 @@ Note that the default branch on GitHub is `master`, which contains the state of ### Contributions -To contribute to the project please fork the repository on GitHub. Create a feature branch off the `develop` branch. Make your changes to the feature branch then submit a pull request via GitHub. +#### CodeSnip 4 + +To contribute to CodeSnip 4 development please fork the repository on GitHub. Create a feature branch off the `develop` branch. Make your changes to your feature branch then submit a pull request via GitHub. + +> **Do not create branches off `master`, always branch from `develop`.** + +#### CodeSnip 5 Belvedere + +Proceed as for CodeSnip 4 except create your feature branch off the `belvedere` branch instead of `develop`. + +> **Do not submit changes to the earlier `pagoda` or `pavilion` branches because they will not be accepted.** ### Compiling From 5aa3d93e90705eb74314530c04882334c30376ad Mon Sep 17 00:00:00 2001 From: Peter Johnson <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 23 Jan 2022 04:01:19 +0000 Subject: [PATCH 17/28] Update README.md Update "Compiling" section. Update "Contributions" section (a) delete mention of belvedere branch (b) add "Licensing of contributions" subsection. --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d3ec8ce78..74fad43e0 100644 --- a/README.md +++ b/README.md @@ -63,24 +63,28 @@ Note that the default branch on GitHub is `master`, which contains the state of ### Contributions -#### CodeSnip 4 - To contribute to CodeSnip 4 development please fork the repository on GitHub. Create a feature branch off the `develop` branch. Make your changes to your feature branch then submit a pull request via GitHub. > **Do not create branches off `master`, always branch from `develop`.** -#### CodeSnip 5 Belvedere +#### Licensing of contributions + +The license that applies to any existing file you edit will continue to apply to the edited file. Any existing license text or copyright statement **must not** be altered or removed. -Proceed as for CodeSnip 4 except create your feature branch off the `belvedere` branch instead of `develop`. +Any new file you contribute **must** either be licensed under the Mozilla Public License v2.0 (MPL2) or have a license compatible with the MPL2. If a license is not specified then the MPL2 will be applied to the file. You should insert a suitable copyright statement in the file. -> **Do not submit changes to the earlier `pagoda` or `pavilion` branches because they will not be accepted.** +Any third party code used by your contributed code **must** also have a license compatible with the MPL2. + +> MPL2 boilerplate text, in several programming language's comment formats, can be found in the file `Docs/MPL-2.0-Boilerplate.txt`. You will need to change the name of the copyright holder. ### Compiling -`master` has a file in the root directory named [`Build.html`](https://htmlpreview.github.io/?https://github.com/delphidabbler/codesnip/blob/master/Build.html) that gives detailed information about how to compile the current release of CodeSnip. +`master` has a file in the root directory named [`Build.html`](https://htmlpreview.github.io/?https://github.com/delphidabbler/codesnip/blob/master/Build.html) that gives detailed information about how to compile the current release of CodeSnip 4. There is also a [Compiling & Source Code FAQ](https://github.com/delphidabbler/codesnip-faq/blob/master/SourceCode.md). +CodeSnip 4 **must** be compiled with Delphi XE. See [Compiling & Source Code FAQ 11](https://github.com/delphidabbler/codesnip-faq/blob/master/SourceCode.md#faq-11) for the reason why. + ## Change Log The program's current change log can be found in the file `CHANGELOG.md` in the root of the `master` branch. From 4f1d56f98bfad25e0a0e752146459b9babb2cc4a Mon Sep 17 00:00:00 2001 From: Peter Johnson <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 23 Jan 2022 04:17:32 +0000 Subject: [PATCH 18/28] Update Build.html Add link to explanation of why CodeSnip uses Delphi XE. --- Build.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Build.html b/Build.html index f30a3d15b..a6a432a39 100644 --- a/Build.html +++ b/Build.html @@ -80,6 +80,13 @@

    XE. Compilation with other compilers is not guaranteed.

    +

    + For an explanation of why CodeSnip still uses Delphi XE see + FAQ 11 of the CodeSnip Compiling & Source Code FAQs. +

    +

    The are currently two editions of CodeSnip: the standard edition and the portable edition. They both share the same code base: the different From 9ba823e1768b7cff6d7b47df1dca211ef461f0a1 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 09:02:29 +0100 Subject: [PATCH 19/28] Bump config file version number to 18 This because of addition of DetailFontSize property to Prefs:Display section of per-user config file. --- Src/FirstRun.UConfigFile.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FirstRun.UConfigFile.pas b/Src/FirstRun.UConfigFile.pas index 30bca5999..2645b6acc 100644 --- a/Src/FirstRun.UConfigFile.pas +++ b/Src/FirstRun.UConfigFile.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2007-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2007-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements class that manages the updating of older config files to the * current format. @@ -82,7 +82,7 @@ TUserConfigFileUpdater = class(TConfigFileUpdater) strict private const ///

    Current user config file version. - FileVersion = 17; + FileVersion = 18; strict protected /// Returns current user config file version. class function GetFileVersion: Integer; override; From 39af1835851b4dab6a243ca3a9e9ce9816c2761b Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 09:03:44 +0100 Subject: [PATCH 20/28] Update config file docs Note addition of DetailFontSize property to Prefs:Display section of per-user config file and resulting bumping of file's version number. --- Docs/Design/FileFormats/config.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Docs/Design/FileFormats/config.html b/Docs/Design/FileFormats/config.html index ed05ef9b2..cf2ce3f32 100644 --- a/Docs/Design/FileFormats/config.html +++ b/Docs/Design/FileFormats/config.html @@ -5,7 +5,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler). * * CodeSnip File Format Documentation: Configuration Files --> @@ -167,7 +167,7 @@

    - There have been several versions of this file. The current one is version 17. The change to version 17 came with CodeSnip v4.19.0 and the addition of the [Prefs] section. + There have been several versions of this file. The current one is version 18. The change to version 18 came with CodeSnip v4.20.0 and the addition of the [Prefs] section.

    @@ -919,6 +919,12 @@

    Size of font to be used in overview pane tree view. If missing or empty the default value is 9.
    +
    + DetailFontSize (Integer) +
    +
    + Size of font to be used in detail pane for all text except for source code. If missing or empty the default value is the default content font size of the operating system. +

    From eff0390cbb44cec6705cb5ed332d681bfa80ff1b Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 09:07:25 +0100 Subject: [PATCH 21/28] Fix description of Prefs:Display OverviewFontSize option --- Docs/Design/FileFormats/config.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Design/FileFormats/config.html b/Docs/Design/FileFormats/config.html index cf2ce3f32..b84ff246d 100644 --- a/Docs/Design/FileFormats/config.html +++ b/Docs/Design/FileFormats/config.html @@ -917,7 +917,7 @@

    OverviewFontSize (Integer)
    - Size of font to be used in overview pane tree view. If missing or empty the default value is 9. + Size of font to be used in overview pane tree view. If missing or empty the default value is the default font size of the operationg system.
    DetailFontSize (Integer) From 3aa37bc8e5f25fd326fc7c9fa9fcbb98f588fa52 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 09:23:30 +0100 Subject: [PATCH 22/28] Update 3rd party PJSysInfo unit to v5.11.0 Fixes #49 --- Src/3rdParty/PJSysInfo.pas | 189 ++++++++++++++++++++++++------------- 1 file changed, 123 insertions(+), 66 deletions(-) diff --git a/Src/3rdParty/PJSysInfo.pas b/Src/3rdParty/PJSysInfo.pas index fa4cd593b..b1040bb83 100644 --- a/Src/3rdParty/PJSysInfo.pas +++ b/Src/3rdParty/PJSysInfo.pas @@ -3,10 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at http://mozilla.org/MPL/2.0/ * - * Copyright (C) 2001-2021, Peter Johnson (@delphidabbler). - * - * $Rev: 2082 $ - * $Date: 2022-01-01 10:12:03 +0000 (Sat, 01 Jan 2022) $ + * Copyright (C) 2001-2022, Peter Johnson (@delphidabbler). * * This unit contains various static classes, constants, type definitions and * global variables for use in providing information about the host computer and @@ -419,7 +416,8 @@ interface osWin10Svr, // Windows 2016 Server osWinSvr2019, // Windows 2019 Server osWin11, // Windows 11 - osWinSvr2022 // Windows 2022 Server + osWinSvr2022, // Windows 2022 Server + osWinServer // Windows Server (between Server 2019 & 2022) ); type @@ -1209,6 +1207,7 @@ implementation Win8Point1Build = 9600; // Build number used for all Win 8.1/Svr 2012 R2 // Windows 10 ---------------------------------------------------------------- + Win10TH1Build = 10240; // Windows 10 TH1 - version 1507 (1st release) Win10TH2Build = 10586; // Windows 10 TH2 - version 1511 Win10RS1Build = 14393; // Windows 10 RS1 - version 1607 @@ -1221,9 +1220,28 @@ implementation Win1020H1Build = 19041; // Windows 10 20H1 - version 2004 Win1020H2Build = 19042; // Windows 10 20H2 - version 20H2 Win1021H1Build = 19043; // Windows 10 21H1 - version 21H1 + // revisions 844..964 were beta Win1021H2Build = 19044; // Windows 10 21H2 - version 21H2 + // revisions 1147..1266 were previews + + // Fast ring + Win10FastRing: array[0..21] of Integer = ( + 19536, 19541, 19546, 19551, 19555, 19559, 19564, 19569, 19577, 19582, 19587, + 19592, 19603, 19608, 19613, 19619, 19624, 19628, 19631, 19635, 19640, 19645 + ); + + // Dev channel + // Assuming all Dev channel releases had version string "Dev" + Win10DevChannel: array[0..44] of Integer = ( + 20150, 20152, 20161, 20170, 20175, 20180, 20185, 20190, 20197, 20201, 20206, + 20211, 20215, 20221, 20226, 20231, 20236, 20241, 20246, 20251, 20257, 20262, + 20270, 20277, 21277, 20279, 21286, 21292, 21296, 21301, 21313, 21318, 21322, + 21327, 21332, 21337, 21343, 21354, 21359, 21364, 21370, 21376, 21382, 21387, + 21390 // transitioned to Windows 11 after here + ); // Windows 11 ---------------------------------------------------------------- + // NOTE: Preview and beta & release versions of Windows 11 report version 10.0 Win11DevBuild = 21996; // Windows 11 version Dev // - 10.0.21996.1 (Insider version) @@ -1237,28 +1255,28 @@ implementation // Revision # 194 // Windows 11 version 21H2 // - ** 1st Public Release ** - Win11v21H2PreRel1Build = 22449; // Windows 11 version 21H2 - // - 10.0.22449.000 (RSPRERELEASE) - Win11v21H2PreRel2Build = 22454; // Windows 11 version 21H2 - // - 10.0.22454.1000 (RSPRERELEASE) - Win11v21H2PreRel3Build = 22458; // Windows 11 version 21H2 - // - 10.0.22458.1000 (RSPRERELEASE) - Win11v21H2PreRel4Build = 22463; // Windows 11 version 21H2 - // - 10.0.22463.1000 (RSPRERELEASE) - Win11v21H2PreRel5Build = 22468; // Windows 11 version 21H2 - // - 10.0.22468.1000 (RSPRERELEASE) - Win11v21H2PreRel6Build = 22471; // Windows 11 version 21H2 - // - 10.0.22471.1000 (RSPRERELEASE) - Win11v21H2PreRel7Build = 22478; // Windows 11 version 21H2 - // - 10.0.22478.1000 (RSPRERELEASE) - Win11v21H2PreRel8Build = 22483; // Windows 11 version 21H2 - // - 10.0.22483.1000 (RSPRERELEASE) - Win11v21H2PreRel9Build = 22489; // Windows 11 version 21H2 - // - 10.0.22489.1000 (RSPRERELEASE) - Win11v21H2PreRel10Build = 22494;// Windows 11 version 21H2 - // - 10.0.22494.1000 (RSPRERELEASE) - Win11v21H2PreRel11Build = 22509;// Windows 11 version 21H2 - // - 10.0.22509.1000 (RSPRERELEASE) + + // Dev channel release - different sources give different names. + // From what I can gather (and take this with a pinch of salt!): + // * Insider Dev channel releases from the RS_PRERELEASE branch weren't + // matched to a Windows 11 release and had version string "Dev"). + // * The NI_RELEASE channel was used from 2022/02/16 (build 2257). + // * From build 22567 the release string changed from "Dev" to "22H" + + // Builds with version string "Dev" + Win11DevChannelDevBuilds: array[0..20] of Integer = ( + 22449, 22454, 22458, 22463, 22468, // pre Win 11 release + 22471, 22478, 22483, 22489, 22494, 22499, 22504, 22509, 22518, 22523, 22526, + 22533, 22538, 22543, 22557, 22563 + ); + // Builds with version string "22H2" in Dev channel + Win11DevChannel22H2Builds: array[0..2] of Integer = ( + 22567, 22572, 22579 + ); + // Builds with version string "22H2" in Dev & Beta channels + Win11DevBetaChannels22H2Builds: array[0..3] of Integer = ( + 22581, 22593, 22598, 22610 + ); Win11FirstBuild = Win11DevBuild; // First build number of Windows 11 @@ -1275,23 +1293,23 @@ implementation // After this it's Win 2019 Server // Windows 2019 Server ------------------------------------------------------- - Win2019IP180320Build = 17623; // Win Server 2019 Insider Preview Build 17623 - Win2019IP180324Build = 17627; // Win Server 2019 Insider Preview Build 17627 - Win2019IP180515Build = 17666; // Win Server 2019 Insider Preview Build 17666 - Win2019IP180619Build = 17692; // Win Server 2019 Insider Preview Build 17692 - Win2019IP180710Build = 17709; // Win Server 2019 Insider Preview Build 17709 - Win2019IP180716Build = 17713; // Win Server 2019 Insider Preview Build 17713 - Win2019IP180731Build = 17723; // Win Server 2019 Insider Preview Build 17723 - Win2019IP180814Build = 17733; // Win Server 2019 Insider Preview Build 17733 - Win2019IP180821Build = 17738; // Win Server 2019 Insider Preview Build 17738 - Win2019IP180828Build = 17744; // Win Server 2019 Insider Preview Build 17744 + // Insider Preview builds + Win2019IPBuilds: array[0..9] of Integer = ( + 17623, 17627, 17666, 17692, 17709, 17713, 17723, 17733, 17738, 17744 + ); + // Release builds Win2019v1809Build = 17763; // Win Server 2019 version 1809 Win2019v1903Build = 18362; // Win Server 2019 version 1903 Win2019v1909Build = 18363; // Win Server 2019 version 1909 - Win2019v2004Build = 19041; // Win Server 2019 version 2004 - Win2019v20H2Build = 19042; // Win Server 2019 version 20H2 - Win2019LastBuild = Win2019v20H2Build; // Last build number of Win 2019 Server - // After this it's Win 2022 Server + Win2019LastBuild = Win2019v1909Build; // Last build number of Win 2019 Server + // After this it's Windows Server + + // Windows Server ------------------------------------------------------------ + WinServerv2004Build = 19041; // Win Server version 2004 + WinServerv20H2Build = 19042; // Win Server version 20H2 + WinServerLastBuild = WinServerv20H2Build; // Last build number of Windows + // Server. After this it's Window + // 2022 Sever // Windows 2022 Server ------------------------------------------------------- Win2022v21H2Build = 20348; // Win Server 2022 version 21H2 @@ -1510,6 +1528,14 @@ function ExcludeTrailingPathDelimiter(const DirOrPath: string) : string; end; {$ENDIF} +// Checks if integer V is in the range of values defined by VLo and VHi, +// inclusive. +function IsInRange(const V, VLo, VHi: Integer): Boolean; +begin + Assert(VLo <= VHi); + Result := (V >= VLo) and (V <= VHi); +end; + // Returns the value of the given environment variable. function GetEnvVar(const VarName: string): string; var @@ -1823,6 +1849,8 @@ procedure InitPlatformIdEx; begin InternalBuildNumber := Win1021H1Build; InternalExtraUpdateInfo := 'Version 21H1'; + if IsInRange(InternalRevisionNumber, 844, 964) then + InternalExtraUpdateInfo := InternalExtraUpdateInfo + ' (beta)'; end else if IsBuildNumber(Win1021H2Build) then begin @@ -1830,8 +1858,29 @@ procedure InitPlatformIdEx; // yearly cycle InternalBuildNumber := Win1021H2Build; InternalExtraUpdateInfo := 'Version 21H2'; + if IsInRange(InternalRevisionNumber, 1147, 1266) then + InternalExtraUpdateInfo := InternalExtraUpdateInfo + + ' (preview)'; + end + else if FindBuildNumberFrom( + Win10DevChannel, InternalBuildNumber + ) then + begin + // Windows 10 Dev Channel releases + InternalExtraUpdateInfo := Format( + 'Dev Channel v10.0.%d.%d (Dev)', + [InternalBuildNumber, InternalRevisionNumber] + ); end - // As of 2021-09-11, Win 11 pre-releases are reporting v10.0 + else if FindBuildNumberFrom(Win10FastRing, InternalBuildNumber) then + begin + // Windows 10 Fast Ring releases + InternalExtraUpdateInfo := Format( + 'Fast ring v10.0.%d.%d', + [InternalBuildNumber, InternalRevisionNumber] + ); + end + // Win 11 releases are reporting v10.0 // Details taken from: https://tinyurl.com/usupsz4a // Correct according to above web page as of 2021-09-11 else if IsBuildNumber(Win11DevBuild) then @@ -1872,19 +1921,32 @@ procedure InitPlatformIdEx; end; end else if FindBuildNumberFrom( - [ - Win11v21H2PreRel1Build, Win11v21H2PreRel2Build, - Win11v21H2PreRel3Build, Win11v21H2PreRel4Build, - Win11v21H2PreRel5Build, Win11v21H2PreRel6Build, - Win11v21H2PreRel7Build, Win11v21H2PreRel8Build, - Win11v21H2PreRel9Build, Win11v21H2PreRel10Build, - Win11v21H2PreRel11Build - ], - InternalBuildNumber + Win11DevChannelDevBuilds, InternalBuildNumber + ) then + begin + // Win11 Dev Channel builds with version string "Dev" + InternalExtraUpdateInfo := Format( + 'Dev Channel v10.0.%d.%d (Dev)', + [InternalBuildNumber, InternalRevisionNumber] + ); + end + else if FindBuildNumberFrom( + Win11DevChannel22H2Builds, InternalBuildNumber + ) then + begin + // Win11 Dev channel builds with version string "22H2" + InternalExtraUpdateInfo := Format( + 'Dev Channel v10.0.%d.%d (22H2)', + [InternalBuildNumber, InternalRevisionNumber] + ); + end + else if FindBuildNumberFrom( + Win11DevBetaChannels22H2Builds, InternalBuildNumber ) then begin + // Win 11 Dev & Beta channel builds with verison string "22H2" InternalExtraUpdateInfo := Format( - 'Version 21H2 [RSPRERELEASE v10.0.%d.%d]', + 'Dev & Beta Channels v10.0.%d.%d (22H2)', [InternalBuildNumber, InternalRevisionNumber] ); end @@ -1930,14 +1992,7 @@ procedure InitPlatformIdEx; InternalExtraUpdateInfo := 'Version 1803'; end else if FindBuildNumberFrom( - [ - Win2019IP180320Build, Win2019IP180324Build, - Win2019IP180515Build, Win2019IP180619Build, - Win2019IP180710Build, Win2019IP180716Build, - Win2019IP180731Build, Win2019IP180814Build, - Win2019IP180821Build, Win2019IP180828Build - ], - InternalBuildNumber + Win2019IPBuilds, InternalBuildNumber ) then begin InternalExtraUpdateInfo := Format( @@ -1959,14 +2014,14 @@ procedure InitPlatformIdEx; InternalBuildNumber := Win2019v1909Build; InternalExtraUpdateInfo := 'Version 1909'; end - else if IsBuildNumber(Win2019v2004Build) then + else if IsBuildNumber(WinServerv2004Build) then begin - InternalBuildNumber := Win2019v2004Build; + InternalBuildNumber := WinServerv2004Build; InternalExtraUpdateInfo := 'Version 2004'; end - else if IsBuildNumber(Win2019v20H2Build) then + else if IsBuildNumber(WinServerv20H2Build) then begin - InternalBuildNumber := Win2019v20H2Build; + InternalBuildNumber := WinServerv20H2Build; InternalExtraUpdateInfo := 'Version 20H2'; end else if IsBuildNumber(Win2022v21H2Build) then @@ -2132,7 +2187,7 @@ class function TPJOSInfo.Edition: string; osWin7, osWinSvr2008R2, osWin8, osWinSvr2012, osWin8Point1, osWinSvr2012R2, - osWin10, osWin11, osWin10Svr, osWinSvr2019, osWinSvr2022: + osWin10, osWin11, osWin10Svr, osWinSvr2019, osWinSvr2022, osWinServer: begin // For v6.0 and later we ignore the suite mask and use the new // PRODUCT_ flags from the GetProductInfo() function to determine the @@ -2682,8 +2737,9 @@ class function TPJOSInfo.Product: TPJOSProduct; Result := osWin10Svr else if InternalBuildNumber <= Win2019LastBuild then Result := osWinSvr2019 + else if InternalBuildNumber <= WinServerLastBuild then + Result := osWinServer else - // Result := osWinSvr2022; end; end; @@ -2734,6 +2790,7 @@ class function TPJOSInfo.ProductName: string; osWinSvr2019: Result := 'Windows Server 2019'; osWin11: Result := 'Windows 11'; osWinSvr2022: Result := 'Windows Server 2022'; + osWinServer: Result := 'Windows Server'; else raise EPJSysInfo.Create(sUnknownProduct); end; From fae18d192b8704941fbc8aae785b00100bd4e5d5 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 09:34:49 +0100 Subject: [PATCH 23/28] Update version displayed for Delphi Alexandria Change version number from 11 to 11.x to reflect fact that there is more than one version number applied to Delphi Alexandria. --- Src/Compilers.UBDS.pas | 4 ++-- Src/FrCodeGenPrefs.pas | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Src/Compilers.UBDS.pas b/Src/Compilers.UBDS.pas index 6d5cd7b3e..668916c19 100644 --- a/Src/Compilers.UBDS.pas +++ b/Src/Compilers.UBDS.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2006-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler). * * Class that controls and provides information about Borland CodeGear and * Embarcadero "BDS" Win32 compilers. @@ -175,7 +175,7 @@ function TBDSCompiler.GetName: string; sDelphi102T = 'Delphi 10.2 Tokyo'; sDelphi103R = 'Delphi 10.3 Rio'; sDelphi104S = 'Delphi 10.4 Sydney'; - sDelphi11A = 'Delphi 11 Alexandria'; + sDelphi11A = 'Delphi 11.x Alexandria'; begin case GetID of ciDXE: diff --git a/Src/FrCodeGenPrefs.pas b/Src/FrCodeGenPrefs.pas index 7e572fb9a..7814ad14b 100644 --- a/Src/FrCodeGenPrefs.pas +++ b/Src/FrCodeGenPrefs.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2010-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2010-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements a frame that allows user to set source code generation * preferences. @@ -685,7 +685,7 @@ procedure TCodeGenPrefsFrame.PopulatePreDefCompilerMenu; AddMenuItem('Delphi 10.2 Tokyo', 32.0); AddMenuItem('Delphi 10.3 Rio', 33.0); AddMenuItem('Delphi 10.4 Sydney', 34.0); - AddMenuItem('Delphi 11 Alexandria', 35.0); + AddMenuItem('Delphi 11.x Alexandria', 35.0); end; procedure TCodeGenPrefsFrame.PreDefCompilerMenuClick(Sender: TObject); From 4c34f8bd406a2e7beaa4a74d38a464f4c442e8cd Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 09:35:09 +0100 Subject: [PATCH 24/28] Update version number for Delphi Alexandria in docs Change version number from 11 to 11.x to reflect fact that there is more than one version number applied to Delphi Alexandria. --- Docs/Design/FileFormats/config.html | 4 ++-- Docs/Design/FileFormats/export.html | 6 +++--- Docs/Design/FileFormats/main-db.html | 4 ++-- Docs/Design/FileFormats/user-db.html | 6 +++--- Docs/ReadMe.txt | 4 ++-- Src/Compilers.UGlobals.pas | 4 ++-- Src/Help/HTML/about_compiler_checks.htm | 4 ++-- Src/Help/HTML/dlg_configcompilers.htm | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Docs/Design/FileFormats/config.html b/Docs/Design/FileFormats/config.html index b84ff246d..c81851d94 100644 --- a/Docs/Design/FileFormats/config.html +++ b/Docs/Design/FileFormats/config.html @@ -257,7 +257,7 @@

    D104S – Delphi 10.4 Sydney
  • - D11A – Delphi 11 Alexandria + D11A – Delphi 11.x Alexandria
  • FPC – Free Pascal @@ -570,7 +570,7 @@

    D11A (Boolean)

  • - Indicates whether Delphi 11 Alexandria was included in the search. + Indicates whether Delphi 11.x Alexandria was included in the search.
    FPC (Boolean) diff --git a/Docs/Design/FileFormats/export.html b/Docs/Design/FileFormats/export.html index 58e394aa6..91e1a1059 100644 --- a/Docs/Design/FileFormats/export.html +++ b/Docs/Design/FileFormats/export.html @@ -5,7 +5,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler). * * CodeSnip File Format Documentation: Export --> @@ -597,7 +597,7 @@

    d104s – Delphi 10.4 Sydney compiler (v7.1 & later)
  • - d11a – Delphi 11 Alexandria compiler (v7.2 & later) + d11a – Delphi 11.x Alexandria compiler (v7.2 & later)
  • fpc – Free Pascal compiler (all versions) @@ -969,7 +969,7 @@

    Version 7.2 - 13 September 2021

  • - Updated with CodeSnip v4.18.0 to add support for Delphi 11 Alexandria. + Updated with CodeSnip v4.18.0 to add support for Delphi 11.x Alexandria.
    diff --git a/Docs/Design/FileFormats/main-db.html b/Docs/Design/FileFormats/main-db.html index 6183e4682..031fac904 100644 --- a/Docs/Design/FileFormats/main-db.html +++ b/Docs/Design/FileFormats/main-db.html @@ -5,7 +5,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler). * * CodeSnip File Format Documentation: Main Database --> @@ -417,7 +417,7 @@

    Delphi104S – Delphi 10.4 Sydney compiler *
  • - Delphi11A – Delphi 11 Alexandria compiler * + Delphi11A – Delphi 11.x Alexandria compiler *
  • FPC – Free Pascal compiler diff --git a/Docs/Design/FileFormats/user-db.html b/Docs/Design/FileFormats/user-db.html index 6c0fe0a88..baeb84715 100644 --- a/Docs/Design/FileFormats/user-db.html +++ b/Docs/Design/FileFormats/user-db.html @@ -5,7 +5,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler). * * CodeSnip File Format Documentation: User Database --> @@ -622,7 +622,7 @@

    d104s – Delphi 10.4 Sydney compiler (v6.9 & later)

  • - d11a – Delphi 11 Alexandria compiler (v6.10 & later) + d11a – Delphi 11.x Alexandria compiler (v6.10 & later)
  • fpc – Free Pascal compiler (all versions) @@ -1005,7 +1005,7 @@

    Version 6.10 - 13 September 2021
    - Updated with CodeSnip v4.18.0 to add support for Delphi 11 Alexandria. + Updated with CodeSnip v4.18.0 to add support for Delphi 11.x Alexandria.
    diff --git a/Docs/ReadMe.txt b/Docs/ReadMe.txt index c7c2339a8..3346f91af 100644 --- a/Docs/ReadMe.txt +++ b/Docs/ReadMe.txt @@ -14,7 +14,7 @@ online DelphiDabbler Code Snippets database as well as maintain a database of user-defined snippets. It displays details of each snippet in the database and can test-compile them -with each installed Win32 version of Delphi from Delphi 2 to Delphi 11 +with each installed Win32 version of Delphi from Delphi 2 to Delphi 11.x Alexandria and Free Pascal. Compilable Pascal units can be created that contain selected snippets. @@ -201,7 +201,7 @@ Configuring CodeSnip to Work With Your Compilers ================================================================================ A feature of CodeSnip is its ability to test compile snippets with any installed -Windows 32 version of Delphi (from Delphi 2 to Delphi 11 Alexandria) and +Windows 32 version of Delphi (from Delphi 2 to Delphi 11.x Alexandria) and FreePascal, providing some simple rules are followed. When CodeSnip is first installed it knows nothing about the available compilers diff --git a/Src/Compilers.UGlobals.pas b/Src/Compilers.UGlobals.pas index 83e287164..5653202f9 100644 --- a/Src/Compilers.UGlobals.pas +++ b/Src/Compilers.UGlobals.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * Declares various types that describe the compiler and compilation results and * defines interfaces to compiler objects. @@ -43,7 +43,7 @@ interface ciD102T, // Delphi 10.2 Tokyo ciD103R, // Delphi 10.3 Rio ciD104S, // Delphi 10.4 Sydney, - ciD11A, // Delphi 11 Alexandria + ciD11A, // Delphi 11.x Alexandria ciFPC // Free Pascal ); diff --git a/Src/Help/HTML/about_compiler_checks.htm b/Src/Help/HTML/about_compiler_checks.htm index 5d9469874..0aa09cb0e 100644 --- a/Src/Help/HTML/about_compiler_checks.htm +++ b/Src/Help/HTML/about_compiler_checks.htm @@ -4,7 +4,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * Help topic explaining compiler checks. --> @@ -34,7 +34,7 @@

    The supported compilers are the Win32 Delphi compilers from Delphi 2 to - Delphi 11 Alexandria and Free Pascal. + Delphi 11.x Alexandria and Free Pascal.

    Configuring CodeSnip diff --git a/Src/Help/HTML/dlg_configcompilers.htm b/Src/Help/HTML/dlg_configcompilers.htm index 4f82b47e8..9055f3c9f 100644 --- a/Src/Help/HTML/dlg_configcompilers.htm +++ b/Src/Help/HTML/dlg_configcompilers.htm @@ -4,7 +4,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * Help topic for Configure Compilers dialogue box. --> @@ -281,7 +281,7 @@

    CodeSnip can automatically detect the presence of Win 32 Delphi - compilers from Delphi 2 to Delphi 11 Alexandria. Click the Detect + compilers from Delphi 2 to Delphi 11.x Alexandria. Click the Detect Delphi Compilers button to do this. Any supported installed version of Delphi will be recorded. This can save considerable time and avoid errors. From 5b9325024f48ead0482e8f04f6a6314cd1502063 Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 09:43:19 +0100 Subject: [PATCH 25/28] Widen Compilers list in Configure Compilers dlg Widened the compilers list box by 8px to display the longer name "Delphi 11.x Alexandria". Widened dlg and rearranged controls to suit. --- Src/FmCompilersDlg.dfm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Src/FmCompilersDlg.dfm b/Src/FmCompilersDlg.dfm index f3bf3134f..12ae8c2a1 100644 --- a/Src/FmCompilersDlg.dfm +++ b/Src/FmCompilersDlg.dfm @@ -1,16 +1,16 @@ inherited CompilersDlg: TCompilersDlg Caption = 'Configure Compilers' ClientHeight = 381 - ClientWidth = 547 - ExplicitWidth = 553 + ClientWidth = 588 + ExplicitWidth = 594 ExplicitHeight = 410 PixelsPerInch = 96 TextHeight = 13 inherited pnlBody: TPanel - Width = 531 - ExplicitWidth = 531 + Width = 539 + ExplicitWidth = 539 object pbBanner: TPaintBox - Left = 161 + Left = 169 Top = 0 Width = 370 Height = 23 @@ -26,7 +26,7 @@ inherited CompilersDlg: TCompilersDlg object lbCompilers: TListBox Left = 0 Top = 0 - Width = 155 + Width = 163 Height = 292 Style = lbOwnerDrawFixed Ctl3D = True @@ -36,7 +36,7 @@ inherited CompilersDlg: TCompilersDlg TabOrder = 0 end object pcCompiler: TPageControl - Left = 161 + Left = 169 Top = 29 Width = 370 Height = 263 @@ -52,8 +52,6 @@ inherited CompilersDlg: TCompilersDlg Height = 235 Align = alClient TabOrder = 0 - ExplicitLeft = -4 - ExplicitTop = 2 end end object tsSwitches: TTabSheet From e873b90834aa71899615c888ed1ef3818035c9ab Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 10:24:00 +0100 Subject: [PATCH 26/28] Bump version information to v2.20.0 build 264 --- Src/VCodeSnip.vi | 6 +++--- Src/VCodeSnipPortable.vi | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Src/VCodeSnip.vi b/Src/VCodeSnip.vi index b9320937b..336a57137 100644 --- a/Src/VCodeSnip.vi +++ b/Src/VCodeSnip.vi @@ -2,14 +2,14 @@ ; v. 2.0. If a copy of the MPL was not distributed with this file, You can ; obtain one at https://mozilla.org/MPL/2.0/ ; -; Copyright (C) 2008-2021, Peter Johnson (gravatar.com/delphidabbler). +; Copyright (C) 2008-2022, Peter Johnson (gravatar.com/delphidabbler). ; ; Version information description file for CodeSnip. [Fixed File Info] -File Version #=4, 19, 0, 263 -Product Version #=4, 19, 0, 0 +File Version #=4, 20, 0, 264 +Product Version #=4, 20, 0, 0 File OS=4 File Type=1 File Sub-Type=0 diff --git a/Src/VCodeSnipPortable.vi b/Src/VCodeSnipPortable.vi index 6b8647290..6f78cbaff 100644 --- a/Src/VCodeSnipPortable.vi +++ b/Src/VCodeSnipPortable.vi @@ -2,14 +2,14 @@ ; v. 2.0. If a copy of the MPL was not distributed with this file, You can ; obtain one at https://mozilla.org/MPL/2.0/ ; -; Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler). +; Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler). ; ; Version information description file for the portable edition of CodeSnip [Fixed File Info] -File Version #=4, 19, 0, 263 -Product Version #=4, 19, 0, 0 +File Version #=4, 20, 0, 264 +Product Version #=4, 20, 0, 0 File OS=4 File Type=1 File Sub-Type=0 From 7dcbab3916532174dd8aaadf0433a5c3c25e356c Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 10:24:23 +0100 Subject: [PATCH 27/28] Update change log re v4.20.0 changes --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb395c211..251825295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,22 @@ This change log begins with the first ever pre-release version of _CodeSnip_. Re From v4.1.0 the version numbering has attempted to adhere to the principles of [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Release v4.20.0 of 15 May 2022 + +* Added an option to delete the user defined database. +* Fixed bug that enabled the user to attempt to move, or back up, the user database when it doesn't exist. These options are now disabled when there is no user database. +* Added facility to customise the size of font used in the details pane for all items except the source code font (which could already be modified separately). A new preference was added to the Display pane of the Preferences dialogue box to be used to set the font size. +* Rearranged the controls on the Preferences dialogue box's Display pane. +* Changed the default font used for the overview pane from a fixed value to the default size for the underlying operating system. +* Changed the description of "Delphi 11 Alexandria" to "Delphi 11.x Alexandria" to reflect the fact the Delphi 11 updates have different minor version numbers, but can't be installed alongside each other. +* Widened the compiler list box in the Configure Compilers dialogue box to accommodate the longer name used for Delphi 11.x compilers. +* Refactored some font handling code. +* Operating system detection code was updated to (a) fix some bugs and (b) detect some Dev channel builds of Windows 11. +* Bumped the version of the per-user config file to 18 following the addition of a new preference. +* Help file updated re the changes in this release. +* Documentation updated to reflect changes in this release. +* Updated `README.md` and `Build.html` + ## Release v4.19.0 of 31 December 2021 * Improved user-friendliness of Preferences dialogue box: From 5ee57b09466425da3ef2cef2e301d7f39e07a1db Mon Sep 17 00:00:00 2001 From: delphidabbler <5164283+delphidabbler@users.noreply.github.com> Date: Sun, 15 May 2022 10:25:32 +0100 Subject: [PATCH 28/28] Bump copyright date in header comments Change copyright date range to include 2022 for files modified for this release. --- Src/FrDetailView.pas | 2 +- Src/FrDisplayPrefs.pas | 2 +- Src/Help/CodeSnip.hhp | 2 +- Src/Help/HTML/dlg_prefs_display.htm | 2 +- Src/Help/Index.hhk | 2 +- Src/Help/TOC.hhc | 2 +- Src/Hiliter.UAttrs.pas | 2 +- Src/UFontHelper.pas | 2 +- Src/UPreferences.pas | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Src/FrDetailView.pas b/Src/FrDetailView.pas index 78d56a712..b6feecc76 100644 --- a/Src/FrDetailView.pas +++ b/Src/FrDetailView.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements a frame that can display detailed views. } diff --git a/Src/FrDisplayPrefs.pas b/Src/FrDisplayPrefs.pas index 83ed29e2c..015d1ea02 100644 --- a/Src/FrDisplayPrefs.pas +++ b/Src/FrDisplayPrefs.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements a frame that allows user to set application display preferences. diff --git a/Src/Help/CodeSnip.hhp b/Src/Help/CodeSnip.hhp index 1bde50619..271557747 100644 --- a/Src/Help/CodeSnip.hhp +++ b/Src/Help/CodeSnip.hhp @@ -2,7 +2,7 @@ ; v. 2.0. If a copy of the MPL was not distributed with this file, You can ; obtain one at https://mozilla.org/MPL/2.0/ ; -; Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). +; Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). ; ; CodeSnip help project file. diff --git a/Src/Help/HTML/dlg_prefs_display.htm b/Src/Help/HTML/dlg_prefs_display.htm index 0dbb43732..50ed4fcfd 100644 --- a/Src/Help/HTML/dlg_prefs_display.htm +++ b/Src/Help/HTML/dlg_prefs_display.htm @@ -4,7 +4,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler). * * Help topic for Display page of Preferences dialogue box. --> diff --git a/Src/Help/Index.hhk b/Src/Help/Index.hhk index 9b3a0f57a..f5550c5d1 100644 --- a/Src/Help/Index.hhk +++ b/Src/Help/Index.hhk @@ -4,7 +4,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * CodeSnip help index file. --> diff --git a/Src/Help/TOC.hhc b/Src/Help/TOC.hhc index f206f44bc..cd91c1f05 100644 --- a/Src/Help/TOC.hhc +++ b/Src/Help/TOC.hhc @@ -4,7 +4,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * CodeSnip help table of contents file. --> diff --git a/Src/Hiliter.UAttrs.pas b/Src/Hiliter.UAttrs.pas index 24a91dd25..42ab29f1d 100644 --- a/Src/Hiliter.UAttrs.pas +++ b/Src/Hiliter.UAttrs.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements classes that define syntax highlighter attributes along with an * object that provides a list of named highlighter attributes. diff --git a/Src/UFontHelper.pas b/Src/UFontHelper.pas index 5e40c0296..dca71c381 100644 --- a/Src/UFontHelper.pas +++ b/Src/UFontHelper.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2006-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements a static class used to assist when working with fonts. } diff --git a/Src/UPreferences.pas b/Src/UPreferences.pas index 59bd8e09a..26a412804 100644 --- a/Src/UPreferences.pas +++ b/Src/UPreferences.pas @@ -3,7 +3,7 @@ * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at https://mozilla.org/MPL/2.0/ * - * Copyright (C) 2006-2021, Peter Johnson (gravatar.com/delphidabbler). + * Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler). * * Implements a singletion object that exposes and persists user preferences. }