mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 08:37:05 +00:00
auto open recent wallets
This commit is contained in:
@@ -252,8 +252,14 @@ public class AppController implements Initializable {
|
||||
|
||||
openTransactionIdItem.disableProperty().bind(onlineProperty.not());
|
||||
|
||||
openWalletFile(new File("/Users/scy/.sparrow/wallets/sparta.json"));
|
||||
openWalletFile(new File("/Users/scy/.sparrow/wallets/sparta-test.json"));
|
||||
List<File> recentWalletFiles = Config.get().getRecentWalletFiles();
|
||||
if(recentWalletFiles != null) {
|
||||
for(File walletFile : recentWalletFiles) {
|
||||
if(walletFile.exists()) {
|
||||
openWalletFile(walletFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ElectrumServer.ConnectionService createConnectionService() {
|
||||
@@ -1085,6 +1091,9 @@ public class AppController implements Initializable {
|
||||
|
||||
@Subscribe
|
||||
public void openWallets(OpenWalletsEvent event) {
|
||||
List<File> walletFiles = event.getWalletsMap().values().stream().map(storage -> storage.getWalletFile()).collect(Collectors.toList());
|
||||
Config.get().setRecentWalletFiles(walletFiles);
|
||||
|
||||
boolean usbWallet = false;
|
||||
for(Map.Entry<Wallet, Storage> entry : event.getWalletsMap().entrySet()) {
|
||||
Wallet wallet = entry.getKey();
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Currency;
|
||||
import java.util.List;
|
||||
|
||||
public class Config {
|
||||
private static final Logger log = LoggerFactory.getLogger(Config.class);
|
||||
@@ -22,6 +23,7 @@ public class Config {
|
||||
private boolean groupByAddress = true;
|
||||
private boolean includeMempoolChange = true;
|
||||
private boolean notifyNewTransactions = true;
|
||||
private List<File> recentWalletFiles;
|
||||
private Integer keyDerivationPeriod;
|
||||
private File hwi;
|
||||
private String electrumServer;
|
||||
@@ -133,6 +135,15 @@ public class Config {
|
||||
flush();
|
||||
}
|
||||
|
||||
public List<File> getRecentWalletFiles() {
|
||||
return recentWalletFiles;
|
||||
}
|
||||
|
||||
public void setRecentWalletFiles(List<File> recentWalletFiles) {
|
||||
this.recentWalletFiles = recentWalletFiles;
|
||||
flush();
|
||||
}
|
||||
|
||||
public Integer getKeyDerivationPeriod() {
|
||||
return keyDerivationPeriod;
|
||||
}
|
||||
|
||||
@@ -272,8 +272,6 @@ public class SendController extends WalletFormController implements Initializabl
|
||||
createButton.setDisable(walletTransaction == null || label.getText().isEmpty());
|
||||
});
|
||||
|
||||
address.setText("19Sp9dLinHy3dKo2Xxj53ouuZWAoVGGhg8");
|
||||
|
||||
addValidation();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user