check if tab wallet on event

This commit is contained in:
Craig Raw 2020-06-02 15:39:56 +02:00
parent df1ed196be
commit 6731823bef
5 changed files with 25 additions and 13 deletions

View file

@ -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;
}
} }

View file

@ -110,6 +110,8 @@ public class ReceiveController extends WalletFormController implements Initializ
@Subscribe @Subscribe
public void receiveTo(ReceiveToEvent event) { public void receiveTo(ReceiveToEvent event) {
if(event.getReceiveEntry().getWallet().equals(getWalletForm().getWallet())) {
setNodeEntry(event.getReceiveEntry()); setNodeEntry(event.getReceiveEntry());
} }
} }
}

View file

@ -96,11 +96,15 @@ public class WalletController extends WalletFormController implements Initializa
@Subscribe @Subscribe
public void walletSettingsChanged(WalletSettingsChangedEvent event) { public void walletSettingsChanged(WalletSettingsChangedEvent event) {
if(event.getWalletFile().equals(walletForm.getWalletFile())) {
configure(walletForm.getWallet().isValid()); configure(walletForm.getWallet().isValid());
} }
}
@Subscribe @Subscribe
public void receiveAction(ReceiveActionEvent event) { public void receiveAction(ReceiveActionEvent event) {
if(event.getReceiveEntry().getWallet().equals(walletForm.getWallet())) {
selectFunction(Function.RECEIVE); selectFunction(Function.RECEIVE);
} }
} }
}

View file

@ -110,6 +110,7 @@ public class WalletForm {
@Subscribe @Subscribe
public void walletChanged(WalletChangedEvent event) { public void walletChanged(WalletChangedEvent event) {
if(event.getWallet().equals(wallet)) {
try { try {
save(); save();
} catch (IOException e) { } catch (IOException e) {
@ -118,3 +119,4 @@ public class WalletForm {
} }
} }
} }
}