Browse Source

Refactor: main form, sync dialog

Herman Schoenfeld 7 years ago
parent
commit
607268445f

+ 4 - 4
PascalCoinWallet.dpr

@@ -9,13 +9,13 @@ uses
   UOpenSSL,
   UOpenSSL,
   UCrypto,
   UCrypto,
   Forms,
   Forms,
-  UFRMWallet,
-  UUserInterface;
+  UUserInterface,
+  UFRMMainForm;
 
 
 {$R *.res}
 {$R *.res}
 
 
 var
 var
-   mainForm : TFRMWallet;
+   mainForm : TFRMMainForm;
 begin
 begin
   // Start OpenSSL dll
   // Start OpenSSL dll
   if Not LoadSSLCrypt then
   if Not LoadSSLCrypt then
@@ -27,7 +27,7 @@ begin
   Application.MainFormOnTaskBar := True;
   Application.MainFormOnTaskBar := True;
   {$Warnings ON}{$ENDIF}
   {$Warnings ON}{$ENDIF}
   Application.Title := 'Pascal Coin Wallet, Miner & Explorer';
   Application.Title := 'Pascal Coin Wallet, Miner & Explorer';
-  Application.CreateForm(TFRMWallet, mainForm);
+  Application.CreateForm(TFRMMainForm, mainForm);
   TUserInterface.StartApplication(mainForm);
   TUserInterface.StartApplication(mainForm);
   Application.Run;
   Application.Run;
 end.
 end.

+ 87 - 89
PascalCoinWallet.lpi

@@ -92,285 +92,283 @@
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit12>
       </Unit12>
       <Unit13>
       <Unit13>
-        <Filename Value="Units\Forms\UFRMWallet.pas"/>
+        <Filename Value="Units\Utils\UFolderHelper.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <ComponentName Value="FRMWallet"/>
-        <HasResources Value="True"/>
-        <ResourceBaseClass Value="Form"/>
       </Unit13>
       </Unit13>
       <Unit14>
       <Unit14>
-        <Filename Value="Units\Utils\UFolderHelper.pas"/>
+        <Filename Value="Units\Utils\UAppParams.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit14>
       </Unit14>
       <Unit15>
       <Unit15>
-        <Filename Value="Units\Utils\UAppParams.pas"/>
+        <Filename Value="Units\Utils\UGridUtils.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit15>
       </Unit15>
       <Unit16>
       <Unit16>
-        <Filename Value="Units\Utils\UGridUtils.pas"/>
-        <IsPartOfProject Value="True"/>
-      </Unit16>
-      <Unit17>
         <Filename Value="Units\Forms\UFRMPascalCoinWalletConfig.pas"/>
         <Filename Value="Units\Forms\UFRMPascalCoinWalletConfig.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMPascalCoinWalletConfig"/>
         <ComponentName Value="FRMPascalCoinWalletConfig"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit17>
-      <Unit18>
+      </Unit16>
+      <Unit17>
         <Filename Value="Units\Forms\UFRMAbout.pas"/>
         <Filename Value="Units\Forms\UFRMAbout.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMAbout"/>
         <ComponentName Value="FRMAbout"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit18>
-      <Unit19>
+      </Unit17>
+      <Unit18>
         <Filename Value="Units\Forms\UFRMOperation.pas"/>
         <Filename Value="Units\Forms\UFRMOperation.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMOperation"/>
         <ComponentName Value="FRMOperation"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit19>
-      <Unit20>
+      </Unit18>
+      <Unit19>
         <Filename Value="Units\Forms\UFRMWalletKeys.pas"/>
         <Filename Value="Units\Forms\UFRMWalletKeys.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMWalletKeys"/>
         <ComponentName Value="FRMWalletKeys"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit20>
-      <Unit21>
+      </Unit19>
+      <Unit20>
         <Filename Value="Units\Forms\UFRMNewPrivateKeyType.pas"/>
         <Filename Value="Units\Forms\UFRMNewPrivateKeyType.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMNewPrivateKeyType"/>
         <ComponentName Value="FRMNewPrivateKeyType"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit21>
-      <Unit22>
+      </Unit20>
+      <Unit21>
         <Filename Value="Units\Forms\UFRMPayloadDecoder.pas"/>
         <Filename Value="Units\Forms\UFRMPayloadDecoder.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMPayloadDecoder"/>
         <ComponentName Value="FRMPayloadDecoder"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit22>
-      <Unit23>
+      </Unit21>
+      <Unit22>
         <Filename Value="Units\Forms\UFRMNodesIp.pas"/>
         <Filename Value="Units\Forms\UFRMNodesIp.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMNodesIp"/>
         <ComponentName Value="FRMNodesIp"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
+      </Unit22>
+      <Unit23>
+        <Filename Value="Units\PascalCoin\UTCPIP.pas"/>
+        <IsPartOfProject Value="True"/>
       </Unit23>
       </Unit23>
       <Unit24>
       <Unit24>
-        <Filename Value="Units\PascalCoin\UTCPIP.pas"/>
+        <Filename Value="Units\Utils\UJSONFunctions.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit24>
       </Unit24>
       <Unit25>
       <Unit25>
-        <Filename Value="Units\Utils\UJSONFunctions.pas"/>
+        <Filename Value="Units\PascalCoin\URPC.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit25>
       </Unit25>
       <Unit26>
       <Unit26>
-        <Filename Value="Units\PascalCoin\URPC.pas"/>
+        <Filename Value="Units\PascalCoin\UPoolMining.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit26>
       </Unit26>
       <Unit27>
       <Unit27>
-        <Filename Value="Units\PascalCoin\UPoolMining.pas"/>
+        <Filename Value="Units\PascalCoin\UOpenSSL.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit27>
       </Unit27>
       <Unit28>
       <Unit28>
-        <Filename Value="Units\PascalCoin\UOpenSSL.pas"/>
+        <Filename Value="Units\PascalCoin\UOpenSSLdef.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit28>
       </Unit28>
       <Unit29>
       <Unit29>
-        <Filename Value="Units\PascalCoin\UOpenSSLdef.pas"/>
+        <Filename Value="Units\PascalCoin\UFileStorage.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit29>
       </Unit29>
       <Unit30>
       <Unit30>
-        <Filename Value="Units\PascalCoin\UFileStorage.pas"/>
+        <Filename Value="Units\PascalCoin\config.inc"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit30>
       </Unit30>
       <Unit31>
       <Unit31>
-        <Filename Value="Units\PascalCoin\config.inc"/>
+        <Filename Value="Units\PascalCoin\UAES.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit31>
       </Unit31>
       <Unit32>
       <Unit32>
-        <Filename Value="Units\PascalCoin\UAES.pas"/>
+        <Filename Value="Units\PascalCoin\UChunk.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit32>
       </Unit32>
       <Unit33>
       <Unit33>
-        <Filename Value="Units\PascalCoin\UChunk.pas"/>
-        <IsPartOfProject Value="True"/>
-      </Unit33>
-      <Unit34>
         <Filename Value="Units\Forms\UFRMAccountSelect.pas"/>
         <Filename Value="Units\Forms\UFRMAccountSelect.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMAccountSelect"/>
         <ComponentName Value="FRMAccountSelect"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit34>
-      <Unit35>
+      </Unit33>
+      <Unit34>
         <Filename Value="Units\PascalCoin\UBaseTypes.pas"/>
         <Filename Value="Units\PascalCoin\UBaseTypes.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-      </Unit35>
-      <Unit36>
+      </Unit34>
+      <Unit35>
         <Filename Value="Units\Utils\UWizard.pas"/>
         <Filename Value="Units\Utils\UWizard.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="WizardHostForm"/>
         <ComponentName Value="WizardHostForm"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit36>
-      <Unit37>
+      </Unit35>
+      <Unit36>
         <Filename Value="Units\Utils\generics.collections.pas"/>
         <Filename Value="Units\Utils\generics.collections.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Generics.Collections"/>
         <UnitName Value="Generics.Collections"/>
-      </Unit37>
-      <Unit38>
+      </Unit36>
+      <Unit37>
         <Filename Value="Units\Utils\generics.defaults.pas"/>
         <Filename Value="Units\Utils\generics.defaults.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Generics.Defaults"/>
         <UnitName Value="Generics.Defaults"/>
-      </Unit38>
-      <Unit39>
+      </Unit37>
+      <Unit38>
         <Filename Value="Units\Utils\generics.hashes.pas"/>
         <Filename Value="Units\Utils\generics.hashes.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Generics.Hashes"/>
         <UnitName Value="Generics.Hashes"/>
-      </Unit39>
-      <Unit40>
+      </Unit38>
+      <Unit39>
         <Filename Value="Units\Utils\generics.helpers.pas"/>
         <Filename Value="Units\Utils\generics.helpers.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Generics.Helpers"/>
         <UnitName Value="Generics.Helpers"/>
-      </Unit40>
-      <Unit41>
+      </Unit39>
+      <Unit40>
         <Filename Value="Units\Utils\generics.memoryexpanders.pas"/>
         <Filename Value="Units\Utils\generics.memoryexpanders.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Generics.MemoryExpanders"/>
         <UnitName Value="Generics.MemoryExpanders"/>
-      </Unit41>
-      <Unit42>
+      </Unit40>
+      <Unit41>
         <Filename Value="Units\Utils\generics.strings.pas"/>
         <Filename Value="Units\Utils\generics.strings.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Generics.Strings"/>
         <UnitName Value="Generics.Strings"/>
-      </Unit42>
-      <Unit43>
+      </Unit41>
+      <Unit42>
         <Filename Value="Units\Forms\UFRMMessages.pas"/>
         <Filename Value="Units\Forms\UFRMMessages.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMMessages"/>
         <ComponentName Value="FRMMessages"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit43>
-      <Unit44>
+      </Unit42>
+      <Unit43>
         <Filename Value="Units\Forms\UFRMNodes.pas"/>
         <Filename Value="Units\Forms\UFRMNodes.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMNodes"/>
         <ComponentName Value="FRMNodes"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit44>
-      <Unit45>
+      </Unit43>
+      <Unit44>
         <Filename Value="Units\Forms\UFRMLogs.pas"/>
         <Filename Value="Units\Forms\UFRMLogs.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMLogs"/>
         <ComponentName Value="FRMLogs"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit45>
-      <Unit46>
+      </Unit44>
+      <Unit45>
         <Filename Value="Units\Forms\UFRMOperationExplorer.pas"/>
         <Filename Value="Units\Forms\UFRMOperationExplorer.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMOperationExplorer"/>
         <ComponentName Value="FRMOperationExplorer"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit46>
-      <Unit47>
+      </Unit45>
+      <Unit46>
         <Filename Value="Units\Forms\UFRMBlockExplorer.pas"/>
         <Filename Value="Units\Forms\UFRMBlockExplorer.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMBlockExplorer"/>
         <ComponentName Value="FRMBlockExplorer"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit47>
-      <Unit48>
+      </Unit46>
+      <Unit47>
         <Filename Value="Units\Forms\UFRMPendingOperations.pas"/>
         <Filename Value="Units\Forms\UFRMPendingOperations.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMPendingOperations"/>
         <ComponentName Value="FRMPendingOperations"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-      </Unit48>
-      <Unit49>
+      </Unit47>
+      <Unit48>
         <Filename Value="Units\Forms\UFRMAccountExplorer.pas"/>
         <Filename Value="Units\Forms\UFRMAccountExplorer.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="FRMAccountExplorer"/>
         <ComponentName Value="FRMAccountExplorer"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
+      </Unit48>
+      <Unit49>
+        <Filename Value="Units\Forms\UUserInterface.pas"/>
+        <IsPartOfProject Value="True"/>
       </Unit49>
       </Unit49>
       <Unit50>
       <Unit50>
-        <Filename Value="Units\Forms\UFRMSyncronizationDialog.pas"/>
+        <Filename Value="Units\Utils\UCommonUI.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <ComponentName Value="FRMSyncronizationDialog"/>
-        <HasResources Value="True"/>
-        <ResourceBaseClass Value="Form"/>
       </Unit50>
       </Unit50>
       <Unit51>
       <Unit51>
-        <Filename Value="Units\Forms\UUserInterface.pas"/>
+        <Filename Value="Units\Utils\UCommon.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit51>
       </Unit51>
       <Unit52>
       <Unit52>
-        <Filename Value="Units\Utils\UCommonUI.pas"/>
+        <Filename Value="Units\PascalCoin\UGPUMining.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit52>
       </Unit52>
       <Unit53>
       <Unit53>
-        <Filename Value="Units\Utils\UCommon.pas"/>
+        <Filename Value="Units\PascalCoin\upcdaemon.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit53>
       </Unit53>
       <Unit54>
       <Unit54>
-        <Filename Value="Units\PascalCoin\UGPUMining.pas"/>
+        <Filename Value="Units\PascalCoin\UPoolMinerThreads.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit54>
       </Unit54>
       <Unit55>
       <Unit55>
-        <Filename Value="Units\PascalCoin\upcdaemon.pas"/>
+        <Filename Value="Units\PascalCoin\UServerApp.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit55>
       </Unit55>
       <Unit56>
       <Unit56>
-        <Filename Value="Units\PascalCoin\UPoolMinerThreads.pas"/>
+        <Filename Value="Units\PascalCoin\USha256.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit56>
       </Unit56>
       <Unit57>
       <Unit57>
-        <Filename Value="Units\PascalCoin\UServerApp.pas"/>
+        <Filename Value="Units\Utils\generics.dictionaries.inc"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit57>
       </Unit57>
       <Unit58>
       <Unit58>
-        <Filename Value="Units\PascalCoin\USha256.pas"/>
+        <Filename Value="Units\Utils\generics.dictionariesh.inc"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit58>
       </Unit58>
       <Unit59>
       <Unit59>
-        <Filename Value="Units\Utils\generics.dictionaries.inc"/>
+        <Filename Value="Units\Utils\UWizard.lfm"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit59>
       </Unit59>
       <Unit60>
       <Unit60>
-        <Filename Value="Units\Utils\generics.dictionariesh.inc"/>
+        <Filename Value="Units\Forms\UFRMAccountInfo.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
+        <HasResources Value="True"/>
       </Unit60>
       </Unit60>
       <Unit61>
       <Unit61>
-        <Filename Value="Units\Utils\UWizard.lfm"/>
+        <Filename Value="Units\Forms\UFRMMemoText.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
+        <HasResources Value="True"/>
       </Unit61>
       </Unit61>
       <Unit62>
       <Unit62>
-        <Filename Value="Units\Forms\UFRMAccountInfo.pas"/>
+        <Filename Value="Units\Forms\UFRMSaleAccounts.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <HasResources Value="True"/>
       </Unit62>
       </Unit62>
       <Unit63>
       <Unit63>
-        <Filename Value="Units\Forms\UFRMMemoText.pas"/>
+        <Filename Value="Units\Forms\UFRMWalletKeys2.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <HasResources Value="True"/>
       </Unit63>
       </Unit63>
       <Unit64>
       <Unit64>
-        <Filename Value="Units\Forms\UFRMSaleAccounts.pas"/>
+        <Filename Value="Units\Forms\UCTRLBanner.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
+        <ComponentName Value="CTRLBanner"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
       </Unit64>
       </Unit64>
       <Unit65>
       <Unit65>
-        <Filename Value="Units\Forms\UFRMWalletKeys2.pas"/>
+        <Filename Value="Units\Forms\UFRMMainForm.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
+        <ComponentName Value="FRMMainForm"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
       </Unit65>
       </Unit65>
       <Unit66>
       <Unit66>
-        <Filename Value="Units\Forms\UCTRLBanner.pas"/>
+        <Filename Value="Units\Forms\UFRMSyncronizationForm.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <ComponentName Value="CTRLBanner"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
-        <ResourceBaseClass Value="Form"/>
       </Unit66>
       </Unit66>
     </Units>
     </Units>
   </ProjectOptions>
   </ProjectOptions>

+ 3 - 2
Units/Forms/UCTRLBanner.lfm

@@ -1,7 +1,7 @@
 object CTRLBanner: TCTRLBanner
 object CTRLBanner: TCTRLBanner
-  Left = 30
+  Left = 736
   Height = 80
   Height = 80
-  Top = 122
+  Top = 26
   Width = 992
   Width = 992
   BorderIcons = []
   BorderIcons = []
   BorderStyle = bsNone
   BorderStyle = bsNone
@@ -1757,6 +1757,7 @@ object CTRLBanner: TCTRLBanner
     Top = 32
     Top = 32
     Width = 100
     Width = 100
     Anchors = [akTop, akRight]
     Anchors = [akTop, akRight]
+    Enabled = False
     ItemHeight = 15
     ItemHeight = 15
     ItemIndex = 0
     ItemIndex = 0
     Items.Strings = (
     Items.Strings = (

+ 1 - 1
Units/Forms/UFRMBlockExplorer.pas

@@ -49,7 +49,7 @@ var
   FRMBlockExplorer: TFRMBlockExplorer = nil;
   FRMBlockExplorer: TFRMBlockExplorer = nil;
 
 
 implementation
 implementation
-uses UFRMWallet, UUserInterface;
+uses UFRMMainForm, UUserInterface;
 
 
 {$R *.lfm}
 {$R *.lfm}
 procedure TFRMBlockExplorer.ebBlockChainBlockStartExit(Sender: TObject);
 procedure TFRMBlockExplorer.ebBlockChainBlockStartExit(Sender: TObject);

+ 1 - 1
Units/Forms/UFRMWallet.lfm → Units/Forms/UFRMMainForm.lfm

@@ -1,4 +1,4 @@
-object FRMWallet: TFRMWallet
+object FRMMainForm: TFRMMainForm
   Left = 125
   Left = 125
   Height = 600
   Height = 600
   Top = 58
   Top = 58

+ 51 - 57
Units/Forms/UFRMWallet.pas → Units/Forms/UFRMMainForm.pas

@@ -1,4 +1,4 @@
-unit UFRMWallet;
+unit UFRMMainForm;
 
 
 {$mode delphi}
 {$mode delphi}
 
 
@@ -21,9 +21,9 @@ uses
   ULog,
   ULog,
   UBlockChain, UNode, UGridUtils, UAccounts, Menus,
   UBlockChain, UNode, UGridUtils, UAccounts, Menus,
   UNetProtocol, UCrypto, Buttons, ActnList, UPoolMining,
   UNetProtocol, UCrypto, Buttons, ActnList, UPoolMining,
-  UCTRLBanner, UCommon, UCommonUI;
+  UCTRLBanner, UFRMSyncronizationForm, UCommon, UCommonUI;
 
 
-Const
+const
   CM_PC_FinishedLoadingDatabase = WM_USER + 1;
   CM_PC_FinishedLoadingDatabase = WM_USER + 1;
   CM_PC_WalletKeysChanged = WM_USER + 2;
   CM_PC_WalletKeysChanged = WM_USER + 2;
   CM_PC_ConnectivityChanged = WM_USER + 3;
   CM_PC_ConnectivityChanged = WM_USER + 3;
@@ -31,13 +31,13 @@ Const
 
 
 type
 type
 
 
-  { TFRMWalletMode }
+  { TFRMMainFormMode }
 
 
-  TFRMWalletMode = (wmWallet, wmSync);
+  TFRMMainFormMode = (wmWallet, wmSync);
 
 
-  { TFRMWallet }
+  { TFRMMainForm }
 
 
-  TFRMWallet = class(TApplicationForm)
+  TFRMMainForm = class(TApplicationForm)
     ilSmallIcons:TImageList;
     ilSmallIcons:TImageList;
     miSyncDialog:TMenuItem;
     miSyncDialog:TMenuItem;
     miBlockExplorer: TMenuItem;
     miBlockExplorer: TMenuItem;
@@ -94,8 +94,8 @@ type
     procedure miSeedNodesClick(Sender: TObject);
     procedure miSeedNodesClick(Sender: TObject);
   private
   private
     __FLastFooterToolBarDrawRect : TRect;  // Required for FPC bug work-around
     __FLastFooterToolBarDrawRect : TRect;  // Required for FPC bug work-around
-    FMode : TFRMWalletMode;
-    FSyncPaneControl : TForm;
+    FMode : TFRMMainFormMode;
+    FSyncControl : TFRMSyncronizationForm;
     procedure CM_FinishedLoadingDatabase(var Msg: TMessage); message CM_PC_FinishedLoadingDatabase;
     procedure CM_FinishedLoadingDatabase(var Msg: TMessage); message CM_PC_FinishedLoadingDatabase;
     procedure CM_WalletChanged(var Msg: TMessage); message CM_PC_WalletKeysChanged;
     procedure CM_WalletChanged(var Msg: TMessage); message CM_PC_WalletKeysChanged;
     procedure CM_ConnectivityChanged(var Msg: TMessage); message CM_PC_ConnectivityChanged;
     procedure CM_ConnectivityChanged(var Msg: TMessage); message CM_PC_ConnectivityChanged;
@@ -103,14 +103,14 @@ type
     procedure OnConnectivityChanged(Sender: TObject);
     procedure OnConnectivityChanged(Sender: TObject);
     procedure OnWalletChanged(Sender: TObject);
     procedure OnWalletChanged(Sender: TObject);
   protected
   protected
-    property SyncPaneControl : TForm read FSyncPaneControl write FSyncPaneControl;
     procedure RefreshWalletLockIcon;
     procedure RefreshWalletLockIcon;
     procedure RefreshConnectivityIcon;
     procedure RefreshConnectivityIcon;
     procedure ActivateFirstTime; override;
     procedure ActivateFirstTime; override;
     Function ForceMining : Boolean; virtual;
     Function ForceMining : Boolean; virtual;
-    procedure SetMode(AMode: TFRMWalletMode);
+    procedure SetMode(AMode: TFRMMainFormMode);
   public
   public
-    property Mode : TFRMWalletMode read FMode write SetMode;
+    property SyncControl : TFRMSyncronizationForm read FSyncControl;
+    property Mode : TFRMMainFormMode read FMode write SetMode;
     procedure OnFinishedLoadingDatabase;
     procedure OnFinishedLoadingDatabase;
   end;
   end;
 
 
@@ -118,7 +118,7 @@ implementation
 
 
 {$R *.lfm}
 {$R *.lfm}
 
 
-uses LCLIntf, UUserInterface, UThread, UOpTransaction, UWizard, UFRMSyncronizationDialog;
+uses LCLIntf, UUserInterface, UThread, UOpTransaction, UWizard;
 
 
 const
 const
   CT_FOOTER_TOOLBAR_LEFT_PADDING = 8;
   CT_FOOTER_TOOLBAR_LEFT_PADDING = 8;
@@ -128,16 +128,18 @@ const
 
 
 {%region Form life-cycle }
 {%region Form life-cycle }
 
 
-procedure TFRMWallet.FormCreate(Sender: TObject);
+procedure TFRMMainForm.FormCreate(Sender: TObject);
 begin
 begin
   tbStatusToolBar.Parent := sbStatusBar;
   tbStatusToolBar.Parent := sbStatusBar;
   __FLastFooterToolBarDrawRect := TRect.Empty;
   __FLastFooterToolBarDrawRect := TRect.Empty;
   CloseAction := caNone; // Will handle terminate in separate method
   CloseAction := caNone; // Will handle terminate in separate method
   FMode := wmSync;
   FMode := wmSync;
+  FSyncControl := TFRMSyncronizationForm.Create(self);
   paLogoPanel.AddControlDockCenter(TCTRLBanner.Create(Self));
   paLogoPanel.AddControlDockCenter(TCTRLBanner.Create(Self));
+  paSyncPanel.AddControlDockCenter(FSyncControl);
 end;
 end;
 
 
-procedure TFRMWallet.FormCloseQuery(Sender: TObject; var CanClose: boolean);
+procedure TFRMMainForm.FormCloseQuery(Sender: TObject; var CanClose: boolean);
 begin
 begin
   case TUserInterface.AskQuestion(Self, 'Quit PascalCoin', 'Are you sure you want to quit? Select ''No'' to run in background.', [mbCancel, mbNo, mbYes]) of
   case TUserInterface.AskQuestion(Self, 'Quit PascalCoin', 'Are you sure you want to quit? Select ''No'' to run in background.', [mbCancel, mbNo, mbYes]) of
     mbYes: begin
     mbYes: begin
@@ -152,16 +154,16 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TFRMWallet.FormClose(Sender: TObject; var CloseAction: TCloseAction);
+procedure TFRMMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
 begin
 begin
 end;
 end;
 
 
-procedure TFRMWallet.CM_Terminate(var Msg: TMessage);
+procedure TFRMMainForm.CM_Terminate(var Msg: TMessage);
 begin
 begin
   TUserInterface.ExitApplication;
   TUserInterface.ExitApplication;
 end;
 end;
 
 
-procedure TFRMWallet.ActivateFirstTime;
+procedure TFRMMainForm.ActivateFirstTime;
 begin
 begin
   TUserInterface.WalletKeys.OnChanged.Add(OnWalletChanged);
   TUserInterface.WalletKeys.OnChanged.Add(OnWalletChanged);
   TNetData.NetData.OnConnectivityChanged.Add(OnConnectivityChanged);
   TNetData.NetData.OnConnectivityChanged.Add(OnConnectivityChanged);
@@ -169,7 +171,7 @@ begin
   RefreshConnectivityIcon;
   RefreshConnectivityIcon;
 end;
 end;
 
 
-procedure TFRMWallet.FormDestroy(Sender: TObject);
+procedure TFRMMainForm.FormDestroy(Sender: TObject);
 begin
 begin
   TUserInterface.WalletKeys.OnChanged.Remove(OnWalletChanged);
   TUserInterface.WalletKeys.OnChanged.Remove(OnWalletChanged);
   TNetData.NetData.OnConnectivityChanged.Remove(OnConnectivityChanged);
   TNetData.NetData.OnConnectivityChanged.Remove(OnConnectivityChanged);
@@ -179,12 +181,12 @@ end;
 
 
 {%region Form methods}
 {%region Form methods}
 
 
-function TFRMWallet.ForceMining: Boolean;
+function TFRMMainForm.ForceMining: Boolean;
 begin
 begin
   Result := false;
   Result := false;
 end;
 end;
 
 
-procedure TFRMWallet.RefreshWalletLockIcon;
+procedure TFRMMainForm.RefreshWalletLockIcon;
 begin
 begin
   if NOT TUserInterface.WalletKeys.HasPassword then begin
   if NOT TUserInterface.WalletKeys.HasPassword then begin
     { No password has been set }
     { No password has been set }
@@ -204,7 +206,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TFRMWallet.RefreshConnectivityIcon;
+procedure TFRMMainForm.RefreshConnectivityIcon;
 const
 const
   ImageIndexConst : array[false..true] of integer=(1,0);
   ImageIndexConst : array[false..true] of integer=(1,0);
   HintConst : array[false..true] of String =('Network is inactive. Click activate.','Network is active. Click to deactivate.');
   HintConst : array[false..true] of String =('Network is inactive. Click activate.','Network is active. Click to deactivate.');
@@ -213,7 +215,7 @@ begin
   tbtnConnectivity.Hint :=  HintConst[TNetData.NetData.NetConnectionsActive];
   tbtnConnectivity.Hint :=  HintConst[TNetData.NetData.NetConnectionsActive];
 end;
 end;
 
 
-procedure TFRMWallet.SetMode(AMode: TFRMWalletMode);
+procedure TFRMMainForm.SetMode(AMode: TFRMMainFormMode);
 var nestedForm : TForm;
 var nestedForm : TForm;
 begin
 begin
   case AMode of
   case AMode of
@@ -223,19 +225,11 @@ begin
       FMode := AMode;
       FMode := AMode;
     end;
     end;
     wmSync: begin
     wmSync: begin
-      if not paSyncPanel.ContainsControl(TUserInterface.SyncDialog) then begin
-        paSyncPanel.RemoveAllControls(false);
-        TUserInterface.SyncDialog.Top := 0;
-        TUserInterface.SyncDialog.Left := 0;
-        TUserInterface.SyncDialog.Width := paSyncPanel.Width;
-        TUserInterface.SyncDialog.Height := paSyncPanel.Height;
-        paSyncPanel.AddControlDockCenter(TUserInterface.SyncDialog);
-      end;
       paSyncPanel.Visible := true;
       paSyncPanel.Visible := true;
       paWalletPanel.Visible := false;;
       paWalletPanel.Visible := false;;
       FMode := AMode;
       FMode := AMode;
     end;
     end;
-    else raise Exception.Create('[Internal Error] - TFRMWallet.SetMode: unsupported mode passed');
+    else raise Exception.Create('[Internal Error] - TFRMMainForm.SetMode: unsupported mode passed');
   end;
   end;
 end;
 end;
 
 
@@ -243,7 +237,7 @@ end;
 
 
 {%region Handlers: Form}
 {%region Handlers: Form}
 
 
-procedure TFRMWallet.FormResize(Sender: TObject);
+procedure TFRMMainForm.FormResize(Sender: TObject);
 begin
 begin
   // Adjust status bar so that footer toolbar panel remains fixed size (by expanding out previous panel)
   // Adjust status bar so that footer toolbar panel remains fixed size (by expanding out previous panel)
    sbStatusBar.Panels[2].Width := ClipValue(sbStatusBar.Width - (sbStatusBar.Panels[0].Width + sbStatusBar.Panels[1].Width + tbStatusToolBar.Width  + CT_FOOTER_TOOLBAR_RIGHT_PADDING) - CT_FOOTER_TOOLBAR_LEFT_PADDING, 0, sbStatusBar.Width);
    sbStatusBar.Panels[2].Width := ClipValue(sbStatusBar.Width - (sbStatusBar.Panels[0].Width + sbStatusBar.Panels[1].Width + tbStatusToolBar.Width  + CT_FOOTER_TOOLBAR_RIGHT_PADDING) - CT_FOOTER_TOOLBAR_LEFT_PADDING, 0, sbStatusBar.Width);
@@ -253,34 +247,34 @@ end;
 
 
 {%region Handlers: Wallet, Network}
 {%region Handlers: Wallet, Network}
 
 
-procedure TFRMWallet.CM_FinishedLoadingDatabase(var Msg: TMessage);
+procedure TFRMMainForm.CM_FinishedLoadingDatabase(var Msg: TMessage);
 begin
 begin
   Self.Enabled:=true;
   Self.Enabled:=true;
 end;
 end;
 
 
-procedure TFRMWallet.OnFinishedLoadingDatabase;
+procedure TFRMMainForm.OnFinishedLoadingDatabase;
 begin
 begin
   // Ensure handled in UI thread
   // Ensure handled in UI thread
   PostMessage(Self.Handle,CM_PC_FinishedLoadingDatabase,0,0);
   PostMessage(Self.Handle,CM_PC_FinishedLoadingDatabase,0,0);
 end;
 end;
 
 
-procedure TFRMWallet.CM_WalletChanged(var Msg: TMessage);
+procedure TFRMMainForm.CM_WalletChanged(var Msg: TMessage);
 begin
 begin
   RefreshWalletLockIcon;
   RefreshWalletLockIcon;
 end;
 end;
 
 
-procedure TFRMWallet.OnWalletChanged(Sender: TObject);
+procedure TFRMMainForm.OnWalletChanged(Sender: TObject);
 begin
 begin
   // Ensure handled in UI thread
   // Ensure handled in UI thread
   PostMessage(Self.Handle,CM_PC_WalletKeysChanged,0,0);
   PostMessage(Self.Handle,CM_PC_WalletKeysChanged,0,0);
 end;
 end;
 
 
-procedure TFRMWallet.CM_ConnectivityChanged(var Msg: TMessage);
+procedure TFRMMainForm.CM_ConnectivityChanged(var Msg: TMessage);
 begin
 begin
   RefreshConnectivityIcon;
   RefreshConnectivityIcon;
 end;
 end;
 
 
-procedure TFRMWallet.OnConnectivityChanged(Sender: TObject);
+procedure TFRMMainForm.OnConnectivityChanged(Sender: TObject);
 begin
 begin
   // Ensure handled in UI thread
   // Ensure handled in UI thread
   PostMessage(Self.Handle,CM_PC_ConnectivityChanged,0,0);
   PostMessage(Self.Handle,CM_PC_ConnectivityChanged,0,0);
@@ -290,72 +284,72 @@ end;
 
 
 {%region Handlers: Menu Items }
 {%region Handlers: Menu Items }
 
 
-procedure TFRMWallet.miMessagesClick(Sender: TObject);
+procedure TFRMMainForm.miMessagesClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowMessagesForm;
   TUserInterface.ShowMessagesForm;
 end;
 end;
 
 
-procedure TFRMWallet.miSyncDialogClick(Sender:TObject);
+procedure TFRMMainForm.miSyncDialogClick(Sender:TObject);
 begin
 begin
   TUserInterface.ShowSyncDialog;
   TUserInterface.ShowSyncDialog;
 end;
 end;
 
 
-procedure TFRMWallet.miNodesClick(Sender: TObject);
+procedure TFRMMainForm.miNodesClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowNodesForm;
   TUserInterface.ShowNodesForm;
 end;
 end;
 
 
-procedure TFRMWallet.miPendingOperationsClick(Sender: TObject);
+procedure TFRMMainForm.miPendingOperationsClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowPendingOperations
   TUserInterface.ShowPendingOperations
 end;
 end;
 
 
-procedure TFRMWallet.miLogsClick(Sender: TObject);
+procedure TFRMMainForm.miLogsClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowLogsForm;
   TUserInterface.ShowLogsForm;
 end;
 end;
 
 
-procedure TFRMWallet.miOperationsExplorerClick(Sender: TObject);
+procedure TFRMMainForm.miOperationsExplorerClick(Sender: TObject);
 begin
 begin
  TUserInterface.ShowOperationsExplorer;
  TUserInterface.ShowOperationsExplorer;
 end;
 end;
 
 
-procedure TFRMWallet.miBlockExplorerClick(Sender: TObject);
+procedure TFRMMainForm.miBlockExplorerClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowBlockExplorer;
   TUserInterface.ShowBlockExplorer;
 end;
 end;
 
 
-procedure TFRMWallet.miAccountExplorerClick(Sender: TObject);
+procedure TFRMMainForm.miAccountExplorerClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowAccountExplorer
   TUserInterface.ShowAccountExplorer
 end;
 end;
 
 
-procedure TFRMWallet.miSeedNodesClick(Sender: TObject);
+procedure TFRMMainForm.miSeedNodesClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowSeedNodesDialog(Self);
   TUserInterface.ShowSeedNodesDialog(Self);
 end;
 end;
 
 
-procedure TFRMWallet.miAboutClick(Sender: TObject);
+procedure TFRMMainForm.miAboutClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowAboutBox(Self);
   TUserInterface.ShowAboutBox(Self);
 end;
 end;
 
 
-procedure TFRMWallet.MiCloseClick(Sender: TObject);
+procedure TFRMMainForm.MiCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;
 end;
 end;
 
 
-procedure TFRMWallet.paLogoPanelClick(Sender: TObject);
+procedure TFRMMainForm.paLogoPanelClick(Sender: TObject);
 begin
 begin
 
 
 end;
 end;
 
 
-procedure TFRMWallet.miOptionsClick(Sender: TObject);
+procedure TFRMMainForm.miOptionsClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowOptionsDialog(Self);
   TUserInterface.ShowOptionsDialog(Self);
 end;
 end;
 
 
-procedure TFRMWallet.miPrivateKeysClick(Sender: TObject);
+procedure TFRMMainForm.miPrivateKeysClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowPrivateKeysDialog(Self);
   TUserInterface.ShowPrivateKeysDialog(Self);
 end;
 end;
@@ -364,7 +358,7 @@ end;
 
 
 {%region Handlers: Footer Toolbar}
 {%region Handlers: Footer Toolbar}
 
 
-procedure TFRMWallet.tbtnWalletLockClick(Sender:TObject);
+procedure TFRMMainForm.tbtnWalletLockClick(Sender:TObject);
 begin
 begin
   if NOT TUserInterface.WalletKeys.HasPassword then begin
   if NOT TUserInterface.WalletKeys.HasPassword then begin
      { no password has been set }
      { no password has been set }
@@ -378,18 +372,18 @@ begin
    end;
    end;
 end;
 end;
 
 
-procedure TFRMWallet.tbtnConnectivityClick(Sender:TObject);
+procedure TFRMMainForm.tbtnConnectivityClick(Sender:TObject);
 begin
 begin
   // Toggle connectivity (icons update with event handler)
   // Toggle connectivity (icons update with event handler)
   TNetData.NetData.NetConnectionsActive := NOT TNetData.NetData.NetConnectionsActive;
   TNetData.NetData.NetConnectionsActive := NOT TNetData.NetData.NetConnectionsActive;
 end;
 end;
 
 
-procedure TFRMWallet.tbtnSyncClick(Sender: TObject);
+procedure TFRMMainForm.tbtnSyncClick(Sender: TObject);
 begin
 begin
   TUserInterface.ShowSyncDialog;
   TUserInterface.ShowSyncDialog;
 end;
 end;
 
 
-procedure TFRMWallet.sbStatusBarDrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect);
+procedure TFRMMainForm.sbStatusBarDrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect);
 begin
 begin
   if __FLastFooterToolBarDrawRect = Rect then exit; // avoid FPC bug: triggers infinite draw refresh on windows
   if __FLastFooterToolBarDrawRect = Rect then exit; // avoid FPC bug: triggers infinite draw refresh on windows
   if Panel = sbStatusBar.Panels[3] then
   if Panel = sbStatusBar.Panels[3] then

+ 1 - 1
Units/Forms/UFRMMessages.pas

@@ -19,7 +19,7 @@ uses
   LCLIntf, LCLType,
   LCLIntf, LCLType,
   SysUtils, Classes, Graphics, Controls, Forms,
   SysUtils, Classes, Graphics, Controls, Forms,
   Dialogs, StdCtrls, Menus, UCommonUI,
   Dialogs, StdCtrls, Menus, UCommonUI,
-  UNode, UNetProtocol, UCrypto, UFRMWallet,UConst;
+  UNode, UNetProtocol, UCrypto, UFRMMainForm,UConst;
 
 
 type
 type
 
 

+ 25 - 7
Units/Forms/UFRMSyncronizationDialog.lfm → Units/Forms/UFRMSyncronizationForm.lfm

@@ -1,12 +1,12 @@
-object FRMSyncronizationDialog: TFRMSyncronizationDialog
-  Left = 208
-  Height = 212
-  Top = 104
+object FRMSyncronizationForm: TFRMSyncronizationForm
+  Left = 322
+  Height = 240
+  Top = 5
   Width = 636
   Width = 636
   BorderIcons = []
   BorderIcons = []
   BorderStyle = bsNone
   BorderStyle = bsNone
   Caption = 'Synchronization'
   Caption = 'Synchronization'
-  ClientHeight = 212
+  ClientHeight = 240
   ClientWidth = 636
   ClientWidth = 636
   LCLVersion = '1.6.4.0'
   LCLVersion = '1.6.4.0'
   object Label8: TLabel
   object Label8: TLabel
@@ -230,10 +230,10 @@ object FRMSyncronizationDialog: TFRMSyncronizationDialog
     ShowHint = True
     ShowHint = True
   end
   end
   object lblCurrentDifficultyCaption1: TLabel
   object lblCurrentDifficultyCaption1: TLabel
-    Left = 38
+    Left = 16
     Height = 15
     Height = 15
     Top = 176
     Top = 176
-    Width = 113
+    Width = 135
     Alignment = taRightJustify
     Alignment = taRightJustify
     AutoSize = False
     AutoSize = False
     Caption = 'Protocol Version'
     Caption = 'Protocol Version'
@@ -247,4 +247,22 @@ object FRMSyncronizationDialog: TFRMSyncronizationDialog
     Caption = '000'
     Caption = '000'
     ParentColor = False
     ParentColor = False
   end
   end
+  object lblCurrentDifficultyCaption2: TLabel
+    Left = 16
+    Height = 15
+    Top = 200
+    Width = 135
+    Alignment = taRightJustify
+    AutoSize = False
+    Caption = 'Net Protocol Version'
+    ParentColor = False
+  end
+  object lblNetProtocolVersion: TLabel
+    Left = 160
+    Height = 15
+    Top = 200
+    Width = 18
+    Caption = '000'
+    ParentColor = False
+  end
 end
 end

+ 17 - 15
Units/Forms/UFRMSyncronizationDialog.pas → Units/Forms/UFRMSyncronizationForm.pas

@@ -1,4 +1,4 @@
-unit UFRMSyncronizationDialog;
+unit UFRMSyncronizationForm;
 
 
 {$mode delphi}
 {$mode delphi}
 
 
@@ -21,12 +21,14 @@ uses
 
 
 type
 type
 
 
-  { TFRMSyncronizationDialog }
+  { TFRMSyncronizationForm }
 
 
-  TFRMSyncronizationDialog = class(TApplicationForm)
+  TFRMSyncronizationForm = class(TApplicationForm)
     btnOpenWallet: TButton;
     btnOpenWallet: TButton;
     Label16: TLabel;
     Label16: TLabel;
     Label4: TLabel;
     Label4: TLabel;
+    lblCurrentDifficultyCaption2: TLabel;
+    lblNetProtocolVersion: TLabel;
     lblTotalAccountsLabel: TLabel;
     lblTotalAccountsLabel: TLabel;
     Label8: TLabel;
     Label8: TLabel;
     lblBlocksFound: TLabel;
     lblBlocksFound: TLabel;
@@ -69,7 +71,7 @@ uses UNetProtocol,UTime,UConst, UUserInterface;
 
 
 {%region Methods}
 {%region Methods}
 
 
-procedure TFRMSyncronizationDialog.UpdateNodeStatus;
+procedure TFRMSyncronizationForm.UpdateNodeStatus;
 Var status : AnsiString;
 Var status : AnsiString;
 begin
 begin
   if not TUserInterface.Started then exit;
   if not TUserInterface.Started then exit;
@@ -96,15 +98,14 @@ begin
       lblNodeStatus.Caption := status;
       lblNodeStatus.Caption := status;
     end;
     end;
   end;
   end;
-
-// this rewrite   -- TODO
-//  If Assigned(FBackgroundPanel) then begin
-//    FBackgroundPanel.Font.Color:=lblNodeStatus.Font.Color;
-//    FBackgroundPanel.Caption:='Please wait until finished: '+lblNodeStatus.Caption;
-  //end;
+  lblProtocolVersion.Caption := Format('%d (%d)', [TUserInterface.Node.Bank.SafeBox.CurrentProtocol,CT_BlockChain_Protocol_Available]);
+  lblNetProtocolVersion.Caption := Format('%d (%d)', [CT_NetProtocol_Version, CT_NetProtocol_Available]);
+  if NOT btnOpenWallet.Enabled then begin
+    lblNodeStatus.Caption := 'Please wait until finished - ' + lblNodeStatus.Caption;
+  end;
 end;
 end;
 
 
-procedure TFRMSyncronizationDialog.UpdateBlockChainState;
+procedure TFRMSyncronizationForm.UpdateBlockChainState;
 Var
 Var
   f, favg : real;
   f, favg : real;
 begin
 begin
@@ -157,7 +158,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TFRMSyncronizationDialog.SetMinersBlocksFound(const Value: Integer);
+procedure TFRMSyncronizationForm.SetMinersBlocksFound(const Value: Integer);
 begin
 begin
   FMinersBlocksFound := Value;
   FMinersBlocksFound := Value;
   lblBlocksFound.Caption := Inttostr(Value);
   lblBlocksFound.Caption := Inttostr(Value);
@@ -165,21 +166,22 @@ begin
   else lblBlocksFound.Font.Color := clDkGray;
   else lblBlocksFound.Font.Color := clDkGray;
 end;
 end;
 
 
-procedure TFRMSyncronizationDialog.OnFinishedLoadingDatabase;
+procedure TFRMSyncronizationForm.OnFinishedLoadingDatabase;
 begin
 begin
   btnOpenWallet.Enabled:=true;
   btnOpenWallet.Enabled:=true;
+  TUserInterface.ShowWallet;
 end;
 end;
 
 
 {%endregion}
 {%endregion}
 
 
 {%region Handlers: widgets }
 {%region Handlers: widgets }
 
 
-procedure TFRMSyncronizationDialog.lblReceivedMessagesClick(Sender:TObject);
+procedure TFRMSyncronizationForm.lblReceivedMessagesClick(Sender:TObject);
 begin
 begin
   TUserInterface.ShowMessagesForm;
   TUserInterface.ShowMessagesForm;
 end;
 end;
 
 
-procedure TFRMSyncronizationDialog.btnOpenWalletClick(Sender:TObject);
+procedure TFRMSyncronizationForm.btnOpenWalletClick(Sender:TObject);
 begin
 begin
   TUserInterface.ShowWallet;
   TUserInterface.ShowWallet;
 end;
 end;

+ 59 - 74
Units/Forms/UUserInterface.pas

@@ -19,7 +19,7 @@ uses
   SysUtils, Classes, Forms, Controls, Windows, ExtCtrls, Dialogs,
   SysUtils, Classes, Forms, Controls, Windows, ExtCtrls, Dialogs,
   UCommonUI, UBlockChain, UAccounts, UNode, UWalletKeys, UAppParams, UConst, UFolderHelper, UGridUtils, URPC, UPoolMining,
   UCommonUI, UBlockChain, UAccounts, UNode, UWalletKeys, UAppParams, UConst, UFolderHelper, UGridUtils, URPC, UPoolMining,
   ULog, UThread, UNetProtocol, UCrypto,
   ULog, UThread, UNetProtocol, UCrypto,
-  UFRMWallet, UFRMSyncronizationDialog, UFRMAccountExplorer, UFRMOperationExplorer, UFRMPendingOperations, UFRMOperation,
+  UFRMMainForm, UFRMSyncronizationForm, UFRMAccountExplorer, UFRMOperationExplorer, UFRMPendingOperations, UFRMOperation,
   UFRMLogs, UFRMMessages, UFRMNodes, UFRMBlockExplorer, UFRMWalletKeys;
   UFRMLogs, UFRMMessages, UFRMNodes, UFRMBlockExplorer, UFRMWalletKeys;
 
 
 type
 type
@@ -39,7 +39,6 @@ type
       FUILock : TPCCriticalSection; static;
       FUILock : TPCCriticalSection; static;
 
 
       // Subforms
       // Subforms
-      FSyncronizationDialog : TFRMSyncronizationDialog; static;
       FAccountExplorer : TFRMAccountExplorer; static;
       FAccountExplorer : TFRMAccountExplorer; static;
       FPendingOperationForm : TFRMPendingOperations; static;
       FPendingOperationForm : TFRMPendingOperations; static;
       FOperationsExplorerForm : TFRMOperationExplorer; static;
       FOperationsExplorerForm : TFRMOperationExplorer; static;
@@ -57,7 +56,7 @@ type
       // Local fields
       // Local fields
       FStarted : boolean; static;
       FStarted : boolean; static;
       FAppParams : TAppParams; static;
       FAppParams : TAppParams; static;
-      FWallet : TFRMWallet; static;
+      FMainForm : TFRMMainForm; static;
       FIsActivated : Boolean; static;
       FIsActivated : Boolean; static;
       FUpdating : Boolean; static;
       FUpdating : Boolean; static;
       FLog : TLog; static;
       FLog : TLog; static;
@@ -80,8 +79,8 @@ type
       class procedure SetStatusBar1Text(const text : AnsiString); static;
       class procedure SetStatusBar1Text(const text : AnsiString); static;
       class procedure SetStatusBar2Text(const text : AnsiString); static;
       class procedure SetStatusBar2Text(const text : AnsiString); static;
       class procedure SetMessagesNotificationText(const text : AnsiString); static;
       class procedure SetMessagesNotificationText(const text : AnsiString); static;
-      class procedure SetWalletMode(AMode: TFRMWalletMode); static;
-      class function GetWalletMode : TFRMWalletMode; static;
+      class procedure SetMainFormMode(AMode: TFRMMainFormMode); static;
+      class function GetMainFormMode : TFRMMainFormMode; static;
 
 
       // Aux methods
       // Aux methods
       class procedure FinishedLoadingDatabase;
       class procedure FinishedLoadingDatabase;
@@ -114,8 +113,7 @@ type
       class property AppParams : TAppParams read FAppParams;
       class property AppParams : TAppParams read FAppParams;
       class property PoolMiningServer : TPoolMiningServer read FPoolMiningServer;
       class property PoolMiningServer : TPoolMiningServer read FPoolMiningServer;
       class property WalletKeys : TWalletKeysExt read FWalletKeys;
       class property WalletKeys : TWalletKeysExt read FWalletKeys;
-      class property WalletMode : TFRMWalletMode read GetWalletMode write SetWalletMode;
-      class property SyncDialog : TFRMSyncronizationDialog read FSyncronizationDialog;
+      class property MainFormMode : TFRMMainFormMode read GetMainFormMode write SetMainFormMode;
       class property StatusBar0Text : AnsiString read FStatusBar0Text write SetStatusBar0Text;
       class property StatusBar0Text : AnsiString read FStatusBar0Text write SetStatusBar0Text;
       class property StatusBar1Text : AnsiString read FStatusBar1Text write SetStatusBar1Text;
       class property StatusBar1Text : AnsiString read FStatusBar1Text write SetStatusBar1Text;
       class property StatusBar2Text : AnsiString read FStatusBar2Text write SetStatusBar2Text;
       class property StatusBar2Text : AnsiString read FStatusBar2Text write SetStatusBar2Text;
@@ -195,21 +193,20 @@ begin
     FMessagesNotificationText := '';
     FMessagesNotificationText := '';
 
 
     // Create root form and dependent components
     // Create root form and dependent components
-    FWallet := mainForm as TFRMWallet;
-    FWallet.CloseAction := caNone;     // wallet is destroyed on ExitApplication
-    if (FWallet = nil)
+    FMainForm := mainForm as TFRMMainForm;
+    FMainForm.CloseAction := caNone;     // wallet is destroyed on ExitApplication
+    if (FMainForm = nil)
       then raise Exception.Create('Main form is not TWallet');
       then raise Exception.Create('Main form is not TWallet');
-    FSyncronizationDialog := TFRMSyncronizationDialog.Create(FWallet);;
 
 
-    FTrayIcon := TTrayIcon.Create(FWallet);
+    FTrayIcon := TTrayIcon.Create(FMainForm);
     FTrayIcon.OnDblClick := OnTrayIconDblClick;
     FTrayIcon.OnDblClick := OnTrayIconDblClick;
     FTrayIcon.Visible := true;
     FTrayIcon.Visible := true;
-    FTrayIcon.Hint := FWallet.Caption;
+    FTrayIcon.Hint := FMainForm.Caption;
     FTrayIcon.BalloonTitle := 'Restoring the window.';
     FTrayIcon.BalloonTitle := 'Restoring the window.';
     FTrayIcon.BalloonHint := 'Double click the system tray icon to restore Pascal Coin';
     FTrayIcon.BalloonHint := 'Double click the system tray icon to restore Pascal Coin';
     FTrayIcon.BalloonFlags := bfInfo;
     FTrayIcon.BalloonFlags := bfInfo;
     FTrayIcon.Show;
     FTrayIcon.Show;
-    FTimerUpdateStatus := TTimer.Create(FWallet);
+    FTimerUpdateStatus := TTimer.Create(FMainForm);
     FTimerUpdateStatus.Enabled := false;
     FTimerUpdateStatus.Enabled := false;
     FDisplayedStartupSyncDialog:=false;
     FDisplayedStartupSyncDialog:=false;
 
 
@@ -222,12 +219,12 @@ begin
       raise Exception.Create('Cannot create dir: '+TFolderHelper.GetPascalCoinDataFolder);
       raise Exception.Create('Cannot create dir: '+TFolderHelper.GetPascalCoinDataFolder);
 
 
     // Open AppParams
     // Open AppParams
-    TUserInterface.FAppParams := TAppParams.Create(FWallet);
+    TUserInterface.FAppParams := TAppParams.Create(FMainForm);
     TUserInterface.FAppParams.FileName := TFolderHelper.GetPascalCoinDataFolder+PathDelim+'AppParams.prm';
     TUserInterface.FAppParams.FileName := TFolderHelper.GetPascalCoinDataFolder+PathDelim+'AppParams.prm';
 
 
     // Open Wallet
     // Open Wallet
     Try
     Try
-      FWalletKeys := TWalletKeysExt.Create(FWallet);  // On Activate, this will be populated
+      FWalletKeys := TWalletKeysExt.Create(FMainForm);  // On Activate, this will be populated
       FWalletKeys.WalletFileName := TFolderHelper.GetPascalCoinDataFolder+PathDelim+'WalletKeys.dat';
       FWalletKeys.WalletFileName := TFolderHelper.GetPascalCoinDataFolder+PathDelim+'WalletKeys.dat';
     Except
     Except
       On E:Exception do begin
       On E:Exception do begin
@@ -248,7 +245,7 @@ begin
     FNode.PeerCache := FAppParams.ParamByName[CT_PARAM_PeerCache].GetAsString('')+';'+CT_Discover_IPs;
     FNode.PeerCache := FAppParams.ParamByName[CT_PARAM_PeerCache].GetAsString('')+';'+CT_Discover_IPs;
 
 
     // Subscribe to Node events (TODO refactor with FNotifyEvents)
     // Subscribe to Node events (TODO refactor with FNotifyEvents)
-    FNodeNotifyEvents := TNodeNotifyEvents.Create(FWallet);
+    FNodeNotifyEvents := TNodeNotifyEvents.Create(FMainForm);
     FNodeNotifyEvents.OnBlocksChanged := OnBlocksChanged;
     FNodeNotifyEvents.OnBlocksChanged := OnBlocksChanged;
     FNodeNotifyEvents.OnNodeMessageEvent :=  OnNodeMessageEvent;
     FNodeNotifyEvents.OnNodeMessageEvent :=  OnNodeMessageEvent;
 
 
@@ -283,13 +280,13 @@ begin
     LoadAppParams;
     LoadAppParams;
 
 
     // open the sync dialog
     // open the sync dialog
-    FSyncronizationDialog.UpdateBlockChainState;   //TODO fix this work-flow
+    FMainForm.SyncControl.UpdateBlockChainState;   //TODO fix this work-flow
     RefreshConnectionStatusDisplay;
     RefreshConnectionStatusDisplay;
 
 
     // Setup tray icon
     // Setup tray icon
 
 
     // Disable wallet form
     // Disable wallet form
-    FWallet.Enabled:=false;
+    FMainForm.Enabled:=false;
     FStarted := true;
     FStarted := true;
   Except
   Except
     On E:Exception do begin
     On E:Exception do begin
@@ -301,7 +298,7 @@ begin
 
 
 
 
   // Notify accounts again?
   // Notify accounts again?
-  OnAccountsChanged(FWallet);
+  OnAccountsChanged(FMainForm);
 
 
   // Refresh status bar since may not have been displayed
   // Refresh status bar since may not have been displayed
   SetStatusBar0Text(FStatusBar0Text);
   SetStatusBar0Text(FStatusBar0Text);
@@ -332,9 +329,8 @@ begin
 
 
     // Destroys root form, non-modal forms and all their attached components
     // Destroys root form, non-modal forms and all their attached components
     step := 'Destroying UI graph';
     step := 'Destroying UI graph';
-    FWallet.Destroy;
-    FWallet := nil;  // destroyed by FWallet
-    FSyncronizationDialog := nil;  // destroyed by FWallet
+    FMainForm.Destroy;
+    FMainForm := nil;  // destroyed by FWallet
     FAccountExplorer := nil;  // destroyed by FWallet
     FAccountExplorer := nil;  // destroyed by FWallet
     FPendingOperationForm := nil;  // destroyed by FWallet
     FPendingOperationForm := nil;  // destroyed by FWallet
     FOperationsExplorerForm := nil;  // destroyed by FWallet
     FOperationsExplorerForm := nil;  // destroyed by FWallet
@@ -392,8 +388,8 @@ end;
 
 
 class procedure TUserInterface.RunInBackground;
 class procedure TUserInterface.RunInBackground;
 begin
 begin
-  FWallet.Hide();
-  FWallet.WindowState := wsMinimized;
+  FMainForm.Hide();
+  FMainForm.WindowState := wsMinimized;
   FTimerUpdateStatus.Enabled := false;
   FTimerUpdateStatus.Enabled := false;
   FTrayIcon.Visible := True;
   FTrayIcon.Visible := True;
   FTrayIcon.ShowBalloonHint;
   FTrayIcon.ShowBalloonHint;
@@ -403,8 +399,8 @@ class procedure TUserInterface.RunInForeground;
 begin
 begin
   FTrayIcon.Visible := False;
   FTrayIcon.Visible := False;
   FTimerUpdateStatus.Enabled := true;
   FTimerUpdateStatus.Enabled := true;
-  FWallet.Show();
-  FWallet.WindowState := wsNormal;
+  FMainForm.Show();
+  FMainForm.WindowState := wsNormal;
   Application.BringToFront();
   Application.BringToFront();
 end;
 end;
 
 
@@ -417,10 +413,10 @@ begin
   FNode.Operations.AccountKey := GetAccountKeyForMiner;
   FNode.Operations.AccountKey := GetAccountKeyForMiner;
   FPoolMiningServer.Active := FAppParams.ParamByName[CT_PARAM_JSONRPCMinerServerActive].GetAsBoolean(true);
   FPoolMiningServer.Active := FAppParams.ParamByName[CT_PARAM_JSONRPCMinerServerActive].GetAsBoolean(true);
   FPoolMiningServer.OnMiningServerNewBlockFound := OnMiningServerNewBlockFound;
   FPoolMiningServer.OnMiningServerNewBlockFound := OnMiningServerNewBlockFound;
-  FSyncronizationDialog.OnFinishedLoadingDatabase;
-  FWallet.OnFinishedLoadingDatabase;
+  FMainForm.SyncControl.OnFinishedLoadingDatabase;
+  FMainForm.OnFinishedLoadingDatabase;
   // Refresh UI
   // Refresh UI
-  OnAccountsChanged(FWallet);
+  OnAccountsChanged(FMainForm);
 end;
 end;
 
 
 {%endregion}
 {%endregion}
@@ -604,7 +600,7 @@ begin
   try
   try
     FUILock.Acquire;
     FUILock.Acquire;
     if not Assigned(FAccountExplorer) then begin
     if not Assigned(FAccountExplorer) then begin
-       FAccountExplorer := TFRMAccountExplorer.Create(FWallet);
+       FAccountExplorer := TFRMAccountExplorer.Create(FMainForm);
        FAccountExplorer.CloseAction:= caFree;
        FAccountExplorer.CloseAction:= caFree;
        FAccountExplorer.OnDestroyed:= Self.OnSubFormDestroyed;
        FAccountExplorer.OnDestroyed:= Self.OnSubFormDestroyed;
        FAccountExplorer.SetSubFormCoordinate(FAccountExplorer);
        FAccountExplorer.SetSubFormCoordinate(FAccountExplorer);
@@ -621,10 +617,10 @@ begin
   try
   try
     FUILock.Acquire;
     FUILock.Acquire;
     if not Assigned(FBlockExplorerForm) then begin
     if not Assigned(FBlockExplorerForm) then begin
-       FBlockExplorerForm := TFRMBlockExplorer.Create(FWallet);
+       FBlockExplorerForm := TFRMBlockExplorer.Create(FMainForm);
        FBlockExplorerForm.CloseAction:= caFree;
        FBlockExplorerForm.CloseAction:= caFree;
        FBlockExplorerForm.OnDestroyed:= Self.OnSubFormDestroyed;
        FBlockExplorerForm.OnDestroyed:= Self.OnSubFormDestroyed;
-       FWallet.SetSubFormCoordinate(FBlockExplorerForm);
+       FMainForm.SetSubFormCoordinate(FBlockExplorerForm);
     end;
     end;
     FBlockExplorerForm.Show;
     FBlockExplorerForm.Show;
   finally
   finally
@@ -637,10 +633,10 @@ begin
   try
   try
     FUILock.Acquire;
     FUILock.Acquire;
     if not Assigned(FOperationsExplorerForm) then begin
     if not Assigned(FOperationsExplorerForm) then begin
-      FOperationsExplorerForm := TFRMOperationExplorer.Create(FWallet);
+      FOperationsExplorerForm := TFRMOperationExplorer.Create(FMainForm);
       FOperationsExplorerForm.CloseAction:= caFree;
       FOperationsExplorerForm.CloseAction:= caFree;
       FOperationsExplorerForm.OnDestroyed:= Self.OnSubFormDestroyed;
       FOperationsExplorerForm.OnDestroyed:= Self.OnSubFormDestroyed;
-      FWallet.SetSubFormCoordinate(FOperationsExplorerForm);
+      FMainForm.SetSubFormCoordinate(FOperationsExplorerForm);
     end;
     end;
     FOperationsExplorerForm.Show;
     FOperationsExplorerForm.Show;
   finally
   finally
@@ -653,10 +649,10 @@ begin
   try
   try
     FUILock.Acquire;
     FUILock.Acquire;
     if not Assigned(FPendingOperationForm) then begin
     if not Assigned(FPendingOperationForm) then begin
-      FPendingOperationForm := TFRMPendingOperations.Create(FWallet);
+      FPendingOperationForm := TFRMPendingOperations.Create(FMainForm);
       FPendingOperationForm.CloseAction:= caFree;
       FPendingOperationForm.CloseAction:= caFree;
       FPendingOperationForm.OnDestroyed:= Self.OnSubFormDestroyed;
       FPendingOperationForm.OnDestroyed:= Self.OnSubFormDestroyed;
-      FWallet.SetSubFormCoordinate(FPendingOperationForm);
+      FMainForm.SetSubFormCoordinate(FPendingOperationForm);
     end;
     end;
     FPendingOperationForm.Show;
     FPendingOperationForm.Show;
   finally
   finally
@@ -669,10 +665,10 @@ begin
   try
   try
     FUILock.Acquire;
     FUILock.Acquire;
     if not Assigned(FMessagesForm) then begin
     if not Assigned(FMessagesForm) then begin
-       FMessagesForm := TFRMMessages.Create(FWallet);
+       FMessagesForm := TFRMMessages.Create(FMainForm);
        FMessagesForm.CloseAction:= caFree;
        FMessagesForm.CloseAction:= caFree;
        FMessagesForm.OnDestroyed:= Self.OnSubFormDestroyed;
        FMessagesForm.OnDestroyed:= Self.OnSubFormDestroyed;
-       FWallet.SetSubFormCoordinate(FMessagesForm);
+       FMainForm.SetSubFormCoordinate(FMessagesForm);
     end;
     end;
     FMessagesForm.Show;
     FMessagesForm.Show;
   finally
   finally
@@ -685,10 +681,10 @@ begin
   try
   try
     FUILock.Acquire;
     FUILock.Acquire;
     if not Assigned(FNodesForm) then begin
     if not Assigned(FNodesForm) then begin
-       FNodesForm := TFRMNodes.Create(FWallet);
+       FNodesForm := TFRMNodes.Create(FMainForm);
        FNodesForm.CloseAction:= caFree;
        FNodesForm.CloseAction:= caFree;
        FNodesForm.OnDestroyed:= Self.OnSubFormDestroyed;
        FNodesForm.OnDestroyed:= Self.OnSubFormDestroyed;
-       FWallet.SetSubFormCoordinate(FNodesForm);
+       FMainForm.SetSubFormCoordinate(FNodesForm);
     end;
     end;
     FNodesForm.Show;
     FNodesForm.Show;
   finally
   finally
@@ -701,10 +697,10 @@ begin
   try
   try
     FUILock.Acquire;
     FUILock.Acquire;
     if not Assigned(FLogsForm) then begin
     if not Assigned(FLogsForm) then begin
-       FLogsForm := TFRMLogs.Create(FWallet);
+       FLogsForm := TFRMLogs.Create(FMainForm);
        FLogsForm.CloseAction:= caFree;
        FLogsForm.CloseAction:= caFree;
        FLogsForm.OnDestroyed:= Self.OnSubFormDestroyed;
        FLogsForm.OnDestroyed:= Self.OnSubFormDestroyed;
-       FWallet.SetSubFormCoordinate(FLogsForm);
+       FMainForm.SetSubFormCoordinate(FLogsForm);
     end;
     end;
     FLogsForm.Show;
     FLogsForm.Show;
   finally
   finally
@@ -715,24 +711,13 @@ end;
 class procedure TUserInterface.ShowWallet;
 class procedure TUserInterface.ShowWallet;
 begin
 begin
   // TODO - VALIDATION HERE
   // TODO - VALIDATION HERE
-  FWallet.Mode := wmWallet;
+  FMainForm.Mode := wmWallet;
   // else ShowError('', 'Wallet is currently unavailable, please wait until processing is finished');
   // else ShowError('', 'Wallet is currently unavailable, please wait until processing is finished');
 end;
 end;
 
 
 class procedure TUserInterface.ShowSyncDialog;
 class procedure TUserInterface.ShowSyncDialog;
 begin
 begin
-  try
-    FUILock.Acquire;
-    if not Assigned(FSyncronizationDialog) then
-      FSyncronizationDialog := TFRMSyncronizationDialog.Create(FWallet);
-
-    if FDisplayedStartupSyncDialog = true then begin
-       FDisplayedStartupSyncDialog := false;
-    end;
-    FWallet.Mode := wmSync;
-  finally
-    FUILock.Release;
-  end;
+  FMainForm.Mode := wmSync;
 end;
 end;
 
 
 {%endregion}
 {%endregion}
@@ -787,8 +772,8 @@ var errors : AnsiString;
 begin
 begin
   FUILock.Acquire;
   FUILock.Acquire;
   Try
   Try
-    FSyncronizationDialog.UpdateNodeStatus;
-    OnNetStatisticsChanged(FWallet);
+    FMainForm.SyncControl.UpdateNodeStatus;
+    OnNetStatisticsChanged(FMainForm);
     if Assigned(FNode) then begin
     if Assigned(FNode) then begin
       if FNode.IsBlockChainValid(errors) then begin
       if FNode.IsBlockChainValid(errors) then begin
         StatusBar2Text := Format('Last account time:%s',
         StatusBar2Text := Format('Last account time:%s',
@@ -850,9 +835,9 @@ begin
   NotifyConfigChanged;
   NotifyConfigChanged;
 end;
 end;
 
 
-class procedure TUserInterface.SetWalletMode(AMode: TFRMWalletMode);
+class procedure TUserInterface.SetMainFormMode(AMode: TFRMMainFormMode);
 begin
 begin
-  if AMode <> FWallet.Mode then
+  if AMode <> FMainForm.Mode then
     case AMode of
     case AMode of
       wmWallet: ShowWallet;
       wmWallet: ShowWallet;
       wmSync: ShowSyncDialog;
       wmSync: ShowSyncDialog;
@@ -860,9 +845,9 @@ begin
     end;
     end;
 end;
 end;
 
 
-class function TUserInterface.GetWalletMode : TFRMWalletMode;
+class function TUserInterface.GetMainFormMode : TFRMMainFormMode;
 begin
 begin
-  Result := FWallet.Mode;
+  Result := FMainForm.Mode;
 end;
 end;
 
 
 class procedure TUserInterface.NotifyConfigChanged;
 class procedure TUserInterface.NotifyConfigChanged;
@@ -904,31 +889,31 @@ end;
 class procedure TUserInterface.SetStatusBar0Text(const text : AnsiString); static;
 class procedure TUserInterface.SetStatusBar0Text(const text : AnsiString); static;
 begin
 begin
   FStatusBar0Text := text;
   FStatusBar0Text := text;
-  if Assigned(FWallet) then
-    FWallet.sbStatusBar.Panels[0].Text := FStatusBar0Text;
+  if Assigned(FMainForm) then
+    FMainForm.sbStatusBar.Panels[0].Text := FStatusBar0Text;
 end;
 end;
 
 
 class procedure TUserInterface.SetStatusBar1Text(const text : AnsiString); static;
 class procedure TUserInterface.SetStatusBar1Text(const text : AnsiString); static;
 begin
 begin
   FStatusBar1Text := text;
   FStatusBar1Text := text;
-  if Assigned(FWallet) then
-    FWallet.sbStatusBar.Panels[1].Text := text;
+  if Assigned(FMainForm) then
+    FMainForm.sbStatusBar.Panels[1].Text := text;
 end;
 end;
 
 
 class procedure TUserInterface.SetStatusBar2Text(const text : AnsiString); static;
 class procedure TUserInterface.SetStatusBar2Text(const text : AnsiString); static;
 begin
 begin
   FStatusBar2Text := text;
   FStatusBar2Text := text;
-  if Assigned(FWallet) then
-    FWallet.sbStatusBar.Panels[2].Text := text;
+  if Assigned(FMainForm) then
+    FMainForm.sbStatusBar.Panels[2].Text := text;
 end;
 end;
 
 
 class procedure TUserInterface.SetMessagesNotificationText(const text : AnsiString); static;
 class procedure TUserInterface.SetMessagesNotificationText(const text : AnsiString); static;
 begin
 begin
   FMessagesNotificationText := text;
   FMessagesNotificationText := text;
-  if Assigned(FSyncronizationDialog) then begin
+  if Assigned(FMainForm.SyncControl) then begin
     if (text = '') then
     if (text = '') then
-      FSyncronizationDialog.lblReceivedMessages.Visible := false;
-    FSyncronizationDialog.lblReceivedMessages.Caption := text;
+      FMainForm.SyncControl.lblReceivedMessages.Visible := false;
+    FMainForm.SyncControl.lblReceivedMessages.Caption := text;
   end;
   end;
 end;
 end;
 
 
@@ -954,7 +939,7 @@ begin
     try
     try
       if Assigned(FAccountExplorer) then
       if Assigned(FAccountExplorer) then
         FAccountExplorer.RefreshAccountsGrid(false);
         FAccountExplorer.RefreshAccountsGrid(false);
-      FSyncronizationDialog.UpdateBlockChainState;
+      FMainForm.SyncControl.UpdateBlockChainState;
     except
     except
       On E:Exception do begin
       On E:Exception do begin
         E.Message := 'Error at OnNewAccount '+E.Message;
         E.Message := 'Error at OnNewAccount '+E.Message;
@@ -1060,8 +1045,8 @@ class procedure TUserInterface.OnTimerUpdateStatusTimer(Sender: TObject);
 begin
 begin
   Try
   Try
     RefreshConnectionStatusDisplay;
     RefreshConnectionStatusDisplay;
-    FSyncronizationDialog.UpdateBlockChainState;
-    FSyncronizationDialog.UpdateNodeStatus;
+    FMainForm.SyncControl.UpdateBlockChainState;
+    FMainForm.SyncControl.UpdateNodeStatus;
   Except
   Except
     On E:Exception do begin
     On E:Exception do begin
       E.Message := 'Exception at TimerUpdate '+E.ClassName+': '+E.Message;
       E.Message := 'Exception at TimerUpdate '+E.ClassName+': '+E.Message;

+ 2 - 0
Units/Utils/UCommonUI.pas

@@ -41,6 +41,8 @@ type
       property CloseAction : TCloseAction read FCloseAction write FCloseAction;
       property CloseAction : TCloseAction read FCloseAction write FCloseAction;
       property OnActivateFirstTime : TNotifyEvent read FActivateFirstTime write FActivateFirstTime;
       property OnActivateFirstTime : TNotifyEvent read FActivateFirstTime write FActivateFirstTime;
       property OnDestroyed : TNotifyEvent read FDestroyed write FDestroyed;
       property OnDestroyed : TNotifyEvent read FDestroyed write FDestroyed;
+    public
+      property ActivationCount : UInt32 read FActivatedCount;
   end;
   end;
 
 
   { TWinControlHelper }
   { TWinControlHelper }