From 41e0703552049d6292e28ca18e917ca1678c49de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Mon, 28 Oct 2024 22:24:03 +0100 Subject: [PATCH] * Settings to skip mysql version check --- .../sqldbrest/fraidesqldbrestsettings.lfm | 19 ++++++ .../sqldbrest/fraidesqldbrestsettings.pas | 64 +++++++++++++++++++ components/sqldbrest/lazsqldbrest.lpk | 9 ++- components/sqldbrest/lazsqldbrest.pas | 2 +- components/sqldbrest/reglazsqldbrest.pp | 9 ++- 5 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 components/sqldbrest/fraidesqldbrestsettings.lfm create mode 100644 components/sqldbrest/fraidesqldbrestsettings.pas diff --git a/components/sqldbrest/fraidesqldbrestsettings.lfm b/components/sqldbrest/fraidesqldbrestsettings.lfm new file mode 100644 index 0000000000..8b4d66532f --- /dev/null +++ b/components/sqldbrest/fraidesqldbrestsettings.lfm @@ -0,0 +1,19 @@ +object SQLDBRestConfigFrame: TSQLDBRestConfigFrame + Left = 0 + Height = 240 + Top = 0 + Width = 320 + ClientHeight = 240 + ClientWidth = 320 + TabOrder = 0 + DesignLeft = 876 + DesignTop = 308 + object cbSkipMysqlVersionCheck: TCheckBox + Left = 16 + Height = 23 + Top = 16 + Width = 181 + Caption = 'Skip MySQL version check' + TabOrder = 0 + end +end diff --git a/components/sqldbrest/fraidesqldbrestsettings.pas b/components/sqldbrest/fraidesqldbrestsettings.pas new file mode 100644 index 0000000000..0f04831ce0 --- /dev/null +++ b/components/sqldbrest/fraidesqldbrestsettings.pas @@ -0,0 +1,64 @@ +unit fraidesqldbrestsettings; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Forms, Controls, StdCtrls, ColorBox, Dialogs, SpinEx, + IDEOptionsIntf, IDEOptEditorIntf; + +type + + { TSQLDBRestConfigFrame } + + TSQLDBRestConfigFrame = class(TAbstractIDEOptionsEditor) + cbSkipMysqlVersionCheck: TCheckBox; + private + + public + function GetTitle: String; override; + procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override; + procedure ReadSettings({%H-}AOptions: TAbstractIDEOptions); override; + procedure WriteSettings({%H-}AOptions: TAbstractIDEOptions); override; + class function SupportedOptionsClass: TAbstractIDEOptionsClass; override; + + end; + +implementation + +uses schemaeditorconf; + +{$R *.lfm} + + +{ TSQLDBRestConfigFrame } + +function TSQLDBRestConfigFrame.GetTitle: String; +begin + Result:='SQLDBRest Editor' +end; + +procedure TSQLDBRestConfigFrame.Setup(ADialog: TAbstractOptionsEditorDialog); +begin + +end; + +procedure TSQLDBRestConfigFrame.ReadSettings(AOptions: TAbstractIDEOptions); +begin + cbSkipMysqlVersionCheck.Checked:=SchemaSettings.DisableMySQLVersionCheck; +end; + +procedure TSQLDBRestConfigFrame.WriteSettings(AOptions: TAbstractIDEOptions); +begin + SchemaSettings.DisableMySQLVersionCheck:=cbSkipMysqlVersionCheck.Checked; + SchemaSettings.SaveToFile(SchemaSettings.CurrentFile); +end; + +class function TSQLDBRestConfigFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; +begin + Result:=IDEEditorGroups.GetByIndex(GroupEnvironment)^.GroupClass; +end; + +end. + diff --git a/components/sqldbrest/lazsqldbrest.lpk b/components/sqldbrest/lazsqldbrest.lpk index 2293eb8c98..642a4d99a9 100644 --- a/components/sqldbrest/lazsqldbrest.lpk +++ b/components/sqldbrest/lazsqldbrest.lpk @@ -1,6 +1,6 @@ - + @@ -9,7 +9,7 @@ - + @@ -38,7 +38,12 @@ + + + + + diff --git a/components/sqldbrest/lazsqldbrest.pas b/components/sqldbrest/lazsqldbrest.pas index 0ec5ae8a2b..6d291f19df 100644 --- a/components/sqldbrest/lazsqldbrest.pas +++ b/components/sqldbrest/lazsqldbrest.pas @@ -9,7 +9,7 @@ interface uses reglazsqldbrest, frmsqldbrestdispatchini, frmsqldbrestselectconn, reslazsqldbrest, frmsqldbrestselecttables, - dlgeditsqldbrestschema, LazarusPackageIntf; + dlgeditsqldbrestschema, fraidesqldbrestsettings, LazarusPackageIntf; implementation diff --git a/components/sqldbrest/reglazsqldbrest.pp b/components/sqldbrest/reglazsqldbrest.pp index 2541a71632..ae29556add 100644 --- a/components/sqldbrest/reglazsqldbrest.pp +++ b/components/sqldbrest/reglazsqldbrest.pp @@ -117,6 +117,7 @@ implementation uses // Lazarus LResources, codecache, Controls, Forms, Dialogs, SrcEditorIntf, lazideintf, FormEditingIntf, codetoolmanager, + IDEOptionsIntf, IDEOptEditorIntf, // FPC sqldbrestini, // This package @@ -125,10 +126,12 @@ uses frmsqldbrestselecttables, dlgeditsqldbrestschema, schemaeditorconf, - reslazsqldbrest; + reslazsqldbrest, + fraidesqldbrestsettings; Var FileDescriptorRestModule: TFileRestModule; + SQLDBRestOptionsFrameID : Integer = 2100; Procedure Register; @@ -155,7 +158,9 @@ begin FileDescriptorRestModule:=TFileRestModule.Create; RegisterProjectFileDescriptor(FileDescriptorRestModule); FormEditingHook.RegisterDesignerBaseClass(TSQLDBRestModule); - + // add IDE options frame + SQLDBRestOptionsFrameID:=RegisterIDEOptionsEditor(GroupEnvironment,TSQLDBRestConfigFrame, + SQLDBRestOptionsFrameID)^.Index; end; { TSQLDBRestSchemaComponentEditor }