mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
feat: wire up hide amounts event handlers
This commit is contained in:
parent
73da024645
commit
2220769b03
2 changed files with 35 additions and 11 deletions
|
|
@ -195,6 +195,15 @@ public class TransactionsController extends WalletFormController implements Init
|
||||||
fiatMempoolBalance.refresh(event.getUnitFormat());
|
fiatMempoolBalance.refresh(event.getUnitFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
transactionsTable.refresh();
|
||||||
|
balance.refresh();
|
||||||
|
mempoolBalance.refresh();
|
||||||
|
fiatBalance.refresh();
|
||||||
|
fiatMempoolBalance.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void fiatCurrencySelected(FiatCurrencySelectedEvent event) {
|
public void fiatCurrencySelected(FiatCurrencySelectedEvent event) {
|
||||||
if(event.getExchangeSource() == ExchangeSource.NONE) {
|
if(event.getExchangeSource() == ExchangeSource.NONE) {
|
||||||
|
|
|
||||||
|
|
@ -121,18 +121,22 @@ public class UtxosController extends WalletFormController implements Initializab
|
||||||
|
|
||||||
long selectedTotal = selectedEntries.stream().mapToLong(Entry::getValue).sum();
|
long selectedTotal = selectedEntries.stream().mapToLong(Entry::getValue).sum();
|
||||||
if(selectedTotal > 0) {
|
if(selectedTotal > 0) {
|
||||||
if(format == null) {
|
if(Config.get().isHideAmounts()) {
|
||||||
format = UnitFormat.DOT;
|
sendSelected.setText("Send Selected");
|
||||||
}
|
|
||||||
|
|
||||||
if(unit == null || unit.equals(BitcoinUnit.AUTO)) {
|
|
||||||
unit = (selectedTotal >= BitcoinUnit.getAutoThreshold() ? BitcoinUnit.BTC : BitcoinUnit.SATOSHIS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(unit.equals(BitcoinUnit.BTC)) {
|
|
||||||
sendSelected.setText("Send Selected (" + format.formatBtcValue(selectedTotal) + " BTC)");
|
|
||||||
} else {
|
} else {
|
||||||
sendSelected.setText("Send Selected (" + format.formatSatsValue(selectedTotal) + " sats)");
|
if(format == null) {
|
||||||
|
format = UnitFormat.DOT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(unit == null || unit.equals(BitcoinUnit.AUTO)) {
|
||||||
|
unit = (selectedTotal >= BitcoinUnit.getAutoThreshold() ? BitcoinUnit.BTC : BitcoinUnit.SATOSHIS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(unit.equals(BitcoinUnit.BTC)) {
|
||||||
|
sendSelected.setText("Send Selected (" + format.formatBtcValue(selectedTotal) + " BTC)");
|
||||||
|
} else {
|
||||||
|
sendSelected.setText("Send Selected (" + format.formatSatsValue(selectedTotal) + " sats)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendSelected.setText("Send Selected");
|
sendSelected.setText("Send Selected");
|
||||||
|
|
@ -270,6 +274,17 @@ public class UtxosController extends WalletFormController implements Initializab
|
||||||
fiatMempoolBalance.refresh(event.getUnitFormat());
|
fiatMempoolBalance.refresh(event.getUnitFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
utxosTable.refresh();
|
||||||
|
utxosChart.update(getWalletForm().getWalletUtxosEntry());
|
||||||
|
balance.refresh();
|
||||||
|
mempoolBalance.refresh();
|
||||||
|
updateButtons(Config.get().getUnitFormat(), Config.get().getBitcoinUnit());
|
||||||
|
fiatBalance.refresh();
|
||||||
|
fiatMempoolBalance.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void walletHistoryStatus(WalletHistoryStatusEvent event) {
|
public void walletHistoryStatus(WalletHistoryStatusEvent event) {
|
||||||
utxosTable.updateHistoryStatus(event);
|
utxosTable.updateHistoryStatus(event);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue