|
@@ -42,7 +42,7 @@ type
|
|
|
SafeBox : TPCSafeBox;
|
|
|
inWalletKeys : TWalletKeys;
|
|
|
inAccountKey : TAccountKey;
|
|
|
- onlyForSale,
|
|
|
+ onlyForSaleOrSwap,
|
|
|
onlyForPublicSale,
|
|
|
onlyForPrivateSaleToMe : Boolean;
|
|
|
minBal,maxBal : Int64;
|
|
@@ -175,17 +175,20 @@ procedure TSearchThread.BCExecute;
|
|
|
end else if (Assigned(FSearchValues.inWalletKeys)) then begin
|
|
|
isValid := FSearchValues.inWalletKeys.IndexOfAccountKey(account.accountInfo.accountKey)>=0;
|
|
|
end;
|
|
|
- If isValid And (FSearchValues.onlyForSale) then begin
|
|
|
- isValid := TAccountComp.IsAccountForSale(account.accountInfo);
|
|
|
+ If isValid And (FSearchValues.onlyForSaleOrSwap) then begin
|
|
|
+ isValid := TAccountComp.IsAccountForSaleOrSwap(account.accountInfo);
|
|
|
end;
|
|
|
If IsValid and (FSearchValues.onlyForPublicSale) then begin
|
|
|
isValid := TAccountComp.IsAccountForPublicSale(account.accountInfo);
|
|
|
end;
|
|
|
If IsValid and (FSearchValues.onlyForPrivateSaleToMe) then begin
|
|
|
- isValid := ((TAccountComp.IsAccountForPrivateSale(account.accountInfo) OR
|
|
|
- TAccountComp.IsAccountForAccountSwap(account.accountInfo)) AND
|
|
|
- (Assigned(FSearchValues.inWalletKeys)) And (FSearchValues.inWalletKeys.IndexOfAccountKey(account.accountInfo.new_publicKey)>=0)) OR
|
|
|
- (True {TODO: TAccountComp.IsAccountForCoinSwap(account.accountInfo) AND account.accountInfo.account_to_pay in [MyListOfAccounts]});
|
|
|
+ isValid := (
|
|
|
+ (TAccountComp.IsAccountForPrivateSale(account.accountInfo) OR (TAccountComp.IsAccountForAccountSwap(account.accountInfo)))
|
|
|
+ and
|
|
|
+ (Assigned(FSearchValues.inWalletKeys))
|
|
|
+ and
|
|
|
+ (FSearchValues.inWalletKeys.IndexOfAccountKey(account.accountInfo.new_publicKey)>=0)
|
|
|
+ );
|
|
|
end;
|
|
|
If IsValid then begin
|
|
|
IsValid := (account.balance>=FSearchValues.minBal) And ((FSearchValues.maxBal<0) Or (account.balance<=FSearchValues.maxBal));
|
|
@@ -267,6 +270,7 @@ begin
|
|
|
end;
|
|
|
|
|
|
procedure TFRMAccountSelect.FormCreate(Sender: TObject);
|
|
|
+var LColumns : TAccountColumnArray;
|
|
|
begin
|
|
|
FSearchThread := TSearchThread.Create(false);
|
|
|
FSearchThread.OnSearchFinished := OnSearchFinished;
|
|
@@ -279,6 +283,23 @@ begin
|
|
|
FAccountsGrid := TAccountsGrid.Create(Self);
|
|
|
FAccountsGrid.DrawGrid := dgAccounts;
|
|
|
FAccountsGrid.OnUpdated:=OnAccountsGridUpdated;
|
|
|
+ FAccountsGrid.AllowMultiSelect := False;
|
|
|
+
|
|
|
+ SetLength(LColumns,6);
|
|
|
+ LColumns[0].ColumnType := act_account_number;
|
|
|
+ LColumns[0].width := 75;
|
|
|
+ LColumns[1].ColumnType := act_name;
|
|
|
+ LColumns[1].width := 80;
|
|
|
+ LColumns[2].ColumnType := act_balance;
|
|
|
+ LColumns[2].width := 80;
|
|
|
+ LColumns[3].ColumnType := act_n_operation;
|
|
|
+ LColumns[3].width := 40;
|
|
|
+ LColumns[4].ColumnType := act_type;
|
|
|
+ LColumns[4].width := 40;
|
|
|
+ LColumns[5].ColumnType := act_saleprice;
|
|
|
+ LColumns[5].width := 45;
|
|
|
+
|
|
|
+ FAccountsGrid.SetColumns( LColumns );
|
|
|
//
|
|
|
cbMyAccounts.OnClick:=cbMyAccountsClick;
|
|
|
cbMyPrivateKeys.OnClick:=cbMyAccountsClick;
|
|
@@ -476,7 +497,7 @@ begin
|
|
|
end else begin
|
|
|
cbMyPrivateKeys.Font.Color := clGray;
|
|
|
end;
|
|
|
- searchValues.onlyForSale := (cbOnlyForSale.Checked);
|
|
|
+ searchValues.onlyForSaleOrSwap := (cbOnlyForSale.Checked);
|
|
|
searchValues.onlyForPrivateSaleToMe := (cbOnlyForPrivateSaleToMe.Checked);
|
|
|
If searchValues.onlyForPrivateSaleToMe then begin
|
|
|
searchValues.inWalletKeys := FWalletKeys;
|
|
@@ -508,7 +529,7 @@ begin
|
|
|
ebAccountName.Font.Color := clGray;
|
|
|
end;
|
|
|
If (searchValues.inAccountKey.EC_OpenSSL_NID=0) AND (searchValues.inWalletKeys=Nil) And (searchValues.maxBal<0) And (searchValues.minBal<=0) And
|
|
|
- (Not searchValues.onlyForPrivateSaleToMe) And (Not searchValues.onlyForPublicSale) And (Not searchValues.onlyForSale) And
|
|
|
+ (Not searchValues.onlyForPrivateSaleToMe) And (Not searchValues.onlyForPublicSale) And (Not searchValues.onlyForSaleOrSwap) And
|
|
|
(Length(searchValues.searchName)=0) then begin
|
|
|
FAccountsGrid.AccountsGridDatasource := acds_Node;
|
|
|
lblAccountsCount.Caption := IntToStr(FAccountsGrid.Node.Bank.SafeBox.AccountsCount);
|