From c38a436b3ae61753b33dc80c1d3ca967fdf7fede Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 1 Feb 2025 16:37:38 +0100 Subject: [PATCH] Issue #1975: add "keep asking" checkbox to reformat dialog --- source/reformatter.dfm | 26 +++++++++++++++++++------- source/reformatter.pas | 7 +++++++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/source/reformatter.dfm b/source/reformatter.dfm index 17448102..92970715 100644 --- a/source/reformatter.dfm +++ b/source/reformatter.dfm @@ -3,7 +3,7 @@ object frmReformatter: TfrmReformatter Top = 0 BorderStyle = bsDialog Caption = 'Reformat SQL' - ClientHeight = 172 + ClientHeight = 217 ClientWidth = 503 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -16,13 +16,13 @@ object frmReformatter: TfrmReformatter OnDestroy = FormDestroy DesignSize = ( 503 - 172) + 217) TextHeight = 15 object grpReformatter: TRadioGroup Left = 8 Top = 8 Width = 487 - Height = 125 + Height = 128 Anchors = [akLeft, akTop, akRight, akBottom] Caption = 'Select reformatter' ItemIndex = 0 @@ -35,7 +35,7 @@ object frmReformatter: TfrmReformatter end object btnCancel: TButton Left = 420 - Top = 139 + Top = 184 Width = 75 Height = 25 Anchors = [akRight, akBottom] @@ -46,7 +46,7 @@ object frmReformatter: TfrmReformatter end object btnOk: TButton Left = 339 - Top = 139 + Top = 184 Width = 75 Height = 25 Anchors = [akRight, akBottom] @@ -59,12 +59,24 @@ object frmReformatter: TfrmReformatter object lblFormatProviderLink: TLinkLabel Left = 8 Top = 142 - Width = 121 - Height = 19 + Width = 149 + Height = 24 + Anchors = [akLeft, akBottom] Caption = 'lblFormatProviderLink' TabOrder = 3 UseVisualStyle = True Visible = False OnLinkClick = lblFormatProviderLinkLinkClick end + object chkKeepAsking: TCheckBox + Left = 8 + Top = 188 + Width = 257 + Height = 17 + Anchors = [akLeft, akRight, akBottom] + Caption = 'Keep asking this question.' + Checked = True + State = cbChecked + TabOrder = 4 + end end diff --git a/source/reformatter.pas b/source/reformatter.pas index 38d5d45b..fa38613b 100644 --- a/source/reformatter.pas +++ b/source/reformatter.pas @@ -13,6 +13,7 @@ type btnCancel: TButton; btnOk: TButton; lblFormatProviderLink: TLinkLabel; + chkKeepAsking: TCheckBox; procedure btnOkClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -78,6 +79,12 @@ begin end; end; + + if not chkKeepAsking.Checked then begin + // No dialog next time please + AppSettings.WriteInt(asReformatterNoDialog, grpReformatter.ItemIndex+1); + end; + Screen.Cursor := crDefault; end;