mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
terminal: add lock menu item to all wallets with a password
This commit is contained in:
parent
88fc8f5017
commit
e0ff42b6a4
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import com.googlecode.lanterna.TerminalSize;
|
||||||
import com.googlecode.lanterna.gui2.*;
|
import com.googlecode.lanterna.gui2.*;
|
||||||
import com.googlecode.lanterna.gui2.dialogs.DialogWindow;
|
import com.googlecode.lanterna.gui2.dialogs.DialogWindow;
|
||||||
import com.sparrowwallet.drongo.wallet.Wallet;
|
import com.sparrowwallet.drongo.wallet.Wallet;
|
||||||
|
import com.sparrowwallet.sparrow.io.Storage;
|
||||||
import com.sparrowwallet.sparrow.terminal.SparrowTerminal;
|
import com.sparrowwallet.sparrow.terminal.SparrowTerminal;
|
||||||
import com.sparrowwallet.sparrow.wallet.Function;
|
import com.sparrowwallet.sparrow.wallet.Function;
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ public class WalletActionsDialog extends DialogWindow {
|
||||||
SettingsDialog settingsDialog = getWalletData().getSettingsDialog();
|
SettingsDialog settingsDialog = getWalletData().getSettingsDialog();
|
||||||
settingsDialog.showDialog(SparrowTerminal.get().getGui());
|
settingsDialog.showDialog(SparrowTerminal.get().getGui());
|
||||||
});
|
});
|
||||||
if(getWalletData().getWalletForm().getWallet().isEncrypted()) {
|
if(!Storage.NO_PASSWORD_KEY.equals(getWalletData().getWalletForm().getStorage().getEncryptionPubKey())) {
|
||||||
actions.addItem("Lock", () -> {
|
actions.addItem("Lock", () -> {
|
||||||
close();
|
close();
|
||||||
SparrowTerminal.get().lockWallet(getWalletData().getWalletForm().getStorage());
|
SparrowTerminal.get().lockWallet(getWalletData().getWalletForm().getStorage());
|
||||||
|
|
Loading…
Reference in a new issue