Browse Source

Fix GUI change account info bug

PascalCoin 6 years ago
parent
commit
cfbd8b4a67

+ 2 - 34
src/gui-classic/UFRMOperation.dfm

@@ -105,10 +105,6 @@ object FRMOperation: TFRMOperation
     TabOrder = 1
     TabOrder = 1
     object tsOperation: TTabSheet
     object tsOperation: TTabSheet
       TabVisible = False
       TabVisible = False
-      ExplicitLeft = 0
-      ExplicitTop = 0
-      ExplicitWidth = 0
-      ExplicitHeight = 0
       object lblFee: TLabel
       object lblFee: TLabel
         Left = 15
         Left = 15
         Top = 220
         Top = 220
@@ -299,15 +295,11 @@ object FRMOperation: TFRMOperation
         Top = 7
         Top = 7
         Width = 524
         Width = 524
         Height = 204
         Height = 204
-        ActivePage = tsListAccount
+        ActivePage = tsChangeInfo
         TabOrder = 0
         TabOrder = 0
         OnChange = PageControlOpTypeChange
         OnChange = PageControlOpTypeChange
         object tsTransaction: TTabSheet
         object tsTransaction: TTabSheet
           Caption = 'Transaction'
           Caption = 'Transaction'
-          ExplicitLeft = 0
-          ExplicitTop = 0
-          ExplicitWidth = 0
-          ExplicitHeight = 0
           object lblDestAccount: TLabel
           object lblDestAccount: TLabel
             Left = 13
             Left = 13
             Top = 32
             Top = 32
@@ -394,10 +386,6 @@ object FRMOperation: TFRMOperation
         object tsChangePrivateKey: TTabSheet
         object tsChangePrivateKey: TTabSheet
           Caption = 'Change Key'
           Caption = 'Change Key'
           ImageIndex = 1
           ImageIndex = 1
-          ExplicitLeft = 0
-          ExplicitTop = 0
-          ExplicitWidth = 0
-          ExplicitHeight = 0
           object lblNewPrivateKey: TLabel
           object lblNewPrivateKey: TLabel
             Left = 57
             Left = 57
             Top = 40
             Top = 40
@@ -537,10 +525,6 @@ object FRMOperation: TFRMOperation
         object tsListAccount: TTabSheet
         object tsListAccount: TTabSheet
           Caption = 'List Account'
           Caption = 'List Account'
           ImageIndex = 3
           ImageIndex = 3
-          ExplicitLeft = 0
-          ExplicitTop = 0
-          ExplicitWidth = 0
-          ExplicitHeight = 0
           object lblListAccountErrors: TLabel
           object lblListAccountErrors: TLabel
             Left = 11
             Left = 11
             Top = 7
             Top = 7
@@ -785,10 +769,6 @@ object FRMOperation: TFRMOperation
         object tsDelistAccount: TTabSheet
         object tsDelistAccount: TTabSheet
           Caption = 'Delist Account'
           Caption = 'Delist Account'
           ImageIndex = 3
           ImageIndex = 3
-          ExplicitLeft = 0
-          ExplicitTop = 0
-          ExplicitWidth = 0
-          ExplicitHeight = 0
           object lblDelistErrors: TLabel
           object lblDelistErrors: TLabel
             Left = 13
             Left = 13
             Top = 10
             Top = 10
@@ -809,10 +789,6 @@ object FRMOperation: TFRMOperation
         object tsBuyAccount: TTabSheet
         object tsBuyAccount: TTabSheet
           Caption = 'Buy Account'
           Caption = 'Buy Account'
           ImageIndex = 4
           ImageIndex = 4
-          ExplicitLeft = 0
-          ExplicitTop = 0
-          ExplicitWidth = 0
-          ExplicitHeight = 0
           object lblAccountToBuy: TLabel
           object lblAccountToBuy: TLabel
             Left = 13
             Left = 13
             Top = 32
             Top = 32
@@ -988,10 +964,6 @@ object FRMOperation: TFRMOperation
         end
         end
         object tsChangeInfo: TTabSheet
         object tsChangeInfo: TTabSheet
           Caption = 'Change Info'
           Caption = 'Change Info'
-          ExplicitLeft = 0
-          ExplicitTop = 0
-          ExplicitWidth = 0
-          ExplicitHeight = 0
           object lblChangeInfoErrors: TLabel
           object lblChangeInfoErrors: TLabel
             Left = 13
             Left = 13
             Top = 10
             Top = 10
@@ -1047,7 +1019,7 @@ object FRMOperation: TFRMOperation
             Width = 258
             Width = 258
             Height = 21
             Height = 21
             TabOrder = 0
             TabOrder = 0
-            TextHint = 'Account name (null or 3..32 chars)'
+            TextHint = 'Account name (null or 3..64 chars)'
           end
           end
           object ebChangeType: TEdit
           object ebChangeType: TEdit
             Left = 118
             Left = 118
@@ -1078,10 +1050,6 @@ object FRMOperation: TFRMOperation
     object tsGlobalError: TTabSheet
     object tsGlobalError: TTabSheet
       ImageIndex = 1
       ImageIndex = 1
       TabVisible = False
       TabVisible = False
-      ExplicitLeft = 0
-      ExplicitTop = 0
-      ExplicitWidth = 0
-      ExplicitHeight = 0
       object lblGlobalErrors: TLabel
       object lblGlobalErrors: TLabel
         Left = 40
         Left = 40
         Top = 50
         Top = 50

+ 1 - 1
src/gui-classic/UFRMOperation.lfm

@@ -931,7 +931,7 @@ object FRMOperation: TFRMOperation
             Top = 29
             Top = 29
             Width = 258
             Width = 258
             TabOrder = 0
             TabOrder = 0
-            TextHint = 'Account name (null or 3..32 chars)'
+            TextHint = 'Account name (null or 3..64 chars)'
           end
           end
           object lblChangeType: TLabel
           object lblChangeType: TLabel
             Left = 13
             Left = 13

+ 5 - 4
src/gui-classic/UFRMOperation.pas

@@ -970,10 +970,6 @@ begin
     end;
     end;
     changeType := TargetAccount.account_type<>newType;
     changeType := TargetAccount.account_type<>newType;
     //
     //
-    If (SenderAccounts.Count=1) And (newName=TargetAccount.name) And (newType=TargetAccount.account_type) then begin
-      errors := 'Account name and type are the same. Not changed';
-      Exit;
-    end;
     if FNode.Bank.SafeBox.CurrentProtocol>=CT_PROTOCOL_5 then begin
     if FNode.Bank.SafeBox.CurrentProtocol>=CT_PROTOCOL_5 then begin
       // Allow Change Account.Data PIP-0024
       // Allow Change Account.Data PIP-0024
       if Not TCrypto.HexaToRaw(ebChangeAccountData.Text,ANewData) then begin
       if Not TCrypto.HexaToRaw(ebChangeAccountData.Text,ANewData) then begin
@@ -986,6 +982,11 @@ begin
         Exit;
         Exit;
       end;
       end;
     end;
     end;
+    If (SenderAccounts.Count=1) And (TBaseType.Equals(newName,TargetAccount.name)) And (newType=TargetAccount.account_type)
+      And (TBaseType.Equals(ANewData,TargetAccount.account_data)) then begin
+      errors := 'No changes on fields. Not changed';
+      Exit;
+    end;
   finally
   finally
     Result := errors = '';
     Result := errors = '';
     if Not Result then begin
     if Not Result then begin