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.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.preferences.ApplicationPreferences; import io.bitsquare.settings.Preferences;
import io.bitsquare.trade.TradeModule; import io.bitsquare.trade.TradeModule;
import io.bitsquare.user.User; import io.bitsquare.user.User;
@ -53,7 +53,7 @@ class BitsquareAppModule extends BitsquareModule {
@Override @Override
protected void configure() { protected void configure() {
bind(User.class).asEagerSingleton(); bind(User.class).asEagerSingleton();
bind(ApplicationPreferences.class).asEagerSingleton(); bind(Preferences.class).asEagerSingleton();
bind(AccountSettings.class).asEagerSingleton(); bind(AccountSettings.class).asEagerSingleton();
File persistenceDir = new File(env.getRequiredProperty(Persistence.DIR_KEY)); 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"), PORTFOLIO("/io/bitsquare/gui/main/portfolio/PortfolioView.fxml"),
FUNDS("/io/bitsquare/gui/main/funds/FundsView.fxml"), FUNDS("/io/bitsquare/gui/main/funds/FundsView.fxml"),
MSG("/io/bitsquare/gui/main/msg/MsgView.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"), ACCOUNT("/io/bitsquare/gui/main/account/AccountView.fxml"),
@ -187,9 +187,9 @@ public class Navigation {
WITHDRAWAL("/io/bitsquare/gui/main/funds/withdrawal/WithdrawalView.fxml"), WITHDRAWAL("/io/bitsquare/gui/main/funds/withdrawal/WithdrawalView.fxml"),
TRANSACTIONS("/io/bitsquare/gui/main/funds/transactions/TransactionsView.fxml"), TRANSACTIONS("/io/bitsquare/gui/main/funds/transactions/TransactionsView.fxml"),
// preferences // settings
APPLICATION_PREFERENCES("/io/bitsquare/gui/main/preferences/application/ApplicationPreferencesView.fxml"), PREFERENCES("/io/bitsquare/gui/main/settings/application/PreferencesView.fxml"),
NETWORK_PREFERENCES("/io/bitsquare/gui/main/preferences/network/NetworkPreferencesView.fxml"), NETWORK_SETTINGS("/io/bitsquare/gui/main/settings/network/NetworkSettingsView.fxml"),
// account // account
ACCOUNT_SETUP("/io/bitsquare/gui/main/account/setup/AccountSetupView.fxml"), ACCOUNT_SETUP("/io/bitsquare/gui/main/account/setup/AccountSetupView.fxml"),

View File

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

View File

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

View File

@ -25,6 +25,6 @@
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0" AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<Tab fx:id="accountSettingsTab" closable="false"/> <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> </TabPane>

View File

@ -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.preferences.ApplicationPreferences; import io.bitsquare.settings.Preferences;
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 ApplicationPreferences applicationPreferences; private final Preferences preferences;
private final Persistence persistence; private final Persistence persistence;
private final BSFormatter formatter; private final BSFormatter formatter;
@ -53,9 +53,9 @@ public class ArbitratorProfileViewCB extends CachedViewCB {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Inject @Inject
public ArbitratorProfileViewCB(ApplicationPreferences applicationPreferences, Persistence persistence, public ArbitratorProfileViewCB(Preferences preferences, Persistence persistence,
BSFormatter formatter) { BSFormatter formatter) {
this.applicationPreferences = applicationPreferences; this.preferences = preferences;
this.persistence = persistence; this.persistence = persistence;
// ApplicationPreferences persistedApplicationPreferences = (ApplicationPreferences) storage // ApplicationPreferences persistedApplicationPreferences = (ApplicationPreferences) storage

View File

@ -19,12 +19,12 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?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.bottomAnchor="0" AnchorPane.leftAnchor="0"
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0" AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<Tab fx:id="applicationTab" text="Application preferences" closable="false"/> <Tab fx:id="preferencesTab" text="Preferences" closable="false"/>
<Tab fx:id="networkTab" text="Network" closable="false"/> <Tab fx:id="networkSettingsTab" text="Network info" closable="false"/>
</TabPane> </TabPane>

View File

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

View File

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

View File

@ -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.gui.main.preferences.application; package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.PresentationModel; import io.bitsquare.gui.PresentationModel;
@ -28,8 +28,8 @@ import javafx.collections.ObservableList;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class ApplicationPreferencesPM extends PresentationModel<ApplicationPreferencesModel> { public class PreferencesPM extends PresentationModel<PreferencesModel> {
private static final Logger log = LoggerFactory.getLogger(ApplicationPreferencesPM.class); private static final Logger log = LoggerFactory.getLogger(PreferencesPM.class);
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -37,7 +37,7 @@ public class ApplicationPreferencesPM extends PresentationModel<ApplicationPrefe
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Inject @Inject
ApplicationPreferencesPM(ApplicationPreferencesModel model) { PreferencesPM(PreferencesModel model) {
super(model); super(model);
} }

View File

@ -22,7 +22,7 @@
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?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" hgap="5.0" vgap="5.0"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="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"/> <Insets bottom="10.0" left="25.0" top="30.0" right="25"/>
</padding> </padding>
<TitledGroupBg text="General application preferences" GridPane.rowSpan="8"/> <TitledGroupBg text="Preferences" GridPane.rowSpan="8"/>
<Label text="Bitcoin denomination:" GridPane.rowIndex="0"> <Label text="Bitcoin denomination:" GridPane.rowIndex="0">
<GridPane.margin> <GridPane.margin>

View File

@ -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.gui.main.preferences.application; package io.bitsquare.gui.main.settings.application;
import io.bitsquare.gui.CachedViewCB; 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. * 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 ComboBox<String> btcDenominationComboBox;
@FXML CheckBox useAnimationsCheckBox, useEffectsCheckBox; @FXML CheckBox useAnimationsCheckBox, useEffectsCheckBox;
@ -47,7 +47,7 @@ public class ApplicationPreferencesViewCB extends CachedViewCB<ApplicationPrefer
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Inject @Inject
private ApplicationPreferencesViewCB(ApplicationPreferencesPM presentationModel) { private PreferencesViewCB(PreferencesPM presentationModel) {
super(presentationModel); super(presentationModel);
} }

View File

@ -21,7 +21,7 @@
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?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" hgap="5.0" vgap="5.0"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="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/>. * 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.btc.BitcoinNetwork;
import io.bitsquare.network.ClientNode; import io.bitsquare.network.ClientNode;
@ -30,7 +30,7 @@ import javafx.fxml.FXML;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.*; import javafx.scene.control.*;
public class NetworkPreferencesViewCB implements Initializable { public class NetworkSettingsViewCB implements Initializable {
private final String bitcoinNetworkValue; private final String bitcoinNetworkValue;
private final ClientNode clientNode; private final ClientNode clientNode;
@ -38,7 +38,7 @@ public class NetworkPreferencesViewCB implements Initializable {
@FXML TextField bitcoinNetwork, connectionType, nodeAddress, bootstrapNodeAddress; @FXML TextField bitcoinNetwork, connectionType, nodeAddress, bootstrapNodeAddress;
@Inject @Inject
public NetworkPreferencesViewCB(BitcoinNetwork bitcoinNetwork, ClientNode clientNode) { public NetworkSettingsViewCB(BitcoinNetwork bitcoinNetwork, ClientNode clientNode) {
this.bitcoinNetworkValue = bitcoinNetwork.toString(); this.bitcoinNetworkValue = bitcoinNetwork.toString();
this.clientNode = clientNode; this.clientNode = clientNode;
} }

View File

@ -29,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.preferences.ApplicationPreferences; import io.bitsquare.settings.Preferences;
import io.bitsquare.trade.TradeManager; import io.bitsquare.trade.TradeManager;
import io.bitsquare.user.User; import io.bitsquare.user.User;
@ -70,7 +70,7 @@ class CreateOfferModel extends UIModel {
private final TradeManager tradeManager; private final TradeManager tradeManager;
private final WalletService walletService; private final WalletService walletService;
private final AccountSettings accountSettings; private final AccountSettings accountSettings;
private ApplicationPreferences applicationPreferences; private Preferences preferences;
private final User user; private final User user;
private final Persistence persistence; private final Persistence persistence;
private final BSFormatter formatter; private final BSFormatter formatter;
@ -113,12 +113,12 @@ class CreateOfferModel extends UIModel {
// non private for testing // non private for testing
@Inject @Inject
public CreateOfferModel(TradeManager tradeManager, WalletService walletService, AccountSettings accountSettings, public CreateOfferModel(TradeManager tradeManager, WalletService walletService, AccountSettings accountSettings,
ApplicationPreferences applicationPreferences, User user, Persistence persistence, Preferences preferences, User user, Persistence persistence,
BSFormatter formatter) { BSFormatter formatter) {
this.tradeManager = tradeManager; this.tradeManager = tradeManager;
this.walletService = walletService; this.walletService = walletService;
this.accountSettings = accountSettings; this.accountSettings = accountSettings;
this.applicationPreferences = applicationPreferences; this.preferences = preferences;
this.user = user; this.user = user;
this.persistence = persistence; this.persistence = persistence;
this.formatter = formatter; this.formatter = formatter;
@ -156,7 +156,7 @@ class CreateOfferModel extends UIModel {
} }
if (accountSettings != null) if (accountSettings != null)
btcCode.bind(applicationPreferences.btcDenominationProperty()); btcCode.bind(preferences.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 (accountSettings != null) if (accountSettings != null)

View File

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

View File

@ -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.preferences.ApplicationPreferences; import io.bitsquare.settings.Preferences;
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 WalletService walletService; private final WalletService walletService;
private final ApplicationPreferences applicationPreferences; private final Preferences preferences;
private final Persistence persistence; private final Persistence persistence;
private Offer offer; private Offer offer;
@ -84,10 +84,10 @@ class TakeOfferModel extends UIModel {
@Inject @Inject
TakeOfferModel(TradeManager tradeManager, WalletService walletService, TakeOfferModel(TradeManager tradeManager, WalletService walletService,
ApplicationPreferences applicationPreferences, Persistence persistence) { Preferences preferences, Persistence persistence) {
this.tradeManager = tradeManager; this.tradeManager = tradeManager;
this.walletService = walletService; this.walletService = walletService;
this.applicationPreferences = applicationPreferences; this.preferences = preferences;
this.persistence = persistence; this.persistence = persistence;
} }
@ -108,7 +108,7 @@ class TakeOfferModel extends UIModel {
public void activate() { public void activate() {
super.activate(); super.activate();
btcCode.bind(applicationPreferences.btcDenominationProperty()); btcCode.bind(preferences.btcDenominationProperty());
} }
@SuppressWarnings("EmptyMethod") @SuppressWarnings("EmptyMethod")

View File

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

View File

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