Révision | 3 (tree) |
---|---|
l'heure | 2018-07-24 13:36:57 |
Auteur | derekwildstar |
Ajustes para compilação no Delphi 25
@@ -5,8 +5,6 @@ | ||
5 | 5 | Vcl.Forms, |
6 | 6 | UFormPrincipal in '..\src\UFormPrincipal.pas' {FormPrincipal}, |
7 | 7 | UDamoPrincipal in '..\src\UDamoPrincipal.pas' {DamoPrincipal: TDataModule}, |
8 | - Vcl.Themes, | |
9 | - Vcl.Styles, | |
10 | 8 | UConfiguracoes in '..\src\lib\UConfiguracoes.pas', |
11 | 9 | URequestThread in '..\src\lib\URequestThread.pas', |
12 | 10 | ServerCAIE in '..\src\lib\ServerCAIE.pas', |
@@ -14,7 +12,9 @@ | ||
14 | 12 | UFormPerguntaEnvio in '..\src\UFormPerguntaEnvio.pas' {FormPerguntaEnvio}, |
15 | 13 | UFormProgresso in '..\src\UFormProgresso.pas' {FormProgresso}, |
16 | 14 | UFormStatus in '..\src\UFormStatus.pas' {FormStatus}, |
17 | - URequestThreadCAIE in '..\src\lib\URequestThreadCAIE.pas'; | |
15 | + URequestThreadCAIE in '..\src\lib\URequestThreadCAIE.pas', | |
16 | + Vcl.Themes, | |
17 | + Vcl.Styles; | |
18 | 18 | |
19 | 19 | {$R *.res} |
20 | 20 |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
2 | 2 | <PropertyGroup> |
3 | 3 | <ProjectGuid>{D0AEBD98-3F69-42B3-9CCD-14182960D5D0}</ProjectGuid> |
4 | - <ProjectVersion>15.3</ProjectVersion> | |
4 | + <ProjectVersion>18.4</ProjectVersion> | |
5 | 5 | <FrameworkType>VCL</FrameworkType> |
6 | 6 | <MainSource>IntegradorCAIE.dpr</MainSource> |
7 | 7 | <Base>True</Base> |
@@ -53,16 +53,22 @@ | ||
53 | 53 | <DCC_S>false</DCC_S> |
54 | 54 | <DCC_F>false</DCC_F> |
55 | 55 | <DCC_K>false</DCC_K> |
56 | + <SanitizedProjectName>IntegradorCAIE</SanitizedProjectName> | |
57 | + <Custom_Styles>"Emerald Light Slate|VCLSTYLE|$(BDSCOMMONDIR)\Styles\EmeraldLightSlate.vsf"</Custom_Styles> | |
56 | 58 | </PropertyGroup> |
57 | 59 | <PropertyGroup Condition="'$(Base_Win32)'!=''"> |
58 | 60 | <DCC_UsePackage>myprovider190;FireDACSqliteDriver;MidasConnR;rbUSER1519;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;TeeDB;dacvcl190;vclib;inetdbbde;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;ADOConnR;DataSnapProviderClient;DBXSybaseASEDriver;PNGComponentsR;DbxCommonDriver;rbDIDE1519;vclimg;unidac190;rbIBE1519;dbxcds;DatasnapConnectorsFreePascal;rbADO1519;rbFireDAC1519;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;rbIDE1519;rbTCUI1519;DBXOracleDriver;CustomIPTransport;rbBDE1519;SynEdit_RXE5;vclribbon;FireDACConnR;dsnap;fmxase;vcl;IndyCore;CloudService;DBXMSSQLDriver;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;PicShowR;dclRBE1519;rbCIDE1519;inetdbxpress;webdsnap;dclRBDBE1519;FireDACDb2Driver;ZeosLibConnR;adortl;FireDACASADriver;bindcompfmx;DBXConnR;dclRBIBE1519;vcldbx;FireDACODBCDriver;rbUSERDesign1519;rbRAP1519;rtl;dbrtl;DbxClientDriver;rbDBDE1519;FireDACCommon;bindcomp;inetdb;Tee;DBXOdbcDriver;vclFireDAC;xmlrtl;svnui;ibxpress;IBXConnR;UserControlR;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindengine;vclactnband;soaprtl;bindcompdbx;FMXTee;TeeUI;bindcompvcl;rbDAD1519;vclie;FireDACADSDriver;vcltouch;BDEConnR;rbTC1519;dac190;VclSmp;FireDACMSSQLDriver;FireDAC;VCLRESTComponents;Intraweb;DBXInformixDriver;rbDBE1519;DataSnapConnectors;FireDACDataSnapDriver;unidacvcl190;dclRBADO1519;dclRBFireDAC1519;dsnapcon;DBXFirebirdDriver;rbRCL1519;inet;pgprovider190;fmxobj;FireDACMySQLDriver;vclx;rbRTL1519;rbDB1519;UniDACConnR;svn;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;rbRIDE1519;bdertl;dclRBBDE1519;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage> |
59 | 61 | <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> |
60 | 62 | <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> |
61 | - <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> | |
63 | + <VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys> | |
62 | 64 | <VerInfo_Locale>1033</VerInfo_Locale> |
65 | + <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44> | |
66 | + <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150> | |
63 | 67 | </PropertyGroup> |
64 | 68 | <PropertyGroup Condition="'$(Base_Win64)'!=''"> |
65 | 69 | <DCC_UsePackage>FireDACSqliteDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;TeeDB;dacvcl190;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;unidac190;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;SynEdit_RXE5;vclribbon;dsnap;fmxase;vcl;IndyCore;CloudService;DBXMSSQLDriver;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;inetdbxpress;webdsnap;FireDACDb2Driver;adortl;FireDACASADriver;bindcompfmx;FireDACODBCDriver;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;Tee;DBXOdbcDriver;vclFireDAC;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindengine;vclactnband;soaprtl;bindcompdbx;FMXTee;TeeUI;bindcompvcl;vclie;FireDACADSDriver;vcltouch;dac190;VclSmp;FireDACMSSQLDriver;FireDAC;VCLRESTComponents;Intraweb;DBXInformixDriver;DataSnapConnectors;FireDACDataSnapDriver;unidacvcl190;dsnapcon;DBXFirebirdDriver;inet;pgprovider190;fmxobj;FireDACMySQLDriver;vclx;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage> |
70 | + <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44> | |
71 | + <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150> | |
66 | 72 | </PropertyGroup> |
67 | 73 | <PropertyGroup Condition="'$(Cfg_1)'!=''"> |
68 | 74 | <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define> |
@@ -77,6 +83,10 @@ | ||
77 | 83 | <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> |
78 | 84 | <VerInfo_Locale>1033</VerInfo_Locale> |
79 | 85 | <DCC_RemoteDebug>false</DCC_RemoteDebug> |
86 | + <BT_BuildType>Debug</BT_BuildType> | |
87 | + <Debugger_DebugSourcePath>D:\Desenvolvimento\Delphi\Componentes\KRAKATOA\KRKLIB\SRC\Rtl\win\;$(Debugger_DebugSourcePath)</Debugger_DebugSourcePath> | |
88 | + <VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys> | |
89 | + <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes> | |
80 | 90 | </PropertyGroup> |
81 | 91 | <PropertyGroup Condition="'$(Cfg_2)'!=''"> |
82 | 92 | <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> |
@@ -186,10 +196,11 @@ | ||
186 | 196 | <Source Name="MainSource">IntegradorCAIE.dpr</Source> |
187 | 197 | </Source> |
188 | 198 | <Excluded_Packages> |
189 | - <Excluded_Packages Name="$(BDSBIN)\webdsnap190.bpl">Embarcadero InternetExpress Components</Excluded_Packages> | |
199 | + <Excluded_Packages Name="$(BDSBIN)\dcloffice2k250.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages> | |
200 | + <Excluded_Packages Name="$(BDSBIN)\dclofficexp250.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages> | |
190 | 201 | </Excluded_Packages> |
191 | 202 | </Delphi.Personality> |
192 | - <Deployment/> | |
203 | + <Deployment Version="3"/> | |
193 | 204 | <Platforms> |
194 | 205 | <Platform value="Win32">True</Platform> |
195 | 206 | <Platform value="Win64">False</Platform> |
@@ -199,4 +210,5 @@ | ||
199 | 210 | </ProjectExtensions> |
200 | 211 | <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/> |
201 | 212 | <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/> |
213 | + <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/> | |
202 | 214 | </Project> |
@@ -8,7 +8,8 @@ | ||
8 | 8 | |
9 | 9 | type |
10 | 10 | TOnStartRequest = TNotifyEvent; |
11 | - TOnGetDataSets = procedure(out ACartorios, AGuias, AAtos, AReceitas: TClientDataSet) of object; | |
11 | + TMoment = (mUnknown, mConfigureCompressionProgress, mCompressionProgress, mEncoding, mRequesting); | |
12 | + TOnStatus = procedure(AMoment: TMoment; AData1: Int64; AData2: String) of object; | |
12 | 13 | |
13 | 14 | TRequestThreadCAIE = class(TThread) |
14 | 15 | private |
@@ -25,11 +26,15 @@ | ||
25 | 26 | |
26 | 27 | FOnStartRequest: TOnStartRequest; |
27 | 28 | |
28 | - FAdditionalData: Pointer; | |
29 | + FProgressMoment: TMoment; | |
30 | + FProgressData1: Int64; | |
31 | + FProgressData2: String; | |
32 | + FOnStatus: TOnStatus; | |
29 | 33 | |
30 | 34 | function Requisicao: String; |
31 | 35 | procedure DoHttpWebNodeBeforePost(const HTTPReqResp: THTTPReqResp; Data: Pointer); |
32 | 36 | procedure DoStartRequest; |
37 | + procedure DoStatus; | |
33 | 38 | procedure BuildFileContents; |
34 | 39 | procedure DoCompressProgress(ASender: TObject); |
35 | 40 | protected |
@@ -40,8 +45,8 @@ | ||
40 | 45 | class function GetFileContents(AUsuarioAtual: Pessoa; ACartorios, AGuias, AAtos, AReceitas: TClientDataSet): String; |
41 | 46 | |
42 | 47 | property OnStartRequest: TOnStartRequest read FOnStartRequest write FOnStartRequest; |
48 | + property OnStatus: TOnStatus read FOnStatus write FOnStatus; | |
43 | 49 | |
44 | - property AdditionalData: Pointer write FAdditionalData; | |
45 | 50 | property UsuarioAtual: Pessoa write FUsuarioAtual; |
46 | 51 | property NomeArquivo: String write FNomeArquivo; |
47 | 52 | property Cartorios: TClientDataSet write FCartorios; |
@@ -56,7 +61,8 @@ | ||
56 | 61 | |
57 | 62 | uses |
58 | 63 | Winapi.ActiveX, System.SysUtils, System.Types, Winapi.WinInet, |
59 | - Data.DB, StrUtils, KRK.Lib.Rtl.Win.WinCrypt.Utilities, UFormStatus, ZLib, EncdDecd; | |
64 | + Data.DB, StrUtils, KRK.Lib.Rtl.Win.WinCrypt.Utilities, UFormStatus, ZLib, | |
65 | + System.NetEncoding; | |
60 | 66 | |
61 | 67 | { TRequestThread } |
62 | 68 |
@@ -242,8 +248,13 @@ | ||
242 | 248 | try |
243 | 249 | StringStream := TStringStream.Create(GetFileContents(FUsuarioAtual,FCartorios,FGuias,FAtos,FReceitas)); |
244 | 250 | try |
245 | - if Assigned(FAdditionalData) then | |
246 | - TFormStatus(FAdditionalData).ResetGauge(StringStream.Size); | |
251 | + if Assigned(FOnStatus) then | |
252 | + begin | |
253 | + FProgressMoment := mConfigureCompressionProgress; | |
254 | + FProgressData1 := StringStream.Size; | |
255 | + FProgressData2 := 'Comprimindo dados...'#13#10; | |
256 | + Synchronize(DoStatus); | |
257 | + end; | |
247 | 258 | |
248 | 259 | with TZCompressionStream.Create(clMax,MemoryStream) do |
249 | 260 | try |
@@ -250,9 +261,15 @@ | ||
250 | 261 | OnProgress := DoCompressProgress; |
251 | 262 | CopyFrom(StringStream,StringStream.Size); |
252 | 263 | |
253 | - if Assigned(FAdditionalData) then | |
254 | - TFormStatus(FAdditionalData).UpdateProgress(StringStream.Size); | |
255 | 264 | finally |
265 | + if Assigned(FOnStatus) then | |
266 | + begin | |
267 | + FProgressMoment := mCompressionProgress; | |
268 | + FProgressData1 := StringStream.Size; | |
269 | + FProgressData2 := 'Comprimindo dados...'#13#10; | |
270 | + Synchronize(DoStatus); | |
271 | + end; | |
272 | + | |
256 | 273 | Free; |
257 | 274 | end; |
258 | 275 | finally |
@@ -261,9 +278,17 @@ | ||
261 | 278 | |
262 | 279 | MemoryStream.Position := 0; |
263 | 280 | |
281 | + if Assigned(FOnStatus) then | |
282 | + begin | |
283 | + FProgressMoment := mEncoding; | |
284 | + FProgressData1 := 0; | |
285 | + FProgressData2 := 'Codificando dados...'; | |
286 | + Synchronize(DoStatus); | |
287 | + end; | |
288 | + | |
264 | 289 | StringStream := TStringStream.Create(''); |
265 | 290 | try |
266 | - EncodeStream(MemoryStream,StringStream); | |
291 | + TNetEncoding.Base64.Encode(MemoryStream, StringStream); | |
267 | 292 | FFileContents := StringStream.DataString; |
268 | 293 | finally |
269 | 294 | StringStream.Free; |
@@ -275,12 +300,14 @@ | ||
275 | 300 | |
276 | 301 | function TRequestThreadCAIE.Requisicao: String; |
277 | 302 | begin |
278 | - if Assigned(FAdditionalData) then | |
279 | - TFormStatus(FAdditionalData).StartTimer; | |
303 | + if Assigned(FOnStatus) then | |
304 | + begin | |
305 | + FProgressMoment := mRequesting; | |
306 | + FProgressData1 := 0; | |
307 | + FProgressData2 := 'Enviando dados ao CAIE...'; | |
308 | + Synchronize(DoStatus); | |
309 | + end; | |
280 | 310 | |
281 | - while True do | |
282 | - Sleep(1000); | |
283 | - | |
284 | 311 | Result := GetServerCAIEPortType(False,'',FHTTPRIO).inserirArquivo(FUsuarioAtual.cpf,FFileContents,FNomeArquivo); |
285 | 312 | end; |
286 | 313 |
@@ -304,10 +331,20 @@ | ||
304 | 331 | end; |
305 | 332 | |
306 | 333 | |
334 | +procedure TRequestThreadCAIE.DoStatus; | |
335 | +begin | |
336 | + FOnStatus(FProgressMoment,FProgressData1,FProgressData2); | |
337 | +end; | |
338 | + | |
307 | 339 | procedure TRequestThreadCAIE.DoCompressProgress(ASender: TObject); |
308 | 340 | begin |
309 | - if Assigned(FAdditionalData) then | |
310 | - TFormStatus(FAdditionalData).UpdateProgress(TZCompressionStream(ASender).Position); | |
341 | + if Assigned(FOnStatus) then | |
342 | + begin | |
343 | + FProgressMoment := mCompressionProgress; | |
344 | + FProgressData1 := TZCompressionStream(ASender).Position; | |
345 | + FProgressData2 := 'Comprimindo dados...'#13#10; | |
346 | + Synchronize(DoStatus); | |
347 | + end; | |
311 | 348 | end; |
312 | 349 | |
313 | 350 | procedure TRequestThreadCAIE.DoStartRequest; |
@@ -3,12 +3,11 @@ | ||
3 | 3 | interface |
4 | 4 | |
5 | 5 | uses |
6 | - System.SysUtils, System.Classes, Data.DB, Datasnap.DBClient, Xml.xmldom, | |
7 | - Xmlxform, Vcl.StdCtrls, Vcl.Dialogs, Winapi.Windows, KRK.Lib.Rtl.Win.WinCrypt, | |
8 | - URequestThread, KRK.Components.AdditionalControls.DefinedCrypt, | |
9 | - UFormProgresso, Vcl.ExtCtrls, Soap.InvokeRegistry, Soap.Rio, | |
10 | - Soap.SOAPHTTPClient, UFormStatus, URequestThreadCAIE, | |
11 | - UFormBlender, ServerCAIE; | |
6 | + System.SysUtils, System.Classes, Data.DB, Datasnap.DBClient, Vcl.StdCtrls, | |
7 | + Vcl.Dialogs, Winapi.Windows, KRK.Lib.Rtl.Win.WinCrypt, URequestThread, | |
8 | + KRK.Components.AdditionalControls.DefinedCrypt, UFormProgresso, Vcl.ExtCtrls, | |
9 | + Soap.InvokeRegistry, Soap.Rio, Soap.SOAPHTTPClient, UFormStatus, | |
10 | + URequestThreadCAIE, UFormBlender, ServerCAIE, Xml.xmldom, Xml.XmlTransform; | |
12 | 11 | |
13 | 12 | type |
14 | 13 | TDamoPrincipal = class(TDataModule) |
@@ -51,7 +50,7 @@ | ||
51 | 50 | KRDC: TKRKDefinedCrypt; |
52 | 51 | TIME: TTimer; |
53 | 52 | procedure DASOCartoriosDataChange(Sender: TObject; Field: TField); |
54 | - procedure DoUpdateProgressOnSaveOrLoad(ASender: TObject; APosition: Integer); | |
53 | + procedure DoEncryptDecryptProgress(ASender: TObject; APosition: Integer); | |
55 | 54 | procedure FormatarCPFCNPJOnGetText(Sender: TField; var Text: string; DisplayText: Boolean); |
56 | 55 | procedure FormatarValorOnGetText(Sender: TField; var Text: string; DisplayText: Boolean); |
57 | 56 | procedure TIMETimer(Sender: TObject); |
@@ -65,12 +64,13 @@ | ||
65 | 64 | FDiretorioAtual: String; |
66 | 65 | FFormProgresso: TFormProgresso; |
67 | 66 | FStartTick: Cardinal; |
68 | - FormBlenderRequisicaoCAIE: TFormBlender; | |
67 | + FFormBlenderRequisicaoCAIE: TFormBlender; | |
69 | 68 | function EnumCertAltNameEntries(ACertAltNameEntry: TCertAltNameEntry; AEnumCertAltNameEntriesArguments: array of const): Boolean; |
70 | 69 | procedure DoTerminateRequest(ASender: TObject); |
71 | 70 | procedure DoTerminateRequestCAIE(ASender: TObject); |
72 | 71 | procedure DoStartRequest(ASender: TObject); |
73 | 72 | procedure DoStartRequestCAIE(ASender: TObject); |
73 | + procedure DoStatusCAIE(AMoment: TMoment; AData1: Int64; AData2: String); | |
74 | 74 | // function GetFileContents(ACartorios, AGuias, AAtos, AReceitas: TClientDataSet): String; |
75 | 75 | public |
76 | 76 | { Public declarations } |
@@ -165,7 +165,8 @@ | ||
165 | 165 | FFormProgresso.PRBR.Max := Length(Subject); |
166 | 166 | FFormProgresso.PRBR.Position := 0; |
167 | 167 | |
168 | - KRDC.OnUpdateProgress := DoUpdateProgressOnSaveOrLoad; | |
168 | + KRDC.OnUpdateProgress := DoEncryptDecryptProgress; | |
169 | + | |
169 | 170 | TempStream := KRDC.SubjectToStream(KRDC.SingleEncryptDecrypt(FUsuarioAtual.cpf + FUsuarioAtual.nome + FUsuarioAtual.cpf |
170 | 171 | ,Subject |
171 | 172 | ,fDecrypt)); |
@@ -286,12 +287,12 @@ | ||
286 | 287 | |
287 | 288 | procedure TDamoPrincipal.DoStartRequestCAIE(ASender: TObject); |
288 | 289 | begin |
289 | - TFormBlender.ShowMe(FormPrincipal,TFormStatus,FormBlenderRequisicaoCAIE); | |
290 | + TFormBlender.ShowMe(FormPrincipal,TFormStatus,FFormBlenderRequisicaoCAIE); | |
290 | 291 | |
291 | - while not FormBlenderRequisicaoCAIE.InternalFormVisible do | |
292 | + while not FFormBlenderRequisicaoCAIE.InternalFormVisible do | |
292 | 293 | Application.ProcessMessages; |
293 | 294 | |
294 | - TRequestThreadCAIE(ASender).AdditionalData := FormBlenderRequisicaoCAIE.InternalFormInstance; | |
295 | +// TRequestThreadCAIE(ASender).AdditionalData := FormBlenderRequisicaoCAIE.InternalFormInstance; | |
295 | 296 | end; |
296 | 297 | |
297 | 298 | // Executado ao final da execução da thread de requisição |
@@ -340,7 +341,7 @@ | ||
340 | 341 | var |
341 | 342 | FormStatus: TFormStatus; |
342 | 343 | begin |
343 | - FormStatus := TFormStatus(FormBlenderRequisicaoCAIE.InternalFormInstance); | |
344 | + FormStatus := TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance); | |
344 | 345 | |
345 | 346 | FormStatus.TIME.Enabled := False; |
346 | 347 | if FRequestThreadCAIE.Sucesso then |
@@ -379,15 +380,34 @@ | ||
379 | 380 | Application.MessageBox(PChar(FRequestThreadCAIE.Resposta),'Falha na requisição',MB_ICONERROR); |
380 | 381 | end; |
381 | 382 | |
382 | - FormBlenderRequisicaoCAIE.Close; | |
383 | - FormBlenderRequisicaoCAIE.Free; | |
383 | + FFormBlenderRequisicaoCAIE.Close; | |
384 | + FFormBlenderRequisicaoCAIE.Free; | |
384 | 385 | end; |
385 | 386 | |
386 | -procedure TDamoPrincipal.DoUpdateProgressOnSaveOrLoad(ASender: TObject; APosition: Integer); | |
387 | +procedure TDamoPrincipal.DoEncryptDecryptProgress(ASender: TObject; APosition: Integer); | |
387 | 388 | begin |
388 | 389 | FFormProgresso.PRBR.Position := APosition; |
389 | 390 | end; |
390 | 391 | |
392 | +procedure TDamoPrincipal.DoStatusCAIE(AMoment: TMoment; AData1: Int64; AData2: String); | |
393 | +begin | |
394 | + case AMoment of | |
395 | + mConfigureCompressionProgress: begin | |
396 | + TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance).LABEStep5FinalMessage.Caption := AData2; | |
397 | + TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance).ResetProgressBar(AData1); | |
398 | + end; | |
399 | + mCompressionProgress: TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance).UpdateProgress(AData1); | |
400 | + mEncoding: begin | |
401 | + TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance).PRBR1.Hide; | |
402 | + TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance).LABEStep5FinalMessage.Caption := AData2; | |
403 | + end; | |
404 | + mRequesting: begin | |
405 | + TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance).LABEStep5FinalMessage.Caption := AData2; | |
406 | + TFormStatus(FFormBlenderRequisicaoCAIE.InternalFormInstance).StartTimer; | |
407 | + end; | |
408 | + end; | |
409 | +end; | |
410 | + | |
391 | 411 | procedure TDamoPrincipal.FillCSPInfo(AComboBox: TComboBox; ACSPName, ACSPType, ACSPGUID: TEdit); |
392 | 412 | begin |
393 | 413 | ACSPName.Text := TSCP(AComboBox.Items.Objects[AComboBox.ItemIndex]).CSPName; |
@@ -614,6 +634,7 @@ | ||
614 | 634 | FRequestThreadCAIE := TRequestThreadCAIE.Create; |
615 | 635 | FRequestThreadCAIE.OnTerminate := DoTerminateRequestCAIE; |
616 | 636 | FRequestThreadCAIE.OnStartRequest := DoStartRequestCAIE; |
637 | + FRequestThreadCAIE.OnStatus := DoStatusCAIE; | |
617 | 638 | FRequestThreadCAIE.Cartorios := CLDSCartorios; |
618 | 639 | FRequestThreadCAIE.Guias := CLDSGuias; |
619 | 640 | FRequestThreadCAIE.Atos := CLDSAtos; |
@@ -668,7 +689,7 @@ | ||
668 | 689 | FFormProgresso.PRBR.Max := TempStream.Size; |
669 | 690 | FFormProgresso.PRBR.Position := 0; |
670 | 691 | |
671 | - KRDC.OnUpdateProgress := DoUpdateProgressOnSaveOrLoad; | |
692 | + KRDC.OnUpdateProgress := DoEncryptDecryptProgress; | |
672 | 693 | KRDC.SaveToFile(SADI.FileName |
673 | 694 | ,KRDC.SingleEncryptDecrypt(FUsuarioAtual.cpf + FUsuarioAtual.nome + FUsuarioAtual.cpf |
674 | 695 | ,Subject |
@@ -28,7 +28,7 @@ | ||
28 | 28 | public |
29 | 29 | { Public declarations } |
30 | 30 | procedure StartTimer; |
31 | - procedure ResetGauge(AMax: Int64); | |
31 | + procedure ResetProgressBar(AMax: Int64); | |
32 | 32 | procedure UpdateProgress(AProgress: Int64); |
33 | 33 | end; |
34 | 34 |
@@ -38,7 +38,7 @@ | ||
38 | 38 | |
39 | 39 | procedure TFormStatus.FormShow(Sender: TObject); |
40 | 40 | begin |
41 | - LABEStep5FinalMessage.Caption := 'Serializando e comprimindo dados...'; | |
41 | + LABEStep5FinalMessage.Caption := 'Serializando dados...'; | |
42 | 42 | IMAGStep5Status.Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'res\RequestRunning200.gif'); |
43 | 43 | |
44 | 44 | (IMAGStep5Status.Picture.Graphic as TGIFImage).Animate := True; |
@@ -45,10 +45,11 @@ | ||
45 | 45 | (IMAGStep5Status.Picture.Graphic as TGIFImage).AnimationSpeed:= 200; |
46 | 46 | end; |
47 | 47 | |
48 | -procedure TFormStatus.ResetGauge(AMax: Int64); | |
48 | +procedure TFormStatus.ResetProgressBar(AMax: Int64); | |
49 | 49 | begin |
50 | 50 | PRBR1.Position := 0; |
51 | 51 | PRBR1.Max := AMax; |
52 | + PRBR1.Visible := True; | |
52 | 53 | end; |
53 | 54 | |
54 | 55 | procedure TFormStatus.StartTimer; |
@@ -67,6 +68,4 @@ | ||
67 | 68 | PRBR1.Position := AProgress; |
68 | 69 | end; |
69 | 70 | |
70 | -colocar o progressbar no label de baixo | |
71 | - | |
72 | 71 | end. |