diff --git a/Bind4Delphi.dproj b/Bind4Delphi.dproj
index fdbcfa9..ab1cd01 100644
--- a/Bind4Delphi.dproj
+++ b/Bind4Delphi.dproj
@@ -47,7 +47,7 @@
System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
All
Bind4Delphi
- modules\.dcp;modules\.dcu;modules;modules\aws4d\src;modules\dataset-serialize\src;modules\localcache4d\samples\LocalCache4D;modules\localcache4d\src;modules\restrequest4delphi\src;modules\translator4d\samples\GoogleTranslator;modules\translator4d\src;$(DCC_UnitSearchPath)
+ $(DCC_UnitSearchPath);modules\.dcp;modules\.dcu;modules;modules\aws4d\src;modules\dataset-serialize\src;modules\localcache4d\samples\LocalCache4D;modules\localcache4d\src;modules\restrequest4delphi\src;modules\translator4d\modules;modules\translator4d\modules\localcache4d\Win32\Debug;modules\translator4d\samples\GoogleTranslator;modules\translator4d\src
Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
diff --git a/boss-lock.json b/boss-lock.json
index 9a6e7dd..266c263 100644
--- a/boss-lock.json
+++ b/boss-lock.json
@@ -12,24 +12,24 @@
},
"https://github.com/bittencourtthulio/aws4d": {
"name": "aws4d",
- "version": "1.0.0",
- "hash": "873d84831be282886a613a8d4a6abd61",
+ "version": "1.0.1",
+ "hash": "5c3492b832d44eef567d6f9c6f6c15d0",
"artifacts": {},
"failed": false,
"changed": false
},
"https://github.com/bittencourtthulio/localcache4d": {
"name": "localcache4d",
- "version": "1.0.1",
- "hash": "aa0209716a9240a685b2700a6fe11582",
+ "version": "1.0.3",
+ "hash": "a7158204540e4b8518fa0e53c2b9024b",
"artifacts": {},
"failed": false,
"changed": false
},
"https://github.com/bittencourtthulio/translator4d": {
"name": "translator4d",
- "version": "1.0.1",
- "hash": "e5495e637775d7e64c5376189bf2ebf8",
+ "version": "1.0.3",
+ "hash": "b9f27579217e70834a98dd445a818a5f",
"artifacts": {},
"failed": false,
"changed": false
diff --git a/boss.json b/boss.json
index 6c83503..2d411e4 100644
--- a/boss.json
+++ b/boss.json
@@ -6,9 +6,9 @@
"mainsrc": "./",
"projects": [],
"dependencies": {
- "https://github.com/bittencourtthulio/aws4d": "^1.0.0",
- "https://github.com/bittencourtthulio/localcache4d": "^1.0.1",
- "https://github.com/bittencourtthulio/translator4d": "^1.0.1",
+ "https://github.com/bittencourtthulio/aws4d": "^1.0.1",
+ "https://github.com/bittencourtthulio/localcache4d": "^1.0.3",
+ "https://github.com/bittencourtthulio/translator4d": "^1.0.3",
"https://github.com/viniciussanchez/restrequest4delphi": "^v3.0.5"
}
}
\ No newline at end of file
diff --git a/src/Bind4D.Attributes.pas b/src/Bind4D.Attributes.pas
index 1260de8..de89699 100644
--- a/src/Bind4D.Attributes.pas
+++ b/src/Bind4D.Attributes.pas
@@ -74,20 +74,11 @@ S3Storage = class(TCustomAttribute)
Translation = class(TCustomAttribute)
private
- FKey: String;
- FSource: String;
- FQuery: String;
- FTarget: String;
- procedure SetKey(const Value: String);
+ FQuery: String;
procedure SetQuery(const Value: String);
- procedure SetSource(const Value: String);
- procedure SetTarget(const Value: String);
public
- constructor Create( aQuery : String; aSource : String; aTarget : String; aKey : String);
+ constructor Create(aQuery : String);
property Query : String read FQuery write SetQuery;
- property Source : String read FSource write SetSource;
- property Target : String read FTarget write SetTarget;
- property Key : String read FKey write SetKey;
end;
{$endregion}
@@ -246,17 +237,9 @@ procedure FormRest.SetSort(const Value: String);
{ Translation }
-constructor Translation.Create(aQuery, aSource, aTarget, aKey: String);
+constructor Translation.Create(aQuery : String);
begin
FQuery := aQuery;
- FSource := aSource;
- FTarget := aTarget;
- FKey := aKey;
-end;
-
-procedure Translation.SetKey(const Value: String);
-begin
- FKey := Value;
end;
procedure Translation.SetQuery(const Value: String);
@@ -264,16 +247,6 @@ procedure Translation.SetQuery(const Value: String);
FQuery := Value;
end;
-procedure Translation.SetSource(const Value: String);
-begin
- FSource := Value;
-end;
-
-procedure Translation.SetTarget(const Value: String);
-begin
- FTarget := Value;
-end;
-
{ S3Storage }
constructor S3Storage.Create(aFileExtension, aContentType, aBucket, aAccounKey,
diff --git a/src/Bind4D.pas b/src/Bind4D.pas
index a9ce348..0413a73 100644
--- a/src/Bind4D.pas
+++ b/src/Bind4D.pas
@@ -49,6 +49,9 @@ TBind4D = class(TInterfacedObject, iBind4D)
function Translator : iTranslator4D;
end;
+var
+ vBind4D : iBind4D;
+
implementation
uses
@@ -75,13 +78,8 @@ procedure TBind4D.__BindCaptionToComponent(aComponent: TComponent;
TTranslator4D
.New
.Google
- .Credential
- .Key(pRtti.GetAttribute.Key)
- .&End
.Params
.Query(pRtti.GetAttribute.Query)
- .Source(pRtti.GetAttribute.Source)
- .Target(pRtti.GetAttribute.Target)
.&End
.Execute;
@@ -91,13 +89,8 @@ procedure TBind4D.__BindCaptionToComponent(aComponent: TComponent;
TTranslator4D
.New
.Google
- .Credential
- .Key(pRtti.GetAttribute.Key)
- .&End
.Params
.Query(pRtti.GetAttribute.Query)
- .Source(pRtti.GetAttribute.Source)
- .Target(pRtti.GetAttribute.Target)
.&End
.Execute;
end;
@@ -308,13 +301,8 @@ function TBind4D.BindFormatListDataSet(aDataSet : TDataSet; aDBGrid : TDBGrid) :
TTranslator4D
.New
.Google
- .Credential
- .Key(prpRtti.GetAttribute.Key)
- .&End
.Params
.Query(prpRtti.GetAttribute.Query)
- .Source(prpRtti.GetAttribute.Source)
- .Target(prpRtti.GetAttribute.Target)
.&End
.Execute
else
@@ -604,7 +592,10 @@ function TBind4D.__GetComponentToValue(aComponent: TComponent; pRtti : TRttiFiel
class function TBind4D.New: iBind4D;
begin
- Result := Self.Create;
+ if not Assigned(vBind4D) then
+ vBind4D := Self.Create;
+
+ Result := vBind4D;
end;
function TBind4D.SetStyleComponents: iBind4D;
@@ -797,4 +788,7 @@ procedure TBind4D.AdjustTimeDataSet(prpRtti: TRttiField; aDataSet: TDataSet);
aDataSet.EnableControls;
end;
+initialization
+ vBind4D := TBind4D.New;
+
end.