Przeglądaj źródła

Bug: fixed some bugs specified by herman.

Ugochukwu Mmaduekwe 7 lat temu
rodzic
commit
bbaa02736a

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

@@ -32,6 +32,7 @@ type
     FChangeKeyGrid: TVisualGrid;
   public
     procedure OnPresent; override;
+    function Validate(out message: ansistring): boolean; override;
   end;
 
 
@@ -106,6 +107,20 @@ begin
   lblSgnAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.Signer.SignerAccount.account);
 end;
 
+function TWIZChangeKey_Confirmation.Validate(out message: ansistring): boolean;
+begin
+  Result := True;
+  if Length(Model.Account.SelectedAccounts) > 1 then
+  begin
+    if not (Model.Fee.SingleOperationFee > 0) then
+    begin
+      message := 'insufficient fee for total operation.';
+      Result := False;
+      Exit;
+    end;
+  end;
+end;
+
 { TAccountChangeKeyDataSource }
 
 function TAccountChangeKeyDataSource.GetColumns: TDataColumns;

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

@@ -22,6 +22,7 @@ object WIZFeeOverride: TWIZFeeOverride
       Height = 23
       Top = 35
       Width = 173
+      DecimalPlaces = 4
       Increment = 1
       MaxValue = 1000000000000
       MinValue = 0

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

@@ -34,6 +34,7 @@ type
     FSendersGrid: TVisualGrid;
   public
     procedure OnPresent; override;
+    function Validate(out message: ansistring): boolean; override;
   end;
 
 
@@ -105,6 +106,20 @@ begin
   lblDestAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.SendPASC.DestinationAccount.account);
 end;
 
+function TWIZSendPASC_Confirmation.Validate(out message: ansistring): boolean;
+begin
+  Result := True;
+  if Length(Model.Account.SelectedAccounts) > 1 then
+  begin
+    if not (Model.Fee.SingleOperationFee > 0) then
+    begin
+      message := 'insufficient fee for total operation.';
+      Result := False;
+      Exit;
+    end;
+  end;
+end;
+
 { TAccountSenderDataSource }
 
 function TAccountSenderDataSource.GetColumns: TDataColumns;