mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 05:36:10 +02:00
SqlDb: In registersqldb, auto declare unit in uses section. Issue #23045, patch from Silvio Clécio
git-svn-id: trunk@40927 -
This commit is contained in:
parent
6f40ba2c6f
commit
a505823935
@ -102,7 +102,9 @@ uses
|
|||||||
lazideintf,
|
lazideintf,
|
||||||
srceditorintf,
|
srceditorintf,
|
||||||
ProjectIntf,
|
ProjectIntf,
|
||||||
idemsgintf;
|
idemsgintf,
|
||||||
|
CodeCache,
|
||||||
|
CodeToolManager;
|
||||||
|
|
||||||
Type
|
Type
|
||||||
{ TSQLStringsPropertyEditor }
|
{ TSQLStringsPropertyEditor }
|
||||||
@ -140,6 +142,7 @@ Type
|
|||||||
public
|
public
|
||||||
function GetAttributes: TPropertyAttributes; override;
|
function GetAttributes: TPropertyAttributes; override;
|
||||||
procedure GetValues(Proc: TGetStrProc); override;
|
procedure GetValues(Proc: TGetStrProc); override;
|
||||||
|
procedure SetValue(const NewValue: ansistring); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF HASLIBLOADER}
|
{$IFDEF HASLIBLOADER}
|
||||||
@ -256,6 +259,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSQLDBConnectorTypePropertyEditor.SetValue(const NewValue: ansistring);
|
||||||
|
var
|
||||||
|
Comp: TPersistent;
|
||||||
|
Code: TCodeBuffer;
|
||||||
|
ConnDef: TConnectionDef;
|
||||||
|
SrcEdit: TSourceEditorInterface;
|
||||||
|
begin
|
||||||
|
if not LazarusIDE.BeginCodeTools then
|
||||||
|
Exit;
|
||||||
|
SrcEdit := SourceEditorManagerIntf.ActiveEditor;
|
||||||
|
if Assigned(SrcEdit) then
|
||||||
|
Code := TCodeBuffer(SrcEdit.CodeToolsBuffer);
|
||||||
|
if Code = nil then
|
||||||
|
Exit;
|
||||||
|
Comp := GetComponent(0);
|
||||||
|
if Comp is TSQLConnector then
|
||||||
|
begin
|
||||||
|
ConnDef := GetConnectionDef(NewValue);
|
||||||
|
if Assigned(ConnDef) then
|
||||||
|
CodeToolBoss.AddUnitToMainUsesSection(Code, ConnDef.UnitName, '');
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
{$IFDEF HASLIBLOADER}
|
{$IFDEF HASLIBLOADER}
|
||||||
{ TSQLDBLibraryLoaderLibraryNamePropertyEditor }
|
{ TSQLDBLibraryLoaderLibraryNamePropertyEditor }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user