mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +00:00
explicitly name functions in strings
This commit is contained in:
parent
28722d385b
commit
b4af3586dc
2 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,15 @@
|
|||
package com.sparrowwallet.sparrow.wallet;
|
||||
|
||||
public enum Function {
|
||||
TRANSACTIONS, SEND, RECEIVE, ADDRESSES, UTXOS, SETTINGS, LOCK;
|
||||
TRANSACTIONS("transactions"), SEND("send"), RECEIVE("receive"), ADDRESSES("addresses"), UTXOS("utxos"), SETTINGS("settings"), LOCK("lock");
|
||||
|
||||
private final String name;
|
||||
|
||||
Function(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,9 +90,9 @@ public class WalletController extends WalletFormController implements Initializa
|
|||
|
||||
try {
|
||||
if(!existing) {
|
||||
URL url = AppServices.class.getResource("wallet/" + function.toString().toLowerCase() + ".fxml");
|
||||
URL url = AppServices.class.getResource("wallet/" + function.getName() + ".fxml");
|
||||
if(url == null) {
|
||||
url = AppServices.class.getResource("wallet" + File.separator + function.toString().toLowerCase() + ".fxml");
|
||||
url = AppServices.class.getResource("wallet" + File.separator + function.getName() + ".fxml");
|
||||
}
|
||||
if(url == null) {
|
||||
throw new IllegalStateException("Cannot find wallet/" + function.toString().toLowerCase() + ".fxml");
|
||||
|
|
Loading…
Reference in a new issue