mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-28 17:34:11 -04:00
Apply code inspection
This commit is contained in:
parent
17c780639f
commit
60a027e00d
45 changed files with 176 additions and 132 deletions
|
@ -7,7 +7,7 @@ new blue: 0f87c3
|
||||||
new grey: 666666
|
new grey: 666666
|
||||||
|
|
||||||
00abff
|
00abff
|
||||||
orange webpage quotes : ff7f00
|
orange web page quotes : ff7f00
|
||||||
|
|
||||||
|
|
||||||
main bg grey: dddddd
|
main bg grey: dddddd
|
||||||
|
@ -679,7 +679,7 @@ textfield */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copied form modena.css text-input */
|
/* copied form modena.css text-input */
|
||||||
#flowpane-checkboxes-bg {
|
#flow-pane-checkboxes-bg {
|
||||||
-fx-text-fill: -fx-text-inner-color;
|
-fx-text-fill: -fx-text-inner-color;
|
||||||
-fx-highlight-fill: derive(-fx-control-inner-background, -20%);
|
-fx-highlight-fill: derive(-fx-control-inner-background, -20%);
|
||||||
-fx-highlight-text-fill: -fx-text-inner-color;
|
-fx-highlight-text-fill: -fx-text-inner-color;
|
||||||
|
@ -691,7 +691,7 @@ textfield */
|
||||||
-fx-padding: 0.333333em 0.583em 0.333333em 0.583em; /* 4 7 4 7 */
|
-fx-padding: 0.333333em 0.583em 0.333333em 0.583em; /* 4 7 4 7 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#flowpane-checkboxes-non-editable-bg {
|
#flow-pane-checkboxes-non-editable-bg {
|
||||||
-fx-text-fill: -fx-text-inner-color;
|
-fx-text-fill: -fx-text-inner-color;
|
||||||
-fx-highlight-fill: derive(-fx-control-inner-background, -20%);
|
-fx-highlight-fill: derive(-fx-control-inner-background, -20%);
|
||||||
-fx-highlight-text-fill: -fx-text-inner-color;
|
-fx-highlight-text-fill: -fx-text-inner-color;
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* 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.gui.common;
|
||||||
|
|
||||||
|
import static java.lang.String.format;
|
||||||
|
|
||||||
|
public class ViewFxException1 extends RuntimeException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6266047448442595372L;
|
||||||
|
|
||||||
|
public ViewFxException1(Throwable cause, String format, Object... args) {
|
||||||
|
super(format(format, args), cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ViewFxException1(String format, Object... args) {
|
||||||
|
super(format(format, args));
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.common.fxml;
|
package io.bitsquare.gui.common.fxml;
|
||||||
|
|
||||||
import io.bitsquare.gui.common.ViewfxException;
|
import io.bitsquare.gui.common.ViewFxException;
|
||||||
import io.bitsquare.gui.common.view.FxmlView;
|
import io.bitsquare.gui.common.view.FxmlView;
|
||||||
import io.bitsquare.gui.common.view.View;
|
import io.bitsquare.gui.common.view.View;
|
||||||
import io.bitsquare.gui.common.view.ViewFactory;
|
import io.bitsquare.gui.common.view.ViewFactory;
|
||||||
|
@ -76,13 +76,13 @@ public class FxmlViewLoader implements ViewLoader {
|
||||||
|
|
||||||
URL fxmlUrl = viewClass.getClassLoader().getResource(resolvedLocation);
|
URL fxmlUrl = viewClass.getClassLoader().getResource(resolvedLocation);
|
||||||
if (fxmlUrl == null)
|
if (fxmlUrl == null)
|
||||||
throw new ViewfxException(
|
throw new ViewFxException(
|
||||||
"Failed to load view class [%s] because FXML file at [%s] could not be loaded " +
|
"Failed to load view class [%s] because FXML file at [%s] could not be loaded " +
|
||||||
"as a classpath resource. Does it exist?", viewClass, specifiedLocation);
|
"as a classpath resource. Does it exist?", viewClass, specifiedLocation);
|
||||||
|
|
||||||
return loadFromFxml(fxmlUrl);
|
return loadFromFxml(fxmlUrl);
|
||||||
} catch (InstantiationException | IllegalAccessException ex) {
|
} catch (InstantiationException | IllegalAccessException ex) {
|
||||||
throw new ViewfxException(ex, "Failed to load view from class %s", viewClass);
|
throw new ViewFxException(ex, "Failed to load view from class %s", viewClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,14 +94,14 @@ public class FxmlViewLoader implements ViewLoader {
|
||||||
loader.load();
|
loader.load();
|
||||||
Object controller = loader.getController();
|
Object controller = loader.getController();
|
||||||
if (controller == null)
|
if (controller == null)
|
||||||
throw new ViewfxException("Failed to load view from FXML file at [%s]. " +
|
throw new ViewFxException("Failed to load view from FXML file at [%s]. " +
|
||||||
"Does it declare an fx:controller attribute?", fxmlUrl);
|
"Does it declare an fx:controller attribute?", fxmlUrl);
|
||||||
if (!(controller instanceof View))
|
if (!(controller instanceof View))
|
||||||
throw new ViewfxException("Controller of type [%s] loaded from FXML file at [%s] " +
|
throw new ViewFxException("Controller of type [%s] loaded from FXML file at [%s] " +
|
||||||
"does not implement [%s] as expected.", controller.getClass(), fxmlUrl, View.class);
|
"does not implement [%s] as expected.", controller.getClass(), fxmlUrl, View.class);
|
||||||
return (View) controller;
|
return (View) controller;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new ViewfxException(ex, "Failed to load view from FXML file at [%s]", fxmlUrl);
|
throw new ViewFxException(ex, "Failed to load view from FXML file at [%s]", fxmlUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public interface Activatable {
|
||||||
void _deactivate();
|
void _deactivate();
|
||||||
|
|
||||||
|
|
||||||
Activatable NOOP_INSTANCE = new Activatable() {
|
Activatable NO_OP_INSTANCE = new Activatable() {
|
||||||
@Override
|
@Override
|
||||||
public void _activate() {
|
public void _activate() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public abstract class ActivatableViewAndModel<R extends Node, M extends Activata
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActivatableViewAndModel() {
|
public ActivatableViewAndModel() {
|
||||||
this((M) Activatable.NOOP_INSTANCE);
|
this((M) Activatable.NO_OP_INSTANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class InfoDisplay extends Parent {
|
||||||
sceneProperty().addListener((ov, oldValue, newValue) -> {
|
sceneProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
if (oldValue == null && newValue != null && newValue.getWindow() != null) {
|
if (oldValue == null && newValue != null && newValue.getWindow() != null) {
|
||||||
newValue.getWindow().widthProperty().addListener(listener);
|
newValue.getWindow().widthProperty().addListener(listener);
|
||||||
// localToScene does deliver 0 instead of the correct x position when scene propery gets set,
|
// localToScene does deliver 0 instead of the correct x position when scene property gets set,
|
||||||
// so we delay for 1 render cycle
|
// so we delay for 1 render cycle
|
||||||
UserThread.execute(() -> {
|
UserThread.execute(() -> {
|
||||||
label.setVisible(true);
|
label.setVisible(true);
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
|
||||||
/**
|
/**
|
||||||
* ************************************************************************
|
* ************************************************************************
|
||||||
* *
|
* *
|
||||||
* UI Subcomponents *
|
* UI SubComponents *
|
||||||
* *
|
* *
|
||||||
* ************************************************************************
|
* ************************************************************************
|
||||||
*/
|
*/
|
||||||
|
@ -173,7 +173,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
|
||||||
return StyleableProperties.PROGRESS_COLOR;
|
return StyleableProperties.PROGRESS_COLOR;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private boolean timelineNulled = false;
|
private boolean timeLineNulled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ************************************************************************
|
* ************************************************************************
|
||||||
|
@ -192,8 +192,8 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
|
||||||
InvalidationListener visibilityListener = new InvalidationListener() {
|
InvalidationListener visibilityListener = new InvalidationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void invalidated(Observable valueModel) {
|
public void invalidated(Observable valueModel) {
|
||||||
if (getSkinnable().isIndeterminate() && timelineNulled && spinner == null) {
|
if (getSkinnable().isIndeterminate() && timeLineNulled && spinner == null) {
|
||||||
timelineNulled = false;
|
timeLineNulled = false;
|
||||||
spinner = new IndeterminateSpinner(
|
spinner = new IndeterminateSpinner(
|
||||||
getSkinnable(), ConfidenceProgressIndicatorSkin.this,
|
getSkinnable(), ConfidenceProgressIndicatorSkin.this,
|
||||||
spinEnabled.get(), progressColor.get());
|
spinEnabled.get(), progressColor.get());
|
||||||
|
@ -204,7 +204,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
|
||||||
if (!(getSkinnable().impl_isTreeVisible() && getSkinnable().getScene() != null)) {
|
if (!(getSkinnable().impl_isTreeVisible() && getSkinnable().getScene() != null)) {
|
||||||
getChildren().remove(spinner);
|
getChildren().remove(spinner);
|
||||||
spinner = null;
|
spinner = null;
|
||||||
timelineNulled = true;
|
timeLineNulled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,11 +219,11 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
|
||||||
if (getSkinnable().getScene() == null) {
|
if (getSkinnable().getScene() == null) {
|
||||||
getChildren().remove(spinner);
|
getChildren().remove(spinner);
|
||||||
spinner = null;
|
spinner = null;
|
||||||
timelineNulled = true;
|
timeLineNulled = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (getSkinnable().getScene() != null && getSkinnable().isIndeterminate()) {
|
if (getSkinnable().getScene() != null && getSkinnable().isIndeterminate()) {
|
||||||
timelineNulled = false;
|
timeLineNulled = false;
|
||||||
spinner = new IndeterminateSpinner(
|
spinner = new IndeterminateSpinner(
|
||||||
getSkinnable(), ConfidenceProgressIndicatorSkin.this,
|
getSkinnable(), ConfidenceProgressIndicatorSkin.this,
|
||||||
spinEnabled.get(), progressColor.get());
|
spinEnabled.get(), progressColor.get());
|
||||||
|
|
|
@ -50,8 +50,7 @@ public class BlockChainForm extends PaymentMethodForm {
|
||||||
|
|
||||||
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountContractData paymentAccountContractData) {
|
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountContractData paymentAccountContractData) {
|
||||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, "Cryptocurrency address:", ((BlockChainAccountContractData) paymentAccountContractData).getAddress());
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, "Cryptocurrency address:", ((BlockChainAccountContractData) paymentAccountContractData).getAddress());
|
||||||
if (paymentAccountContractData instanceof BlockChainAccountContractData &&
|
if (((BlockChainAccountContractData) paymentAccountContractData).getPaymentId() != null)
|
||||||
((BlockChainAccountContractData) paymentAccountContractData).getPaymentId() != null)
|
|
||||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, "Payment ID:", ((BlockChainAccountContractData) paymentAccountContractData).getPaymentId());
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, "Payment ID:", ((BlockChainAccountContractData) paymentAccountContractData).getPaymentId());
|
||||||
|
|
||||||
return gridRow;
|
return gridRow;
|
||||||
|
|
|
@ -84,9 +84,9 @@ public class OKPayForm extends PaymentMethodForm {
|
||||||
flowPane.setHgap(10);
|
flowPane.setHgap(10);
|
||||||
|
|
||||||
if (isEditable)
|
if (isEditable)
|
||||||
flowPane.setId("flowpane-checkboxes-bg");
|
flowPane.setId("flow-pane-checkboxes-bg");
|
||||||
else
|
else
|
||||||
flowPane.setId("flowpane-checkboxes-non-editable-bg");
|
flowPane.setId("flow-pane-checkboxes-non-editable-bg");
|
||||||
|
|
||||||
CurrencyUtil.getAllOKPayCurrencies().stream().forEach(e ->
|
CurrencyUtil.getAllOKPayCurrencies().stream().forEach(e ->
|
||||||
{
|
{
|
||||||
|
|
|
@ -164,9 +164,9 @@ public class SepaForm extends PaymentMethodForm {
|
||||||
flowPane.setHgap(10);
|
flowPane.setHgap(10);
|
||||||
|
|
||||||
if (isEditable)
|
if (isEditable)
|
||||||
flowPane.setId("flowpane-checkboxes-bg");
|
flowPane.setId("flow-pane-checkboxes-bg");
|
||||||
else
|
else
|
||||||
flowPane.setId("flowpane-checkboxes-non-editable-bg");
|
flowPane.setId("flow-pane-checkboxes-non-editable-bg");
|
||||||
|
|
||||||
dataProvider.stream().forEach(country ->
|
dataProvider.stream().forEach(country ->
|
||||||
{
|
{
|
||||||
|
@ -255,7 +255,8 @@ public class SepaForm extends PaymentMethodForm {
|
||||||
ibanField.setMouseTransparent(false);
|
ibanField.setMouseTransparent(false);
|
||||||
TextField bicField = addLabelTextField(gridPane, ++gridRow, "BIC/SWIFT:", sepaAccount.getBic()).second;
|
TextField bicField = addLabelTextField(gridPane, ++gridRow, "BIC/SWIFT:", sepaAccount.getBic()).second;
|
||||||
bicField.setMouseTransparent(false);
|
bicField.setMouseTransparent(false);
|
||||||
addLabelTextField(gridPane, ++gridRow, "Location of Bank:", sepaAccount.getCountry().name);
|
addLabelTextField(gridPane, ++gridRow, "Location of Bank:",
|
||||||
|
sepaAccount.getCountry() != null ? sepaAccount.getCountry().name : "");
|
||||||
addLabelTextField(gridPane, ++gridRow, "Currency:", sepaAccount.getSingleTradeCurrency().getNameAndCode());
|
addLabelTextField(gridPane, ++gridRow, "Currency:", sepaAccount.getSingleTradeCurrency().getNameAndCode());
|
||||||
String countries;
|
String countries;
|
||||||
Tooltip tooltip = null;
|
Tooltip tooltip = null;
|
||||||
|
|
|
@ -154,6 +154,7 @@ class ProcessStepBarSkin<T> extends BehaviorSkinBase<ProcessStepBar<T>, Behavior
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open() {
|
public void open() {
|
||||||
|
//noinspection SuspiciousNameCombination,SuspiciousNameCombination
|
||||||
BorderStroke borderStroke = new BorderStroke(Colors.LIGHT_GREY, BorderStrokeStyle.SOLID, null,
|
BorderStroke borderStroke = new BorderStroke(Colors.LIGHT_GREY, BorderStrokeStyle.SOLID, null,
|
||||||
new BorderWidths(borderWidth, borderWidth, borderWidth, borderWidth), Insets.EMPTY);
|
new BorderWidths(borderWidth, borderWidth, borderWidth, borderWidth), Insets.EMPTY);
|
||||||
this.setBorder(new Border(borderStroke));
|
this.setBorder(new Border(borderStroke));
|
||||||
|
@ -161,6 +162,7 @@ class ProcessStepBarSkin<T> extends BehaviorSkinBase<ProcessStepBar<T>, Behavior
|
||||||
}
|
}
|
||||||
|
|
||||||
public void current() {
|
public void current() {
|
||||||
|
//noinspection SuspiciousNameCombination,SuspiciousNameCombination
|
||||||
BorderStroke borderStroke = new BorderStroke(Colors.GREEN, BorderStrokeStyle.SOLID, null,
|
BorderStroke borderStroke = new BorderStroke(Colors.GREEN, BorderStrokeStyle.SOLID, null,
|
||||||
new BorderWidths(borderWidth, borderWidth, borderWidth, borderWidth), Insets.EMPTY);
|
new BorderWidths(borderWidth, borderWidth, borderWidth, borderWidth), Insets.EMPTY);
|
||||||
this.setBorder(new Border(borderStroke));
|
this.setBorder(new Border(borderStroke));
|
||||||
|
@ -168,6 +170,7 @@ class ProcessStepBarSkin<T> extends BehaviorSkinBase<ProcessStepBar<T>, Behavior
|
||||||
}
|
}
|
||||||
|
|
||||||
public void past() {
|
public void past() {
|
||||||
|
//noinspection SuspiciousNameCombination,SuspiciousNameCombination
|
||||||
BorderStroke borderStroke = new BorderStroke(Color.valueOf("#444444"), BorderStrokeStyle.SOLID, null,
|
BorderStroke borderStroke = new BorderStroke(Color.valueOf("#444444"), BorderStrokeStyle.SOLID, null,
|
||||||
new BorderWidths(borderWidth, borderWidth, borderWidth, borderWidth), Insets.EMPTY);
|
new BorderWidths(borderWidth, borderWidth, borderWidth, borderWidth), Insets.EMPTY);
|
||||||
this.setBorder(new Border(borderStroke));
|
this.setBorder(new Border(borderStroke));
|
||||||
|
|
|
@ -464,13 +464,11 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||||
p2PNetworkIcon.setOpacity(1);
|
p2PNetworkIcon.setOpacity(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
AnchorPane footerContainer = new AnchorPane(separator, blockchainSyncBox, versionLabel, p2PNetworkLabel, p2PNetworkIcon) {{
|
return new AnchorPane(separator, blockchainSyncBox, versionLabel, p2PNetworkLabel, p2PNetworkIcon) {{
|
||||||
setId("footer-pane");
|
setId("footer-pane");
|
||||||
setMinHeight(30);
|
setMinHeight(30);
|
||||||
setMaxHeight(30);
|
setMaxHeight(30);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
return footerContainer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupNotificationIcon(Pane buttonHolder) {
|
private void setupNotificationIcon(Pane buttonHolder) {
|
||||||
|
|
|
@ -91,9 +91,9 @@ public class MainViewModel implements ViewModel {
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final AlertManager alertManager;
|
private final AlertManager alertManager;
|
||||||
private final WalletPasswordPopup walletPasswordPopup;
|
private final WalletPasswordPopup walletPasswordPopup;
|
||||||
private NotificationCenter notificationCenter;
|
private final NotificationCenter notificationCenter;
|
||||||
private TacPopup tacPopup;
|
private final TacPopup tacPopup;
|
||||||
private Navigation navigation;
|
private final Navigation navigation;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
// BTC network
|
// BTC network
|
||||||
|
@ -129,13 +129,13 @@ public class MainViewModel implements ViewModel {
|
||||||
final StringProperty p2PNetworkLabelId = new SimpleStringProperty("footer-pane");
|
final StringProperty p2PNetworkLabelId = new SimpleStringProperty("footer-pane");
|
||||||
|
|
||||||
private MonadicBinding<Boolean> allServicesDone, tradesAndUIReady;
|
private MonadicBinding<Boolean> allServicesDone, tradesAndUIReady;
|
||||||
private MarketPriceFeed marketPriceFeed;
|
private final MarketPriceFeed marketPriceFeed;
|
||||||
private final User user;
|
private final User user;
|
||||||
private int numBTCPeers = 0;
|
private int numBTCPeers = 0;
|
||||||
private Timer checkForBtcSyncStateTimer;
|
private Timer checkForBtcSyncStateTimer;
|
||||||
private ChangeListener<Number> numConnectedPeersListener, btcNumPeersListener;
|
private ChangeListener<Number> numConnectedPeersListener, btcNumPeersListener;
|
||||||
private java.util.Timer numberofBtcPeersTimer;
|
private java.util.Timer numberOfBtcPeersTimer;
|
||||||
private java.util.Timer numberofP2PNetworkPeersTimer;
|
private java.util.Timer numberOfP2PNetworkPeersTimer;
|
||||||
private Timer startupTimeout;
|
private Timer startupTimeout;
|
||||||
private final Map<String, Subscription> disputeIsClosedSubscriptionsMap = new HashMap<>();
|
private final Map<String, Subscription> disputeIsClosedSubscriptionsMap = new HashMap<>();
|
||||||
|
|
||||||
|
@ -325,9 +325,9 @@ public class MainViewModel implements ViewModel {
|
||||||
btcNumPeersListener = (observable, oldValue, newValue) -> {
|
btcNumPeersListener = (observable, oldValue, newValue) -> {
|
||||||
if ((int) oldValue > 0 && (int) newValue == 0) {
|
if ((int) oldValue > 0 && (int) newValue == 0) {
|
||||||
// give a bit of tolerance
|
// give a bit of tolerance
|
||||||
if (numberofBtcPeersTimer != null)
|
if (numberOfBtcPeersTimer != null)
|
||||||
numberofBtcPeersTimer.cancel();
|
numberOfBtcPeersTimer.cancel();
|
||||||
numberofBtcPeersTimer = UserThread.runAfter(() -> {
|
numberOfBtcPeersTimer = UserThread.runAfter(() -> {
|
||||||
if (walletService.numPeersProperty().get() == 0) {
|
if (walletService.numPeersProperty().get() == 0) {
|
||||||
walletServiceErrorMsg.set("You lost the connection to all bitcoin network peers.\n" +
|
walletServiceErrorMsg.set("You lost the connection to all bitcoin network peers.\n" +
|
||||||
"Maybe you lost your internet connection or your computer was in hibernate/sleep mode.");
|
"Maybe you lost your internet connection or your computer was in hibernate/sleep mode.");
|
||||||
|
@ -517,9 +517,9 @@ public class MainViewModel implements ViewModel {
|
||||||
numConnectedPeersListener = (observable, oldValue, newValue) -> {
|
numConnectedPeersListener = (observable, oldValue, newValue) -> {
|
||||||
if ((int) oldValue > 0 && (int) newValue == 0) {
|
if ((int) oldValue > 0 && (int) newValue == 0) {
|
||||||
// give a bit of tolerance
|
// give a bit of tolerance
|
||||||
if (numberofP2PNetworkPeersTimer != null)
|
if (numberOfP2PNetworkPeersTimer != null)
|
||||||
numberofP2PNetworkPeersTimer.cancel();
|
numberOfP2PNetworkPeersTimer.cancel();
|
||||||
numberofP2PNetworkPeersTimer = UserThread.runAfter(() -> {
|
numberOfP2PNetworkPeersTimer = UserThread.runAfter(() -> {
|
||||||
if (p2PService.getNumConnectedPeers().get() == 0) {
|
if (p2PService.getNumConnectedPeers().get() == 0) {
|
||||||
p2PNetworkWarnMsg.set("You lost the connection to all P2P network peers.\n" +
|
p2PNetworkWarnMsg.set("You lost the connection to all P2P network peers.\n" +
|
||||||
"Maybe you lost your internet connection or your computer was in hibernate/sleep mode.");
|
"Maybe you lost your internet connection or your computer was in hibernate/sleep mode.");
|
||||||
|
|
|
@ -79,7 +79,7 @@ class ArbitratorRegistrationViewModel extends ActivatableViewModel {
|
||||||
Arbitrator myRegisteredArbitrator = user.getRegisteredArbitrator();
|
Arbitrator myRegisteredArbitrator = user.getRegisteredArbitrator();
|
||||||
myArbitratorProperty.set(myRegisteredArbitrator);
|
myArbitratorProperty.set(myRegisteredArbitrator);
|
||||||
|
|
||||||
// We don't reset the languages in case of revokation, as its likely that the arbitrator will use the same again when he re-activate
|
// We don't reset the languages in case of revocation, as its likely that the arbitrator will use the same again when he re-activate
|
||||||
// registration later
|
// registration later
|
||||||
if (myRegisteredArbitrator != null)
|
if (myRegisteredArbitrator != null)
|
||||||
languageCodes.setAll(myRegisteredArbitrator.getLanguageCodes());
|
languageCodes.setAll(myRegisteredArbitrator.getLanguageCodes());
|
||||||
|
|
|
@ -130,8 +130,12 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
|
||||||
Wallet wallet = walletService.getWallet();
|
Wallet wallet = walletService.getWallet();
|
||||||
KeyCrypter keyCrypter = wallet.getKeyCrypter();
|
KeyCrypter keyCrypter = wallet.getKeyCrypter();
|
||||||
keyChainSeed = wallet.getKeyChainSeed();
|
keyChainSeed = wallet.getKeyChainSeed();
|
||||||
|
if (keyCrypter != null) {
|
||||||
DeterministicSeed decryptedSeed = keyChainSeed.decrypt(keyCrypter, "", aesKey);
|
DeterministicSeed decryptedSeed = keyChainSeed.decrypt(keyCrypter, "", aesKey);
|
||||||
showSeedScreen(decryptedSeed);
|
showSeedScreen(decryptedSeed);
|
||||||
|
} else {
|
||||||
|
log.warn("keyCrypter is null");
|
||||||
|
}
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class AccountSettingsView extends ActivatableViewAndModel {
|
||||||
@FXML
|
@FXML
|
||||||
private AnchorPane content;
|
private AnchorPane content;
|
||||||
|
|
||||||
private Class<? extends View> selecteedViewClass;
|
private Class<? extends View> selectedViewClass;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AccountSettingsView(CachingViewLoader viewLoader, Navigation navigation) {
|
private AccountSettingsView(CachingViewLoader viewLoader, Navigation navigation) {
|
||||||
|
@ -97,8 +97,8 @@ public class AccountSettingsView extends ActivatableViewAndModel {
|
||||||
viewPath.size() == 2 && viewPath.indexOf(AccountView.class) == 1) {
|
viewPath.size() == 2 && viewPath.indexOf(AccountView.class) == 1) {
|
||||||
navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, PaymentAccountView.class);
|
navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, PaymentAccountView.class);
|
||||||
} else if (viewPath.size() == 4 && viewPath.indexOf(AccountSettingsView.class) == 2) {
|
} else if (viewPath.size() == 4 && viewPath.indexOf(AccountSettingsView.class) == 2) {
|
||||||
selecteedViewClass = viewPath.get(3);
|
selectedViewClass = viewPath.get(3);
|
||||||
loadView(selecteedViewClass);
|
loadView(selectedViewClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public class AccountSettingsView extends ActivatableViewAndModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class<? extends View> getSelectedViewClass() {
|
public Class<? extends View> getSelectedViewClass() {
|
||||||
return selecteedViewClass;
|
return selectedViewClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -135,8 +135,8 @@ class MenuItem extends ToggleButton {
|
||||||
|
|
||||||
private final ChangeListener<Boolean> selectedPropertyChangeListener;
|
private final ChangeListener<Boolean> selectedPropertyChangeListener;
|
||||||
private final ChangeListener<Boolean> disablePropertyChangeListener;
|
private final ChangeListener<Boolean> disablePropertyChangeListener;
|
||||||
private Navigation navigation;
|
private final Navigation navigation;
|
||||||
private Class<? extends View> viewClass;
|
private final Class<? extends View> viewClass;
|
||||||
|
|
||||||
MenuItem(Navigation navigation, ToggleGroup toggleGroup, String title, Class<? extends View> viewClass, AwesomeIcon awesomeIcon) {
|
MenuItem(Navigation navigation, ToggleGroup toggleGroup, String title, Class<? extends View> viewClass, AwesomeIcon awesomeIcon) {
|
||||||
this.navigation = navigation;
|
this.navigation = navigation;
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class DebugView extends InitializableView {
|
||||||
OfferAvailabilityProtocol.class,
|
OfferAvailabilityProtocol.class,
|
||||||
SendOfferAvailabilityRequest.class,
|
SendOfferAvailabilityRequest.class,
|
||||||
ProcessOfferAvailabilityResponse.class,
|
ProcessOfferAvailabilityResponse.class,
|
||||||
Boolean.class, /* used as seperator*/
|
Boolean.class, /* used as separator*/
|
||||||
|
|
||||||
|
|
||||||
/*---- Protocol ----*/
|
/*---- Protocol ----*/
|
||||||
|
@ -74,7 +74,7 @@ public class DebugView extends InitializableView {
|
||||||
CreateOfferFeeTx.class,
|
CreateOfferFeeTx.class,
|
||||||
AddOfferToRemoteOfferBook.class,
|
AddOfferToRemoteOfferBook.class,
|
||||||
BroadcastCreateOfferFeeTx.class,
|
BroadcastCreateOfferFeeTx.class,
|
||||||
Boolean.class, /* used as seperator*/
|
Boolean.class, /* used as separator*/
|
||||||
|
|
||||||
|
|
||||||
/*---- Protocol ----*/
|
/*---- Protocol ----*/
|
||||||
|
@ -98,7 +98,7 @@ public class DebugView extends InitializableView {
|
||||||
SignAndFinalizePayoutTx.class,
|
SignAndFinalizePayoutTx.class,
|
||||||
SendPayoutTxFinalizedMessage.class,
|
SendPayoutTxFinalizedMessage.class,
|
||||||
BroadcastAfterLockTime.class,
|
BroadcastAfterLockTime.class,
|
||||||
Boolean.class, /* used as seperator*/
|
Boolean.class, /* used as separator*/
|
||||||
|
|
||||||
|
|
||||||
/*---- Protocol ----*/
|
/*---- Protocol ----*/
|
||||||
|
@ -123,7 +123,7 @@ public class DebugView extends InitializableView {
|
||||||
|
|
||||||
ProcessPayoutTxFinalizedMessage.class,
|
ProcessPayoutTxFinalizedMessage.class,
|
||||||
BroadcastAfterLockTime.class,
|
BroadcastAfterLockTime.class,
|
||||||
Boolean.class /* used as seperator*/
|
Boolean.class /* used as separator*/
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
final ObservableList<Class> items2 = FXCollections.observableArrayList(Arrays.asList(
|
final ObservableList<Class> items2 = FXCollections.observableArrayList(Arrays.asList(
|
||||||
|
@ -149,7 +149,7 @@ public class DebugView extends InitializableView {
|
||||||
SignAndFinalizePayoutTx.class,
|
SignAndFinalizePayoutTx.class,
|
||||||
SendPayoutTxFinalizedMessage.class,
|
SendPayoutTxFinalizedMessage.class,
|
||||||
BroadcastAfterLockTime.class,
|
BroadcastAfterLockTime.class,
|
||||||
Boolean.class, /* used as seperator*/
|
Boolean.class, /* used as separator*/
|
||||||
|
|
||||||
|
|
||||||
/*---- Protocol ----*/
|
/*---- Protocol ----*/
|
||||||
|
@ -173,7 +173,7 @@ public class DebugView extends InitializableView {
|
||||||
|
|
||||||
ProcessPayoutTxFinalizedMessage.class,
|
ProcessPayoutTxFinalizedMessage.class,
|
||||||
BroadcastAfterLockTime.class,
|
BroadcastAfterLockTime.class,
|
||||||
Boolean.class /* used as seperator*/
|
Boolean.class /* used as separator*/
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,6 @@
|
||||||
AnchorPane.topAnchor="0.0"
|
AnchorPane.topAnchor="0.0"
|
||||||
xmlns:fx="http://javafx.com/fxml">
|
xmlns:fx="http://javafx.com/fxml">
|
||||||
|
|
||||||
<Tab fx:id="tradersDisputesTab" text="Support tickets" closable="false"></Tab>
|
<Tab fx:id="tradersDisputesTab" text="Support tickets" closable="false"/>
|
||||||
|
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
|
|
@ -228,6 +228,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
hideSendMsgInfo(timer);
|
hideSendMsgInfo(timer);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (disputeDirectMessage.arrivedProperty() != null)
|
||||||
disputeDirectMessage.arrivedProperty().addListener(arrivedPropertyListener);
|
disputeDirectMessage.arrivedProperty().addListener(arrivedPropertyListener);
|
||||||
storedInMailboxPropertyListener = (observable, oldValue, newValue) -> {
|
storedInMailboxPropertyListener = (observable, oldValue, newValue) -> {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
AnchorPane.topAnchor="0.0"
|
AnchorPane.topAnchor="0.0"
|
||||||
xmlns:fx="http://javafx.com/fxml">
|
xmlns:fx="http://javafx.com/fxml">
|
||||||
|
|
||||||
<Tab fx:id="reservedTab" text="Reserved/Locked funds" closable="false"></Tab>
|
<Tab fx:id="reservedTab" text="Reserved/Locked funds" closable="false"/>
|
||||||
<Tab fx:id="withdrawalTab" text="Available for withdrawal" closable="false"/>
|
<Tab fx:id="withdrawalTab" text="Available for withdrawal" closable="false"/>
|
||||||
<Tab fx:id="transactionsTab" text="Transactions" closable="false"/>
|
<Tab fx:id="transactionsTab" text="Transactions" closable="false"/>
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class MarketsChartsView extends ActivatableViewAndModel<VBox, MarketsChar
|
||||||
private NumberAxis xAxis, yAxis;
|
private NumberAxis xAxis, yAxis;
|
||||||
XYChart.Series seriesBuy, seriesSell;
|
XYChart.Series seriesBuy, seriesSell;
|
||||||
private final ListChangeListener<OfferBookListItem> changeListener;
|
private final ListChangeListener<OfferBookListItem> changeListener;
|
||||||
private Navigation navigation;
|
private final Navigation navigation;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
private TableView<Offer> buyOfferTableView;
|
private TableView<Offer> buyOfferTableView;
|
||||||
private TableView<Offer> sellOfferTableView;
|
private TableView<Offer> sellOfferTableView;
|
||||||
|
|
|
@ -42,7 +42,7 @@ class MarketsChartsViewModel extends ActivatableViewModel {
|
||||||
|
|
||||||
private final OfferBook offerBook;
|
private final OfferBook offerBook;
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private MarketPriceFeed marketPriceFeed;
|
private final MarketPriceFeed marketPriceFeed;
|
||||||
|
|
||||||
final ObjectProperty<TradeCurrency> tradeCurrency = new SimpleObjectProperty<>(CurrencyUtil.getDefaultTradeCurrency());
|
final ObjectProperty<TradeCurrency> tradeCurrency = new SimpleObjectProperty<>(CurrencyUtil.getDefaultTradeCurrency());
|
||||||
private final List<XYChart.Data> buyData = new ArrayList();
|
private final List<XYChart.Data> buyData = new ArrayList();
|
||||||
|
|
|
@ -48,10 +48,10 @@ public class NotificationCenter {
|
||||||
// Instance fields
|
// Instance fields
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private DisputeManager disputeManager;
|
private final DisputeManager disputeManager;
|
||||||
private Preferences preferences;
|
private final Preferences preferences;
|
||||||
private Navigation navigation;
|
private final Navigation navigation;
|
||||||
|
|
||||||
private final Map<String, Subscription> disputeStateSubscriptionsMap = new HashMap<>();
|
private final Map<String, Subscription> disputeStateSubscriptionsMap = new HashMap<>();
|
||||||
private final Map<String, Subscription> tradeStateSubscriptionsMap = new HashMap<>();
|
private final Map<String, Subscription> tradeStateSubscriptionsMap = new HashMap<>();
|
||||||
|
@ -126,6 +126,7 @@ public class NotificationCenter {
|
||||||
// Setter/Getter
|
// Setter/Getter
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@org.jetbrains.annotations.Nullable
|
||||||
public String getSelectedTradeId() {
|
public String getSelectedTradeId() {
|
||||||
return selectedTradeId;
|
return selectedTradeId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
|
||||||
|
|
||||||
private final ViewLoader viewLoader;
|
private final ViewLoader viewLoader;
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
private MarketPriceFeed marketPriceFeed;
|
private final MarketPriceFeed marketPriceFeed;
|
||||||
private final Offer.Direction direction;
|
private final Offer.Direction direction;
|
||||||
private Tab takeOfferTab, createOfferTab, offerBookTab;
|
private Tab takeOfferTab, createOfferTab, offerBookTab;
|
||||||
private TradeCurrency tradeCurrency;
|
private TradeCurrency tradeCurrency;
|
||||||
|
@ -94,7 +94,7 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
tabListChangeListener = (ListChangeListener<Tab>) change -> {
|
tabListChangeListener = change -> {
|
||||||
change.next();
|
change.next();
|
||||||
List<? extends Tab> removedTabs = change.getRemoved();
|
List<? extends Tab> removedTabs = change.getRemoved();
|
||||||
if (removedTabs.size() == 1) {
|
if (removedTabs.size() == 1) {
|
||||||
|
|
|
@ -70,9 +70,9 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
||||||
private final User user;
|
private final User user;
|
||||||
private final KeyRing keyRing;
|
private final KeyRing keyRing;
|
||||||
private final P2PService p2PService;
|
private final P2PService p2PService;
|
||||||
private MarketPriceFeed marketPriceFeed;
|
private final MarketPriceFeed marketPriceFeed;
|
||||||
private final WalletPasswordPopup walletPasswordPopup;
|
private final WalletPasswordPopup walletPasswordPopup;
|
||||||
private BlockchainService blockchainService;
|
private final BlockchainService blockchainService;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
private final String offerId;
|
private final String offerId;
|
||||||
private final AddressEntry addressEntry;
|
private final AddressEntry addressEntry;
|
||||||
|
|
|
@ -110,7 +110,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
||||||
|
|
||||||
private EventHandler<ActionEvent> currencyComboBoxSelectionHandler;
|
private EventHandler<ActionEvent> currencyComboBoxSelectionHandler;
|
||||||
private int gridRow = 0;
|
private int gridRow = 0;
|
||||||
private Preferences preferences;
|
private final Preferences preferences;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -213,7 +213,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
||||||
private void onPlaceOffer() {
|
private void onPlaceOffer() {
|
||||||
if (model.isBootstrapped()) {
|
if (model.isBootstrapped()) {
|
||||||
Offer offer = model.createAndGetOffer();
|
Offer offer = model.createAndGetOffer();
|
||||||
String id = "CreatOfferConfirmation";
|
String id = "CreateOfferConfirmation";
|
||||||
if (preferences.showAgain(id)) {
|
if (preferences.showAgain(id)) {
|
||||||
offerDetailsPopup.onPlaceOffer(model::onPlaceOffer)
|
offerDetailsPopup.onPlaceOffer(model::onPlaceOffer)
|
||||||
.dontShowAgainId(id)
|
.dontShowAgainId(id)
|
||||||
|
|
|
@ -118,7 +118,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
||||||
paymentLabel = BSResources.get("createOffer.fundsBox.paymentLabel", dataModel.getOfferId());
|
paymentLabel = BSResources.get("createOffer.fundsBox.paymentLabel", dataModel.getOfferId());
|
||||||
|
|
||||||
if (dataModel.getAddressEntry() != null) {
|
if (dataModel.getAddressEntry() != null) {
|
||||||
addressAsString = dataModel.getAddressEntry().getAddress().toString();
|
addressAsString = dataModel.getAddressEntry().getAddressString();
|
||||||
address.set(dataModel.getAddressEntry().getAddress());
|
address.set(dataModel.getAddressEntry().getAddress());
|
||||||
}
|
}
|
||||||
createListeners();
|
createListeners();
|
||||||
|
|
|
@ -53,7 +53,7 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||||
private final OfferBook offerBook;
|
private final OfferBook offerBook;
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final P2PService p2PService;
|
private final P2PService p2PService;
|
||||||
private MarketPriceFeed marketPriceFeed;
|
private final MarketPriceFeed marketPriceFeed;
|
||||||
final BSFormatter formatter;
|
final BSFormatter formatter;
|
||||||
|
|
||||||
private final FilteredList<OfferBookListItem> filteredItems;
|
private final FilteredList<OfferBookListItem> filteredItems;
|
||||||
|
@ -168,8 +168,7 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableList<TradeCurrency> getTradeCurrencies() {
|
public ObservableList<TradeCurrency> getTradeCurrencies() {
|
||||||
ObservableList<TradeCurrency> list = preferences.getTradeCurrenciesAsObservable();
|
return preferences.getTradeCurrenciesAsObservable();
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isBootstrapped() {
|
boolean isBootstrapped() {
|
||||||
|
|
|
@ -68,9 +68,9 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||||
private final User user;
|
private final User user;
|
||||||
private final WalletPasswordPopup walletPasswordPopup;
|
private final WalletPasswordPopup walletPasswordPopup;
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private MarketPriceFeed marketPriceFeed;
|
private final MarketPriceFeed marketPriceFeed;
|
||||||
private BlockchainService blockchainService;
|
private final BlockchainService blockchainService;
|
||||||
private BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
private final Coin offerFeeAsCoin;
|
private final Coin offerFeeAsCoin;
|
||||||
private final Coin networkFeeAsCoin;
|
private final Coin networkFeeAsCoin;
|
||||||
|
@ -305,7 +305,6 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||||
|
|
||||||
void calculateVolume() {
|
void calculateVolume() {
|
||||||
if (offer != null &&
|
if (offer != null &&
|
||||||
offer.getPrice() != null &&
|
|
||||||
amountAsCoin.get() != null &&
|
amountAsCoin.get() != null &&
|
||||||
!amountAsCoin.get().isZero()) {
|
!amountAsCoin.get().isZero()) {
|
||||||
volumeAsFiat.set(new ExchangeRate(offer.getPrice()).coinToFiat(amountAsCoin.get()));
|
volumeAsFiat.set(new ExchangeRate(offer.getPrice()).coinToFiat(amountAsCoin.get()));
|
||||||
|
@ -330,7 +329,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||||
|
|
||||||
boolean isMinAmountLessOrEqualAmount() {
|
boolean isMinAmountLessOrEqualAmount() {
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (offer != null && offer.getMinAmount() != null && amountAsCoin.get() != null)
|
if (offer != null && amountAsCoin.get() != null)
|
||||||
return !offer.getMinAmount().isGreaterThan(amountAsCoin.get());
|
return !offer.getMinAmount().isGreaterThan(amountAsCoin.get());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
private final OfferDetailsPopup offerDetailsPopup;
|
private final OfferDetailsPopup offerDetailsPopup;
|
||||||
private Preferences preferences;
|
private final Preferences preferences;
|
||||||
private ScrollPane scrollPane;
|
private ScrollPane scrollPane;
|
||||||
private GridPane gridPane;
|
private GridPane gridPane;
|
||||||
private ImageView imageView;
|
private ImageView imageView;
|
||||||
|
|
|
@ -48,7 +48,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
|
||||||
|
|
||||||
class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> implements ViewModel {
|
class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> implements ViewModel {
|
||||||
private final BtcValidator btcValidator;
|
private final BtcValidator btcValidator;
|
||||||
private P2PService p2PService;
|
private final P2PService p2PService;
|
||||||
final BSFormatter formatter;
|
final BSFormatter formatter;
|
||||||
|
|
||||||
private String amountRange;
|
private String amountRange;
|
||||||
|
@ -161,7 +161,7 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
|
||||||
|
|
||||||
checkNotNull(dataModel.getAddressEntry(), "dataModel.getAddressEntry() must not be null");
|
checkNotNull(dataModel.getAddressEntry(), "dataModel.getAddressEntry() must not be null");
|
||||||
|
|
||||||
addressAsString = dataModel.getAddressEntry().getAddress().toString();
|
addressAsString = dataModel.getAddressEntry().getAddressString();
|
||||||
address.set(dataModel.getAddressEntry().getAddress());
|
address.set(dataModel.getAddressEntry().getAddress());
|
||||||
|
|
||||||
offerErrorListener = (observable, oldValue, newValue) -> {
|
offerErrorListener = (observable, oldValue, newValue) -> {
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class OfferDetailsPopup extends Popup {
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
protected final Preferences preferences;
|
protected final Preferences preferences;
|
||||||
private final User user;
|
private final User user;
|
||||||
private KeyRing keyRing;
|
private final KeyRing keyRing;
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
private Offer offer;
|
private Offer offer;
|
||||||
private Coin tradeAmount;
|
private Coin tradeAmount;
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||||
|
|
||||||
class PopupManager {
|
class PopupManager {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PopupManager.class);
|
private static final Logger log = LoggerFactory.getLogger(PopupManager.class);
|
||||||
private static Queue<Popup> popups = new LinkedBlockingQueue<>(3);
|
private static final Queue<Popup> popups = new LinkedBlockingQueue<>(3);
|
||||||
private static Popup displayedPopup;
|
private static Popup displayedPopup;
|
||||||
|
|
||||||
static void queueForDisplay(Popup popup) {
|
static void queueForDisplay(Popup popup) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class TacPopup extends Popup {
|
public class TacPopup extends Popup {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TacPopup.class);
|
private static final Logger log = LoggerFactory.getLogger(TacPopup.class);
|
||||||
private Preferences preferences;
|
private final Preferences preferences;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TacPopup(Preferences preferences) {
|
public TacPopup(Preferences preferences) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class TradeDetailsPopup extends Popup {
|
||||||
protected static final Logger log = LoggerFactory.getLogger(TradeDetailsPopup.class);
|
protected static final Logger log = LoggerFactory.getLogger(TradeDetailsPopup.class);
|
||||||
|
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
private DisputeManager disputeManager;
|
private final DisputeManager disputeManager;
|
||||||
private Trade trade;
|
private Trade trade;
|
||||||
private ChangeListener<Number> changeListener;
|
private ChangeListener<Number> changeListener;
|
||||||
private TextArea textArea;
|
private TextArea textArea;
|
||||||
|
|
|
@ -44,7 +44,7 @@ class FailedTradesViewModel extends ActivatableWithDataModel<FailedTradesDataMod
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAmount(FailedTradesListItem item) {
|
String getAmount(FailedTradesListItem item) {
|
||||||
if (item != null && item.getTrade() instanceof Trade)
|
if (item != null && item.getTrade() != null)
|
||||||
return formatter.formatCoinWithCode(item.getTrade().getTradeAmount());
|
return formatter.formatCoinWithCode(item.getTrade().getTradeAmount());
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
|
@ -55,7 +55,7 @@ class FailedTradesViewModel extends ActivatableWithDataModel<FailedTradesDataMod
|
||||||
}
|
}
|
||||||
|
|
||||||
String getVolume(FailedTradesListItem item) {
|
String getVolume(FailedTradesListItem item) {
|
||||||
if (item != null && item.getTrade() instanceof Trade)
|
if (item != null && item.getTrade() != null)
|
||||||
return formatter.formatFiatWithCode(item.getTrade().getTradeVolume());
|
return formatter.formatFiatWithCode(item.getTrade().getTradeVolume());
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
||||||
public final DisputeManager disputeManager;
|
public final DisputeManager disputeManager;
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
private final WalletPasswordPopup walletPasswordPopup;
|
private final WalletPasswordPopup walletPasswordPopup;
|
||||||
private NotificationCenter notificationCenter;
|
private final NotificationCenter notificationCenter;
|
||||||
|
|
||||||
final ObservableList<PendingTradesListItem> list = FXCollections.observableArrayList();
|
final ObservableList<PendingTradesListItem> list = FXCollections.observableArrayList();
|
||||||
private final ListChangeListener<Trade> tradesListChangeListener;
|
private final ListChangeListener<Trade> tradesListChangeListener;
|
||||||
|
@ -351,13 +351,16 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
||||||
} else {
|
} else {
|
||||||
log.warn("depositTx is null");
|
log.warn("depositTx is null");
|
||||||
}
|
}
|
||||||
Transaction payoutTx = getTrade().getPayoutTx();
|
Trade trade = getTrade();
|
||||||
|
if (trade != null) {
|
||||||
|
Transaction payoutTx = trade.getPayoutTx();
|
||||||
if (payoutTx != null) {
|
if (payoutTx != null) {
|
||||||
payoutTxSerialized = payoutTx.bitcoinSerialize();
|
payoutTxSerialized = payoutTx.bitcoinSerialize();
|
||||||
payoutTxHashAsString = payoutTx.getHashAsString();
|
payoutTxHashAsString = payoutTx.getHashAsString();
|
||||||
|
} else {
|
||||||
|
log.warn("payoutTx is null at doOpenDispute");
|
||||||
}
|
}
|
||||||
|
|
||||||
Trade trade = getTrade();
|
|
||||||
Dispute dispute = new Dispute(disputeManager.getDisputeStorage(),
|
Dispute dispute = new Dispute(disputeManager.getDisputeStorage(),
|
||||||
trade.getId(),
|
trade.getId(),
|
||||||
keyRing.getPubKeyRing().hashCode(), // traderId
|
keyRing.getPubKeyRing().hashCode(), // traderId
|
||||||
|
@ -381,6 +384,9 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
||||||
trade.setDisputeState(Trade.DisputeState.DISPUTE_REQUESTED);
|
trade.setDisputeState(Trade.DisputeState.DISPUTE_REQUESTED);
|
||||||
disputeManager.sendOpenNewDisputeMessage(dispute);
|
disputeManager.sendOpenNewDisputeMessage(dispute);
|
||||||
navigation.navigateTo(MainView.class, DisputesView.class);
|
navigation.navigateTo(MainView.class, DisputesView.class);
|
||||||
|
} else {
|
||||||
|
log.warn("trade is null at doOpenDispute");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ import javax.inject.Inject;
|
||||||
public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTradesViewModel> {
|
public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTradesViewModel> {
|
||||||
|
|
||||||
private final TradeDetailsPopup tradeDetailsPopup;
|
private final TradeDetailsPopup tradeDetailsPopup;
|
||||||
private BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
@FXML
|
@FXML
|
||||||
TableView<PendingTradesListItem> table;
|
TableView<PendingTradesListItem> table;
|
||||||
@FXML
|
@FXML
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
||||||
private final BtcAddressValidator btcAddressValidator;
|
private final BtcAddressValidator btcAddressValidator;
|
||||||
|
|
||||||
public final P2PService p2PService;
|
public final P2PService p2PService;
|
||||||
public User user;
|
public final User user;
|
||||||
|
|
||||||
private final ObjectProperty<BuyerState> buyerState = new SimpleObjectProperty<>();
|
private final ObjectProperty<BuyerState> buyerState = new SimpleObjectProperty<>();
|
||||||
private final ObjectProperty<SellerState> sellerState = new SimpleObjectProperty<>();
|
private final ObjectProperty<SellerState> sellerState = new SimpleObjectProperty<>();
|
||||||
|
|
|
@ -166,7 +166,7 @@ public abstract class TradeSubView extends HBox {
|
||||||
|
|
||||||
private void addLeftBox() {
|
private void addLeftBox() {
|
||||||
leftVBox = new VBox();
|
leftVBox = new VBox();
|
||||||
leftVBox.setSpacing(Layout.SPACING_VBOX);
|
leftVBox.setSpacing(Layout.SPACING_V_BOX);
|
||||||
leftVBox.setMinWidth(290);
|
leftVBox.setMinWidth(290);
|
||||||
getChildren().add(leftVBox);
|
getChildren().add(leftVBox);
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
addTradeInfoBlock();
|
addTradeInfoBlock();
|
||||||
|
|
||||||
PaymentAccountContractData paymentAccountContractData = model.dataModel.getSellersPaymentAccountContractData();
|
PaymentAccountContractData paymentAccountContractData = model.dataModel.getSellersPaymentAccountContractData();
|
||||||
String paymentMethodName = paymentAccountContractData.getPaymentMethodName();
|
String paymentMethodName = paymentAccountContractData != null ? paymentAccountContractData.getPaymentMethodName() : "";
|
||||||
TitledGroupBg accountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 1,
|
TitledGroupBg accountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 1,
|
||||||
"Start payment using " + BSResources.get(paymentAccountContractData.getPaymentMethodName()),
|
"Start payment using " + BSResources.get(paymentAccountContractData.getPaymentMethodName()),
|
||||||
Layout.GROUP_DISTANCE);
|
Layout.GROUP_DISTANCE);
|
||||||
|
|
|
@ -98,9 +98,9 @@ public class BuyerStep5View extends TradeStepView {
|
||||||
Tuple2<Label, TextField> fiatTradeAmountPair = addLabelTextField(gridPane, ++gridRow, getFiatTradeAmountLabel(), model.getFiatVolume());
|
Tuple2<Label, TextField> fiatTradeAmountPair = addLabelTextField(gridPane, ++gridRow, getFiatTradeAmountLabel(), model.getFiatVolume());
|
||||||
fiatTradeAmountLabel = fiatTradeAmountPair.first;
|
fiatTradeAmountLabel = fiatTradeAmountPair.first;
|
||||||
|
|
||||||
Tuple2<Label, TextField> feesPair = addLabelTextField(gridPane, ++gridRow, "Total fees paid:", model.getTotalFees());
|
addLabelTextField(gridPane, ++gridRow, "Total fees paid:", model.getTotalFees());
|
||||||
|
|
||||||
Tuple2<Label, TextField> securityDepositPair = addLabelTextField(gridPane, ++gridRow, "Refunded security deposit:", model.getSecurityDeposit());
|
addLabelTextField(gridPane, ++gridRow, "Refunded security deposit:", model.getSecurityDeposit());
|
||||||
|
|
||||||
addTitledGroupBg(gridPane, ++gridRow, 2, "Withdraw your bitcoins", Layout.GROUP_DISTANCE);
|
addTitledGroupBg(gridPane, ++gridRow, 2, "Withdraw your bitcoins", Layout.GROUP_DISTANCE);
|
||||||
addLabelTextField(gridPane, gridRow, "Amount to withdraw:", model.getPayoutAmount(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
|
addLabelTextField(gridPane, gridRow, "Amount to withdraw:", model.getPayoutAmount(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
|
||||||
private int gridRow = 0;
|
private int gridRow = 0;
|
||||||
//private InputTextField transactionFeeInputTextField;
|
//private InputTextField transactionFeeInputTextField;
|
||||||
private ChangeListener<Boolean> transactionFeeFocusedListener;
|
private ChangeListener<Boolean> transactionFeeFocusedListener;
|
||||||
private Preferences preferences;
|
private final Preferences preferences;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PreferencesView(PreferencesViewModel model, Preferences preferences) {
|
public PreferencesView(PreferencesViewModel model, Preferences preferences) {
|
||||||
|
|
|
@ -23,8 +23,8 @@ public class Layout {
|
||||||
public static final double FIRST_ROW_AND_GROUP_DISTANCE = GROUP_DISTANCE + FIRST_ROW_DISTANCE;
|
public static final double FIRST_ROW_AND_GROUP_DISTANCE = GROUP_DISTANCE + FIRST_ROW_DISTANCE;
|
||||||
public static final double PADDING_WINDOW = 20d;
|
public static final double PADDING_WINDOW = 20d;
|
||||||
public static double PADDING = 10d;
|
public static double PADDING = 10d;
|
||||||
public static double SPACING_HBOX = 10d;
|
public static double SPACING_H_BOX = 10d;
|
||||||
public static final double SPACING_VBOX = 5d;
|
public static final double SPACING_V_BOX = 5d;
|
||||||
public static final double GRID_GAP = 5d;
|
public static final double GRID_GAP = 5d;
|
||||||
public static final double LIST_ROW_HEIGHT = 34;
|
public static final double LIST_ROW_HEIGHT = 34;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.common.fxml;
|
package io.bitsquare.common.fxml;
|
||||||
|
|
||||||
import io.bitsquare.gui.common.ViewfxException;
|
import io.bitsquare.gui.common.ViewFxException;
|
||||||
import io.bitsquare.gui.common.fxml.FxmlViewLoader;
|
import io.bitsquare.gui.common.fxml.FxmlViewLoader;
|
||||||
import io.bitsquare.gui.common.view.*;
|
import io.bitsquare.gui.common.view.*;
|
||||||
import javafx.fxml.LoadException;
|
import javafx.fxml.LoadException;
|
||||||
|
@ -70,7 +70,7 @@ public class FxmlViewLoaderTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void fxmlFileMissingFxControllerAttributeShouldThrow() {
|
public void fxmlFileMissingFxControllerAttributeShouldThrow() {
|
||||||
thrown.expect(ViewfxException.class);
|
thrown.expect(ViewFxException.class);
|
||||||
thrown.expectMessage("Does it declare an fx:controller attribute?");
|
thrown.expectMessage("Does it declare an fx:controller attribute?");
|
||||||
viewLoader.load(MissingFxController.class);
|
viewLoader.load(MissingFxController.class);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ public class FxmlViewLoaderTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void malformedFxmlFileShouldThrow() {
|
public void malformedFxmlFileShouldThrow() {
|
||||||
thrown.expect(ViewfxException.class);
|
thrown.expect(ViewFxException.class);
|
||||||
thrown.expectMessage("Failed to load view from FXML file");
|
thrown.expectMessage("Failed to load view from FXML file");
|
||||||
thrown.expectCause(instanceOf(LoadException.class));
|
thrown.expectCause(instanceOf(LoadException.class));
|
||||||
viewLoader.load(Malformed.class);
|
viewLoader.load(Malformed.class);
|
||||||
|
@ -106,7 +106,7 @@ public class FxmlViewLoaderTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void missingFxmlFileShouldThrow() {
|
public void missingFxmlFileShouldThrow() {
|
||||||
thrown.expect(ViewfxException.class);
|
thrown.expect(ViewFxException.class);
|
||||||
thrown.expectMessage("Does it exist?");
|
thrown.expectMessage("Does it exist?");
|
||||||
viewLoader.load(MissingFxmlFile.class);
|
viewLoader.load(MissingFxmlFile.class);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public class FxmlViewLoaderTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void customFxmlFileLocationShouldOverrideDefaultConvention() {
|
public void customFxmlFileLocationShouldOverrideDefaultConvention() {
|
||||||
thrown.expect(ViewfxException.class);
|
thrown.expect(ViewFxException.class);
|
||||||
thrown.expectMessage("Failed to load view class");
|
thrown.expectMessage("Failed to load view class");
|
||||||
thrown.expectMessage("CustomLocation");
|
thrown.expectMessage("CustomLocation");
|
||||||
thrown.expectMessage("[unconventionally/located.fxml] could not be loaded");
|
thrown.expectMessage("[unconventionally/located.fxml] could not be loaded");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue