mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
add menu item to lock all open wallets in a window
This commit is contained in:
parent
8e85543c6e
commit
06c0fb8594
3 changed files with 17 additions and 0 deletions
|
@ -1300,6 +1300,17 @@ public class AppController implements Initializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void lockWallets(ActionEvent event) {
|
||||||
|
for(Tab tab : tabs.getTabs()) {
|
||||||
|
TabData tabData = (TabData)tab.getUserData();
|
||||||
|
if(tabData instanceof WalletTabData walletTabData) {
|
||||||
|
if(!walletTabData.getWalletForm().isLocked()) {
|
||||||
|
EventManager.get().post(new WalletLockEvent(walletTabData.getWalletForm().getMasterWallet()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void refreshWallet(ActionEvent event) {
|
public void refreshWallet(ActionEvent event) {
|
||||||
WalletForm selectedWalletForm = getSelectedWalletForm();
|
WalletForm selectedWalletForm = getSelectedWalletForm();
|
||||||
if(selectedWalletForm != null) {
|
if(selectedWalletForm != null) {
|
||||||
|
|
|
@ -332,6 +332,10 @@ public class WalletForm {
|
||||||
return walletUtxosEntry;
|
return walletUtxosEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isLocked() {
|
||||||
|
return lockedProperty.get();
|
||||||
|
}
|
||||||
|
|
||||||
public BooleanProperty lockedProperty() {
|
public BooleanProperty lockedProperty() {
|
||||||
return lockedProperty;
|
return lockedProperty;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,8 @@
|
||||||
<SeparatorMenuItem />
|
<SeparatorMenuItem />
|
||||||
<MenuItem fx:id="minimizeToTray" mnemonicParsing="false" text="Minimize to System Tray" accelerator="Shortcut+Y" onAction="#minimizeToTray"/>
|
<MenuItem fx:id="minimizeToTray" mnemonicParsing="false" text="Minimize to System Tray" accelerator="Shortcut+Y" onAction="#minimizeToTray"/>
|
||||||
<MenuItem fx:id="lockWallet" mnemonicParsing="false" text="Lock Wallet" accelerator="Shortcut+L" onAction="#lockWallet"/>
|
<MenuItem fx:id="lockWallet" mnemonicParsing="false" text="Lock Wallet" accelerator="Shortcut+L" onAction="#lockWallet"/>
|
||||||
|
<MenuItem mnemonicParsing="false" text="Lock All Wallets" accelerator="Shortcut+Shift+L" onAction="#lockWallets"/>
|
||||||
|
<SeparatorMenuItem />
|
||||||
<MenuItem fx:id="refreshWallet" mnemonicParsing="false" text="Refresh Wallet" accelerator="Shortcut+R" onAction="#refreshWallet"/>
|
<MenuItem fx:id="refreshWallet" mnemonicParsing="false" text="Refresh Wallet" accelerator="Shortcut+R" onAction="#refreshWallet"/>
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|
Loading…
Reference in a new issue