Răsfoiți Sursa

GUI: wallet unlocking from account explorer now uses correct facade

Herman Schoenfeld 7 ani în urmă
părinte
comite
29b7577505

+ 12 - 12
Units/Forms/UFRMAccountExplorer.lfm

@@ -3,6 +3,7 @@ object FRMAccountExplorer: TFRMAccountExplorer
   Height = 451
   Top = 94
   Width = 868
+  ActiveControl = cbMyPrivateKeys
   Caption = 'Accounts Explorer'
   ClientHeight = 451
   ClientWidth = 868
@@ -11,11 +12,10 @@ object FRMAccountExplorer: TFRMAccountExplorer
   OnCreate = FormCreate
   OnDestroy = FormDestroy
   Position = poOwnerFormCenter
-  LCLVersion = '1.8.0.6'
   Visible = False
   object Splitter1: TSplitter
     Left = 380
-    Height = 365
+    Height = 385
     Top = 66
     Width = 5
   end
@@ -141,17 +141,17 @@ object FRMAccountExplorer: TFRMAccountExplorer
   end
   object pnlAccounts: TPanel
     Left = 0
-    Height = 365
+    Height = 385
     Top = 66
     Width = 380
     Align = alLeft
     BevelOuter = bvNone
-    ClientHeight = 365
+    ClientHeight = 385
     ClientWidth = 380
     TabOrder = 1
     object dgAccounts: TDrawGrid
       Left = 0
-      Height = 331
+      Height = 351
       Top = 0
       Width = 380
       Align = alClient
@@ -165,7 +165,7 @@ object FRMAccountExplorer: TFRMAccountExplorer
     object pnlAccountsInfo: TPanel
       Left = 0
       Height = 34
-      Top = 331
+      Top = 351
       Width = 380
       Align = alBottom
       BevelOuter = bvNone
@@ -246,7 +246,7 @@ object FRMAccountExplorer: TFRMAccountExplorer
   end
   object pcAccountsOptions: TPageControl
     Left = 385
-    Height = 365
+    Height = 385
     Top = 66
     Width = 483
     ActivePage = tsMultiSelectAccounts
@@ -274,12 +274,12 @@ object FRMAccountExplorer: TFRMAccountExplorer
     end
     object tsMultiSelectAccounts: TTabSheet
       Caption = 'Selected accounts for massive operations'
-      ClientHeight = 337
+      ClientHeight = 357
       ClientWidth = 475
       ImageIndex = 1
       object dgSelectedAccounts: TDrawGrid
         Left = 41
-        Height = 280
+        Height = 300
         Top = 31
         Width = 325
         Align = alLeft
@@ -317,7 +317,7 @@ object FRMAccountExplorer: TFRMAccountExplorer
       object pnlSelectedAccountsBottom: TPanel
         Left = 0
         Height = 26
-        Top = 311
+        Top = 331
         Width = 475
         Align = alBottom
         BevelOuter = bvNone
@@ -359,12 +359,12 @@ object FRMAccountExplorer: TFRMAccountExplorer
       end
       object pnlSelectedAccountsLeft: TPanel
         Left = 0
-        Height = 280
+        Height = 300
         Top = 31
         Width = 41
         Align = alLeft
         BevelOuter = bvNone
-        ClientHeight = 280
+        ClientHeight = 300
         ClientWidth = 41
         TabOrder = 3
         object sbSelectedAccountsAdd: TSpeedButton

+ 0 - 4
Units/Forms/UFRMAccountExplorer.pas

@@ -528,8 +528,6 @@ procedure TFRMAccountExplorer.sbSelectedAccountsAddAllClick(Sender: TObject);
 Var lsource,ltarget : TOrderedCardinalList;
   i : Integer;
 begin
-//  with FRMWallet do
-//  begin
   lsource := FAccountsGrid.LockAccountsList;
   Try
     ltarget := FAccountsSelectedGrid.LockAccountsList;
@@ -544,8 +542,6 @@ begin
   Finally
     FAccountsGrid.UnlockAccountsList;
   End;
-
-//  end;
 end;
 
 procedure TFRMAccountExplorer.sbSelectedAccountsAddClick(Sender: TObject);

+ 5 - 4
Units/Forms/UFRMOperation.lfm

@@ -3,6 +3,7 @@ object FRMOperation: TFRMOperation
   Height = 493
   Top = 245
   Width = 608
+  ActiveControl = ebSenderAccount
   BorderIcons = [biSystemMenu]
   BorderStyle = bsSingle
   Caption = 'New Operation'
@@ -15,7 +16,7 @@ object FRMOperation: TFRMOperation
   OnCreate = FormCreate
   OnDestroy = FormDestroy
   Position = poOwnerFormCenter
-  LCLVersion = '1.6.0.4'
+  Visible = False
   object lblAccountCaption: TLabel
     Left = 25
     Height = 13
@@ -97,8 +98,8 @@ object FRMOperation: TFRMOperation
     Height = 367
     Top = 72
     Width = 556
-    ActivePage = tsOperation
-    TabIndex = 0
+    ActivePage = tsGlobalError
+    TabIndex = 1
     TabOrder = 1
     object tsOperation: TTabSheet
       Caption = 'Operation'
@@ -905,7 +906,7 @@ object FRMOperation: TFRMOperation
     end
     object tsGlobalError: TTabSheet
       Caption = 'Notification'
-      ClientHeight = 325
+      ClientHeight = 341
       ClientWidth = 548
       ImageIndex = 1
       TabVisible = False

+ 5 - 10
Units/Forms/UFRMOperation.pas

@@ -174,7 +174,7 @@ type
 implementation
 
 uses
-  UECIES, UConst, UOpTransaction, UAES, UFRMWalletKeys;
+  UECIES, UConst, UOpTransaction, UAES, UFRMWalletKeys, UUserInterface;
 
 {$R *.lfm}
 
@@ -381,17 +381,12 @@ begin
 end;
 
 procedure TFRMOperation.bbPasswordClick(Sender: TObject);
-Var s : String;
+Var
   errors : AnsiString;
 begin
-  if FWalletKeys.IsValidPassword then begin
-  end else begin
-    s := '';
-    Repeat
-      if Not InputQuery('Wallet password','Enter wallet password',s) then exit;
-      FWalletKeys.WalletPassword := s;
-    Until FWalletKeys.IsValidPassword;
-    SetWalletKeys(WalletKeys);
+  if NOT FWalletKeys.IsValidPassword then begin
+    TUserInterface.UnlockWallet(Self);
+    SetWalletKeys(TWallet.Keys);
     UpdateOperationOptions(errors);
   end;
 end;