Rename Preferences to Settings (#272)

This commit is contained in:
Manfred Karrer 2014-11-14 14:28:08 +01:00
parent 45f7a3b8fc
commit 3811cabba1
23 changed files with 105 additions and 111 deletions

View File

@ -27,7 +27,7 @@ import io.bitsquare.msg.tomp2p.TomP2PMessageModule;
import io.bitsquare.offer.OfferModule;
import io.bitsquare.offer.tomp2p.TomP2POfferModule;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import io.bitsquare.trade.TradeModule;
import io.bitsquare.user.User;
@ -53,7 +53,7 @@ class BitsquareAppModule extends BitsquareModule {
@Override
protected void configure() {
bind(User.class).asEagerSingleton();
bind(ApplicationPreferences.class).asEagerSingleton();
bind(Preferences.class).asEagerSingleton();
bind(AccountSettings.class).asEagerSingleton();
File persistenceDir = new File(env.getRequiredProperty(Persistence.DIR_KEY));

View File

@ -165,7 +165,7 @@ public class Navigation {
PORTFOLIO("/io/bitsquare/gui/main/portfolio/PortfolioView.fxml"),
FUNDS("/io/bitsquare/gui/main/funds/FundsView.fxml"),
MSG("/io/bitsquare/gui/main/msg/MsgView.fxml"),
PREFERENCES("/io/bitsquare/gui/main/preferences/PreferencesView.fxml"),
SETTINGS("/io/bitsquare/gui/main/settings/SettingsView.fxml"),
ACCOUNT("/io/bitsquare/gui/main/account/AccountView.fxml"),
@ -187,9 +187,9 @@ public class Navigation {
WITHDRAWAL("/io/bitsquare/gui/main/funds/withdrawal/WithdrawalView.fxml"),
TRANSACTIONS("/io/bitsquare/gui/main/funds/transactions/TransactionsView.fxml"),
// preferences
APPLICATION_PREFERENCES("/io/bitsquare/gui/main/preferences/application/ApplicationPreferencesView.fxml"),
NETWORK_PREFERENCES("/io/bitsquare/gui/main/preferences/network/NetworkPreferencesView.fxml"),
// settings
PREFERENCES("/io/bitsquare/gui/main/settings/application/PreferencesView.fxml"),
NETWORK_SETTINGS("/io/bitsquare/gui/main/settings/network/NetworkSettingsView.fxml"),
// account
ACCOUNT_SETUP("/io/bitsquare/gui/main/account/setup/AccountSetupView.fxml"),

View File

@ -94,12 +94,12 @@
-fx-image: url("../../../images/nav/msg_active.png");
}
#image-nav-preferences {
-fx-image: url("../../../images/nav/preferences.png");
#image-nav-settings {
-fx-image: url("../../../images/nav/settings.png");
}
#image-nav-preferences-active {
-fx-image: url("../../../images/nav/preferences_active.png");
#image-nav-settings-active {
-fx-image: url("../../../images/nav/settings_active.png");
}
#image-nav-account {

View File

@ -65,7 +65,7 @@ public class MainViewCB extends ViewCB<MainPM> {
private VBox splashScreen;
private AnchorPane contentContainer;
private HBox leftNavPane, rightNavPane;
private ToggleButton buyButton, sellButton, homeButton, msgButton, portfolioButton, fundsButton, preferencesButton,
private ToggleButton buyButton, sellButton, homeButton, msgButton, portfolioButton, fundsButton, settingsButton,
accountButton;
private Pane portfolioButtonButtonPane;
private Label numPendingTradesLabel;
@ -253,8 +253,8 @@ public class MainViewCB extends ViewCB<MainPM> {
case PORTFOLIO:
portfolioButton.setSelected(true);
break;
case PREFERENCES:
preferencesButton.setSelected(true);
case SETTINGS:
settingsButton.setSelected(true);
break;
case SELL:
sellButton.setSelected(true);
@ -409,7 +409,7 @@ public class MainViewCB extends ViewCB<MainPM> {
addBankAccountComboBox(rightNavPane);
preferencesButton = addNavButton(rightNavPane, "Preferences", Navigation.Item.PREFERENCES);
settingsButton = addNavButton(rightNavPane, "Settings", Navigation.Item.SETTINGS);
accountButton = addNavButton(rightNavPane, "Account", Navigation.Item.ACCOUNT);

View File

@ -25,6 +25,6 @@
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml">
<Tab fx:id="accountSettingsTab" closable="false"/>
<Tab fx:id="arbitratorSettingsTab" text="Arbitrator settings" closable="false"/>
<Tab fx:id="arbitratorSettingsTab" text="Arbitrator setup" closable="false"/>
</TabPane>

View File

@ -21,7 +21,7 @@ import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import java.net.URL;
@ -35,7 +35,7 @@ import javafx.scene.control.*;
// TODO Arbitration is very basic yet
public class ArbitratorProfileViewCB extends CachedViewCB {
private final ApplicationPreferences applicationPreferences;
private final Preferences preferences;
private final Persistence persistence;
private final BSFormatter formatter;
@ -53,9 +53,9 @@ public class ArbitratorProfileViewCB extends CachedViewCB {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public ArbitratorProfileViewCB(ApplicationPreferences applicationPreferences, Persistence persistence,
public ArbitratorProfileViewCB(Preferences preferences, Persistence persistence,
BSFormatter formatter) {
this.applicationPreferences = applicationPreferences;
this.preferences = preferences;
this.persistence = persistence;
// ApplicationPreferences persistedApplicationPreferences = (ApplicationPreferences) storage

View File

@ -19,12 +19,12 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.preferences.PreferencesViewCB"
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.settings.SettingsViewCB"
AnchorPane.bottomAnchor="0" AnchorPane.leftAnchor="0"
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml">
<Tab fx:id="applicationTab" text="Application preferences" closable="false"/>
<Tab fx:id="networkTab" text="Network" closable="false"/>
<Tab fx:id="preferencesTab" text="Preferences" closable="false"/>
<Tab fx:id="networkSettingsTab" text="Network info" closable="false"/>
</TabPane>

View File

@ -15,13 +15,13 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.preferences;
package io.bitsquare.gui.main.settings;
import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.ViewCB;
import io.bitsquare.gui.ViewLoader;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import java.net.URL;
@ -38,16 +38,16 @@ import javafx.scene.control.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PreferencesViewCB extends CachedViewCB {
private static final Logger log = LoggerFactory.getLogger(PreferencesViewCB.class);
public class SettingsViewCB extends CachedViewCB {
private static final Logger log = LoggerFactory.getLogger(SettingsViewCB.class);
private final Navigation navigation;
private ApplicationPreferences applicationPreferences;
private Preferences preferences;
private Navigation.Listener navigationListener;
private ChangeListener<Tab> tabChangeListener;
@FXML Tab applicationTab, networkTab;
@FXML Tab preferencesTab, networkSettingsTab;
///////////////////////////////////////////////////////////////////////////////////////////
@ -55,11 +55,11 @@ public class PreferencesViewCB extends CachedViewCB {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
PreferencesViewCB(Navigation navigation, ApplicationPreferences applicationPreferences) {
SettingsViewCB(Navigation navigation, Preferences preferences) {
super();
this.navigation = navigation;
this.applicationPreferences = applicationPreferences;
this.preferences = preferences;
}
@ -71,17 +71,17 @@ public class PreferencesViewCB extends CachedViewCB {
public void initialize(URL url, ResourceBundle rb) {
navigationListener = navigationItems -> {
if (navigationItems != null && navigationItems.length == 3
&& navigationItems[1] == Navigation.Item.PREFERENCES)
&& navigationItems[1] == Navigation.Item.SETTINGS)
loadView(navigationItems[2]);
};
tabChangeListener = (ov, oldValue, newValue) -> {
if (newValue == applicationTab)
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PREFERENCES,
Navigation.Item.APPLICATION_PREFERENCES);
else if (newValue == networkTab)
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PREFERENCES,
Navigation.Item.NETWORK_PREFERENCES);
if (newValue == preferencesTab)
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.SETTINGS,
Navigation.Item.PREFERENCES);
else if (newValue == networkSettingsTab)
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.SETTINGS,
Navigation.Item.NETWORK_SETTINGS);
};
super.initialize(url, rb);
@ -94,14 +94,14 @@ public class PreferencesViewCB extends CachedViewCB {
((TabPane) root).getSelectionModel().selectedItemProperty().addListener(tabChangeListener);
navigation.addListener(navigationListener);
if (((TabPane) root).getSelectionModel().getSelectedItem() == applicationTab)
if (((TabPane) root).getSelectionModel().getSelectedItem() == preferencesTab)
navigation.navigationTo(Navigation.Item.MAIN,
Navigation.Item.PREFERENCES,
Navigation.Item.APPLICATION_PREFERENCES);
Navigation.Item.SETTINGS,
Navigation.Item.PREFERENCES);
else
navigation.navigationTo(Navigation.Item.MAIN,
Navigation.Item.PREFERENCES,
Navigation.Item.NETWORK_PREFERENCES);
Navigation.Item.SETTINGS,
Navigation.Item.NETWORK_SETTINGS);
}
@Override
@ -112,12 +112,6 @@ public class PreferencesViewCB extends CachedViewCB {
navigation.removeListener(navigationListener);
}
@SuppressWarnings("EmptyMethod")
@Override
public void terminate() {
super.terminate();
}
///////////////////////////////////////////////////////////////////////////////////////////
// Navigation
@ -131,11 +125,11 @@ public class PreferencesViewCB extends CachedViewCB {
Parent view = loader.load();
Tab tab = null;
switch (navigationItem) {
case APPLICATION_PREFERENCES:
tab = applicationTab;
case PREFERENCES:
tab = preferencesTab;
break;
case NETWORK_PREFERENCES:
tab = networkTab;
case NETWORK_SETTINGS:
tab = networkSettingsTab;
break;
}
tab.setContent(view);

View File

@ -15,10 +15,10 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.preferences.application;
package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.UIModel;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import com.google.inject.Inject;
@ -33,10 +33,10 @@ import javafx.collections.ObservableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class ApplicationPreferencesModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(ApplicationPreferencesModel.class);
class PreferencesModel extends UIModel {
private static final Logger log = LoggerFactory.getLogger(PreferencesModel.class);
private final ApplicationPreferences applicationPreferences;
private final Preferences preferences;
private final ChangeListener<Boolean> useAnimationsListener;
private final ChangeListener<Boolean> useEffectsListener;
@ -54,13 +54,13 @@ class ApplicationPreferencesModel extends UIModel {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
ApplicationPreferencesModel(ApplicationPreferences applicationPreferences) {
this.applicationPreferences = applicationPreferences;
PreferencesModel(Preferences preferences) {
this.preferences = preferences;
btcDenominations = FXCollections.observableArrayList(applicationPreferences.getBtcDenominations());
btcDenominationListener = (ov, oldValue, newValue) -> applicationPreferences.setBtcDenomination(newValue);
useAnimationsListener = (ov, oldValue, newValue) -> applicationPreferences.setUseAnimations(newValue);
useEffectsListener = (ov, oldValue, newValue) -> applicationPreferences.setUseEffects(newValue);
btcDenominations = FXCollections.observableArrayList(preferences.getBtcDenominations());
btcDenominationListener = (ov, oldValue, newValue) -> preferences.setBtcDenomination(newValue);
useAnimationsListener = (ov, oldValue, newValue) -> preferences.setUseAnimations(newValue);
useEffectsListener = (ov, oldValue, newValue) -> preferences.setUseEffects(newValue);
}
@ -78,9 +78,9 @@ class ApplicationPreferencesModel extends UIModel {
public void activate() {
super.activate();
useAnimations.set(applicationPreferences.getUseAnimations());
useEffects.set(applicationPreferences.getUseEffects());
btcDenomination.set(applicationPreferences.getBtcDenomination());
useAnimations.set(preferences.getUseAnimations());
useEffects.set(preferences.getUseEffects());
btcDenomination.set(preferences.getBtcDenomination());
useAnimations.addListener(useAnimationsListener);
useEffects.addListener(useEffectsListener);

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.preferences.application;
package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.PresentationModel;
@ -28,8 +28,8 @@ import javafx.collections.ObservableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ApplicationPreferencesPM extends PresentationModel<ApplicationPreferencesModel> {
private static final Logger log = LoggerFactory.getLogger(ApplicationPreferencesPM.class);
public class PreferencesPM extends PresentationModel<PreferencesModel> {
private static final Logger log = LoggerFactory.getLogger(PreferencesPM.class);
///////////////////////////////////////////////////////////////////////////////////////////
@ -37,7 +37,7 @@ public class ApplicationPreferencesPM extends PresentationModel<ApplicationPrefe
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
ApplicationPreferencesPM(ApplicationPreferencesModel model) {
PreferencesPM(PreferencesModel model) {
super(model);
}

View File

@ -22,7 +22,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<GridPane fx:id="root" fx:controller="io.bitsquare.gui.main.preferences.application.ApplicationPreferencesViewCB"
<GridPane fx:id="root" fx:controller="io.bitsquare.gui.main.settings.application.PreferencesViewCB"
hgap="5.0" vgap="5.0"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
@ -32,7 +32,7 @@
<Insets bottom="10.0" left="25.0" top="30.0" right="25"/>
</padding>
<TitledGroupBg text="General application preferences" GridPane.rowSpan="8"/>
<TitledGroupBg text="Preferences" GridPane.rowSpan="8"/>
<Label text="Bitcoin denomination:" GridPane.rowIndex="0">
<GridPane.margin>

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.preferences.application;
package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.CachedViewCB;
@ -34,9 +34,9 @@ import org.slf4j.LoggerFactory;
/**
* This UI is not cached as it is normally only needed once.
*/
public class ApplicationPreferencesViewCB extends CachedViewCB<ApplicationPreferencesPM> {
public class PreferencesViewCB extends CachedViewCB<PreferencesPM> {
private static final Logger log = LoggerFactory.getLogger(ApplicationPreferencesViewCB.class);
private static final Logger log = LoggerFactory.getLogger(PreferencesViewCB.class);
@FXML ComboBox<String> btcDenominationComboBox;
@FXML CheckBox useAnimationsCheckBox, useEffectsCheckBox;
@ -47,7 +47,7 @@ public class ApplicationPreferencesViewCB extends CachedViewCB<ApplicationPrefer
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
private ApplicationPreferencesViewCB(ApplicationPreferencesPM presentationModel) {
private PreferencesViewCB(PreferencesPM presentationModel) {
super(presentationModel);
}

View File

@ -21,7 +21,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<GridPane fx:id="root" fx:controller="io.bitsquare.gui.main.preferences.network.NetworkPreferencesViewCB"
<GridPane fx:id="root" fx:controller="io.bitsquare.gui.main.settings.network.NetworkSettingsViewCB"
hgap="5.0" vgap="5.0"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.preferences.network;
package io.bitsquare.gui.main.settings.network;
import io.bitsquare.btc.BitcoinNetwork;
import io.bitsquare.network.ClientNode;
@ -30,7 +30,7 @@ import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
public class NetworkPreferencesViewCB implements Initializable {
public class NetworkSettingsViewCB implements Initializable {
private final String bitcoinNetworkValue;
private final ClientNode clientNode;
@ -38,7 +38,7 @@ public class NetworkPreferencesViewCB implements Initializable {
@FXML TextField bitcoinNetwork, connectionType, nodeAddress, bootstrapNodeAddress;
@Inject
public NetworkPreferencesViewCB(BitcoinNetwork bitcoinNetwork, ClientNode clientNode) {
public NetworkSettingsViewCB(BitcoinNetwork bitcoinNetwork, ClientNode clientNode) {
this.bitcoinNetworkValue = bitcoinNetwork.toString();
this.clientNode = clientNode;
}

View File

@ -29,7 +29,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.Country;
import io.bitsquare.offer.Direction;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import io.bitsquare.trade.TradeManager;
import io.bitsquare.user.User;
@ -70,7 +70,7 @@ class CreateOfferModel extends UIModel {
private final TradeManager tradeManager;
private final WalletService walletService;
private final AccountSettings accountSettings;
private ApplicationPreferences applicationPreferences;
private Preferences preferences;
private final User user;
private final Persistence persistence;
private final BSFormatter formatter;
@ -113,12 +113,12 @@ class CreateOfferModel extends UIModel {
// non private for testing
@Inject
public CreateOfferModel(TradeManager tradeManager, WalletService walletService, AccountSettings accountSettings,
ApplicationPreferences applicationPreferences, User user, Persistence persistence,
Preferences preferences, User user, Persistence persistence,
BSFormatter formatter) {
this.tradeManager = tradeManager;
this.walletService = walletService;
this.accountSettings = accountSettings;
this.applicationPreferences = applicationPreferences;
this.preferences = preferences;
this.user = user;
this.persistence = persistence;
this.formatter = formatter;
@ -156,7 +156,7 @@ class CreateOfferModel extends UIModel {
}
if (accountSettings != null)
btcCode.bind(applicationPreferences.btcDenominationProperty());
btcCode.bind(preferences.btcDenominationProperty());
// we need to set it here already as initWithData is called before activate
if (accountSettings != null)

View File

@ -24,7 +24,7 @@ import io.bitsquare.locale.Country;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.offer.Direction;
import io.bitsquare.offer.Offer;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import io.bitsquare.trade.TradeManager;
import io.bitsquare.user.User;
@ -56,7 +56,7 @@ class OfferBookModel extends UIModel {
private final User user;
private final OfferBook offerBook;
private final ApplicationPreferences applicationPreferences;
private final Preferences preferences;
private final BSFormatter formatter;
private final TradeManager tradeManager;
@ -85,12 +85,12 @@ class OfferBookModel extends UIModel {
OfferBookModel(User user,
TradeManager tradeManager,
OfferBook offerBook,
ApplicationPreferences applicationPreferences,
Preferences preferences,
BSFormatter formatter) {
this.tradeManager = tradeManager;
this.user = user;
this.offerBook = offerBook;
this.applicationPreferences = applicationPreferences;
this.preferences = preferences;
this.formatter = formatter;
filteredItems = new FilteredList<>(offerBook.getOfferBookListItems());
@ -119,7 +119,7 @@ class OfferBookModel extends UIModel {
offerBook.addClient();
user.currentBankAccountProperty().addListener(bankAccountChangeListener);
btcCode.bind(applicationPreferences.btcDenominationProperty());
btcCode.bind(preferences.btcDenominationProperty());
setBankAccount(user.getCurrentBankAccount());
applyFilter();
@ -199,7 +199,7 @@ class OfferBookModel extends UIModel {
// we might get rid of languages (handles viy arbitrators)
/*
// disjoint returns true if the two specified collections have no elements in common.
boolean languageResult = !Collections.disjoint(applicationPreferences.getAcceptedLanguageLocales(),
boolean languageResult = !Collections.disjoint(preferences.getAcceptedLanguageLocales(),
offer.getAcceptedLanguageLocales());
if (!languageResult)
restrictionsInfo.set("This offer requires that the payments account resides in one of those languages:\n" +
@ -207,7 +207,7 @@ class OfferBookModel extends UIModel {
"\n\nThe country of your payments account (" + user.getCurrentBankAccount().getCountry().getName() +
") is not included in that list.");
boolean arbitratorResult = !Collections.disjoint(applicationPreferences.getAcceptedArbitrators(),
boolean arbitratorResult = !Collections.disjoint(preferences.getAcceptedArbitrators(),
offer.getArbitrators());*/
return countryResult;

View File

@ -24,7 +24,7 @@ import io.bitsquare.btc.listeners.BalanceListener;
import io.bitsquare.gui.UIModel;
import io.bitsquare.offer.Offer;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import io.bitsquare.trade.Trade;
import io.bitsquare.trade.TradeManager;
@ -56,7 +56,7 @@ class TakeOfferModel extends UIModel {
private final TradeManager tradeManager;
private final WalletService walletService;
private final ApplicationPreferences applicationPreferences;
private final Preferences preferences;
private final Persistence persistence;
private Offer offer;
@ -84,10 +84,10 @@ class TakeOfferModel extends UIModel {
@Inject
TakeOfferModel(TradeManager tradeManager, WalletService walletService,
ApplicationPreferences applicationPreferences, Persistence persistence) {
Preferences preferences, Persistence persistence) {
this.tradeManager = tradeManager;
this.walletService = walletService;
this.applicationPreferences = applicationPreferences;
this.preferences = preferences;
this.persistence = persistence;
}
@ -108,7 +108,7 @@ class TakeOfferModel extends UIModel {
public void activate() {
super.activate();
btcCode.bind(applicationPreferences.btcDenominationProperty());
btcCode.bind(preferences.btcDenominationProperty());
}
@SuppressWarnings("EmptyMethod")

View File

@ -17,7 +17,7 @@
package io.bitsquare.gui.util;
import io.bitsquare.preferences.ApplicationPreferences;
import io.bitsquare.settings.Preferences;
import javax.inject.Inject;
@ -40,16 +40,16 @@ public class Transitions {
public final static int DEFAULT_DURATION = 400;
private ApplicationPreferences applicationPreferences;
private Preferences preferences;
private Timeline removeBlurTimeLine;
@Inject
public Transitions(ApplicationPreferences applicationPreferences) {
this.applicationPreferences = applicationPreferences;
public Transitions(Preferences preferences) {
this.preferences = preferences;
}
private int evaluateDuration(int duration) {
return applicationPreferences.getUseAnimations() ? duration : 1;
return preferences.getUseAnimations() ? duration : 1;
}
// Fade
@ -58,7 +58,7 @@ public class Transitions {
}
public void fadeIn(Node node, int duration) {
if (applicationPreferences.getUseEffects()) {
if (preferences.getUseEffects()) {
FadeTransition fade = new FadeTransition(Duration.millis(evaluateDuration(duration)), node);
fade.setFromValue(node.getOpacity());
fade.setToValue(1.0);
@ -71,7 +71,7 @@ public class Transitions {
}
public FadeTransition fadeOut(Node node, int duration) {
if (!applicationPreferences.getUseEffects())
if (!preferences.getUseEffects())
duration = 1;
FadeTransition fade = new FadeTransition(Duration.millis(evaluateDuration(duration)), node);
@ -86,7 +86,7 @@ public class Transitions {
}
public void fadeOutAndRemove(Node node, int duration) {
if (!applicationPreferences.getUseEffects())
if (!preferences.getUseEffects())
duration = 1;
FadeTransition fade = fadeOut(node, evaluateDuration(duration));
@ -103,7 +103,7 @@ public class Transitions {
}
public void blur(Node node, int duration, boolean useDarken, boolean removeNode) {
if (applicationPreferences.getUseEffects()) {
if (preferences.getUseEffects()) {
if (removeBlurTimeLine != null)
removeBlurTimeLine.stop();
@ -136,7 +136,7 @@ public class Transitions {
}
public void removeBlur(Node node, int duration, boolean useDarken) {
if (applicationPreferences.getUseEffects()) {
if (preferences.getUseEffects()) {
if (node != null) {
GaussianBlur blur = (GaussianBlur) node.getEffect();
if (blur != null) {

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.preferences;
package io.bitsquare.settings;
import io.bitsquare.persistence.Persistence;
@ -36,9 +36,9 @@ import javafx.beans.property.StringProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ApplicationPreferences implements Serializable {
public class Preferences implements Serializable {
private static final long serialVersionUID = 7995048077355006861L;
private static final Logger log = LoggerFactory.getLogger(ApplicationPreferences.class);
private static final Logger log = LoggerFactory.getLogger(Preferences.class);
// deactivate mBit for now as most screens are not supporting it yet
private List<String> btcDenominations = Arrays.asList(MonetaryFormat.CODE_BTC/*, MonetaryFormat.CODE_MBTC*/);
@ -61,7 +61,7 @@ public class ApplicationPreferences implements Serializable {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public ApplicationPreferences(Persistence persistence) {
public Preferences(Persistence persistence) {
this.persistence = persistence;
applyPersistedSettings();

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB