Browse Source

implemented some UX changes and fixes as specified by herman.

Ugochukwu Mmaduekwe 7 years ago
parent
commit
a275eb10cf

+ 0 - 1
src/gui/wizards/operations/UWIZChangeKey_ConfirmAccount.lfm

@@ -6,7 +6,6 @@ object WIZChangeKey_ConfirmAccount: TWIZChangeKey_ConfirmAccount
   Caption = 'ChangeKey_ConfirmAccount'
   ClientHeight = 261
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
   object gpChangeKey: TGroupBox
     Left = 4

+ 27 - 11
src/gui/wizards/operations/UWIZChangeKey_Confirmation.lfm

@@ -1,28 +1,27 @@
 object WIZChangeKey_Confirmation: TWIZChangeKey_Confirmation
   Left = 0
-  Height = 253
+  Height = 320
   Top = 0
-  Width = 429
+  Width = 511
   Caption = 'WIZChangeKey_Confirmation'
-  ClientHeight = 253
-  ClientWidth = 429
-  LCLVersion = '1.8.2.0'
+  ClientHeight = 320
+  ClientWidth = 511
   Visible = False
   object GroupBox1: TGroupBox
     Left = 10
-    Height = 232
+    Height = 299
     Top = 8
-    Width = 408
+    Width = 490
     Anchors = [akTop, akLeft, akRight, akBottom]
     Caption = 'Confirm Change Key Transaction'
-    ClientHeight = 212
-    ClientWidth = 404
+    ClientHeight = 279
+    ClientWidth = 486
     TabOrder = 0
     object paGrid: TPanel
       Left = 8
-      Height = 152
+      Height = 123
       Top = 48
-      Width = 382
+      Width = 464
       Anchors = [akTop, akLeft, akRight, akBottom]
       BevelOuter = bvNone
       Caption = 'GRID PANEL'
@@ -44,5 +43,22 @@ object WIZChangeKey_Confirmation: TWIZChangeKey_Confirmation
       Caption = 'Signer Account:'
       ParentColor = False
     end
+    object lblPayload: TLabel
+      Left = 8
+      Height = 15
+      Top = 172
+      Width = 42
+      Caption = 'Payload'
+      ParentColor = False
+    end
+    object mmoPayload: TMemo
+      Left = 8
+      Height = 82
+      Top = 192
+      Width = 464
+      Enabled = False
+      ScrollBars = ssBoth
+      TabOrder = 1
+    end
   end
 end

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

@@ -26,7 +26,9 @@ type
   TWIZChangeKey_Confirmation = class(TWizardForm<TWIZOperationsModel>)
     GroupBox1: TGroupBox;
     Label1: TLabel;
+    lblPayload: TLabel;
     lblSgnAcc: TLabel;
+    mmoPayload: TMemo;
     paGrid: TPanel;
   private
     FChangeKeyGrid: TVisualGrid;
@@ -106,6 +108,7 @@ begin
   FChangeKeyGrid.DataSource := Data;
   paGrid.AddControlDockCenter(FChangeKeyGrid);
   lblSgnAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.Signer.SignerAccount.account);
+  mmoPayload.Lines.Text := Model.Payload.Content;
 end;
 
 procedure TWIZChangeKey_Confirmation.OnNext;

+ 0 - 1
src/gui/wizards/operations/UWIZChangeKey_EnterKey.lfm

@@ -7,7 +7,6 @@ object WIZChangeKey_EnterKey: TWIZChangeKey_EnterKey
   Caption = 'ChangeKey_EnterKey'
   ClientHeight = 253
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
   object gbNewPublicKey: TGroupBox
     Left = 16

+ 35 - 10
src/gui/wizards/operations/UWIZChangeKey_EnterKey.pas

@@ -33,6 +33,7 @@ type
     mmoNewPrivateKey: TMemo;
 
   public
+    procedure OnPresent; override;
     procedure OnNext; override;
     function Validate(out message: ansistring): boolean; override;
   end;
@@ -47,32 +48,57 @@ uses
 
 { TWIZChangeKey_EnterKey }
 
+procedure TWIZChangeKey_EnterKey.OnPresent;
+begin
+  if Length(Model.Account.SelectedAccounts) > 1 then
+  begin
+    chkChooseFee.Checked := True;
+    chkChooseFee.Enabled := False;
+  end;
+  mmoNewPrivateKey.Clear;
+  mmoNewPrivateKey.SetFocus;
+end;
+
 procedure TWIZChangeKey_EnterKey.OnNext;
 begin
+  //Model.Payload.HasPayload := chkAttachPayload.Checked;
+  //
+  //if chkChooseFee.Checked then
+  //  UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZChangeKey_Confirmation])
+  //else
+  //begin
+  //  Model.Fee.SingleOperationFee := TSettings.DefaultFee;
+  //  if Model.Payload.HasPayload then
+  //    UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZChangeKey_Confirmation])
+  //  else
+  //    UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZChangeKey_Confirmation]);
+  //end;
+
+
   Model.Payload.HasPayload := chkAttachPayload.Checked;
 
   if chkChooseFee.Checked then
-  begin
-    UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZChangeKey_Confirmation]);
-  end
+    UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZChangeKey_Confirmation])
   else
   begin
     Model.Fee.SingleOperationFee := TSettings.DefaultFee;
     if Model.Payload.HasPayload then
-    begin
-      UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZChangeKey_Confirmation]);
-    end
+      UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZChangeKey_Confirmation])
+    else if Length(Model.Account.SelectedAccounts) > 1 then
+      UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZChangeKey_Confirmation])
     else
     begin
-      UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZChangeKey_Confirmation]);
+      Model.Signer.SignerAccount := Model.Account.SelectedAccounts[0];
+      Model.Signer.OperationSigningMode := akaPrimary;
     end;
   end;
+
 end;
 
 function TWIZChangeKey_EnterKey.Validate(out message: ansistring): boolean;
 var
   tempAccountKey: TAccountKey;
-  i: Integer;
+  i: integer;
 begin
   Result := True;
   if not TAccountComp.AccountKeyFromImport(mmoNewPrivateKey.Lines.Text,
@@ -82,7 +108,6 @@ begin
     Exit;
   end;
   for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
-  begin
     if TAccountComp.EqualAccountKeys(Model.Account.SelectedAccounts[i].accountInfo.accountKey,
       tempAccountKey) then
     begin
@@ -90,7 +115,7 @@ begin
       message := 'New key is same as current key';
       Exit;
     end;
-  end;
+
   Model.TransferAccount.AccountKey := tempAccountKey;
 end;
 

+ 1 - 1
src/gui/wizards/operations/UWIZChangeKey_SelectKey.lfm

@@ -3,10 +3,10 @@ object WIZChangeKey_SelectKey: TWIZChangeKey_SelectKey
   Height = 253
   Top = 0
   Width = 429
+  ActiveControl = cbNewPrivateKey
   Caption = 'WIZChangeKey_SelectKey'
   ClientHeight = 253
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
   object gbNewPrivateKey: TGroupBox
     Left = 16

+ 30 - 15
src/gui/wizards/operations/UWIZChangeKey_SelectKey.pas

@@ -83,17 +83,13 @@ begin
     cbNewPrivateKey.Items.Clear;
     cbNewPrivateKey.Items.Add('Select Private Key');
     if not Assigned(TWallet.Keys) then
-    begin
       Exit;
-    end;
     for i := 0 to TWallet.Keys.Count - 1 do
     begin
       wk := TWallet.Keys.Key[i];
       s := IIF(wk.Name = '', TCrypto.ToHexaString(TAccountComp.AccountKey2RawString(wk.AccountKey)), wk.Name);
       if not Assigned(wk.PrivateKey) then
-      begin
         s := s + '(*)';
-      end;
       cbNewPrivateKey.Items.AddObject(s, TObject(i));
     end;
     cbNewPrivateKey.Sorted := True;
@@ -105,8 +101,17 @@ end;
 procedure TWIZChangeKey_SelectKey.OnPresent;
 begin
   UpdateWalletKeys();
-  cbNewPrivateKey.ItemIndex := Model.ChangeAccountPrivateKey.SelectedIndex;
+  if TWallet.Keys.Count = 1 then
+    cbNewPrivateKey.ItemIndex := 1
+  else
+    cbNewPrivateKey.ItemIndex := Model.ChangeAccountPrivateKey.SelectedIndex;
   cbNewPrivateKeyChange(Self);
+  if Length(Model.Account.SelectedAccounts) > 1 then
+  begin
+    chkChooseFee.Checked := True;
+    chkChooseFee.Enabled := False;
+  end;
+  cbNewPrivateKey.SetFocus;
 end;
 
 procedure TWIZChangeKey_SelectKey.OnNext;
@@ -114,23 +119,34 @@ begin
   Model.ChangeAccountPrivateKey.SelectedIndex := cbNewPrivateKey.ItemIndex;
   Model.ChangeAccountPrivateKey.NewWalletKey := TWallet.Keys.Key[PtrInt(cbNewPrivateKey.Items.Objects[cbNewPrivateKey.ItemIndex])];
   Model.Payload.HasPayload := chkAttachPayload.Checked;
+  //
+  //if chkChooseFee.Checked then
+  //  UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZChangeKey_Confirmation])
+  //else
+  //begin
+  //  Model.Fee.SingleOperationFee := TSettings.DefaultFee;
+  //  if Model.Payload.HasPayload then
+  //    UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZChangeKey_Confirmation])
+  //  else
+  //    UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZChangeKey_Confirmation]);
+  //end;
 
   if chkChooseFee.Checked then
-  begin
-    UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZChangeKey_Confirmation]);
-  end
+    UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZChangeKey_Confirmation])
   else
   begin
     Model.Fee.SingleOperationFee := TSettings.DefaultFee;
     if Model.Payload.HasPayload then
-    begin
-      UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZChangeKey_Confirmation]);
-    end
+      UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZChangeKey_Confirmation])
+    else if Length(Model.Account.SelectedAccounts) > 1 then
+      UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZChangeKey_Confirmation])
     else
     begin
-      UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZChangeKey_Confirmation]);
+      Model.Signer.SignerAccount := Model.Account.SelectedAccounts[0];
+      Model.Signer.OperationSigningMode := akaPrimary;
     end;
   end;
+
 end;
 
 function TWIZChangeKey_SelectKey.Validate(out message: ansistring): boolean;
@@ -148,8 +164,7 @@ begin
 
   tempAccountKey := TWallet.Keys.Key[PtrInt(cbNewPrivateKey.Items.Objects[cbNewPrivateKey.ItemIndex])].AccountKey;
 
-   for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
-  begin
+  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
     if TAccountComp.EqualAccountKeys(Model.Account.SelectedAccounts[i].accountInfo.accountKey,
       tempAccountKey) then
     begin
@@ -157,7 +172,7 @@ begin
       message := 'New key is same as current key';
       Exit;
     end;
-  end;
+
 end;
 
 end.

+ 1 - 1
src/gui/wizards/operations/UWIZChangeKey_SelectOption.lfm

@@ -3,10 +3,10 @@ object WIZChangeKey_SelectOption: TWIZChangeKey_SelectOption
   Height = 253
   Top = 0
   Width = 429
+  ActiveControl = rbTransferAccountOwnership
   Caption = 'WIZChangeKey_SelectOption'
   ClientHeight = 253
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
   object gbChangeKeyOptions: TGroupBox
     Left = 8

+ 14 - 4
src/gui/wizards/operations/UWIZOperationFee_Custom.pas

@@ -36,6 +36,8 @@ type
     procedure fseFeeChange(Sender: TObject);
 
 
+
+
   public
     procedure OnPresent; override;
     procedure OnNext; override;
@@ -68,6 +70,7 @@ end;
 procedure TWIZOperationFee_Custom.OnPresent;
 begin
   UpdateUI();
+  fseFee.SetFocus;
 end;
 
 procedure TWIZOperationFee_Custom.OnNext;
@@ -75,12 +78,13 @@ begin
   TAccountComp.TxtToMoney(Trim(fseFee.ValueToStr(fseFee.Value)),
     Model.Fee.SingleOperationFee);
   if Model.Payload.HasPayload then
-  begin
-    UpdatePath(ptInject, [TWIZOperationPayload_Encryption]);
-  end
+    UpdatePath(ptInject, [TWIZOperationPayload_Encryption])
+  else if Length(Model.Account.SelectedAccounts) > 1 then
+    UpdatePath(ptInject, [TWIZOperationSigner_Select])
   else
   begin
-  UpdatePath(ptInject, [TWIZOperationSigner_Select]);
+    Model.Signer.SignerAccount := Model.Account.SelectedAccounts[0];
+    Model.Signer.OperationSigningMode := akaPrimary;
   end;
 end;
 
@@ -97,6 +101,12 @@ begin
     Exit;
   end;
 
+  if (opfee = 0) and (Length(Model.Account.SelectedAccounts) > 1) then
+  begin
+    message := 'zero fee only allowed for single operations.';
+    Result := False;
+    Exit;
+  end;
 end;
 
 end.

+ 12 - 1
src/gui/wizards/operations/UWIZOperationPayload_Content.pas

@@ -30,6 +30,7 @@ type
     mmoPayload: TMemo;
     paPayload: TPanel;
   public
+    procedure OnPresent; override;
     procedure OnNext; override;
   end;
 
@@ -43,10 +44,20 @@ uses
 
 { TWIZOperationPayload_Content }
 
+procedure TWIZOperationPayload_Content.OnPresent;
+begin
+  mmoPayload.SetFocus;
+end;
+
 procedure TWIZOperationPayload_Content.OnNext;
 begin
   Model.Payload.Content := mmoPayload.Lines.Text;
-   UpdatePath(ptInject, [TWIZOperationSigner_Select]);
+  if Length(Model.Account.SelectedAccounts) > 1 then
+    UpdatePath(ptInject, [TWIZOperationSigner_Select])
+  else begin
+    Model.Signer.SignerAccount := Model.Account.SelectedAccounts[0];
+    Model.Signer.OperationSigningMode := akaPrimary;
+  end;
 end;
 
 end.

+ 13 - 1
src/gui/wizards/operations/UWIZOperationPayload_Password.pas

@@ -31,6 +31,7 @@ type
     lblPassword: TLabel;
     paPayload: TPanel;
   public
+    procedure OnPresent; override;
     procedure OnNext; override;
     function Validate(out message: ansistring): boolean; override;
   end;
@@ -45,10 +46,21 @@ uses
 
 { TWIZOperationPayload_Password }
 
+procedure TWIZOperationPayload_Password.OnPresent;
+begin
+  edtPassword.SetFocus;
+end;
+
 procedure TWIZOperationPayload_Password.OnNext;
 begin
   Model.Payload.Password := edtPassword.Text;
-   UpdatePath(ptInject, [TWIZOperationSigner_Select]);
+  if Length(Model.Account.SelectedAccounts) > 1 then
+    UpdatePath(ptInject, [TWIZOperationSigner_Select])
+  else
+  begin
+    Model.Signer.SignerAccount := Model.Account.SelectedAccounts[0];
+    Model.Signer.OperationSigningMode := akaPrimary;
+  end;
 end;
 
 function TWIZOperationPayload_Password.Validate(out message: ansistring): boolean;

+ 6 - 6
src/gui/wizards/operations/UWIZOperationSigner_Select.pas

@@ -90,8 +90,12 @@ begin
   finally
     cbSignerAccount.Items.EndUpdate;
   end;
-  cbSignerAccount.ItemIndex := Model.Signer.SelectedIndex;
+  if Length(Model.Signer.SignerCandidates) = 1 then
+    cbSignerAccount.ItemIndex := 1
+  else
+    cbSignerAccount.ItemIndex := Model.Signer.SelectedIndex;
   cbSignerAccountChange(Self);
+  cbSignerAccount.SetFocus;
 end;
 
 procedure TWIZOperationSigner_Select.OnNext;
@@ -100,13 +104,9 @@ begin
   Model.Signer.SignerAccount := Model.Signer.SignerCandidates[PtrInt(
     cbSignerAccount.Items.Objects[cbSignerAccount.ItemIndex])];
   if rbPrimary.Checked then
-  begin
-    Model.Signer.OperationSigningMode := akaPrimary;
-  end
+    Model.Signer.OperationSigningMode := akaPrimary
   else if rbSecondary.Checked then
-  begin
     Model.Signer.OperationSigningMode := akaSecondary;
-  end;
 end;
 
 function TWIZOperationSigner_Select.Validate(out message: ansistring): boolean;

+ 20 - 54
src/gui/wizards/operations/UWIZSendPASC.pas

@@ -46,6 +46,7 @@ uses
   UECIES,
   UAES,
   UWIZSendPASC_ConfirmSender,
+  UWIZSendPASC_EnterRecipient,
   UWIZSendPASC_Confirmation;
 
 { TWIZSendPASCWizard }
@@ -72,8 +73,6 @@ begin
     Exit;
   end
   else
-  begin
-
     for iAcc := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
     begin
       sender_account := Model.Account.SelectedAccounts[iAcc];
@@ -89,20 +88,15 @@ begin
       if not assigned(wk.PrivateKey) then
       begin
         if wk.CryptedKey <> '' then
-        begin
-          // TODO: handle unlocking of encrypted wallet here
-          errors := 'Wallet is password protected. Need password';
-        end
+          errors := 'Wallet is password protected. Need password'// TODO: handle unlocking of encrypted wallet here
+
         else
-        begin
           errors := 'Only public key of account ' +
             TAccountComp.AccountNumberToAccountTxtNumber(sender_account.account) +
             ' found in wallet. You cannot operate with this account';
-        end;
         Exit;
       end;
     end;
-  end;
 
   Result := UpdateOpTransaction(Model.Account.SelectedAccounts[0], dest_account, amount, errors);
   UpdatePayload(sender_account, e);
@@ -119,14 +113,11 @@ begin
 
   case Model.SendPASC.SendPASCMode of
     akaAllBalance:
-    begin
-      amount := 0; // ALL BALANCE
-    end;
+      amount := 0;// ALL BALANCE
+
 
     akaSpecifiedAmount:
-    begin
       amount := Model.SendPASC.SingleAmountToSend;
-    end;
   end;
 
   if DestAccount.account = SenderAccount.account then
@@ -137,13 +128,11 @@ begin
 
   case Model.SendPASC.SendPASCMode of
     akaSpecifiedAmount:
-    begin
       if (SenderAccount.balance < (amount + Model.Fee.SingleOperationFee)) then
       begin
         errors := 'Insufficient funds';
         Exit;
       end;
-    end;
   end;
 
   Result := True;
@@ -179,15 +168,11 @@ begin
       op := nil;
       account := Model.Account.SelectedAccounts[iAcc];
       if not UpdatePayload(account, errors) then
-      begin
         raise Exception.Create('Error encoding payload of sender account ' +
           TAccountComp.AccountNumberToAccountTxtNumber(account.account) + ': ' + errors);
-      end;
       i := TWallet.Keys.IndexOfAccountKey(account.accountInfo.accountKey);
       if i < 0 then
-      begin
         raise Exception.Create('Sender account private key not found in Wallet');
-      end;
 
       wk := TWallet.Keys.Key[i];
       dooperation := True;
@@ -203,15 +188,13 @@ begin
       if account.balance > 0 then
       begin
         if account.balance > Model.Fee.SingleOperationFee then
-        begin
           case Model.SendPASC.SendPASCMode of
             akaAllBalance:
             begin
               _amount := account.balance - Model.Fee.SingleOperationFee;
               _fee := Model.Fee.SingleOperationFee;
             end;
-          end;
-        end
+          end
         else
         begin
           _amount := account.balance;
@@ -219,9 +202,7 @@ begin
         end;
       end
       else
-      begin
         dooperation := False;
-      end;
 
       if dooperation then
       begin
@@ -258,37 +239,29 @@ begin
         #10 + #10 + 'Note: This operation will be transmitted to the network!'),
         PChar(Application.Title), MB_YESNO + MB_ICONINFORMATION + MB_DEFBUTTON2) <>
         idYes then
-      begin
         Exit;
-      end;
     end
     else
-    begin
-      if Application.MessageBox(PChar('Execute this operation:' +
-        #10 + #10 + operation_to_string + #10 + #10 +
-        'Note: This operation will be transmitted to the network!'),
-        PChar(Application.Title), MB_YESNO + MB_ICONINFORMATION + MB_DEFBUTTON2) <>
-        idYes then
-      begin
-        Exit;
-      end;
-    end;
+    if Application.MessageBox(PChar('Execute this operation:' +
+      #10 + #10 + operation_to_string + #10 + #10 +
+      'Note: This operation will be transmitted to the network!'),
+      PChar(Application.Title), MB_YESNO + MB_ICONINFORMATION + MB_DEFBUTTON2) <>
+      idYes then
+      Exit;
     i := TNode.Node.AddOperations(nil, ops, nil, errors);
     if (i = ops.OperationsCount) then
     begin
       operationstxt := 'Successfully executed ' + IntToStr(i) +
         ' operations!' + #10 + #10 + operation_to_string;
       if i > 1 then
-      begin
-        //  with TFRMMemoText.Create(Self) do
-        //    try
-        //      InitData(Application.Title, operationstxt);
-        //      ShowModal;
-        //    finally
-        //      Free;
-        //    end;
-        ShowMessage(operationstxt);
-      end
+        ShowMessage(operationstxt)//  with TFRMMemoText.Create(Self) do
+      //    try
+      //      InitData(Application.Title, operationstxt);
+      //      ShowModal;
+      //    finally
+      //      Free;
+      //    end;
+
       else
       begin
         Application.MessageBox(
@@ -314,9 +287,7 @@ begin
       ShowMessage(operationstxt);
     end
     else
-    begin
       raise Exception.Create(errors);
-    end;
 
   finally
     ops.Free;
@@ -375,22 +346,17 @@ begin
       end
 
       else
-      begin
         raise Exception.Create('Invalid Encryption Selection');
-      end;
     end;
 
   finally
     if valid then
-    begin
       if length(payload_encrypted) > CT_MaxPayloadSize then
       begin
         valid := False;
         errors := 'Payload size is bigger than ' + IntToStr(CT_MaxPayloadSize) +
           ' (' + IntToStr(length(payload_encrypted)) + ')';
       end;
-
-    end;
     Model.Payload.EncodedBytes := payload_encrypted;
     Result := valid;
   end;

+ 0 - 1
src/gui/wizards/operations/UWIZSendPASC_ConfirmSender.lfm

@@ -6,7 +6,6 @@ object WIZSendPASC_ConfirmSender: TWIZSendPASC_ConfirmSender
   Caption = 'WIZSendPASC_ConfirmSender'
   ClientHeight = 261
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
   object gpSender: TGroupBox
     Left = 4

+ 27 - 11
src/gui/wizards/operations/UWIZSendPASC_Confirmation.lfm

@@ -1,28 +1,27 @@
 object WIZSendPASC_Confirmation: TWIZSendPASC_Confirmation
   Left = 0
-  Height = 253
+  Height = 320
   Top = 0
-  Width = 429
+  Width = 511
   Caption = 'WIZSendPASC_Confirmation'
-  ClientHeight = 253
-  ClientWidth = 429
-  LCLVersion = '1.8.2.0'
+  ClientHeight = 320
+  ClientWidth = 511
   Visible = False
   object GroupBox1: TGroupBox
     Left = 10
-    Height = 232
+    Height = 299
     Top = 8
-    Width = 408
+    Width = 490
     Anchors = [akTop, akLeft, akRight, akBottom]
     Caption = 'Confirm Transaction'
-    ClientHeight = 212
-    ClientWidth = 404
+    ClientHeight = 279
+    ClientWidth = 486
     TabOrder = 0
     object paGrid: TPanel
       Left = 8
-      Height = 152
+      Height = 123
       Top = 48
-      Width = 382
+      Width = 464
       Anchors = [akTop, akLeft, akRight, akBottom]
       BevelOuter = bvNone
       Caption = 'GRID PANEL'
@@ -60,5 +59,22 @@ object WIZSendPASC_Confirmation: TWIZSendPASC_Confirmation
       Caption = 'lblDestAcc'
       ParentColor = False
     end
+    object mmoPayload: TMemo
+      Left = 8
+      Height = 82
+      Top = 192
+      Width = 464
+      Enabled = False
+      ScrollBars = ssBoth
+      TabOrder = 1
+    end
+    object lblPayload: TLabel
+      Left = 8
+      Height = 15
+      Top = 172
+      Width = 42
+      Caption = 'Payload'
+      ParentColor = False
+    end
   end
 end

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

@@ -27,8 +27,10 @@ type
     GroupBox1: TGroupBox;
     Label1: TLabel;
     Label2: TLabel;
+    lblPayload: TLabel;
     lblDestAcc: TLabel;
     lblSgnAcc: TLabel;
+    mmoPayload: TMemo;
     paGrid: TPanel;
   private
     FSendersGrid: TVisualGrid;
@@ -105,6 +107,7 @@ begin
   paGrid.AddControlDockCenter(FSendersGrid);
   lblSgnAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.Signer.SignerAccount.account);
   lblDestAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.SendPASC.DestinationAccount.account);
+  mmoPayload.Lines.Text := Model.Payload.Content;
 end;
 
 procedure TWIZSendPASC_Confirmation.OnNext;

+ 0 - 2
src/gui/wizards/operations/UWIZSendPASC_EnterQuantity.lfm

@@ -7,7 +7,6 @@ object WIZSendPASC_EnterQuantity: TWIZSendPASC_EnterQuantity
   Caption = 'WIZSendPASC_EnterQuantity'
   ClientHeight = 253
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
   object gbQuantity: TGroupBox
     Left = 16
@@ -56,7 +55,6 @@ object WIZSendPASC_EnterQuantity: TWIZSendPASC_EnterQuantity
       Top = 110
       Width = 303
       Caption = 'I want to attach a message payload to this transaction'
-      OnChange = chkAttachPayloadChange
       TabOrder = 3
     end
   end

+ 39 - 20
src/gui/wizards/operations/UWIZSendPASC_EnterQuantity.pas

@@ -32,11 +32,12 @@ type
     edtAmt: TEdit;
     gbQuantity: TGroupBox;
     lblQuantityNotice: TLabel;
-    procedure chkAttachPayloadChange(Sender: TObject);
     procedure UpdateUI();
     procedure chkallfundsChange(Sender: TObject);
 
 
+
+
   public
     procedure OnPresent; override;
     procedure OnNext; override;
@@ -67,7 +68,6 @@ begin
     edtAmt.Enabled := True;
     Model.SendPASC.SendPASCMode := akaSpecifiedAmount;
   end;
-
   Model.Payload.HasPayload := IIF(chkAttachPayload.Checked, True, False);
 
 end;
@@ -80,41 +80,39 @@ end;
 procedure TWIZSendPASC_EnterQuantity.OnPresent;
 begin
   UpdateUI();
-end;
-
-procedure TWIZSendPASC_EnterQuantity.chkAttachPayloadChange(Sender: TObject);
-begin
-  UpdateUI();
+  if Length(Model.Account.SelectedAccounts) > 1 then
+  begin
+    chkChooseFee.Checked := True;
+    chkChooseFee.Enabled := False;
+  end;
+  if edtAmt.Enabled then
+    edtAmt.SetFocus;
 end;
 
 procedure TWIZSendPASC_EnterQuantity.OnNext;
 var
-  amount: Int64;
+  amount: int64;
 begin
   Model.Payload.HasPayload := chkAttachPayload.Checked;
   if chkallfunds.Checked then
-  begin
-    Model.SendPASC.SingleAmountToSend := 0; // all balance
-  end
+    Model.SendPASC.SingleAmountToSend := 0// all balance
+
   else
-  begin
     TAccountComp.TxtToMoney(edtAmt.Text, Model.SendPASC.SingleAmountToSend);
-  end;
 
   if chkChooseFee.Checked then
-  begin
-    UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZSendPASC_Confirmation]);
-  end
+    UpdatePath(ptReplaceAllNext, [TWIZOperationFee_Custom, TWIZSendPASC_Confirmation])
   else
   begin
     Model.Fee.SingleOperationFee := TSettings.DefaultFee;
     if Model.Payload.HasPayload then
-    begin
-      UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZSendPASC_Confirmation]);
-    end
+      UpdatePath(ptReplaceAllNext, [TWIZOperationPayload_Encryption, TWIZSendPASC_Confirmation])
+    else if Length(Model.Account.SelectedAccounts) > 1 then
+      UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZSendPASC_Confirmation])
     else
     begin
-      UpdatePath(ptReplaceAllNext, [TWIZOperationSigner_Select, TWIZSendPASC_Confirmation]);
+      Model.Signer.SignerAccount := Model.Account.SelectedAccounts[0];
+      Model.Signer.OperationSigningMode := akaPrimary;
     end;
   end;
 
@@ -123,6 +121,8 @@ end;
 function TWIZSendPASC_EnterQuantity.Validate(out message: ansistring): boolean;
 var
   amount: int64;
+  i: integer;
+  acc: TAccount;
 begin
   Result := True;
   if not chkallfunds.Checked then
@@ -133,6 +133,25 @@ begin
       Result := False;
       Exit;
     end;
+
+    if amount < 1 then
+    begin
+      message := 'Invalid amount (' + edtAmt.Text + '), you must send an amount greater than zero';
+      Result := False;
+      Exit;
+    end;
+
+    for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+    begin
+      acc := Model.Account.SelectedAccounts[i];
+      if acc.balance < amount then
+      begin
+        message := 'Insufficient funds in one or more accounts';
+        Result := False;
+        Exit;
+      end;
+    end;
+
   end;
 
 end;

+ 1 - 0
src/gui/wizards/operations/UWIZSendPASC_EnterRecipient.pas

@@ -88,6 +88,7 @@ end;
 procedure TWIZSendPASC_EnterRecipient.OnPresent;
 begin
   UpdateUI();
+  edtDestAcc.SetFocus;
 end;
 
 procedure TWIZSendPASC_EnterRecipient.btnSearchClick(Sender: TObject);