mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 00:27:00 +00:00
add preference option to load recent wallets
This commit is contained in:
@@ -540,7 +540,7 @@ public class AppServices {
|
||||
Platform.runLater(() -> {
|
||||
if(!Window.getWindows().isEmpty()) {
|
||||
List<File> walletFiles = allWallets.stream().map(walletTabData -> walletTabData.getStorage().getWalletFile()).collect(Collectors.toList());
|
||||
Config.get().setRecentWalletFiles(walletFiles);
|
||||
Config.get().setRecentWalletFiles(Config.get().isLoadRecentWallets() ? walletFiles : Collections.emptyList());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ public class Config {
|
||||
private FeeRatesSelection feeRatesSelection;
|
||||
private Currency fiatCurrency;
|
||||
private ExchangeSource exchangeSource;
|
||||
private boolean loadRecentWallets = true;
|
||||
private boolean validateDerivationPaths = true;
|
||||
private boolean groupByAddress = true;
|
||||
private boolean includeMempoolChange = true;
|
||||
@@ -155,6 +156,15 @@ public class Config {
|
||||
flush();
|
||||
}
|
||||
|
||||
public boolean isLoadRecentWallets() {
|
||||
return loadRecentWallets;
|
||||
}
|
||||
|
||||
public void setLoadRecentWallets(boolean loadRecentWallets) {
|
||||
this.loadRecentWallets = loadRecentWallets;
|
||||
flush();
|
||||
}
|
||||
|
||||
public boolean isValidateDerivationPaths() {
|
||||
return validateDerivationPaths;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ public class GeneralPreferencesController extends PreferencesDetailController {
|
||||
@FXML
|
||||
private ComboBox<ExchangeSource> exchangeSource;
|
||||
|
||||
@FXML
|
||||
private UnlabeledToggleSwitch loadRecentWallets;
|
||||
|
||||
@FXML
|
||||
private UnlabeledToggleSwitch validateDerivationPaths;
|
||||
|
||||
@@ -97,6 +100,12 @@ public class GeneralPreferencesController extends PreferencesDetailController {
|
||||
|
||||
updateCurrencies(exchangeSource.getSelectionModel().getSelectedItem());
|
||||
|
||||
loadRecentWallets.setSelected(config.isLoadRecentWallets());
|
||||
loadRecentWallets.selectedProperty().addListener((observableValue, oldValue, newValue) -> {
|
||||
config.setLoadRecentWallets(newValue);
|
||||
EventManager.get().post(new RequestOpenWalletsEvent());
|
||||
});
|
||||
|
||||
validateDerivationPaths.setSelected(config.isValidateDerivationPaths());
|
||||
validateDerivationPaths.selectedProperty().addListener((observableValue, oldValue, newValue) -> {
|
||||
config.setValidateDerivationPaths(newValue);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class PreferencesDialog extends Dialog<Boolean> {
|
||||
}
|
||||
|
||||
dialogPane.setPrefWidth(750);
|
||||
dialogPane.setPrefHeight(600);
|
||||
dialogPane.setPrefHeight(630);
|
||||
|
||||
preferencesController.reconnectOnClosingProperty().set(AppServices.isConnecting() || AppServices.isConnected());
|
||||
setOnCloseRequest(event -> {
|
||||
|
||||
Reference in New Issue
Block a user