mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-26 08:25:23 -04:00
Add missing persist call
This commit is contained in:
parent
da25f041ec
commit
79972e5762
1 changed files with 51 additions and 43 deletions
|
@ -224,14 +224,6 @@ public final class Preferences implements Persistable {
|
||||||
storage.queueUpForSave(1000);
|
storage.queueUpForSave(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTradeCurrencies(ListChangeListener.Change<? extends TradeCurrency> change) {
|
|
||||||
change.next();
|
|
||||||
if (change.wasAdded() && change.getAddedSize() == 1)
|
|
||||||
tradeCurrenciesAsObservable.add(change.getAddedSubList().get(0));
|
|
||||||
else if (change.wasRemoved() && change.getRemovedSize() == 1)
|
|
||||||
tradeCurrenciesAsObservable.remove(change.getRemoved().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Setter
|
// Setter
|
||||||
|
@ -254,14 +246,6 @@ public final class Preferences implements Persistable {
|
||||||
// We don't store the bitcoinNetwork locally as BitcoinNetwork is not serializable!
|
// We don't store the bitcoinNetwork locally as BitcoinNetwork is not serializable!
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setFiatCurrencies(List<FiatCurrency> currencies) {
|
|
||||||
fiatCurrenciesAsObservable.setAll(currencies);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setCryptoCurrencies(List<CryptoCurrency> currencies) {
|
|
||||||
cryptoCurrenciesAsObservable.setAll(currencies);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFiatCurrency(FiatCurrency tradeCurrency) {
|
public void addFiatCurrency(FiatCurrency tradeCurrency) {
|
||||||
if (!fiatCurrenciesAsObservable.contains(tradeCurrency))
|
if (!fiatCurrenciesAsObservable.contains(tradeCurrency))
|
||||||
fiatCurrenciesAsObservable.add(tradeCurrency);
|
fiatCurrenciesAsObservable.add(tradeCurrency);
|
||||||
|
@ -296,16 +280,6 @@ public final class Preferences implements Persistable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setBlockChainExplorerTestNet(BlockChainExplorer blockChainExplorerTestNet) {
|
|
||||||
this.blockChainExplorerTestNet = blockChainExplorerTestNet;
|
|
||||||
storage.queueUpForSave(2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setBlockChainExplorerMainNet(BlockChainExplorer blockChainExplorerMainNet) {
|
|
||||||
this.blockChainExplorerMainNet = blockChainExplorerMainNet;
|
|
||||||
storage.queueUpForSave(2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlockChainExplorer(BlockChainExplorer blockChainExplorer) {
|
public void setBlockChainExplorer(BlockChainExplorer blockChainExplorer) {
|
||||||
if (bitcoinNetwork == BitcoinNetwork.MAINNET)
|
if (bitcoinNetwork == BitcoinNetwork.MAINNET)
|
||||||
setBlockChainExplorerMainNet(blockChainExplorer);
|
setBlockChainExplorerMainNet(blockChainExplorer);
|
||||||
|
@ -349,6 +323,26 @@ public final class Preferences implements Persistable {
|
||||||
storage.queueUpForSave();
|
storage.queueUpForSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setShowOwnOffersInOfferBook(boolean showOwnOffersInOfferBook) {
|
||||||
|
this.showOwnOffersInOfferBook = showOwnOffersInOfferBook;
|
||||||
|
storage.queueUpForSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxPriceDistanceInPercent(double maxPriceDistanceInPercent) {
|
||||||
|
this.maxPriceDistanceInPercent = maxPriceDistanceInPercent;
|
||||||
|
storage.queueUpForSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackupDirectory(String backupDirectory) {
|
||||||
|
this.backupDirectory = backupDirectory;
|
||||||
|
storage.queueUpForSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutoSelectArbitrators(boolean autoSelectArbitrators) {
|
||||||
|
this.autoSelectArbitrators = autoSelectArbitrators;
|
||||||
|
storage.queueUpForSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Getter
|
// Getter
|
||||||
|
@ -390,11 +384,11 @@ public final class Preferences implements Persistable {
|
||||||
return tradeCurrenciesAsObservable;
|
return tradeCurrenciesAsObservable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BlockChainExplorer getBlockChainExplorerTestNet() {
|
public BlockChainExplorer getBlockChainExplorerTestNet() {
|
||||||
return blockChainExplorerTestNet;
|
return blockChainExplorerTestNet;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BlockChainExplorer getBlockChainExplorerMainNet() {
|
public BlockChainExplorer getBlockChainExplorerMainNet() {
|
||||||
return blockChainExplorerMainNet;
|
return blockChainExplorerMainNet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,15 +410,6 @@ public final class Preferences implements Persistable {
|
||||||
return backupDirectory;
|
return backupDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBackupDirectory(String backupDirectory) {
|
|
||||||
this.backupDirectory = backupDirectory;
|
|
||||||
storage.queueUpForSave();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAutoSelectArbitrators(boolean autoSelectArbitrators) {
|
|
||||||
this.autoSelectArbitrators = autoSelectArbitrators;
|
|
||||||
storage.queueUpForSave();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getAutoSelectArbitrators() {
|
public boolean getAutoSelectArbitrators() {
|
||||||
return autoSelectArbitrators;
|
return autoSelectArbitrators;
|
||||||
|
@ -462,15 +447,38 @@ public final class Preferences implements Persistable {
|
||||||
return showOwnOffersInOfferBook;
|
return showOwnOffersInOfferBook;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShowOwnOffersInOfferBook(boolean showOwnOffersInOfferBook) {
|
|
||||||
this.showOwnOffersInOfferBook = showOwnOffersInOfferBook;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getMaxPriceDistanceInPercent() {
|
public double getMaxPriceDistanceInPercent() {
|
||||||
return maxPriceDistanceInPercent;
|
return maxPriceDistanceInPercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMaxPriceDistanceInPercent(double maxPriceDistanceInPercent) {
|
|
||||||
this.maxPriceDistanceInPercent = maxPriceDistanceInPercent;
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Private
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private void updateTradeCurrencies(ListChangeListener.Change<? extends TradeCurrency> change) {
|
||||||
|
change.next();
|
||||||
|
if (change.wasAdded() && change.getAddedSize() == 1)
|
||||||
|
tradeCurrenciesAsObservable.add(change.getAddedSubList().get(0));
|
||||||
|
else if (change.wasRemoved() && change.getRemovedSize() == 1)
|
||||||
|
tradeCurrenciesAsObservable.remove(change.getRemoved().get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setFiatCurrencies(List<FiatCurrency> currencies) {
|
||||||
|
fiatCurrenciesAsObservable.setAll(currencies);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setCryptoCurrencies(List<CryptoCurrency> currencies) {
|
||||||
|
cryptoCurrenciesAsObservable.setAll(currencies);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setBlockChainExplorerTestNet(BlockChainExplorer blockChainExplorerTestNet) {
|
||||||
|
this.blockChainExplorerTestNet = blockChainExplorerTestNet;
|
||||||
|
storage.queueUpForSave(2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setBlockChainExplorerMainNet(BlockChainExplorer blockChainExplorerMainNet) {
|
||||||
|
this.blockChainExplorerMainNet = blockChainExplorerMainNet;
|
||||||
|
storage.queueUpForSave(2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue