mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-26 16:35:18 -04:00
Refactor Settings model to 2 separate models
This commit is contained in:
parent
9751a5206e
commit
33085b5c2c
18 changed files with 335 additions and 197 deletions
|
@ -15,7 +15,7 @@
|
||||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.bitsquare.settings;
|
package io.bitsquare.account;
|
||||||
|
|
||||||
import io.bitsquare.arbitrator.Arbitrator;
|
import io.bitsquare.arbitrator.Arbitrator;
|
||||||
import io.bitsquare.locale.Country;
|
import io.bitsquare.locale.Country;
|
||||||
|
@ -30,26 +30,24 @@ import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.OptionalLong;
|
import java.util.OptionalLong;
|
||||||
|
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
public class AccountSettings implements Serializable {
|
||||||
import javafx.beans.property.StringProperty;
|
|
||||||
|
|
||||||
public class Settings implements Serializable {
|
|
||||||
private static final long serialVersionUID = 7995048077355006861L;
|
private static final long serialVersionUID = 7995048077355006861L;
|
||||||
|
|
||||||
private List<Locale> acceptedLanguageLocales = new ArrayList<>();
|
private List<Locale> acceptedLanguageLocales = new ArrayList<>();
|
||||||
private List<Country> acceptedCountryLocales = new ArrayList<>();
|
private List<Country> acceptedCountryLocales = new ArrayList<>();
|
||||||
private List<Arbitrator> acceptedArbitrators = new ArrayList<>();
|
private List<Arbitrator> acceptedArbitrators = new ArrayList<>();
|
||||||
|
|
||||||
private Boolean useAnimations = true;
|
// needed for persistence
|
||||||
private String btcDenominationString = MonetaryFormat.CODE_BTC;
|
private String btcDenominationString = MonetaryFormat.CODE_BTC;
|
||||||
final transient StringProperty btcDenomination = new SimpleStringProperty(MonetaryFormat.CODE_BTC);
|
private Boolean useAnimationsBoolean = true;
|
||||||
|
private Boolean useEffectsBoolean = true;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public Settings() {
|
public AccountSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,12 +55,11 @@ public class Settings implements Serializable {
|
||||||
// Public API
|
// Public API
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public void applyPersistedSettings(Settings persistedSettings) {
|
public void applyPersistedAccountSettings(AccountSettings persistedSettings) {
|
||||||
if (persistedSettings != null) {
|
if (persistedSettings != null) {
|
||||||
acceptedLanguageLocales = persistedSettings.getAcceptedLanguageLocales();
|
acceptedLanguageLocales = persistedSettings.getAcceptedLanguageLocales();
|
||||||
acceptedCountryLocales = persistedSettings.getAcceptedCountries();
|
acceptedCountryLocales = persistedSettings.getAcceptedCountries();
|
||||||
acceptedArbitrators = persistedSettings.getAcceptedArbitrators();
|
acceptedArbitrators = persistedSettings.getAcceptedArbitrators();
|
||||||
setBtcDenomination(persistedSettings.getBtcDenominationString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,30 +115,4 @@ public class Settings implements Serializable {
|
||||||
return result.isPresent() ? Coin.valueOf(result.getAsLong()) : Coin.ZERO;
|
return result.isPresent() ? Coin.valueOf(result.getAsLong()) : Coin.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBtcDenomination() {
|
|
||||||
return btcDenomination.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public StringProperty btcDenominationProperty() {
|
|
||||||
return btcDenomination;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBtcDenomination(String btcDenomination) {
|
|
||||||
btcDenominationString = btcDenomination;
|
|
||||||
this.btcDenomination.set(btcDenomination);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBtcDenominationString() {
|
|
||||||
return btcDenominationString;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getUseAnimations() {
|
|
||||||
return useAnimations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseAnimations(boolean useAnimations) {
|
|
||||||
this.useAnimations = useAnimations;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -18,13 +18,14 @@
|
||||||
package io.bitsquare.app.gui;
|
package io.bitsquare.app.gui;
|
||||||
|
|
||||||
import io.bitsquare.BitsquareException;
|
import io.bitsquare.BitsquareException;
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.gui.Navigation;
|
import io.bitsquare.gui.Navigation;
|
||||||
import io.bitsquare.gui.SystemTray;
|
import io.bitsquare.gui.SystemTray;
|
||||||
import io.bitsquare.gui.ViewLoader;
|
import io.bitsquare.gui.ViewLoader;
|
||||||
import io.bitsquare.gui.components.Popups;
|
import io.bitsquare.gui.components.Popups;
|
||||||
import io.bitsquare.gui.util.ImageUtil;
|
import io.bitsquare.gui.util.ImageUtil;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
@ -81,14 +82,18 @@ public class BitsquareApp extends Application {
|
||||||
// load and apply any stored settings
|
// load and apply any stored settings
|
||||||
|
|
||||||
User user = injector.getInstance(User.class);
|
User user = injector.getInstance(User.class);
|
||||||
Settings settings = injector.getInstance(Settings.class);
|
ApplicationPreferences applicationPreferences = injector.getInstance(ApplicationPreferences.class);
|
||||||
|
AccountSettings accountSettings = injector.getInstance(AccountSettings.class);
|
||||||
Persistence persistence = injector.getInstance(Persistence.class);
|
Persistence persistence = injector.getInstance(Persistence.class);
|
||||||
persistence.init();
|
persistence.init();
|
||||||
|
|
||||||
User persistedUser = (User) persistence.read(user);
|
User persistedUser = (User) persistence.read(user);
|
||||||
user.applyPersistedUser(persistedUser);
|
user.applyPersistedUser(persistedUser);
|
||||||
|
|
||||||
settings.applyPersistedSettings((Settings) persistence.read(settings.getClass().getName()));
|
applicationPreferences.applyPersistedSettings((ApplicationPreferences) persistence
|
||||||
|
.read(applicationPreferences.getClass().getName()));
|
||||||
|
accountSettings.applyPersistedAccountSettings((AccountSettings) persistence
|
||||||
|
.read(accountSettings.getClass().getName()));
|
||||||
|
|
||||||
|
|
||||||
// load the main view and create the main scene
|
// load the main view and create the main scene
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
package io.bitsquare.app.gui;
|
package io.bitsquare.app.gui;
|
||||||
|
|
||||||
import io.bitsquare.BitsquareModule;
|
import io.bitsquare.BitsquareModule;
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.btc.BitcoinModule;
|
import io.bitsquare.btc.BitcoinModule;
|
||||||
import io.bitsquare.crypto.CryptoModule;
|
import io.bitsquare.crypto.CryptoModule;
|
||||||
import io.bitsquare.gui.GuiModule;
|
import io.bitsquare.gui.GuiModule;
|
||||||
|
@ -26,7 +27,7 @@ import io.bitsquare.msg.tomp2p.TomP2PMessageModule;
|
||||||
import io.bitsquare.offer.OfferModule;
|
import io.bitsquare.offer.OfferModule;
|
||||||
import io.bitsquare.offer.tomp2p.TomP2POfferModule;
|
import io.bitsquare.offer.tomp2p.TomP2POfferModule;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
import io.bitsquare.trade.TradeModule;
|
import io.bitsquare.trade.TradeModule;
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
|
|
||||||
|
@ -52,7 +53,8 @@ class BitsquareAppModule extends BitsquareModule {
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
bind(User.class).asEagerSingleton();
|
bind(User.class).asEagerSingleton();
|
||||||
bind(Settings.class).asEagerSingleton();
|
bind(ApplicationPreferences.class).asEagerSingleton();
|
||||||
|
bind(AccountSettings.class).asEagerSingleton();
|
||||||
|
|
||||||
File persistenceDir = new File(env.getRequiredProperty(Persistence.DIR_KEY));
|
File persistenceDir = new File(env.getRequiredProperty(Persistence.DIR_KEY));
|
||||||
bind(File.class).annotatedWith(named(Persistence.DIR_KEY)).toInstance(persistenceDir);
|
bind(File.class).annotatedWith(named(Persistence.DIR_KEY)).toInstance(persistenceDir);
|
||||||
|
|
|
@ -22,6 +22,7 @@ import io.bitsquare.gui.components.Popups;
|
||||||
import io.bitsquare.gui.main.help.Help;
|
import io.bitsquare.gui.main.help.Help;
|
||||||
import io.bitsquare.gui.main.trade.offerbook.OfferBook;
|
import io.bitsquare.gui.main.trade.offerbook.OfferBook;
|
||||||
import io.bitsquare.gui.util.BSFormatter;
|
import io.bitsquare.gui.util.BSFormatter;
|
||||||
|
import io.bitsquare.gui.util.Transitions;
|
||||||
import io.bitsquare.gui.util.validation.BankAccountNumberValidator;
|
import io.bitsquare.gui.util.validation.BankAccountNumberValidator;
|
||||||
import io.bitsquare.gui.util.validation.BtcValidator;
|
import io.bitsquare.gui.util.validation.BtcValidator;
|
||||||
import io.bitsquare.gui.util.validation.FiatValidator;
|
import io.bitsquare.gui.util.validation.FiatValidator;
|
||||||
|
@ -55,6 +56,7 @@ public class GuiModule extends BitsquareModule {
|
||||||
bind(FiatValidator.class).asEagerSingleton();
|
bind(FiatValidator.class).asEagerSingleton();
|
||||||
bind(InputValidator.class).asEagerSingleton();
|
bind(InputValidator.class).asEagerSingleton();
|
||||||
bind(PasswordValidator.class).asEagerSingleton();
|
bind(PasswordValidator.class).asEagerSingleton();
|
||||||
|
bind(Transitions.class).asEagerSingleton();
|
||||||
|
|
||||||
bind(Stage.class).toInstance(primaryStage);
|
bind(Stage.class).toInstance(primaryStage);
|
||||||
Popups.primaryStage = primaryStage;
|
Popups.primaryStage = primaryStage;
|
||||||
|
|
|
@ -26,7 +26,6 @@ import io.bitsquare.gui.components.Popups;
|
||||||
import io.bitsquare.gui.components.SystemNotification;
|
import io.bitsquare.gui.components.SystemNotification;
|
||||||
import io.bitsquare.gui.util.Profiler;
|
import io.bitsquare.gui.util.Profiler;
|
||||||
import io.bitsquare.gui.util.Transitions;
|
import io.bitsquare.gui.util.Transitions;
|
||||||
import io.bitsquare.settings.Settings;
|
|
||||||
import io.bitsquare.trade.TradeManager;
|
import io.bitsquare.trade.TradeManager;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -36,7 +35,6 @@ import java.util.ResourceBundle;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import javafx.animation.Interpolator;
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
|
@ -58,7 +56,7 @@ public class MainViewCB extends ViewCB<MainPM> {
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
private final OverlayManager overlayManager;
|
private final OverlayManager overlayManager;
|
||||||
private final ToggleGroup navButtonsGroup = new ToggleGroup();
|
private final ToggleGroup navButtonsGroup = new ToggleGroup();
|
||||||
private final Settings settings;
|
private Transitions transitions;
|
||||||
private final String title;
|
private final String title;
|
||||||
|
|
||||||
private BorderPane baseApplicationContainer;
|
private BorderPane baseApplicationContainer;
|
||||||
|
@ -77,12 +75,13 @@ public class MainViewCB extends ViewCB<MainPM> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private MainViewCB(MainPM presentationModel, Navigation navigation, OverlayManager overlayManager,
|
private MainViewCB(MainPM presentationModel, Navigation navigation, OverlayManager overlayManager,
|
||||||
TradeManager tradeManager, Settings settings, @Named(TITLE_KEY) String title) {
|
TradeManager tradeManager, Transitions transitions,
|
||||||
|
@Named(TITLE_KEY) String title) {
|
||||||
super(presentationModel);
|
super(presentationModel);
|
||||||
|
|
||||||
this.navigation = navigation;
|
this.navigation = navigation;
|
||||||
this.overlayManager = overlayManager;
|
this.overlayManager = overlayManager;
|
||||||
this.settings = settings;
|
this.transitions = transitions;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
|
|
||||||
tradeManager.featureNotImplementedWarningProperty().addListener((ov, oldValue, newValue) -> {
|
tradeManager.featureNotImplementedWarningProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
|
@ -118,14 +117,12 @@ public class MainViewCB extends ViewCB<MainPM> {
|
||||||
overlayManager.addListener(new OverlayManager.OverlayListener() {
|
overlayManager.addListener(new OverlayManager.OverlayListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onBlurContentRequested() {
|
public void onBlurContentRequested() {
|
||||||
if (settings.getUseAnimations())
|
transitions.blur(baseApplicationContainer);
|
||||||
Transitions.blur(baseApplicationContainer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemoveBlurContentRequested() {
|
public void onRemoveBlurContentRequested() {
|
||||||
if (settings.getUseAnimations())
|
transitions.removeBlur(baseApplicationContainer);
|
||||||
Transitions.removeBlur(baseApplicationContainer);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -230,7 +227,7 @@ public class MainViewCB extends ViewCB<MainPM> {
|
||||||
|
|
||||||
private void onContentAdded() {
|
private void onContentAdded() {
|
||||||
Profiler.printMsgWithTime("MainController.onContentAdded");
|
Profiler.printMsgWithTime("MainController.onContentAdded");
|
||||||
Transitions.fadeOutAndRemove(splashScreen, 1500).setInterpolator(Interpolator.EASE_IN);
|
transitions.fadeOutAndRemove(splashScreen, 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.account.arbitrator.browser;
|
package io.bitsquare.gui.main.account.arbitrator.browser;
|
||||||
|
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.arbitrator.Arbitrator;
|
import io.bitsquare.arbitrator.Arbitrator;
|
||||||
import io.bitsquare.gui.CachedViewCB;
|
import io.bitsquare.gui.CachedViewCB;
|
||||||
import io.bitsquare.gui.Navigation;
|
import io.bitsquare.gui.Navigation;
|
||||||
|
@ -27,7 +28,6 @@ import io.bitsquare.locale.LanguageUtil;
|
||||||
import io.bitsquare.msg.MessageFacade;
|
import io.bitsquare.msg.MessageFacade;
|
||||||
import io.bitsquare.msg.listeners.ArbitratorListener;
|
import io.bitsquare.msg.listeners.ArbitratorListener;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory;
|
||||||
public class ArbitratorBrowserViewCB extends CachedViewCB implements ArbitratorListener {
|
public class ArbitratorBrowserViewCB extends CachedViewCB implements ArbitratorListener {
|
||||||
private static final Logger log = LoggerFactory.getLogger(ArbitratorBrowserViewCB.class);
|
private static final Logger log = LoggerFactory.getLogger(ArbitratorBrowserViewCB.class);
|
||||||
|
|
||||||
private final Settings settings;
|
private final AccountSettings accountSettings;
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
private final MessageFacade messageFacade;
|
private final MessageFacade messageFacade;
|
||||||
|
|
||||||
|
@ -68,8 +68,9 @@ public class ArbitratorBrowserViewCB extends CachedViewCB implements ArbitratorL
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ArbitratorBrowserViewCB(Settings settings, Persistence persistence, MessageFacade messageFacade) {
|
public ArbitratorBrowserViewCB(AccountSettings accountSettings, Persistence persistence,
|
||||||
this.settings = settings;
|
MessageFacade messageFacade) {
|
||||||
|
this.accountSettings = accountSettings;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.messageFacade = messageFacade;
|
this.messageFacade = messageFacade;
|
||||||
}
|
}
|
||||||
|
@ -199,8 +200,8 @@ public class ArbitratorBrowserViewCB extends CachedViewCB implements ArbitratorL
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void onSelect() {
|
public void onSelect() {
|
||||||
settings.addAcceptedArbitrator(currentArbitrator);
|
accountSettings.addAcceptedArbitrator(currentArbitrator);
|
||||||
persistence.write(settings);
|
persistence.write(accountSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
|
|
@ -21,7 +21,7 @@ import io.bitsquare.arbitrator.Arbitrator;
|
||||||
import io.bitsquare.gui.CachedViewCB;
|
import io.bitsquare.gui.CachedViewCB;
|
||||||
import io.bitsquare.gui.util.BSFormatter;
|
import io.bitsquare.gui.util.BSFormatter;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ import javafx.scene.control.*;
|
||||||
// TODO Arbitration is very basic yet
|
// TODO Arbitration is very basic yet
|
||||||
public class ArbitratorProfileViewCB extends CachedViewCB {
|
public class ArbitratorProfileViewCB extends CachedViewCB {
|
||||||
|
|
||||||
private final Settings settings;
|
private final ApplicationPreferences settings;
|
||||||
|
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
@ -53,7 +53,7 @@ public class ArbitratorProfileViewCB extends CachedViewCB {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ArbitratorProfileViewCB(Settings settings, Persistence persistence, BSFormatter formatter) {
|
public ArbitratorProfileViewCB(ApplicationPreferences settings, Persistence persistence, BSFormatter formatter) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.account.content.fiat;
|
package io.bitsquare.gui.main.account.content.fiat;
|
||||||
|
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.bank.BankAccount;
|
import io.bitsquare.bank.BankAccount;
|
||||||
import io.bitsquare.bank.BankAccountType;
|
import io.bitsquare.bank.BankAccountType;
|
||||||
import io.bitsquare.gui.UIModel;
|
import io.bitsquare.gui.UIModel;
|
||||||
|
@ -25,7 +26,6 @@ import io.bitsquare.locale.CountryUtil;
|
||||||
import io.bitsquare.locale.CurrencyUtil;
|
import io.bitsquare.locale.CurrencyUtil;
|
||||||
import io.bitsquare.locale.Region;
|
import io.bitsquare.locale.Region;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
@ -48,7 +48,7 @@ class FiatAccountModel extends UIModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(FiatAccountModel.class);
|
private static final Logger log = LoggerFactory.getLogger(FiatAccountModel.class);
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final Settings settings;
|
private final AccountSettings accountSettings;
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
|
|
||||||
final StringProperty title = new SimpleStringProperty();
|
final StringProperty title = new SimpleStringProperty();
|
||||||
|
@ -75,10 +75,10 @@ class FiatAccountModel extends UIModel {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
FiatAccountModel(User user, Persistence persistence, Settings settings) {
|
FiatAccountModel(User user, Persistence persistence, AccountSettings accountSettings) {
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.settings = settings;
|
this.accountSettings = accountSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ class FiatAccountModel extends UIModel {
|
||||||
user.setBankAccount(bankAccount);
|
user.setBankAccount(bankAccount);
|
||||||
saveUser();
|
saveUser();
|
||||||
allBankAccounts.setAll(user.getBankAccounts());
|
allBankAccounts.setAll(user.getBankAccounts());
|
||||||
countryNotInAcceptedCountriesList.set(!settings.getAcceptedCountries().contains(country.get()));
|
countryNotInAcceptedCountriesList.set(!accountSettings.getAcceptedCountries().contains(country.get()));
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ class FiatAccountModel extends UIModel {
|
||||||
// We ask the user if he likes to add his own bank account country to the accepted country list if he has not
|
// We ask the user if he likes to add his own bank account country to the accepted country list if he has not
|
||||||
// already added it before
|
// already added it before
|
||||||
void addCountryToAcceptedCountriesList() {
|
void addCountryToAcceptedCountriesList() {
|
||||||
settings.addAcceptedCountry(country.get());
|
accountSettings.addAcceptedCountry(country.get());
|
||||||
saveSettings();
|
saveSettings();
|
||||||
countryNotInAcceptedCountriesList.set(false);
|
countryNotInAcceptedCountriesList.set(false);
|
||||||
}
|
}
|
||||||
|
@ -225,6 +225,6 @@ class FiatAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveSettings() {
|
private void saveSettings() {
|
||||||
persistence.write(settings);
|
persistence.write(accountSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.account.content.irc;
|
package io.bitsquare.gui.main.account.content.irc;
|
||||||
|
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.arbitrator.Arbitrator;
|
import io.bitsquare.arbitrator.Arbitrator;
|
||||||
import io.bitsquare.arbitrator.Reputation;
|
import io.bitsquare.arbitrator.Reputation;
|
||||||
import io.bitsquare.bank.BankAccount;
|
import io.bitsquare.bank.BankAccount;
|
||||||
|
@ -29,7 +30,6 @@ import io.bitsquare.locale.LanguageUtil;
|
||||||
import io.bitsquare.locale.Region;
|
import io.bitsquare.locale.Region;
|
||||||
import io.bitsquare.msg.MessageFacade;
|
import io.bitsquare.msg.MessageFacade;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
import io.bitsquare.util.DSAKeyUtil;
|
import io.bitsquare.util.DSAKeyUtil;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class IrcAccountModel extends UIModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(IrcAccountModel.class);
|
private static final Logger log = LoggerFactory.getLogger(IrcAccountModel.class);
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final Settings settings;
|
private final AccountSettings accountSettings;
|
||||||
private final MessageFacade messageFacade;
|
private final MessageFacade messageFacade;
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
|
|
||||||
|
@ -78,10 +78,10 @@ class IrcAccountModel extends UIModel {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
IrcAccountModel(User user, Persistence persistence, Settings settings, MessageFacade messageFacade) {
|
IrcAccountModel(User user, Persistence persistence, AccountSettings accountSettings, MessageFacade messageFacade) {
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.settings = settings;
|
this.accountSettings = accountSettings;
|
||||||
this.messageFacade = messageFacade;
|
this.messageFacade = messageFacade;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class IrcAccountModel extends UIModel {
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
if (settings.getAcceptedArbitrators().isEmpty())
|
if (accountSettings.getAcceptedArbitrators().isEmpty())
|
||||||
addMockArbitrator();
|
addMockArbitrator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,11 +175,11 @@ class IrcAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveSettings() {
|
private void saveSettings() {
|
||||||
persistence.write(settings);
|
persistence.write(accountSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addMockArbitrator() {
|
private void addMockArbitrator() {
|
||||||
if (settings.getAcceptedArbitrators().isEmpty() && user.getMessageKeyPair() != null) {
|
if (accountSettings.getAcceptedArbitrators().isEmpty() && user.getMessageKeyPair() != null) {
|
||||||
String pubKeyAsHex = Utils.HEX.encode(new ECKey().getPubKey());
|
String pubKeyAsHex = Utils.HEX.encode(new ECKey().getPubKey());
|
||||||
String messagePubKeyAsHex = DSAKeyUtil.getHexStringFromPublicKey(user.getMessagePublicKey());
|
String messagePubKeyAsHex = DSAKeyUtil.getHexStringFromPublicKey(user.getMessagePublicKey());
|
||||||
List<Locale> languages = new ArrayList<>();
|
List<Locale> languages = new ArrayList<>();
|
||||||
|
@ -202,8 +202,8 @@ class IrcAccountModel extends UIModel {
|
||||||
"http://bitsquare.io/",
|
"http://bitsquare.io/",
|
||||||
"Bla bla...");
|
"Bla bla...");
|
||||||
|
|
||||||
settings.addAcceptedArbitrator(arbitrator);
|
accountSettings.addAcceptedArbitrator(arbitrator);
|
||||||
persistence.write(settings);
|
persistence.write(accountSettings);
|
||||||
|
|
||||||
messageFacade.addArbitrator(arbitrator);
|
messageFacade.addArbitrator(arbitrator);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.account.content.restrictions;
|
package io.bitsquare.gui.main.account.content.restrictions;
|
||||||
|
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.arbitrator.Arbitrator;
|
import io.bitsquare.arbitrator.Arbitrator;
|
||||||
import io.bitsquare.arbitrator.Reputation;
|
import io.bitsquare.arbitrator.Reputation;
|
||||||
import io.bitsquare.gui.UIModel;
|
import io.bitsquare.gui.UIModel;
|
||||||
|
@ -26,7 +27,6 @@ import io.bitsquare.locale.LanguageUtil;
|
||||||
import io.bitsquare.locale.Region;
|
import io.bitsquare.locale.Region;
|
||||||
import io.bitsquare.msg.MessageFacade;
|
import io.bitsquare.msg.MessageFacade;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
import io.bitsquare.util.DSAKeyUtil;
|
import io.bitsquare.util.DSAKeyUtil;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class RestrictionsModel extends UIModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(RestrictionsModel.class);
|
private static final Logger log = LoggerFactory.getLogger(RestrictionsModel.class);
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final Settings settings;
|
private final AccountSettings accountSettings;
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
private final MessageFacade messageFacade;
|
private final MessageFacade messageFacade;
|
||||||
|
|
||||||
|
@ -67,9 +67,10 @@ class RestrictionsModel extends UIModel {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RestrictionsModel(User user, Settings settings, Persistence persistence, MessageFacade messageFacade) {
|
private RestrictionsModel(User user, AccountSettings accountSettings, Persistence persistence,
|
||||||
|
MessageFacade messageFacade) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.settings = settings;
|
this.accountSettings = accountSettings;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.messageFacade = messageFacade;
|
this.messageFacade = messageFacade;
|
||||||
}
|
}
|
||||||
|
@ -83,9 +84,9 @@ class RestrictionsModel extends UIModel {
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
Settings persistedSettings = (Settings) persistence.read(settings);
|
AccountSettings persistedAccountSettings = (AccountSettings) persistence.read(accountSettings);
|
||||||
if (persistedSettings != null) {
|
if (persistedAccountSettings != null) {
|
||||||
settings.applyPersistedSettings(persistedSettings);
|
accountSettings.applyPersistedAccountSettings(persistedAccountSettings);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (Locale.getDefault() != null) {
|
if (Locale.getDefault() != null) {
|
||||||
|
@ -103,9 +104,9 @@ class RestrictionsModel extends UIModel {
|
||||||
@Override
|
@Override
|
||||||
public void activate() {
|
public void activate() {
|
||||||
super.activate();
|
super.activate();
|
||||||
languageList.setAll(settings.getAcceptedLanguageLocales());
|
languageList.setAll(accountSettings.getAcceptedLanguageLocales());
|
||||||
countryList.setAll(settings.getAcceptedCountries());
|
countryList.setAll(accountSettings.getAcceptedCountries());
|
||||||
arbitratorList.setAll(settings.getAcceptedArbitrators());
|
arbitratorList.setAll(accountSettings.getAcceptedArbitrators());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
|
@ -131,26 +132,26 @@ class RestrictionsModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateArbitratorList() {
|
void updateArbitratorList() {
|
||||||
arbitratorList.setAll(settings.getAcceptedArbitrators());
|
arbitratorList.setAll(accountSettings.getAcceptedArbitrators());
|
||||||
}
|
}
|
||||||
|
|
||||||
void addLanguage(Locale locale) {
|
void addLanguage(Locale locale) {
|
||||||
if (locale != null && !languageList.contains(locale)) {
|
if (locale != null && !languageList.contains(locale)) {
|
||||||
languageList.add(locale);
|
languageList.add(locale);
|
||||||
settings.addAcceptedLanguageLocale(locale);
|
accountSettings.addAcceptedLanguageLocale(locale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeLanguage(Locale locale) {
|
void removeLanguage(Locale locale) {
|
||||||
languageList.remove(locale);
|
languageList.remove(locale);
|
||||||
settings.removeAcceptedLanguageLocale(locale);
|
accountSettings.removeAcceptedLanguageLocale(locale);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void addCountry(Country country) {
|
void addCountry(Country country) {
|
||||||
if (!countryList.contains(country) && country != null) {
|
if (!countryList.contains(country) && country != null) {
|
||||||
countryList.add(country);
|
countryList.add(country);
|
||||||
settings.addAcceptedCountry(country);
|
accountSettings.addAcceptedCountry(country);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,21 +159,21 @@ class RestrictionsModel extends UIModel {
|
||||||
ObservableList<Country> getListWithAllEuroCountries() {
|
ObservableList<Country> getListWithAllEuroCountries() {
|
||||||
// TODO use Set instead of List
|
// TODO use Set instead of List
|
||||||
// In addAcceptedCountry there is a check to no add duplicates, so it works correctly for now
|
// In addAcceptedCountry there is a check to no add duplicates, so it works correctly for now
|
||||||
CountryUtil.getAllEuroCountries().stream().forEach(settings::addAcceptedCountry);
|
CountryUtil.getAllEuroCountries().stream().forEach(accountSettings::addAcceptedCountry);
|
||||||
countryList.setAll(settings.getAcceptedCountries());
|
countryList.setAll(accountSettings.getAcceptedCountries());
|
||||||
saveSettings();
|
saveSettings();
|
||||||
return countryList;
|
return countryList;
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeCountry(Country country) {
|
void removeCountry(Country country) {
|
||||||
countryList.remove(country);
|
countryList.remove(country);
|
||||||
settings.removeAcceptedCountry(country);
|
accountSettings.removeAcceptedCountry(country);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeArbitrator(Arbitrator arbitrator) {
|
void removeArbitrator(Arbitrator arbitrator) {
|
||||||
arbitratorList.remove(arbitrator);
|
arbitratorList.remove(arbitrator);
|
||||||
settings.removeAcceptedArbitrator(arbitrator);
|
accountSettings.removeAcceptedArbitrator(arbitrator);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,12 +183,12 @@ class RestrictionsModel extends UIModel {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void saveSettings() {
|
private void saveSettings() {
|
||||||
persistence.write(settings);
|
persistence.write(accountSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Remove mock later
|
// TODO Remove mock later
|
||||||
private void addMockArbitrator() {
|
private void addMockArbitrator() {
|
||||||
if (settings.getAcceptedArbitrators().isEmpty() && user.getMessageKeyPair() != null) {
|
if (accountSettings.getAcceptedArbitrators().isEmpty() && user.getMessageKeyPair() != null) {
|
||||||
String pubKeyAsHex = Utils.HEX.encode(new ECKey().getPubKey());
|
String pubKeyAsHex = Utils.HEX.encode(new ECKey().getPubKey());
|
||||||
String messagePubKeyAsHex = DSAKeyUtil.getHexStringFromPublicKey(user.getMessagePublicKey());
|
String messagePubKeyAsHex = DSAKeyUtil.getHexStringFromPublicKey(user.getMessagePublicKey());
|
||||||
List<Locale> languages = new ArrayList<>();
|
List<Locale> languages = new ArrayList<>();
|
||||||
|
@ -211,8 +212,8 @@ class RestrictionsModel extends UIModel {
|
||||||
"Bla bla...");
|
"Bla bla...");
|
||||||
|
|
||||||
arbitratorList.add(arbitrator);
|
arbitratorList.add(arbitrator);
|
||||||
settings.addAcceptedArbitrator(arbitrator);
|
accountSettings.addAcceptedArbitrator(arbitrator);
|
||||||
persistence.write(settings);
|
persistence.write(accountSettings);
|
||||||
|
|
||||||
messageFacade.addArbitrator(arbitrator);
|
messageFacade.addArbitrator(arbitrator);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import io.bitsquare.gui.CachedViewCB;
|
||||||
import io.bitsquare.gui.Navigation;
|
import io.bitsquare.gui.Navigation;
|
||||||
import io.bitsquare.gui.ViewCB;
|
import io.bitsquare.gui.ViewCB;
|
||||||
import io.bitsquare.gui.ViewLoader;
|
import io.bitsquare.gui.ViewLoader;
|
||||||
import io.bitsquare.settings.Settings;
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class PreferencesViewCB extends CachedViewCB {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PreferencesViewCB.class);
|
private static final Logger log = LoggerFactory.getLogger(PreferencesViewCB.class);
|
||||||
|
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
private Settings settings;
|
private ApplicationPreferences settings;
|
||||||
|
|
||||||
private Navigation.Listener navigationListener;
|
private Navigation.Listener navigationListener;
|
||||||
private ChangeListener<Tab> tabChangeListener;
|
private ChangeListener<Tab> tabChangeListener;
|
||||||
|
@ -55,7 +55,7 @@ public class PreferencesViewCB extends CachedViewCB {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PreferencesViewCB(Navigation navigation, Settings settings) {
|
PreferencesViewCB(Navigation navigation, ApplicationPreferences settings) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.navigation = navigation;
|
this.navigation = navigation;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.main.trade.createoffer;
|
package io.bitsquare.gui.main.trade.createoffer;
|
||||||
|
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.arbitrator.Arbitrator;
|
import io.bitsquare.arbitrator.Arbitrator;
|
||||||
import io.bitsquare.bank.BankAccount;
|
import io.bitsquare.bank.BankAccount;
|
||||||
import io.bitsquare.btc.AddressEntry;
|
import io.bitsquare.btc.AddressEntry;
|
||||||
|
@ -28,7 +29,7 @@ import io.bitsquare.gui.util.BSFormatter;
|
||||||
import io.bitsquare.locale.Country;
|
import io.bitsquare.locale.Country;
|
||||||
import io.bitsquare.offer.Direction;
|
import io.bitsquare.offer.Direction;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
import io.bitsquare.trade.TradeManager;
|
import io.bitsquare.trade.TradeManager;
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
|
|
||||||
|
@ -68,7 +69,8 @@ class CreateOfferModel extends UIModel {
|
||||||
|
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private final WalletFacade walletFacade;
|
private final WalletFacade walletFacade;
|
||||||
private final Settings settings;
|
private final AccountSettings accountSettings;
|
||||||
|
private ApplicationPreferences applicationPreferences;
|
||||||
private final User user;
|
private final User user;
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
@ -110,11 +112,13 @@ class CreateOfferModel extends UIModel {
|
||||||
|
|
||||||
// non private for testing
|
// non private for testing
|
||||||
@Inject
|
@Inject
|
||||||
public CreateOfferModel(TradeManager tradeManager, WalletFacade walletFacade, Settings settings, User user,
|
public CreateOfferModel(TradeManager tradeManager, WalletFacade walletFacade, AccountSettings accountSettings,
|
||||||
Persistence persistence, BSFormatter formatter) {
|
ApplicationPreferences applicationPreferences, User user, Persistence persistence,
|
||||||
|
BSFormatter formatter) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.walletFacade = walletFacade;
|
this.walletFacade = walletFacade;
|
||||||
this.settings = settings;
|
this.accountSettings = accountSettings;
|
||||||
|
this.applicationPreferences = applicationPreferences;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
||||||
|
@ -151,12 +155,12 @@ class CreateOfferModel extends UIModel {
|
||||||
applyBankAccount(user.getCurrentBankAccount());
|
applyBankAccount(user.getCurrentBankAccount());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings != null)
|
if (accountSettings != null)
|
||||||
btcCode.bind(settings.btcDenominationProperty());
|
btcCode.bind(applicationPreferences.btcDenominationProperty());
|
||||||
|
|
||||||
// we need to set it here already as initWithData is called before activate
|
// we need to set it here already as initWithData is called before activate
|
||||||
if (settings != null)
|
if (accountSettings != null)
|
||||||
securityDepositAsCoin.set(settings.getSecurityDeposit());
|
securityDepositAsCoin.set(accountSettings.getSecurityDeposit());
|
||||||
|
|
||||||
super.initialize();
|
super.initialize();
|
||||||
}
|
}
|
||||||
|
@ -166,14 +170,14 @@ class CreateOfferModel extends UIModel {
|
||||||
super.activate();
|
super.activate();
|
||||||
|
|
||||||
// might be changed after screen change
|
// might be changed after screen change
|
||||||
if (settings != null) {
|
if (accountSettings != null) {
|
||||||
// set it here again to cover the case of an securityDeposit change after a screen change
|
// set it here again to cover the case of an securityDeposit change after a screen change
|
||||||
if (settings != null)
|
if (accountSettings != null)
|
||||||
securityDepositAsCoin.set(settings.getSecurityDeposit());
|
securityDepositAsCoin.set(accountSettings.getSecurityDeposit());
|
||||||
|
|
||||||
acceptedCountries.setAll(settings.getAcceptedCountries());
|
acceptedCountries.setAll(accountSettings.getAcceptedCountries());
|
||||||
acceptedLanguages.setAll(settings.getAcceptedLanguageLocales());
|
acceptedLanguages.setAll(accountSettings.getAcceptedLanguageLocales());
|
||||||
acceptedArbitrators.setAll(settings.getAcceptedArbitrators());
|
acceptedArbitrators.setAll(accountSettings.getAcceptedArbitrators());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import io.bitsquare.locale.Country;
|
||||||
import io.bitsquare.locale.CurrencyUtil;
|
import io.bitsquare.locale.CurrencyUtil;
|
||||||
import io.bitsquare.offer.Direction;
|
import io.bitsquare.offer.Direction;
|
||||||
import io.bitsquare.offer.Offer;
|
import io.bitsquare.offer.Offer;
|
||||||
import io.bitsquare.settings.Settings;
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
import io.bitsquare.trade.TradeManager;
|
import io.bitsquare.trade.TradeManager;
|
||||||
import io.bitsquare.user.User;
|
import io.bitsquare.user.User;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class OfferBookModel extends UIModel {
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final OfferBook offerBook;
|
private final OfferBook offerBook;
|
||||||
private final Settings settings;
|
private final ApplicationPreferences settings;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ class OfferBookModel extends UIModel {
|
||||||
OfferBookModel(User user,
|
OfferBookModel(User user,
|
||||||
TradeManager tradeManager,
|
TradeManager tradeManager,
|
||||||
OfferBook offerBook,
|
OfferBook offerBook,
|
||||||
Settings settings,
|
ApplicationPreferences settings,
|
||||||
BSFormatter formatter) {
|
BSFormatter formatter) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
|
@ -24,7 +24,7 @@ import io.bitsquare.btc.listeners.BalanceListener;
|
||||||
import io.bitsquare.gui.UIModel;
|
import io.bitsquare.gui.UIModel;
|
||||||
import io.bitsquare.offer.Offer;
|
import io.bitsquare.offer.Offer;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
import io.bitsquare.trade.Trade;
|
import io.bitsquare.trade.Trade;
|
||||||
import io.bitsquare.trade.TradeManager;
|
import io.bitsquare.trade.TradeManager;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class TakeOfferModel extends UIModel {
|
||||||
|
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private final WalletFacade walletFacade;
|
private final WalletFacade walletFacade;
|
||||||
private final Settings settings;
|
private final ApplicationPreferences settings;
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
|
|
||||||
private Offer offer;
|
private Offer offer;
|
||||||
|
@ -83,7 +83,8 @@ class TakeOfferModel extends UIModel {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
TakeOfferModel(TradeManager tradeManager, WalletFacade walletFacade, Settings settings, Persistence persistence) {
|
TakeOfferModel(TradeManager tradeManager, WalletFacade walletFacade, ApplicationPreferences settings,
|
||||||
|
Persistence persistence) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.walletFacade = walletFacade;
|
this.walletFacade = walletFacade;
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
|
|
|
@ -17,7 +17,12 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.util;
|
package io.bitsquare.gui.util;
|
||||||
|
|
||||||
|
import io.bitsquare.preferences.ApplicationPreferences;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import javafx.animation.FadeTransition;
|
import javafx.animation.FadeTransition;
|
||||||
|
import javafx.animation.Interpolator;
|
||||||
import javafx.animation.KeyFrame;
|
import javafx.animation.KeyFrame;
|
||||||
import javafx.animation.KeyValue;
|
import javafx.animation.KeyValue;
|
||||||
import javafx.animation.Timeline;
|
import javafx.animation.Timeline;
|
||||||
|
@ -33,58 +38,79 @@ import org.slf4j.LoggerFactory;
|
||||||
public class Transitions {
|
public class Transitions {
|
||||||
private static final Logger log = LoggerFactory.getLogger(Transitions.class);
|
private static final Logger log = LoggerFactory.getLogger(Transitions.class);
|
||||||
|
|
||||||
public static final int DURATION = 400;
|
public final static int DEFAULT_DURATION = 400;
|
||||||
private static Timeline removeBlurTimeline;
|
|
||||||
|
|
||||||
public static void fadeIn(Node node) {
|
private ApplicationPreferences settings;
|
||||||
fadeIn(node, DURATION);
|
private Timeline removeBlurTimeLine;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public Transitions(ApplicationPreferences settings) {
|
||||||
|
this.settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FadeTransition fadeIn(Node node, int duration) {
|
private int evaluateDuration(int duration) {
|
||||||
FadeTransition fade = new FadeTransition(Duration.millis(duration), node);
|
return settings.getUseAnimations() ? duration : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fade
|
||||||
|
public void fadeIn(Node node) {
|
||||||
|
fadeIn(node, DEFAULT_DURATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fadeIn(Node node, int duration) {
|
||||||
|
if (settings.getUseEffects()) {
|
||||||
|
FadeTransition fade = new FadeTransition(Duration.millis(evaluateDuration(duration)), node);
|
||||||
fade.setFromValue(node.getOpacity());
|
fade.setFromValue(node.getOpacity());
|
||||||
fade.setToValue(1.0);
|
fade.setToValue(1.0);
|
||||||
fade.play();
|
fade.play();
|
||||||
return fade;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FadeTransition fadeOut(Node node) {
|
public FadeTransition fadeOut(Node node) {
|
||||||
return fadeOut(node, DURATION);
|
return fadeOut(node, DEFAULT_DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FadeTransition fadeOut(Node node, int duration) {
|
public FadeTransition fadeOut(Node node, int duration) {
|
||||||
FadeTransition fade = new FadeTransition(Duration.millis(duration), node);
|
if (!settings.getUseEffects())
|
||||||
|
duration = 1;
|
||||||
|
|
||||||
|
FadeTransition fade = new FadeTransition(Duration.millis(evaluateDuration(duration)), node);
|
||||||
fade.setFromValue(node.getOpacity());
|
fade.setFromValue(node.getOpacity());
|
||||||
fade.setToValue(0.0);
|
fade.setToValue(0.0);
|
||||||
fade.play();
|
fade.play();
|
||||||
return fade;
|
return fade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FadeTransition fadeOutAndRemove(Node node) {
|
public void fadeOutAndRemove(Node node) {
|
||||||
return fadeOutAndRemove(node, DURATION);
|
fadeOutAndRemove(node, DEFAULT_DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FadeTransition fadeOutAndRemove(Node node, int duration) {
|
public void fadeOutAndRemove(Node node, int duration) {
|
||||||
FadeTransition fade = fadeOut(node, duration);
|
if (!settings.getUseEffects())
|
||||||
|
duration = 1;
|
||||||
|
|
||||||
|
FadeTransition fade = fadeOut(node, evaluateDuration(duration));
|
||||||
|
fade.setInterpolator(Interpolator.EASE_IN);
|
||||||
fade.setOnFinished(actionEvent -> {
|
fade.setOnFinished(actionEvent -> {
|
||||||
((Pane) (node.getParent())).getChildren().remove(node);
|
((Pane) (node.getParent())).getChildren().remove(node);
|
||||||
Profiler.printMsgWithTime("fadeOutAndRemove");
|
Profiler.printMsgWithTime("fadeOutAndRemove");
|
||||||
});
|
});
|
||||||
return fade;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void blur(Node node) {
|
// Blur
|
||||||
blur(node, DURATION, true, false);
|
public void blur(Node node) {
|
||||||
|
blur(node, DEFAULT_DURATION, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Timeline blur(Node node, int duration, boolean useDarken, boolean removeNode) {
|
public void blur(Node node, int duration, boolean useDarken, boolean removeNode) {
|
||||||
if (removeBlurTimeline != null)
|
if (settings.getUseEffects()) {
|
||||||
removeBlurTimeline.stop();
|
if (removeBlurTimeLine != null)
|
||||||
|
removeBlurTimeLine.stop();
|
||||||
|
|
||||||
GaussianBlur blur = new GaussianBlur(0.0);
|
GaussianBlur blur = new GaussianBlur(0.0);
|
||||||
Timeline timeline = new Timeline();
|
Timeline timeline = new Timeline();
|
||||||
KeyValue kv1 = new KeyValue(blur.radiusProperty(), 15.0);
|
KeyValue kv1 = new KeyValue(blur.radiusProperty(), 15.0);
|
||||||
KeyFrame kf1 = new KeyFrame(Duration.millis(duration), kv1);
|
KeyFrame kf1 = new KeyFrame(Duration.millis(evaluateDuration(duration)), kv1);
|
||||||
|
|
||||||
if (useDarken) {
|
if (useDarken) {
|
||||||
ColorAdjust darken = new ColorAdjust();
|
ColorAdjust darken = new ColorAdjust();
|
||||||
|
@ -92,7 +118,7 @@ public class Transitions {
|
||||||
blur.setInput(darken);
|
blur.setInput(darken);
|
||||||
|
|
||||||
KeyValue kv2 = new KeyValue(darken.brightnessProperty(), -0.1);
|
KeyValue kv2 = new KeyValue(darken.brightnessProperty(), -0.1);
|
||||||
KeyFrame kf2 = new KeyFrame(Duration.millis(duration), kv2);
|
KeyFrame kf2 = new KeyFrame(Duration.millis(evaluateDuration(duration)), kv2);
|
||||||
timeline.getKeyFrames().addAll(kf1, kf2);
|
timeline.getKeyFrames().addAll(kf1, kf2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -102,38 +128,40 @@ public class Transitions {
|
||||||
if (removeNode) timeline.setOnFinished(actionEvent -> Platform.runLater(() -> ((Pane) (node.getParent()))
|
if (removeNode) timeline.setOnFinished(actionEvent -> Platform.runLater(() -> ((Pane) (node.getParent()))
|
||||||
.getChildren().remove(node)));
|
.getChildren().remove(node)));
|
||||||
timeline.play();
|
timeline.play();
|
||||||
return timeline;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeBlur(Node node) {
|
public void removeBlur(Node node) {
|
||||||
removeBlur(node, DURATION, false);
|
removeBlur(node, DEFAULT_DURATION, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeBlur(Node node, int duration, boolean useDarken) {
|
public void removeBlur(Node node, int duration, boolean useDarken) {
|
||||||
|
if (settings.getUseEffects()) {
|
||||||
if (node != null) {
|
if (node != null) {
|
||||||
GaussianBlur blur = (GaussianBlur) node.getEffect();
|
GaussianBlur blur = (GaussianBlur) node.getEffect();
|
||||||
if (blur != null) {
|
if (blur != null) {
|
||||||
removeBlurTimeline = new Timeline();
|
removeBlurTimeLine = new Timeline();
|
||||||
KeyValue kv1 = new KeyValue(blur.radiusProperty(), 0.0);
|
KeyValue kv1 = new KeyValue(blur.radiusProperty(), 0.0);
|
||||||
KeyFrame kf1 = new KeyFrame(Duration.millis(DURATION), kv1);
|
KeyFrame kf1 = new KeyFrame(Duration.millis(evaluateDuration(duration)), kv1);
|
||||||
|
|
||||||
|
|
||||||
if (useDarken) {
|
if (useDarken) {
|
||||||
ColorAdjust darken = (ColorAdjust) blur.getInput();
|
ColorAdjust darken = (ColorAdjust) blur.getInput();
|
||||||
|
|
||||||
KeyValue kv2 = new KeyValue(darken.brightnessProperty(), 0.0);
|
KeyValue kv2 = new KeyValue(darken.brightnessProperty(), 0.0);
|
||||||
KeyFrame kf2 = new KeyFrame(Duration.millis(duration), kv2);
|
KeyFrame kf2 = new KeyFrame(Duration.millis(evaluateDuration(duration)), kv2);
|
||||||
removeBlurTimeline.getKeyFrames().addAll(kf1, kf2);
|
removeBlurTimeLine.getKeyFrames().addAll(kf1, kf2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
removeBlurTimeline.getKeyFrames().addAll(kf1);
|
removeBlurTimeLine.getKeyFrames().addAll(kf1);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeBlurTimeline.setOnFinished(actionEvent -> {
|
removeBlurTimeLine.setOnFinished(actionEvent -> {
|
||||||
node.setEffect(null);
|
node.setEffect(null);
|
||||||
removeBlurTimeline = null;
|
removeBlurTimeLine = null;
|
||||||
});
|
});
|
||||||
removeBlurTimeline.play();
|
removeBlurTimeLine.play();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,125 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Bitsquare.
|
||||||
|
*
|
||||||
|
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or (at
|
||||||
|
* your option) any later version.
|
||||||
|
*
|
||||||
|
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||||
|
* License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.bitsquare.preferences;
|
||||||
|
|
||||||
|
import org.bitcoinj.utils.MonetaryFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
|
public class ApplicationPreferences implements Serializable {
|
||||||
|
private static final long serialVersionUID = 7995048077355006861L;
|
||||||
|
|
||||||
|
// Needed for persistence as Property objects are transient (not serializable)
|
||||||
|
// Will be probably removed when we have another persistence solution in place
|
||||||
|
private String btcDenominationString = MonetaryFormat.CODE_BTC;
|
||||||
|
private Boolean useAnimationsBoolean = true;
|
||||||
|
private Boolean useEffectsBoolean = true;
|
||||||
|
|
||||||
|
final transient StringProperty btcDenomination = new SimpleStringProperty(btcDenominationString);
|
||||||
|
final transient BooleanProperty useAnimations = new SimpleBooleanProperty(useAnimationsBoolean);
|
||||||
|
final transient BooleanProperty useEffects = new SimpleBooleanProperty(useEffectsBoolean);
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Constructor
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public ApplicationPreferences() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Public API
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public void applyPersistedSettings(ApplicationPreferences persistedSettings) {
|
||||||
|
if (persistedSettings != null) {
|
||||||
|
setBtcDenomination(persistedSettings.getBtcDenominationString());
|
||||||
|
setUseAnimations(persistedSettings.getUseAnimationsBooleanBoolean());
|
||||||
|
setUseEffects(persistedSettings.getUseEffectsBoolean());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Setters/Getters
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// btcDenomination
|
||||||
|
public String getBtcDenomination() {
|
||||||
|
return btcDenomination.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringProperty btcDenominationProperty() {
|
||||||
|
return btcDenomination;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBtcDenomination(String btcDenomination) {
|
||||||
|
btcDenominationString = btcDenomination;
|
||||||
|
this.btcDenomination.set(btcDenomination);
|
||||||
|
}
|
||||||
|
|
||||||
|
// for persistence
|
||||||
|
public String getBtcDenominationString() {
|
||||||
|
return btcDenominationString;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// useAnimations
|
||||||
|
public boolean getUseAnimations() {
|
||||||
|
return useAnimations.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BooleanProperty useAnimationsProperty() {
|
||||||
|
return useAnimations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseAnimations(boolean useAnimations) {
|
||||||
|
useAnimationsBoolean = useAnimations;
|
||||||
|
this.useAnimations.set(useAnimations);
|
||||||
|
}
|
||||||
|
|
||||||
|
// for persistence
|
||||||
|
public boolean getUseAnimationsBooleanBoolean() {
|
||||||
|
return useAnimationsBoolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// useEffects
|
||||||
|
public boolean getUseEffects() {
|
||||||
|
return useEffects.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BooleanProperty useEffectsProperty() {
|
||||||
|
return useEffects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseEffects(boolean useEffects) {
|
||||||
|
useEffectsBoolean = useEffects;
|
||||||
|
this.useEffects.set(useEffects);
|
||||||
|
}
|
||||||
|
|
||||||
|
// for persistence
|
||||||
|
public boolean getUseEffectsBoolean() {
|
||||||
|
return useEffectsBoolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.trade;
|
package io.bitsquare.trade;
|
||||||
|
|
||||||
|
import io.bitsquare.account.AccountSettings;
|
||||||
import io.bitsquare.btc.BlockChainFacade;
|
import io.bitsquare.btc.BlockChainFacade;
|
||||||
import io.bitsquare.btc.WalletFacade;
|
import io.bitsquare.btc.WalletFacade;
|
||||||
import io.bitsquare.crypto.CryptoFacade;
|
import io.bitsquare.crypto.CryptoFacade;
|
||||||
|
@ -27,7 +28,6 @@ import io.bitsquare.offer.Direction;
|
||||||
import io.bitsquare.offer.Offer;
|
import io.bitsquare.offer.Offer;
|
||||||
import io.bitsquare.offer.OfferRepository;
|
import io.bitsquare.offer.OfferRepository;
|
||||||
import io.bitsquare.persistence.Persistence;
|
import io.bitsquare.persistence.Persistence;
|
||||||
import io.bitsquare.settings.Settings;
|
|
||||||
import io.bitsquare.trade.handlers.TransactionResultHandler;
|
import io.bitsquare.trade.handlers.TransactionResultHandler;
|
||||||
import io.bitsquare.trade.protocol.createoffer.CreateOfferCoordinator;
|
import io.bitsquare.trade.protocol.createoffer.CreateOfferCoordinator;
|
||||||
import io.bitsquare.trade.protocol.trade.TradeMessage;
|
import io.bitsquare.trade.protocol.trade.TradeMessage;
|
||||||
|
@ -73,7 +73,7 @@ public class TradeManager {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TradeManager.class);
|
private static final Logger log = LoggerFactory.getLogger(TradeManager.class);
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final Settings settings;
|
private final AccountSettings accountSettings;
|
||||||
private final Persistence persistence;
|
private final Persistence persistence;
|
||||||
private final MessageFacade messageFacade;
|
private final MessageFacade messageFacade;
|
||||||
private final BlockChainFacade blockChainFacade;
|
private final BlockChainFacade blockChainFacade;
|
||||||
|
@ -99,11 +99,12 @@ public class TradeManager {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TradeManager(User user, Settings settings, Persistence persistence, MessageFacade messageFacade,
|
public TradeManager(User user, AccountSettings accountSettings, Persistence persistence,
|
||||||
|
MessageFacade messageFacade,
|
||||||
BlockChainFacade blockChainFacade, WalletFacade walletFacade, CryptoFacade cryptoFacade,
|
BlockChainFacade blockChainFacade, WalletFacade walletFacade, CryptoFacade cryptoFacade,
|
||||||
OfferRepository offerRepository) {
|
OfferRepository offerRepository) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.settings = settings;
|
this.accountSettings = accountSettings;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.messageFacade = messageFacade;
|
this.messageFacade = messageFacade;
|
||||||
this.blockChainFacade = blockChainFacade;
|
this.blockChainFacade = blockChainFacade;
|
||||||
|
@ -161,10 +162,10 @@ public class TradeManager {
|
||||||
user.getCurrentBankAccount().getCurrency(),
|
user.getCurrentBankAccount().getCurrency(),
|
||||||
user.getCurrentBankAccount().getCountry(),
|
user.getCurrentBankAccount().getCountry(),
|
||||||
user.getCurrentBankAccount().getUid(),
|
user.getCurrentBankAccount().getUid(),
|
||||||
settings.getAcceptedArbitrators(),
|
accountSettings.getAcceptedArbitrators(),
|
||||||
settings.getSecurityDeposit(),
|
accountSettings.getSecurityDeposit(),
|
||||||
settings.getAcceptedCountries(),
|
accountSettings.getAcceptedCountries(),
|
||||||
settings.getAcceptedLanguageLocales());
|
accountSettings.getAcceptedLanguageLocales());
|
||||||
|
|
||||||
CreateOfferCoordinator createOfferCoordinator = new CreateOfferCoordinator(
|
CreateOfferCoordinator createOfferCoordinator = new CreateOfferCoordinator(
|
||||||
offer,
|
offer,
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class CreateOfferPMTest {
|
||||||
BSFormatter formatter = new BSFormatter(new User());
|
BSFormatter formatter = new BSFormatter(new User());
|
||||||
formatter.setLocale(Locale.US);
|
formatter.setLocale(Locale.US);
|
||||||
formatter.setFiatCurrencyCode("USD");
|
formatter.setFiatCurrencyCode("USD");
|
||||||
model = new CreateOfferModel(null, null, null, null, null, formatter);
|
model = new CreateOfferModel(null, null, null, null, null, null, formatter);
|
||||||
|
|
||||||
presenter = new CreateOfferPM(model, new FiatValidator(null), new BtcValidator(), formatter);
|
presenter = new CreateOfferPM(model, new FiatValidator(null), new BtcValidator(), formatter);
|
||||||
presenter.initialize();
|
presenter.initialize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue