Quellcode durchsuchen

some UI fixes for wizards.

Ugochukwu Mmaduekwe vor 7 Jahren
Ursprung
Commit
95e1417270

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

@@ -6,9 +6,8 @@ object WIZOperationConfirmation: TWIZOperationConfirmation
   Caption = 'WIZOperationConfirmation'
   ClientHeight = 320
   ClientWidth = 511
-  LCLVersion = '1.8.2.0'
   Visible = False
-  object GroupBox1: TGroupBox
+  object gpConfirmOperation: TGroupBox
     Left = 10
     Height = 299
     Top = 8

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

@@ -24,13 +24,16 @@ type
   { TWIZOperationConfirmation }
 
   TWIZOperationConfirmation = class(TWizardForm<TWIZOperationsModel>)
-    GroupBox1: TGroupBox;
+    gpConfirmOperation: TGroupBox;
+    lblPayload: TLabel;
+    lblPayload1: TLabel;
+    lblPayload2: TLabel;
     lblSignerAccount: TLabel;
     lblBeneficiaryAccount: TLabel;
-    lblPayload: TLabel;
     lblSgnAcc: TLabel;
     lblBenAcc: TLabel;
     mmoPayload: TMemo;
+    mmoPayload1: TMemo;
     paGrid: TPanel;
   private
     FConfirmationGrid: TVisualGrid;
@@ -67,7 +70,9 @@ type
 procedure TWIZOperationConfirmation.OnPresent;
 var
   LData: TOperationConfirmationDataSource;
+  LCaption: string;
 begin
+
   FConfirmationGrid := TVisualGrid.Create(Self);
   FConfirmationGrid.CanSearch := False;
   FConfirmationGrid.SortMode := smMultiColumn;
@@ -75,6 +80,8 @@ begin
   FConfirmationGrid.AutoPageSize := True;
   FConfirmationGrid.SelectionType := stNone;
   FConfirmationGrid.Options := [vgoColAutoFill, vgoColSizing, vgoSortDirectionAllowNone, vgoAutoHidePaging];
+  LCaption := 'Confirm Operation';
+  gpConfirmOperation.Caption := IIF(Length(Model.Account.SelectedAccounts) > 1, Format('%ss', [LCaption]), Format('%s', [LCaption]));
   with FConfirmationGrid.AddColumn('Sender') do
   begin
     StretchedToFill := True;
@@ -136,7 +143,21 @@ begin
     lblBenAcc.Visible := True;
     lblBenAcc.Caption := Model.EnlistAccountForSale.SellerAccount.AccountString;
   end;
-  mmoPayload.Lines.Text := Model.Payload.Content;
+
+
+  if not Model.Payload.HasPayload then
+  begin
+    lblPayload.Visible := False;
+    mmoPayload.Visible := False;
+    paGrid.SetBounds(paGrid.Left, paGrid.Top, paGrid.Width, gpConfirmOperation.Height - 50);
+  end
+  else
+  begin
+    lblPayload.Visible := True;
+    mmoPayload.Visible := True;
+    mmoPayload.Lines.Text := Model.Payload.Content;
+    paGrid.SetBounds(paGrid.Left, paGrid.Top, paGrid.Width, gpConfirmOperation.Height - mmoPayload.Height - lblPayload.Height - 60);
+  end;
 end;
 
 procedure TWIZOperationConfirmation.OnNext;
@@ -201,10 +222,17 @@ begin
   else if ABindingName = 'Recipient' then
     case Model.ExecuteOperationType of
       omtSendPasc:
+      begin
         Result := Model.SendPASC.DestinationAccount.AccountString;
+        Result := TCellRenderers.OperationShortHash(Result);
+      end;
       omtChangeKey:
         case Model.ChangeKey.ChangeKeyMode of
-          akaTransferAccountOwnership: Result := TAccountComp.AccountPublicKeyExport(Model.TransferAccount.AccountKey);
+          akaTransferAccountOwnership:
+          begin
+            Result := TAccountComp.AccountPublicKeyExport(Model.TransferAccount.AccountKey);
+            Result := TCellRenderers.OperationShortHash(Result);
+          end;
           akaChangeAccountPrivateKey:
           begin
             Result := IIF(
@@ -214,13 +242,16 @@ begin
               );
             if not Assigned(Model.ChangeAccountPrivateKey.NewWalletKey.PrivateKey) then
               Result := Result + '(*)';
+            Result := TCellRenderers.OperationShortHash(Result);
           end
           else
             raise ENotSupportedException.Create('ChangeKeyMode');
         end;
       omtEnlistAccountForSale:
+      begin
         Result := IIF(Model.EnlistAccountForSale.AccountSaleMode = akaPrivateSale, TAccountComp.AccountPublicKeyExport(Model.EnlistAccountForSale.NewOwnerPublicKey), '');
-
+        Result := TCellRenderers.OperationShortHash(Result);
+      end;
     end
   else if ABindingName = 'Fee' then
     Result := -Model.Fee.SingleOperationFee

+ 2 - 3
src/gui/wizards/operations/UWIZOperationSelected.lfm

@@ -6,15 +6,14 @@ object WIZOperationSelected: TWIZOperationSelected
   Caption = 'OperationSelected'
   ClientHeight = 261
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
-  object gpSelectedAccounts: TGroupBox
+  object gpSelectedAccount: TGroupBox
     Left = 4
     Height = 256
     Top = 4
     Width = 420
     Anchors = [akTop, akLeft, akRight, akBottom]
-    Caption = 'Selected Accounts'
+    Caption = 'Selected Account'
     ClientHeight = 236
     ClientWidth = 416
     TabOrder = 0

+ 4 - 1
src/gui/wizards/operations/UWIZOperationSelected.pas

@@ -24,7 +24,7 @@ type
   { TWIZOperationSelected }
 
   TWIZOperationSelected = class(TWizardForm<TWIZOperationsModel>)
-    gpSelectedAccounts: TGroupBox;
+    gpSelectedAccount: TGroupBox;
     lblTotalBalances: TLabel;
     lblTotalBalanceValue: TLabel;
     paGrid: TPanel;
@@ -63,6 +63,7 @@ var
   LIdx: integer;
   LAccount: TAccount;
   LTotalBalance: int64;
+  LCaption: String;
 begin
   FSelectedAccountsGrid := TVisualGrid.Create(Self);
   FSelectedAccountsGrid.CanSearch := False;
@@ -71,6 +72,8 @@ begin
   FSelectedAccountsGrid.AutoPageSize := True;
   FSelectedAccountsGrid.SelectionType := stNone;
   FSelectedAccountsGrid.Options := [vgoColAutoFill, vgoColSizing, vgoSortDirectionAllowNone, vgoAutoHidePaging];
+  LCaption := 'Selected Account';
+  gpSelectedAccount.Caption := IIF(Length(Model.Account.SelectedAccounts) > 1, Format('%ss', [LCaption]), Format('%s', [LCaption]));
   with FSelectedAccountsGrid.AddColumn('Account') do
   begin
     StretchedToFill := True;

+ 0 - 1
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

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

@@ -62,7 +62,7 @@ begin
   end
   else
   begin
-    edtAmt.Text := TAccountComp.FormatMoney(0);
+    edtAmt.Text := '';
     edtAmt.Enabled := True;
     Model.SendPASC.SendPASCMode := akaSpecifiedAmount;
   end;

+ 5 - 33
src/gui/wizards/operations/UWIZSendPASC_EnterRecipient.lfm

@@ -7,7 +7,6 @@ object WIZSendPASC_EnterRecipient: TWIZSendPASC_EnterRecipient
   Caption = 'WIZSendPASC_EnterRecipient'
   ClientHeight = 253
   ClientWidth = 429
-  LCLVersion = '1.8.2.0'
   Visible = False
   object gbRecipient: TGroupBox
     Left = 16
@@ -79,39 +78,12 @@ object WIZSendPASC_EnterRecipient: TWIZSendPASC_EnterRecipient
       ParentColor = False
       ParentFont = False
     end
-    object lblDestAccNumber: TLabel
-      Left = 8
-      Height = 15
-      Top = 80
-      Width = 158
-      Caption = 'Destination Account Number:'
-      ParentColor = False
-      ParentFont = False
-    end
-    object lblDestAccNumberName: TLabel
-      Left = 8
-      Height = 15
-      Top = 108
-      Width = 193
-      Caption = 'Destination Account Number Name:'
-      ParentColor = False
-      ParentFont = False
-    end
-    object lblDestAccNumberValue: TLabel
-      Left = 224
-      Height = 15
-      Top = 80
-      Width = 92
-      Caption = 'Account Number'
-      ParentColor = False
-      ParentFont = False
-    end
-    object lblDestAccNumberNameValue: TLabel
-      Left = 224
+    object lblAccDetails: TLabel
+      Left = 208
       Height = 15
-      Top = 108
-      Width = 121
-      Caption = 'AccountNumberName'
+      Top = 44
+      Width = 83
+      Caption = 'Account Details'
       ParentColor = False
       ParentFont = False
     end

+ 6 - 12
src/gui/wizards/operations/UWIZSendPASC_EnterRecipient.pas

@@ -27,10 +27,7 @@ type
   TWIZSendPASC_EnterRecipient = class(TWizardForm<TWIZOperationsModel>)
     edtDestAcc: TEdit;
     gbRecipient: TGroupBox;
-    lblDestAccNumber: TLabel;
-    lblDestAccNumberValue: TLabel;
-    lblDestAccNumberName: TLabel;
-    lblDestAccNumberNameValue: TLabel;
+    lblAccDetails: TLabel;
     lblDestNotice: TLabel;
     btnSearch: TSpeedButton;
     procedure btnSearchClick(Sender: TObject);
@@ -38,6 +35,7 @@ type
     procedure UpdateUI();
 
 
+
   public
     procedure OnPresent; override;
     procedure OnNext; override;
@@ -68,19 +66,15 @@ begin
   begin
     if (LAccountNumber < 0) or (LAccountNumber >= TNode.Node.Bank.AccountsCount) then
     begin
-      lblDestAccNumberValue.Caption := 'Unknown';
-      lblDestAccNumberNameValue.Caption := 'Unknown';
+      lblAccDetails.Caption := '';
       Exit;
     end;
     LTempAccount := TNode.Node.Operations.SafeBoxTransaction.account(LAccountNumber);
-    lblDestAccNumberValue.Caption := edtDestAcc.Text;
-    lblDestAccNumberNameValue.Caption := LTempAccount.Name;
+    lblAccDetails.Caption := LTempAccount.DisplayString;
   end
   else
-  begin
-    lblDestAccNumberValue.Caption := 'Unknown';
-    lblDestAccNumberNameValue.Caption := 'Unknown';
-  end;
+    lblAccDetails.Caption := '';
+
 
 end;