mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
freeze and unfreeze utxos in sparrow terminal by pressing f on utxos table
This commit is contained in:
parent
d881e47ec9
commit
cb06e1aaf7
2 changed files with 19 additions and 0 deletions
|
@ -118,6 +118,20 @@ public class UtxosDialog extends WalletDialog {
|
|||
updateMixSelectedButton();
|
||||
}
|
||||
});
|
||||
utxos.setInputFilter((interactable, keyStroke) -> {
|
||||
if(keyStroke.getCharacter() == Character.valueOf('f')) {
|
||||
if(utxos.getTableModel().getRowCount() > utxos.getSelectedRow()) {
|
||||
TableCell dateCell = utxos.getTableModel().getRow(utxos.getSelectedRow()).get(0);
|
||||
if(dateCell.getEntry() instanceof UtxoEntry utxoEntry) {
|
||||
utxoEntry.getHashIndex().setStatus(utxoEntry.getHashIndex().getStatus() == Status.FROZEN ? null : Status.FROZEN);
|
||||
utxos.invalidate();
|
||||
EventManager.get().post(new WalletUtxoStatusChangedEvent(utxoEntry.getWallet(), List.of(utxoEntry.getHashIndex())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
updateLabels(walletUtxosEntry);
|
||||
updateHistory(getWalletForm().getWalletUtxosEntry());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.sparrowwallet.sparrow.terminal.wallet.table;
|
||||
|
||||
import com.sparrowwallet.drongo.wallet.Status;
|
||||
import com.sparrowwallet.sparrow.wallet.Entry;
|
||||
import com.sparrowwallet.sparrow.wallet.TransactionEntry;
|
||||
import com.sparrowwallet.sparrow.wallet.UtxoEntry;
|
||||
|
@ -24,6 +25,10 @@ public class DateTableCell extends TableCell {
|
|||
return "(*) " + unselected.substring(Math.min(4, unselected.length()));
|
||||
}
|
||||
|
||||
if(entry instanceof UtxoEntry utxoEntry && utxoEntry.getHashIndex().getStatus() == Status.FROZEN) {
|
||||
return "(f) " + unselected.substring(Math.min(4, unselected.length()));
|
||||
}
|
||||
|
||||
return unselected;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue