mirror of
https://github.com/sparrowwallet/drongo.git
synced 2025-11-05 11:56:38 +00:00
add wallet table to store layout settings
This commit is contained in:
parent
378ab611f5
commit
1805aeb374
3 changed files with 50 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
||||||
|
package com.sparrowwallet.drongo.wallet;
|
||||||
|
|
||||||
|
public enum TableType {
|
||||||
|
TRANSACTIONS, UTXOS, RECEIVE_ADDRESSES, CHANGE_ADDRESSES, SEARCH_WALLET, WALLET_SUMMARY
|
||||||
|
}
|
||||||
|
|
@ -41,6 +41,7 @@ public class Wallet extends Persistable implements Comparable<Wallet> {
|
||||||
private final Map<Sha256Hash, BlockTransaction> transactions = new HashMap<>();
|
private final Map<Sha256Hash, BlockTransaction> transactions = new HashMap<>();
|
||||||
private final Map<String, String> detachedLabels = new HashMap<>();
|
private final Map<String, String> detachedLabels = new HashMap<>();
|
||||||
private WalletConfig walletConfig;
|
private WalletConfig walletConfig;
|
||||||
|
private final Map<TableType, WalletTable> walletTables = new HashMap<>();
|
||||||
private MixConfig mixConfig;
|
private MixConfig mixConfig;
|
||||||
private final Map<Sha256Hash, UtxoMixData> utxoMixes = new HashMap<>();
|
private final Map<Sha256Hash, UtxoMixData> utxoMixes = new HashMap<>();
|
||||||
private Integer storedBlockHeight;
|
private Integer storedBlockHeight;
|
||||||
|
|
@ -466,6 +467,14 @@ public class Wallet extends Persistable implements Comparable<Wallet> {
|
||||||
this.walletConfig = walletConfig;
|
this.walletConfig = walletConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<TableType, WalletTable> getWalletTables() {
|
||||||
|
return walletTables;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WalletTable getWalletTable(TableType tableType) {
|
||||||
|
return walletTables.get(tableType);
|
||||||
|
}
|
||||||
|
|
||||||
public MixConfig getMixConfig() {
|
public MixConfig getMixConfig() {
|
||||||
return mixConfig;
|
return mixConfig;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.sparrowwallet.drongo.wallet;
|
||||||
|
|
||||||
|
public class WalletTable extends Persistable {
|
||||||
|
private final TableType tableType;
|
||||||
|
private final Double[] widths;
|
||||||
|
|
||||||
|
public WalletTable(TableType tableType, Double[] widths) {
|
||||||
|
this.tableType = tableType;
|
||||||
|
this.widths = widths;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TableType getTableType() {
|
||||||
|
return tableType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double[] getWidths() {
|
||||||
|
return widths;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final boolean equals(Object o) {
|
||||||
|
if(this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(!(o instanceof WalletTable that)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return tableType == that.tableType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return tableType.hashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue