mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
replace illegal filename characters in wallet name with underscores
This commit is contained in:
parent
0b4785e01c
commit
ed2914f2aa
1 changed files with 4 additions and 0 deletions
|
@ -53,6 +53,10 @@ public class WalletNameDialog extends Dialog<WalletNameDialog.NameAndBirthDate>
|
||||||
final VBox content = new VBox(20);
|
final VBox content = new VBox(20);
|
||||||
name = (CustomTextField)TextFields.createClearableTextField();
|
name = (CustomTextField)TextFields.createClearableTextField();
|
||||||
name.setText(initialName);
|
name.setText(initialName);
|
||||||
|
name.setTextFormatter(new TextFormatter<>((change) -> {
|
||||||
|
change.setText(change.getText().replaceAll("[\\\\/:*?\"<>|]", "_"));
|
||||||
|
return change;
|
||||||
|
}));
|
||||||
content.getChildren().add(name);
|
content.getChildren().add(name);
|
||||||
|
|
||||||
HBox existingBox = new HBox(10);
|
HBox existingBox = new HBox(10);
|
||||||
|
|
Loading…
Reference in a new issue