mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
check if tab wallet on event
This commit is contained in:
parent
df1ed196be
commit
6731823bef
5 changed files with 25 additions and 13 deletions
|
@ -244,7 +244,7 @@ public class TransactionController implements Initializable {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void transactionChanged(TransactionChangedEvent event) {
|
public void transactionChanged(TransactionChangedEvent event) {
|
||||||
if (event.getTransaction().equals(transaction)) {
|
if(event.getTransaction().equals(transaction)) {
|
||||||
refreshTxHex();
|
refreshTxHex();
|
||||||
txtree.refresh();
|
txtree.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,14 @@ public class NodeEntry extends Entry {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Wallet getWallet() {
|
||||||
|
return wallet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WalletNode getNode() {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
public Address getAddress() {
|
public Address getAddress() {
|
||||||
return wallet.getAddress(node);
|
return wallet.getAddress(node);
|
||||||
}
|
}
|
||||||
|
@ -42,8 +50,4 @@ public class NodeEntry extends Entry {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WalletNode getNode() {
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,8 @@ public class ReceiveController extends WalletFormController implements Initializ
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void receiveTo(ReceiveToEvent event) {
|
public void receiveTo(ReceiveToEvent event) {
|
||||||
setNodeEntry(event.getReceiveEntry());
|
if(event.getReceiveEntry().getWallet().equals(getWalletForm().getWallet())) {
|
||||||
|
setNodeEntry(event.getReceiveEntry());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,11 +96,15 @@ public class WalletController extends WalletFormController implements Initializa
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void walletSettingsChanged(WalletSettingsChangedEvent event) {
|
public void walletSettingsChanged(WalletSettingsChangedEvent event) {
|
||||||
configure(walletForm.getWallet().isValid());
|
if(event.getWalletFile().equals(walletForm.getWalletFile())) {
|
||||||
|
configure(walletForm.getWallet().isValid());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void receiveAction(ReceiveActionEvent event) {
|
public void receiveAction(ReceiveActionEvent event) {
|
||||||
selectFunction(Function.RECEIVE);
|
if(event.getReceiveEntry().getWallet().equals(walletForm.getWallet())) {
|
||||||
|
selectFunction(Function.RECEIVE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,11 +110,13 @@ public class WalletForm {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void walletChanged(WalletChangedEvent event) {
|
public void walletChanged(WalletChangedEvent event) {
|
||||||
try {
|
if(event.getWallet().equals(wallet)) {
|
||||||
save();
|
try {
|
||||||
} catch (IOException e) {
|
save();
|
||||||
//Background save failed
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
//Background save failed
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue