Browse Source

minor UI fixes.

Ugochukwu Mmaduekwe 7 years ago
parent
commit
1ef3fa98bc

+ 3 - 1
src/gui/wizards/operations/UWIZChangeKey.pas

@@ -33,7 +33,7 @@ type
 implementation
 
 uses
-  UCoreUtils,
+  UWallet,
   UWIZOperationSelected,
   UWIZChangeKey_SelectOption,
   UWIZOperationConfirmation;
@@ -78,6 +78,8 @@ begin
   end;
 
   Result := TWIZOperationsHelper.ExecuteChangeKey(Model.Account.SelectedAccounts, Model.Signer.SignerAccount, LPublicKey, Model.Fee.SingleOperationFee, Model.Payload.PayloadEncryptionMode, IIF(Model.Payload.HasPayload, Model.Payload.Content, ''), Model.Payload.Password, message);
+  if TWIZOperationsModel.RelockOnFinish then
+   TWallet.Keys.LockWallet;
 end;
 
 function TWIZChangeKeyWizard.CancelRequested(out message: ansistring): boolean;

+ 3 - 1
src/gui/wizards/operations/UWIZEnlistAccountForSale.pas

@@ -34,7 +34,7 @@ type
 implementation
 
 uses
-  UCoreUtils,
+  UWallet,
   UWIZOperationSelected,
   UWIZEnlistAccountForSale_SelectOption,
   UWIZEnlistAccountForSale_EnterSeller,
@@ -83,6 +83,8 @@ begin
   end;
 
   Result := TWIZOperationsHelper.ExecuteEnlistAccountForSale(Model.Account.SelectedAccounts, Model.Signer.SignerAccount, Model.EnlistAccountForSale.SellerAccount, LPublicKey, Model.Fee.SingleOperationFee, Model.EnlistAccountForSale.SalePrice, Model.EnlistAccountForSale.LockedUntilBlock, Model.EnlistAccountForSale.AccountSaleMode, Model.Payload.PayloadEncryptionMode, IIF(Model.Payload.HasPayload, Model.Payload.Content, ''), Model.Payload.Password, message);
+  if TWIZOperationsModel.RelockOnFinish then
+   TWallet.Keys.LockWallet;
 end;
 
 function TWIZEnlistAccountForSaleWizard.CancelRequested(out message: ansistring): boolean;

+ 3 - 0
src/gui/wizards/operations/UWIZOperation.pas

@@ -131,6 +131,7 @@ type
 
     private
       FExecuteOperationType: TExecuteOperationType;
+      FRelockOnFinish: Boolean; static;
       FAccount: TAccountModel;
       FSendPASC: TSendPASCModel;
       FChangeKey: TChangeKeyModel;
@@ -152,6 +153,7 @@ type
       property Fee: TFeeModel read FFee;
       property Signer: TSignerModel read FSigner;
       property Payload: TPayloadModel read FPayload;
+      class property RelockOnFinish: Boolean read FRelockOnFinish write FRelockOnFinish;
   end;
 
 
@@ -180,6 +182,7 @@ constructor TWIZOperationsModel.Create(AOwner: TComponent; AType: TWIZOperations
 begin
   inherited Create(AOwner);
   FExecuteOperationType := AType;
+  FRelockOnFinish := False;
   FAccount := TAccountModel.Create(Self);
   FSendPASC := TSendPASCModel.Create(Self);
   FChangeKey := TChangeKeyModel.Create(Self);

+ 6 - 2
src/gui/wizards/operations/UWIZOperationConfirmation.lfm

@@ -31,9 +31,11 @@ object WIZOperationConfirmation: TWIZOperationConfirmation
       Left = 8
       Height = 15
       Top = 2
-      Width = 84
+      Width = 88
       Caption = 'Signer Account:'
+      Font.Style = [fsBold]
       ParentColor = False
+      ParentFont = False
     end
     object lblSgnAcc: TLabel
       Left = 112
@@ -68,9 +70,11 @@ object WIZOperationConfirmation: TWIZOperationConfirmation
       Left = 280
       Height = 15
       Top = 2
-      Width = 109
+      Width = 115
       Caption = 'Beneficiary Account:'
+      Font.Style = [fsBold]
       ParentColor = False
+      ParentFont = False
     end
     object lblBenAcc: TLabel
       Left = 408

+ 5 - 3
src/gui/wizards/operations/UWIZOperationConfirmation.pas

@@ -165,8 +165,10 @@ var
   LLocked: boolean;
 begin
   LLocked := (not TWallet.Keys.HasPassword) or (not TWallet.Keys.IsValidPassword);
-  if LLocked then
+  if LLocked then begin
     TUserInterface.UnlockWallet(Self);
+    TWIZOperationsModel.RelockOnFinish := LLocked;
+  end;
 end;
 
 { TOperationConfirmationDataSource }
@@ -230,14 +232,14 @@ begin
         case Model.ChangeKey.ChangeKeyMode of
           akaTransferAccountOwnership:
           begin
-            Result := TAccountComp.AccountPublicKeyExport(Model.TransferAccount.AccountKey);
+            Result := TAccountComp.AccountPublicKeyExport(LDestinationAccountKey);
             Result := TCellRenderers.OperationShortHash(Result);
           end;
           akaChangeAccountPrivateKey:
           begin
             Result := IIF(
               Model.ChangeAccountPrivateKey.NewWalletKey.Name = '',
-              TCrypto.ToHexaString(TAccountComp.AccountKey2RawString(Model.ChangeAccountPrivateKey.NewWalletKey.AccountKey)),
+              TCrypto.ToHexaString(TAccountComp.AccountKey2RawString(LDestinationAccountKey)),
               Model.ChangeAccountPrivateKey.NewWalletKey.Name
               );
             if not Assigned(Model.ChangeAccountPrivateKey.NewWalletKey.PrivateKey) then

+ 3 - 1
src/gui/wizards/operations/UWIZSendPASC.pas

@@ -33,7 +33,7 @@ type
 implementation
 
 uses
-  UCoreUtils,
+  UWallet,
   UWIZOperationSelected,
   UWIZSendPASC_EnterRecipient,
   UWIZSendPASC_EnterQuantity,
@@ -69,6 +69,8 @@ function TWIZSendPASCWizard.FinishRequested(out message: ansistring): boolean;
 begin
   // Execute the PASC Sending here
   Result := TWIZOperationsHelper.ExecuteSendPASC(Model.Account.SelectedAccounts, Model.SendPASC.DestinationAccount, Model.Signer.SignerAccount, Model.SendPASC.SingleAmountToSend, Model.Fee.SingleOperationFee, Model.SendPASC.SendPASCMode, Model.Payload.PayloadEncryptionMode, IIF(Model.Payload.HasPayload, Model.Payload.Content, ''), Model.Payload.Password, message);
+  if TWIZOperationsModel.RelockOnFinish then
+  TWallet.Keys.LockWallet;
 end;
 
 function TWIZSendPASCWizard.CancelRequested(out message: ansistring): boolean;

+ 1 - 1
src/gui/wizards/operations/UWIZSendPASC_EnterQuantity.pas

@@ -62,8 +62,8 @@ begin
   end
   else
   begin
-    edtAmt.Text := '';
     edtAmt.Enabled := True;
+    edtAmt.Text := IIF(Model.SendPASC.SingleAmountToSend = 0, '', TAccountComp.FormatMoney(Model.SendPASC.SingleAmountToSend));
     Model.SendPASC.SendPASCMode := akaSpecifiedAmount;
   end;
   Model.Payload.HasPayload := IIF(chkAttachPayload.Checked, True, False);