Browse Source

always show wallet name on password dialog

terminal
Craig Raw 4 years ago
parent
commit
9166160008
  1. 2
      src/main/java/com/sparrowwallet/sparrow/AppController.java
  2. 2
      src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java
  3. 2
      src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java
  4. 12
      src/main/java/com/sparrowwallet/sparrow/control/WalletPasswordDialog.java
  5. 2
      src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java
  6. 2
      src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java

2
src/main/java/com/sparrowwallet/sparrow/AppController.java

@ -837,7 +837,7 @@ public class AppController implements Initializable {
}
Storage storage = new Storage(Storage.getWalletFile(wallet.getName()));
WalletPasswordDialog dlg = new WalletPasswordDialog(WalletPasswordDialog.PasswordRequirement.UPDATE_NEW);
WalletPasswordDialog dlg = new WalletPasswordDialog(wallet.getName(), WalletPasswordDialog.PasswordRequirement.UPDATE_NEW);
Optional<SecureString> password = dlg.showAndWait();
if(password.isPresent()) {
if(password.get().length() == 0) {

2
src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java

@ -93,7 +93,7 @@ public class FileWalletExportPane extends TitledDescriptionPane {
Wallet copy = wallet.copy();
if(copy.isEncrypted()) {
WalletPasswordDialog dlg = new WalletPasswordDialog(WalletPasswordDialog.PasswordRequirement.LOAD);
WalletPasswordDialog dlg = new WalletPasswordDialog(wallet.getName(), WalletPasswordDialog.PasswordRequirement.LOAD);
Optional<SecureString> password = dlg.showAndWait();
if(password.isPresent()) {
final File walletFile = AppServices.get().getOpenWallets().get(wallet).getWalletFile();

2
src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java

@ -308,7 +308,7 @@ public class MessageSignDialog extends Dialog<ButtonBar.ButtonData> {
return;
}
WalletPasswordDialog dlg = new WalletPasswordDialog(WalletPasswordDialog.PasswordRequirement.LOAD);
WalletPasswordDialog dlg = new WalletPasswordDialog(wallet.getName(), WalletPasswordDialog.PasswordRequirement.LOAD);
Optional<SecureString> password = dlg.showAndWait();
if(password.isPresent()) {
Storage.DecryptWalletService decryptWalletService = new Storage.DecryptWalletService(wallet.copy(), password.get());

12
src/main/java/com/sparrowwallet/sparrow/control/WalletPasswordDialog.java

@ -25,12 +25,8 @@ public class WalletPasswordDialog extends Dialog<SecureString> {
private final CheckBox deleteBackups;
private boolean addingPassword;
public WalletPasswordDialog(PasswordRequirement requirement) {
this(null, requirement);
}
public WalletPasswordDialog(String walletName, PasswordRequirement requirement) {
this(null, requirement, false);
this(walletName, requirement, false);
}
public WalletPasswordDialog(String walletName, PasswordRequirement requirement, boolean suggestChangePassword) {
@ -135,10 +131,10 @@ public class WalletPasswordDialog extends Dialog<SecureString> {
public enum PasswordRequirement {
LOAD("Please enter the wallet password:", "Unlock"),
UPDATE_NEW("Add a password to the wallet?\nLeave empty for none:", "No Password"),
UPDATE_EMPTY("This wallet has no password.\nAdd a password to the wallet?\nLeave empty for none:", "No Password"),
UPDATE_NEW("Add a password to the wallet?\nLeave empty for no password:", "No Password"),
UPDATE_EMPTY("This wallet has no password.\nAdd a password to the wallet?\nLeave empty for no password:", "No Password"),
UPDATE_SET("Please re-enter the wallet password:", "Verify Password"),
UPDATE_CHANGE("Enter the new wallet password.\nLeave empty for none:", "No Password");
UPDATE_CHANGE("Enter the new wallet password.\nLeave empty for no password:", "No Password");
private final String description;
private final String okButtonText;

2
src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java

@ -716,7 +716,7 @@ public class HeadersController extends TransactionFormController implements Init
File file = headersForm.getAvailableWallets().get(headersForm.getSigningWallet()).getWalletFile();
if(copy.isEncrypted()) {
WalletPasswordDialog dlg = new WalletPasswordDialog(WalletPasswordDialog.PasswordRequirement.LOAD);
WalletPasswordDialog dlg = new WalletPasswordDialog(copy.getName(), WalletPasswordDialog.PasswordRequirement.LOAD);
Optional<SecureString> password = dlg.showAndWait();
if(password.isPresent()) {
Storage.DecryptWalletService decryptWalletService = new Storage.DecryptWalletService(copy, password.get());

2
src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java

@ -338,7 +338,7 @@ public class KeystoreController extends WalletFormController implements Initiali
Wallet copy = getWalletForm().getWallet().copy();
if(copy.isEncrypted()) {
WalletPasswordDialog dlg = new WalletPasswordDialog(WalletPasswordDialog.PasswordRequirement.LOAD);
WalletPasswordDialog dlg = new WalletPasswordDialog(copy.getName(), WalletPasswordDialog.PasswordRequirement.LOAD);
Optional<SecureString> password = dlg.showAndWait();
if(password.isPresent()) {
Storage.DecryptWalletService decryptWalletService = new Storage.DecryptWalletService(copy, password.get());

Loading…
Cancel
Save