mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-25 07:10:48 -04:00
Fine tune trade process
This commit is contained in:
parent
026a3e4b93
commit
14b452efc3
23 changed files with 191 additions and 111 deletions
|
@ -92,6 +92,7 @@ lower gradient color on tab: dddddd
|
||||||
#nav-balance-label {
|
#nav-balance-label {
|
||||||
-fx-font-weight: bold;
|
-fx-font-weight: bold;
|
||||||
-fx-alignment: center;
|
-fx-alignment: center;
|
||||||
|
-fx-background-color: #dddddd;
|
||||||
}
|
}
|
||||||
#nav-alert-label {
|
#nav-alert-label {
|
||||||
-fx-font-weight: bold;
|
-fx-font-weight: bold;
|
||||||
|
@ -172,7 +173,7 @@ textfield */
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-view .column-header .label {
|
.table-view .column-header .label {
|
||||||
-fx-alignment-alignment: center;
|
-fx-alignment: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-view .focus {
|
.table-view .focus {
|
||||||
|
|
|
@ -67,11 +67,12 @@ public class AddressTextField extends AnchorPane {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public AddressTextField() {
|
public AddressTextField() {
|
||||||
TextField addressLabel = new TextField();
|
TextField textField = new TextField();
|
||||||
addressLabel.setId("address-text-field");
|
textField.setId("address-text-field");
|
||||||
addressLabel.setEditable(false);
|
textField.setEditable(false);
|
||||||
addressLabel.textProperty().bind(address);
|
textField.textProperty().bind(address);
|
||||||
addressLabel.setOnMouseClicked(mouseEvent -> {
|
Tooltip.install(textField, new Tooltip("Open your default Bitcoin wallet with that address."));
|
||||||
|
textField.setOnMouseClicked(mouseEvent -> {
|
||||||
try {
|
try {
|
||||||
Desktop.getDesktop().browse(URI.create(getBitcoinURI()));
|
Desktop.getDesktop().browse(URI.create(getBitcoinURI()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -80,8 +81,8 @@ public class AddressTextField extends AnchorPane {
|
||||||
"Perhaps you don't have one installed?");
|
"Perhaps you don't have one installed?");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
addressLabel.focusTraversableProperty().set(focusTraversableProperty().get());
|
textField.focusTraversableProperty().set(focusTraversableProperty().get());
|
||||||
focusedProperty().addListener((ov, oldValue, newValue) -> addressLabel.requestFocus());
|
focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus());
|
||||||
|
|
||||||
Label copyIcon = new Label();
|
Label copyIcon = new Label();
|
||||||
copyIcon.setLayoutY(3);
|
copyIcon.setLayoutY(3);
|
||||||
|
@ -136,10 +137,10 @@ public class AddressTextField extends AnchorPane {
|
||||||
|
|
||||||
AnchorPane.setRightAnchor(qrCode, 5.0);
|
AnchorPane.setRightAnchor(qrCode, 5.0);
|
||||||
AnchorPane.setRightAnchor(copyIcon, 30.0);
|
AnchorPane.setRightAnchor(copyIcon, 30.0);
|
||||||
AnchorPane.setRightAnchor(addressLabel, 55.0);
|
AnchorPane.setRightAnchor(textField, 55.0);
|
||||||
AnchorPane.setLeftAnchor(addressLabel, 0.0);
|
AnchorPane.setLeftAnchor(textField, 0.0);
|
||||||
|
|
||||||
getChildren().addAll(addressLabel, copyIcon, qrCode);
|
getChildren().addAll(textField, copyIcon, qrCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
|
||||||
public class BalanceTextField extends AnchorPane {
|
public class BalanceTextField extends AnchorPane {
|
||||||
private static final Logger log = LoggerFactory.getLogger(BalanceTextField.class);
|
private static final Logger log = LoggerFactory.getLogger(BalanceTextField.class);
|
||||||
|
|
||||||
private final TextField balanceTextField;
|
private final TextField textField;
|
||||||
private final Tooltip progressIndicatorTooltip;
|
private final Tooltip progressIndicatorTooltip;
|
||||||
private final ConfidenceProgressIndicator progressIndicator;
|
private final ConfidenceProgressIndicator progressIndicator;
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@ public class BalanceTextField extends AnchorPane {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public BalanceTextField() {
|
public BalanceTextField() {
|
||||||
balanceTextField = new TextField();
|
textField = new TextField();
|
||||||
balanceTextField.setFocusTraversable(false);
|
textField.setFocusTraversable(false);
|
||||||
balanceTextField.setEditable(false);
|
textField.setEditable(false);
|
||||||
|
|
||||||
progressIndicator = new ConfidenceProgressIndicator();
|
progressIndicator = new ConfidenceProgressIndicator();
|
||||||
progressIndicator.setFocusTraversable(false);
|
progressIndicator.setFocusTraversable(false);
|
||||||
|
@ -68,10 +68,10 @@ public class BalanceTextField extends AnchorPane {
|
||||||
Tooltip.install(progressIndicator, progressIndicatorTooltip);
|
Tooltip.install(progressIndicator, progressIndicatorTooltip);
|
||||||
|
|
||||||
AnchorPane.setRightAnchor(progressIndicator, 0.0);
|
AnchorPane.setRightAnchor(progressIndicator, 0.0);
|
||||||
AnchorPane.setRightAnchor(balanceTextField, 55.0);
|
AnchorPane.setRightAnchor(textField, 55.0);
|
||||||
AnchorPane.setLeftAnchor(balanceTextField, 0.0);
|
AnchorPane.setLeftAnchor(textField, 0.0);
|
||||||
|
|
||||||
getChildren().addAll(balanceTextField, progressIndicator);
|
getChildren().addAll(textField, progressIndicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setup(WalletFacade walletFacade, Address address, BSFormatter formatter) {
|
public void setup(WalletFacade walletFacade, Address address, BSFormatter formatter) {
|
||||||
|
@ -123,17 +123,17 @@ public class BalanceTextField extends AnchorPane {
|
||||||
if (progressIndicator.getProgress() != 0) {
|
if (progressIndicator.getProgress() != 0) {
|
||||||
progressIndicator.setVisible(true);
|
progressIndicator.setVisible(true);
|
||||||
AnchorPane.setRightAnchor(progressIndicator, 0.0);
|
AnchorPane.setRightAnchor(progressIndicator, 0.0);
|
||||||
AnchorPane.setRightAnchor(balanceTextField, 35.0);
|
AnchorPane.setRightAnchor(textField, 35.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBalance(Coin balance) {
|
private void updateBalance(Coin balance) {
|
||||||
balanceTextField.setText(formatter.formatCoinWithCode(balance));
|
textField.setText(formatter.formatCoinWithCode(balance));
|
||||||
if (balance.isPositive())
|
if (balance.isPositive())
|
||||||
balanceTextField.setEffect(fundedEffect);
|
textField.setEffect(fundedEffect);
|
||||||
else
|
else
|
||||||
balanceTextField.setEffect(notFundedEffect);
|
textField.setEffect(notFundedEffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory;
|
||||||
public class TxIdTextField extends AnchorPane {
|
public class TxIdTextField extends AnchorPane {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TxIdTextField.class);
|
private static final Logger log = LoggerFactory.getLogger(TxIdTextField.class);
|
||||||
|
|
||||||
private final TextField txIdLabel;
|
private final TextField textField;
|
||||||
private final Tooltip progressIndicatorTooltip;
|
private final Tooltip progressIndicatorTooltip;
|
||||||
private final ConfidenceProgressIndicator progressIndicator;
|
private final ConfidenceProgressIndicator progressIndicator;
|
||||||
private final Label copyIcon;
|
private final Label copyIcon;
|
||||||
|
@ -73,20 +73,21 @@ public class TxIdTextField extends AnchorPane {
|
||||||
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
|
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
|
||||||
AnchorPane.setRightAnchor(copyIcon, 30.0);
|
AnchorPane.setRightAnchor(copyIcon, 30.0);
|
||||||
|
|
||||||
txIdLabel = new TextField();
|
textField = new TextField();
|
||||||
txIdLabel.setId("address-text-field");
|
textField.setId("address-text-field");
|
||||||
txIdLabel.setEditable(false);
|
textField.setEditable(false);
|
||||||
AnchorPane.setRightAnchor(txIdLabel, 55.0);
|
Tooltip.install(textField, new Tooltip("Open a blockchain explorer with that transactions ID"));
|
||||||
AnchorPane.setLeftAnchor(txIdLabel, 0.0);
|
AnchorPane.setRightAnchor(textField, 55.0);
|
||||||
txIdLabel.focusTraversableProperty().set(focusTraversableProperty().get());
|
AnchorPane.setLeftAnchor(textField, 0.0);
|
||||||
focusedProperty().addListener((ov, oldValue, newValue) -> txIdLabel.requestFocus());
|
textField.focusTraversableProperty().set(focusTraversableProperty().get());
|
||||||
|
focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus());
|
||||||
|
|
||||||
getChildren().addAll(txIdLabel, copyIcon, progressIndicator);
|
getChildren().addAll(textField, copyIcon, progressIndicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setup(WalletFacade walletFacade, String txID) {
|
public void setup(WalletFacade walletFacade, String txID) {
|
||||||
txIdLabel.setText(txID);
|
textField.setText(txID);
|
||||||
txIdLabel.setOnMouseClicked(mouseEvent -> {
|
textField.setOnMouseClicked(mouseEvent -> {
|
||||||
try {
|
try {
|
||||||
Desktop.getDesktop().browse(URI.create("https://blockchain.info/address/" + txID));
|
Desktop.getDesktop().browse(URI.create("https://blockchain.info/address/" + txID));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -214,6 +214,7 @@ public class MainViewCB extends ViewCB<MainPM> {
|
||||||
numPendingTradesLabel.setText(String.valueOf(numPendingTrades));
|
numPendingTradesLabel.setText(String.valueOf(numPendingTrades));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.trace("openInfoNotification " + BitSquare.getAppName());
|
||||||
SystemNotification.openInfoNotification(BitSquare.getAppName(), "You got a new trade message.");
|
SystemNotification.openInfoNotification(BitSquare.getAppName(), "You got a new trade message.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -225,8 +226,11 @@ public class MainViewCB extends ViewCB<MainPM> {
|
||||||
private void onMainNavigationAdded() {
|
private void onMainNavigationAdded() {
|
||||||
Profiler.printMsgWithTime("MainController.ondMainNavigationAdded");
|
Profiler.printMsgWithTime("MainController.ondMainNavigationAdded");
|
||||||
|
|
||||||
presentationModel.numPendingTrades.addListener((ov, olaValue, newValue) -> applyPendingTradesInfoIcon((int)
|
presentationModel.numPendingTrades.addListener((ov, oldValue, newValue) ->
|
||||||
newValue));
|
{
|
||||||
|
if ((int) newValue > (int) oldValue)
|
||||||
|
applyPendingTradesInfoIcon((int) newValue);
|
||||||
|
});
|
||||||
applyPendingTradesInfoIcon(presentationModel.numPendingTrades.get());
|
applyPendingTradesInfoIcon(presentationModel.numPendingTrades.get());
|
||||||
navigation.navigateToLastStoredItem();
|
navigation.navigateToLastStoredItem();
|
||||||
onContentAdded();
|
onContentAdded();
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||||
</padding>
|
</padding>
|
||||||
<TableView fx:id="tableView" VBox.vgrow="ALWAYS">
|
<TableView fx:id="table" VBox.vgrow="ALWAYS">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn text="Date" fx:id="dateColumn" minWidth="100" sortable="false">
|
<TableColumn text="Date" fx:id="dateColumn" minWidth="100" sortable="false">
|
||||||
<cellValueFactory>
|
<cellValueFactory>
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class TransactionsViewCB extends CachedViewCB {
|
||||||
private BSFormatter formatter;
|
private BSFormatter formatter;
|
||||||
private ObservableList<TransactionsListItem> transactionsListItems;
|
private ObservableList<TransactionsListItem> transactionsListItems;
|
||||||
|
|
||||||
@FXML TableView<TransactionsListItem> tableView;
|
@FXML TableView<TransactionsListItem> table;
|
||||||
@FXML TableColumn<TransactionsListItem, TransactionsListItem> dateColumn, addressColumn, amountColumn, typeColumn,
|
@FXML TableColumn<TransactionsListItem, TransactionsListItem> dateColumn, addressColumn, amountColumn, typeColumn,
|
||||||
confidenceColumn;
|
confidenceColumn;
|
||||||
|
|
||||||
|
@ -72,7 +72,8 @@ public class TransactionsViewCB extends CachedViewCB {
|
||||||
public void initialize(URL url, ResourceBundle rb) {
|
public void initialize(URL url, ResourceBundle rb) {
|
||||||
super.initialize(url, rb);
|
super.initialize(url, rb);
|
||||||
|
|
||||||
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||||
|
table.setPlaceholder(new Label("No transactions available"));
|
||||||
|
|
||||||
setAddressColumnCellFactory();
|
setAddressColumnCellFactory();
|
||||||
setConfidenceColumnCellFactory();
|
setConfidenceColumnCellFactory();
|
||||||
|
@ -95,7 +96,7 @@ public class TransactionsViewCB extends CachedViewCB {
|
||||||
transactionsListItems.addAll(transactions.stream().map(transaction ->
|
transactionsListItems.addAll(transactions.stream().map(transaction ->
|
||||||
new TransactionsListItem(transaction, walletFacade, formatter)).collect(Collectors.toList()));
|
new TransactionsListItem(transaction, walletFacade, formatter)).collect(Collectors.toList()));
|
||||||
|
|
||||||
tableView.setItems(transactionsListItems);
|
table.setItems(transactionsListItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
|
@ -129,7 +130,7 @@ public class TransactionsViewCB extends CachedViewCB {
|
||||||
public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem,
|
public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem,
|
||||||
TransactionsListItem> column) {
|
TransactionsListItem> column) {
|
||||||
return new TableCell<TransactionsListItem, TransactionsListItem>() {
|
return new TableCell<TransactionsListItem, TransactionsListItem>() {
|
||||||
Hyperlink hyperlink;
|
private Hyperlink hyperlink;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(final TransactionsListItem item, boolean empty) {
|
public void updateItem(final TransactionsListItem item, boolean empty) {
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||||
</padding>
|
</padding>
|
||||||
|
|
||||||
<TableView fx:id="tableView" VBox.vgrow="ALWAYS">
|
<TableView fx:id="table" VBox.vgrow="ALWAYS">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn text="Label" fx:id="labelColumn" minWidth="100" sortable="false"/>
|
<TableColumn text="Label" fx:id="labelColumn" minWidth="100" sortable="false"/>
|
||||||
<TableColumn text="Address" fx:id="addressColumn" minWidth="240" sortable="false">
|
<TableColumn text="Address" fx:id="addressColumn" minWidth="240" sortable="false">
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class WithdrawalViewCB extends CachedViewCB {
|
||||||
private BSFormatter formatter;
|
private BSFormatter formatter;
|
||||||
private ObservableList<WithdrawalListItem> addressList;
|
private ObservableList<WithdrawalListItem> addressList;
|
||||||
|
|
||||||
@FXML TableView<WithdrawalListItem> tableView;
|
@FXML TableView<WithdrawalListItem> table;
|
||||||
@FXML TableColumn<WithdrawalListItem, WithdrawalListItem> labelColumn, addressColumn, balanceColumn, copyColumn,
|
@FXML TableColumn<WithdrawalListItem, WithdrawalListItem> labelColumn, addressColumn, balanceColumn, copyColumn,
|
||||||
confidenceColumn;
|
confidenceColumn;
|
||||||
@FXML Button addNewAddressButton;
|
@FXML Button addNewAddressButton;
|
||||||
|
@ -90,7 +90,8 @@ public class WithdrawalViewCB extends CachedViewCB {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL url, ResourceBundle rb) {
|
public void initialize(URL url, ResourceBundle rb) {
|
||||||
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||||
|
table.setPlaceholder(new Label("No funded wallets for withdrawal available"));
|
||||||
|
|
||||||
setLabelColumnCellFactory();
|
setLabelColumnCellFactory();
|
||||||
setBalanceColumnCellFactory();
|
setBalanceColumnCellFactory();
|
||||||
|
@ -112,7 +113,7 @@ public class WithdrawalViewCB extends CachedViewCB {
|
||||||
public void activate() {
|
public void activate() {
|
||||||
super.activate();
|
super.activate();
|
||||||
|
|
||||||
tableView.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
|
table.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
|
|
||||||
if (Coin.ZERO.compareTo(newValue.getBalance()) <= 0) {
|
if (Coin.ZERO.compareTo(newValue.getBalance()) <= 0) {
|
||||||
|
@ -134,7 +135,7 @@ public class WithdrawalViewCB extends CachedViewCB {
|
||||||
addressList.addAll(addressEntryList.stream().map(anAddressEntryList ->
|
addressList.addAll(addressEntryList.stream().map(anAddressEntryList ->
|
||||||
new WithdrawalListItem(anAddressEntryList, walletFacade, formatter)).collect(Collectors.toList()));
|
new WithdrawalListItem(anAddressEntryList, walletFacade, formatter)).collect(Collectors.toList()));
|
||||||
|
|
||||||
tableView.setItems(addressList);
|
table.setItems(addressList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
|
@ -220,7 +221,7 @@ public class WithdrawalViewCB extends CachedViewCB {
|
||||||
WithdrawalListItem> column) {
|
WithdrawalListItem> column) {
|
||||||
return new TableCell<WithdrawalListItem, WithdrawalListItem>() {
|
return new TableCell<WithdrawalListItem, WithdrawalListItem>() {
|
||||||
|
|
||||||
Hyperlink hyperlink;
|
private Hyperlink hyperlink;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(final WithdrawalListItem item, boolean empty) {
|
public void updateItem(final WithdrawalListItem item, boolean empty) {
|
||||||
|
|
|
@ -65,6 +65,7 @@ public class ClosedTradesViewCB extends CachedViewCB<ClosedTradesPM> {
|
||||||
setDateColumnCellFactory();
|
setDateColumnCellFactory();
|
||||||
|
|
||||||
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||||
|
table.setPlaceholder(new Label("No closed trades available"));
|
||||||
|
|
||||||
super.initialize(url, rb);
|
super.initialize(url, rb);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +114,7 @@ public class ClosedTradesViewCB extends CachedViewCB<ClosedTradesPM> {
|
||||||
public TableCell<ClosedTradesListItem, ClosedTradesListItem> call(TableColumn<ClosedTradesListItem,
|
public TableCell<ClosedTradesListItem, ClosedTradesListItem> call(TableColumn<ClosedTradesListItem,
|
||||||
ClosedTradesListItem> column) {
|
ClosedTradesListItem> column) {
|
||||||
return new TableCell<ClosedTradesListItem, ClosedTradesListItem>() {
|
return new TableCell<ClosedTradesListItem, ClosedTradesListItem>() {
|
||||||
Hyperlink hyperlink;
|
private Hyperlink hyperlink;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(final ClosedTradesListItem item, boolean empty) {
|
public void updateItem(final ClosedTradesListItem item, boolean empty) {
|
||||||
|
@ -121,6 +122,7 @@ public class ClosedTradesViewCB extends CachedViewCB<ClosedTradesPM> {
|
||||||
|
|
||||||
if (item != null && !empty) {
|
if (item != null && !empty) {
|
||||||
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
|
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
|
||||||
|
hyperlink.setId("id-link");
|
||||||
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
|
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
|
||||||
hyperlink.setOnAction(event -> openOfferDetails(item));
|
hyperlink.setOnAction(event -> openOfferDetails(item));
|
||||||
setGraphic(hyperlink);
|
setGraphic(hyperlink);
|
||||||
|
|
|
@ -67,6 +67,7 @@ public class OffersViewCB extends CachedViewCB<OffersPM> {
|
||||||
setRemoveColumnCellFactory();
|
setRemoveColumnCellFactory();
|
||||||
|
|
||||||
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||||
|
table.setPlaceholder(new Label("No open offers available"));
|
||||||
|
|
||||||
super.initialize(url, rb);
|
super.initialize(url, rb);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +119,7 @@ public class OffersViewCB extends CachedViewCB<OffersPM> {
|
||||||
public TableCell<OfferListItem, OfferListItem> call(TableColumn<OfferListItem,
|
public TableCell<OfferListItem, OfferListItem> call(TableColumn<OfferListItem,
|
||||||
OfferListItem> column) {
|
OfferListItem> column) {
|
||||||
return new TableCell<OfferListItem, OfferListItem>() {
|
return new TableCell<OfferListItem, OfferListItem>() {
|
||||||
Hyperlink hyperlink;
|
private Hyperlink hyperlink;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(final OfferListItem item, boolean empty) {
|
public void updateItem(final OfferListItem item, boolean empty) {
|
||||||
|
@ -126,6 +127,7 @@ public class OffersViewCB extends CachedViewCB<OffersPM> {
|
||||||
|
|
||||||
if (item != null && !empty) {
|
if (item != null && !empty) {
|
||||||
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
|
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
|
||||||
|
hyperlink.setId("id-link");
|
||||||
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
|
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
|
||||||
hyperlink.setOnAction(event -> openOfferDetails(item));
|
hyperlink.setOnAction(event -> openOfferDetails(item));
|
||||||
setGraphic(hyperlink);
|
setGraphic(hyperlink);
|
||||||
|
|
|
@ -181,7 +181,6 @@ class PendingTradesModel extends UIModel {
|
||||||
|
|
||||||
if (closedTrade != null) {
|
if (closedTrade != null) {
|
||||||
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
|
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
|
||||||
closedTrade = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -201,7 +200,6 @@ class PendingTradesModel extends UIModel {
|
||||||
void closeSummary() {
|
void closeSummary() {
|
||||||
if (closedTrade != null) {
|
if (closedTrade != null) {
|
||||||
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
|
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
|
||||||
closedTrade = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,6 +232,9 @@ class PendingTradesModel extends UIModel {
|
||||||
return selectedItem;
|
return selectedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getCurrencyCode() {
|
||||||
|
return selectedItem.getTrade().getOffer().getCurrency().getCurrencyCode();
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Private
|
// Private
|
||||||
|
|
|
@ -151,6 +151,10 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||||
return model.getSelectedItem();
|
return model.getSelectedItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getCurrencyCode() {
|
||||||
|
return model.getCurrencyCode();
|
||||||
|
}
|
||||||
|
|
||||||
// columns
|
// columns
|
||||||
String getTradeId(PendingTradesListItem item) {
|
String getTradeId(PendingTradesListItem item) {
|
||||||
return item.getTrade().getId();
|
return item.getTrade().getId();
|
||||||
|
@ -169,7 +173,15 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
String getDirectionLabel(PendingTradesListItem item) {
|
String getDirectionLabel(PendingTradesListItem item) {
|
||||||
return (item != null) ? formatter.formatDirection(item.getTrade().getOffer().getMirroredDirection()) : "";
|
if (item != null) {
|
||||||
|
if (model.isOfferer())
|
||||||
|
return formatter.formatDirection(item.getTrade().getOffer().getDirection()) + " Bitcoin";
|
||||||
|
else
|
||||||
|
return formatter.formatDirection(item.getTrade().getOffer().getMirroredDirection()) + " Bitcoin";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String getDate(PendingTradesListItem item) {
|
String getDate(PendingTradesListItem item) {
|
||||||
|
|
|
@ -164,7 +164,8 @@
|
||||||
<InfoDisplay fx:id="summaryInfoDisplay" onAction="#onOpenSummaryHelp" rowIndex="9" gridPane="$root"
|
<InfoDisplay fx:id="summaryInfoDisplay" onAction="#onOpenSummaryHelp" rowIndex="9" gridPane="$root"
|
||||||
visible="false"/>
|
visible="false"/>
|
||||||
|
|
||||||
<Button fx:id="closeSummaryButton" text="Close summary" onAction="#onCloseSummary" GridPane.rowIndex="10"
|
<Button fx:id="openWithdrawalButton" text="Open withdrawal screen" onAction="#onOpenWithdrawal"
|
||||||
|
GridPane.rowIndex="10"
|
||||||
GridPane.columnIndex="1" defaultButton="true" visible="false">
|
GridPane.columnIndex="1" defaultButton="true" visible="false">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets top="15"/>
|
<Insets top="15"/>
|
||||||
|
@ -188,7 +189,6 @@
|
||||||
<RowConstraints/>
|
<RowConstraints/>
|
||||||
<RowConstraints/>
|
<RowConstraints/>
|
||||||
<RowConstraints/>
|
<RowConstraints/>
|
||||||
<RowConstraints/>
|
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
|
|
||||||
</GridPane>
|
</GridPane>
|
|
@ -18,6 +18,7 @@
|
||||||
package io.bitsquare.gui.main.orders.pending;
|
package io.bitsquare.gui.main.orders.pending;
|
||||||
|
|
||||||
import io.bitsquare.gui.CachedViewCB;
|
import io.bitsquare.gui.CachedViewCB;
|
||||||
|
import io.bitsquare.gui.Navigation;
|
||||||
import io.bitsquare.gui.components.InfoDisplay;
|
import io.bitsquare.gui.components.InfoDisplay;
|
||||||
import io.bitsquare.gui.components.TextFieldWithCopyIcon;
|
import io.bitsquare.gui.components.TextFieldWithCopyIcon;
|
||||||
import io.bitsquare.gui.components.TitledGroupBg;
|
import io.bitsquare.gui.components.TitledGroupBg;
|
||||||
|
@ -26,6 +27,7 @@ import io.bitsquare.gui.components.processbar.ProcessStepBar;
|
||||||
import io.bitsquare.gui.components.processbar.ProcessStepItem;
|
import io.bitsquare.gui.components.processbar.ProcessStepItem;
|
||||||
import io.bitsquare.gui.main.help.Help;
|
import io.bitsquare.gui.main.help.Help;
|
||||||
import io.bitsquare.gui.main.help.HelpId;
|
import io.bitsquare.gui.main.help.HelpId;
|
||||||
|
import io.bitsquare.locale.BSResources;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
@ -35,6 +37,7 @@ import java.util.ResourceBundle;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import javafx.application.Platform;
|
||||||
import javafx.beans.property.ReadOnlyObjectWrapper;
|
import javafx.beans.property.ReadOnlyObjectWrapper;
|
||||||
import javafx.beans.value.ChangeListener;
|
import javafx.beans.value.ChangeListener;
|
||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
|
@ -63,11 +66,12 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
collateralTextField;
|
collateralTextField;
|
||||||
@FXML TxIdTextField txIdTextField;
|
@FXML TxIdTextField txIdTextField;
|
||||||
@FXML InfoDisplay infoDisplay, paymentsInfoDisplay, summaryInfoDisplay;
|
@FXML InfoDisplay infoDisplay, paymentsInfoDisplay, summaryInfoDisplay;
|
||||||
@FXML Button confirmPaymentReceiptButton, paymentsButton, closeSummaryButton;
|
@FXML Button confirmPaymentReceiptButton, paymentsButton, openWithdrawalButton;
|
||||||
@FXML TextFieldWithCopyIcon holderNameTextField, secondaryIdTextField, primaryIdTextField;
|
@FXML TextFieldWithCopyIcon holderNameTextField, secondaryIdTextField, primaryIdTextField;
|
||||||
@FXML TableView<PendingTradesListItem> table;
|
@FXML TableView<PendingTradesListItem> table;
|
||||||
@FXML TableColumn<PendingTradesListItem, PendingTradesListItem> priceColumn, amountColumn, volumeColumn,
|
@FXML TableColumn<PendingTradesListItem, PendingTradesListItem> priceColumn, amountColumn, volumeColumn,
|
||||||
directionColumn, dateColumn, tradeIdColumn, selectColumn;
|
directionColumn, dateColumn, tradeIdColumn, selectColumn;
|
||||||
|
private Navigation navigation;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -75,8 +79,10 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PendingTradesViewCB(PendingTradesPM presentationModel) {
|
PendingTradesViewCB(PendingTradesPM presentationModel, Navigation navigation) {
|
||||||
super(presentationModel);
|
super(presentationModel);
|
||||||
|
|
||||||
|
this.navigation = navigation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,6 +101,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
setSelectColumnCellFactory();
|
setSelectColumnCellFactory();
|
||||||
|
|
||||||
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||||
|
table.setPlaceholder(new Label("No pending trades available"));
|
||||||
|
|
||||||
txIdChangeListener = (ov, oldValue, newValue) ->
|
txIdChangeListener = (ov, oldValue, newValue) ->
|
||||||
txIdTextField.setup(presentationModel.getWalletFacade(), newValue);
|
txIdTextField.setup(presentationModel.getWalletFacade(), newValue);
|
||||||
|
@ -176,9 +183,12 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void onCloseSummary() {
|
void onOpenWithdrawal() {
|
||||||
presentationModel.closeSummary();
|
|
||||||
setSummaryControlsVisible(false);
|
setSummaryControlsVisible(false);
|
||||||
|
presentationModel.closeSummary();
|
||||||
|
|
||||||
|
Platform.runLater(() ->
|
||||||
|
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.FUNDS, Navigation.Item.WITHDRAWAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -258,43 +268,58 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case OFFERER_BUYER_WAIT_TX_CONF:
|
case OFFERER_BUYER_WAIT_TX_CONF:
|
||||||
processBar.setSelectedIndex(0);
|
processBar.setSelectedIndex(0);
|
||||||
statusTextField.setText("Deposit transaction is published. Waiting " +
|
|
||||||
"for at least 1 confirmation");
|
statusTextField.setText("Deposit transaction has been published. You need to wait for at least " +
|
||||||
infoDisplay.setText("Deposit transaction has bee published. You need to wait for at least one " +
|
"one block chain confirmation.");
|
||||||
"block chain confirmation. After that you need to make the payments transfer.");
|
infoDisplay.setText("The Bitcoin buyer needs to wait for at least one block chain confirmation to" +
|
||||||
|
" be sure that the deposit funding has not been double spent. For higher trade volumes we" +
|
||||||
|
" recommend to wait up to 6 confirmations.");
|
||||||
|
infoDisplay.layout();
|
||||||
break;
|
break;
|
||||||
case OFFERER_BUYER_START_PAYMENT:
|
case OFFERER_BUYER_START_PAYMENT:
|
||||||
processBar.setSelectedIndex(1);
|
processBar.setSelectedIndex(1);
|
||||||
|
|
||||||
setPaymentsControlsVisible(true);
|
setPaymentsControlsVisible(true);
|
||||||
|
|
||||||
statusTextField.setText("Deposit transaction has at least 1 confirmation. Start payment.");
|
statusTextField.setText("Deposit transaction has at least one block chain confirmation. " +
|
||||||
infoDisplay.setText("Deposit transaction has at least one blockchain confirmation. You need to " +
|
"Please start now the payment.");
|
||||||
"start the payment.");
|
infoDisplay.setText("You are now safe to start the payment. You can wait for up to 6 block chain " +
|
||||||
|
"confirmations if you want more security.");
|
||||||
|
infoDisplay.layout();
|
||||||
|
|
||||||
paymentMethodTextField.setText(presentationModel.getPaymentMethod());
|
paymentMethodTextField.setText(presentationModel.getPaymentMethod());
|
||||||
holderNameTextField.setText(presentationModel.getHolderName());
|
holderNameTextField.setText(presentationModel.getHolderName());
|
||||||
primaryIdTextField.setText(presentationModel.getPrimaryId());
|
primaryIdTextField.setText(presentationModel.getPrimaryId());
|
||||||
secondaryIdTextField.setText(presentationModel.getSecondaryId());
|
secondaryIdTextField.setText(presentationModel.getSecondaryId());
|
||||||
paymentsInfoDisplay.setText("Copy and paste the payments accounts data to your payments " +
|
paymentsInfoDisplay.setText(BSResources.get("Copy and paste the payment account data to your " +
|
||||||
"accounts web page and transfer the payment to the other trader. When the transfer is " +
|
"internet banking web page and transfer the {0} amount to the other traders " +
|
||||||
"done confirm it with the 'Payment started' button.");
|
"payment account. When the transfer is completed inform the other trader by " +
|
||||||
|
"clicking the button below.",
|
||||||
|
presentationModel.getCurrencyCode()));
|
||||||
|
paymentsInfoDisplay.layout();
|
||||||
break;
|
break;
|
||||||
case OFFERER_BUYER_WAIT_CONFIRM_PAYMENT_RECEIVED:
|
case OFFERER_BUYER_WAIT_CONFIRM_PAYMENT_RECEIVED:
|
||||||
processBar.setSelectedIndex(2);
|
processBar.setSelectedIndex(2);
|
||||||
|
|
||||||
statusTextField.setText("Waiting until the other trader has received your payment.");
|
statusTextField.setText(BSResources.get("Waiting for the Bitcoin sellers confirmation " +
|
||||||
infoDisplay.setText("Waiting until the other trader has confirmed that he has received your " +
|
"that the {0} payment has arrived.",
|
||||||
"payment.");
|
presentationModel.getCurrencyCode()));
|
||||||
|
infoDisplay.setText(BSResources.get("When the confirmation that the {0} payment arrived at the " +
|
||||||
|
"Bitcoin sellers payment account, the payout transaction will be published.",
|
||||||
|
presentationModel.getCurrencyCode()));
|
||||||
|
infoDisplay.layout();
|
||||||
break;
|
break;
|
||||||
case OFFERER_BUYER_COMPLETED:
|
case OFFERER_BUYER_COMPLETED:
|
||||||
processBar.setSelectedIndex(3);
|
processBar.setSelectedIndex(3);
|
||||||
|
|
||||||
setSummaryControlsVisible(true);
|
setSummaryControlsVisible(true);
|
||||||
|
|
||||||
statusTextField.setText("Trade has successfully completed.");
|
statusTextField.setText("Congratulations! Trade has successfully completed.");
|
||||||
infoDisplay.setText("Trade has successfully completed. You can find the details to that trade" +
|
infoDisplay.setText("The trade is now completed and you can withdraw your Bitcoin to any external" +
|
||||||
" in the closed trades section.");
|
"wallet. To protect your privacy you should take care that your trades are not merged " +
|
||||||
|
"in " +
|
||||||
|
"that external wallet. For more information about privacy see our help pages.");
|
||||||
|
infoDisplay.layout();
|
||||||
|
|
||||||
btcLabel.setText("You have bought:");
|
btcLabel.setText("You have bought:");
|
||||||
fiatLabel.setText("You have paid:");
|
fiatLabel.setText("You have paid:");
|
||||||
|
@ -302,7 +327,9 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
fiatTextField.setText(presentationModel.getFiatVolume());
|
fiatTextField.setText(presentationModel.getFiatVolume());
|
||||||
feesTextField.setText(presentationModel.getTotalFees());
|
feesTextField.setText(presentationModel.getTotalFees());
|
||||||
collateralTextField.setText(presentationModel.getCollateral());
|
collateralTextField.setText(presentationModel.getCollateral());
|
||||||
summaryInfoDisplay.setText("You can open that summary any time in the closed orders section.");
|
summaryInfoDisplay.setText("Your trade bond has been refunded to you. " +
|
||||||
|
"You can review the details to that trade any time in the closed trades section.");
|
||||||
|
summaryInfoDisplay.layout();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,28 +348,41 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
case TAKER_SELLER_WAIT_TX_CONF:
|
case TAKER_SELLER_WAIT_TX_CONF:
|
||||||
processBar.setSelectedIndex(0);
|
processBar.setSelectedIndex(0);
|
||||||
|
|
||||||
statusTextField.setText("Deposit transaction is published. Waiting for at least 1 confirmation");
|
statusTextField.setText("Deposit transaction has been published. " +
|
||||||
infoDisplay.setText("Deposit transaction has bee published. He needs to wait for at least one " +
|
"The Bitcoin buyer need to wait for at least one block chain confirmation.");
|
||||||
"blockchain confirmation.");
|
infoDisplay.setText(BSResources.get("The Bitcoin buyer needs to wait for at least one " +
|
||||||
|
"block chain confirmation before starting the {0} payment. " +
|
||||||
|
"That is needed to assure that the deposit input funding has not been " +
|
||||||
|
"double-spent. " +
|
||||||
|
"For higher trade volumes it is recommended to wait up to 6 confirmations.",
|
||||||
|
presentationModel.getCurrencyCode()));
|
||||||
|
infoDisplay.layout();
|
||||||
break;
|
break;
|
||||||
case TAKER_SELLER_WAIT_PAYMENT_STARTED:
|
case TAKER_SELLER_WAIT_PAYMENT_STARTED:
|
||||||
processBar.setSelectedIndex(1);
|
processBar.setSelectedIndex(1);
|
||||||
|
|
||||||
statusTextField.setText("Deposit transaction has at least 1 confirmation. Waiting that other " +
|
statusTextField.setText(BSResources.get("Deposit transaction has at least one block chain " +
|
||||||
"trader starts payment.");
|
"confirmation. " +
|
||||||
infoDisplay.setText("Deposit transaction has at least one blockchain " +
|
"Waiting that other trader starts the {0} payment.",
|
||||||
"confirmation. The other trader need to start the payment. You will get informed when " +
|
presentationModel.getCurrencyCode()));
|
||||||
"that been done.");
|
infoDisplay.setText(BSResources.get("You will get informed when the other trader has indicated " +
|
||||||
|
"the {0} payment has been started.",
|
||||||
|
presentationModel.getCurrencyCode()));
|
||||||
|
infoDisplay.layout();
|
||||||
break;
|
break;
|
||||||
case TAKER_SELLER_CONFIRM_RECEIVE_PAYMENT:
|
case TAKER_SELLER_CONFIRM_RECEIVE_PAYMENT:
|
||||||
processBar.setSelectedIndex(2);
|
processBar.setSelectedIndex(2);
|
||||||
|
|
||||||
confirmPaymentReceiptButton.setVisible(true);
|
confirmPaymentReceiptButton.setVisible(true);
|
||||||
|
|
||||||
statusTextField.setText("Payment is on the way. Check your payments account and confirm when you " +
|
statusTextField.setText(BSResources.get("The Bitcoin buyer has started the {0} payment." +
|
||||||
"have received the payment.");
|
"Check your payments account and confirm when you have received the payment.",
|
||||||
infoDisplay.setText("The other trader has started the payment. You need to check your payments " +
|
presentationModel.getCurrencyCode()));
|
||||||
"account and confirm the payment when the money has arrived there.");
|
infoDisplay.setText(BSResources.get("It is important that you confirm when you have received the " +
|
||||||
|
"{0} payment as this will publish the payout transaction where you get returned " +
|
||||||
|
"your trade bond and the Bitcoin buyer receive the Bitcoin amount you sold.",
|
||||||
|
presentationModel.getCurrencyCode()));
|
||||||
|
infoDisplay.layout();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case TAKER_SELLER_COMPLETED:
|
case TAKER_SELLER_COMPLETED:
|
||||||
|
@ -350,9 +390,13 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
|
|
||||||
setSummaryControlsVisible(true);
|
setSummaryControlsVisible(true);
|
||||||
|
|
||||||
statusTextField.setText("Trade has successfully completed.");
|
|
||||||
infoDisplay.setText("Trade has successfully completed. You can find the details to that trade" +
|
statusTextField.setText("Congratulations! Trade has successfully completed.");
|
||||||
" in the closed trades section.");
|
infoDisplay.setText("The trade is now completed and you can withdraw the refunded Bitcoin from " +
|
||||||
|
"the trade bond to any external wallet. " +
|
||||||
|
"To protect your privacy you should take care that your coins are not merged in " +
|
||||||
|
"that external wallet. For more information about privacy see our help pages.");
|
||||||
|
infoDisplay.layout();
|
||||||
|
|
||||||
btcLabel.setText("You have sold:");
|
btcLabel.setText("You have sold:");
|
||||||
fiatLabel.setText("You have received:");
|
fiatLabel.setText("You have received:");
|
||||||
|
@ -360,7 +404,9 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
fiatTextField.setText(presentationModel.getFiatVolume());
|
fiatTextField.setText(presentationModel.getFiatVolume());
|
||||||
feesTextField.setText(presentationModel.getTotalFees());
|
feesTextField.setText(presentationModel.getTotalFees());
|
||||||
collateralTextField.setText(presentationModel.getCollateral());
|
collateralTextField.setText(presentationModel.getCollateral());
|
||||||
summaryInfoDisplay.setText("You can open that summary any time in the closed orders section.");
|
summaryInfoDisplay.setText("Your trade bond has been refunded to you. " +
|
||||||
|
"You can review the details to that trade any time in the closed trades section.");
|
||||||
|
summaryInfoDisplay.layout();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -402,7 +448,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
collateralLabel.setVisible(visible);
|
collateralLabel.setVisible(visible);
|
||||||
collateralTextField.setVisible(visible);
|
collateralTextField.setVisible(visible);
|
||||||
summaryInfoDisplay.setVisible(visible);
|
summaryInfoDisplay.setVisible(visible);
|
||||||
closeSummaryButton.setVisible(visible);
|
openWithdrawalButton.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -421,7 +467,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
(TableColumn<PendingTradesListItem,
|
(TableColumn<PendingTradesListItem,
|
||||||
PendingTradesListItem> column) {
|
PendingTradesListItem> column) {
|
||||||
return new TableCell<PendingTradesListItem, PendingTradesListItem>() {
|
return new TableCell<PendingTradesListItem, PendingTradesListItem>() {
|
||||||
Hyperlink hyperlink;
|
private Hyperlink hyperlink;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(final PendingTradesListItem item, boolean empty) {
|
public void updateItem(final PendingTradesListItem item, boolean empty) {
|
||||||
|
@ -429,6 +475,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||||
|
|
||||||
if (item != null && !empty) {
|
if (item != null && !empty) {
|
||||||
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
|
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
|
||||||
|
hyperlink.setId("id-link");
|
||||||
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
|
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
|
||||||
hyperlink.setOnAction(event -> openOfferDetails(item));
|
hyperlink.setOnAction(event -> openOfferDetails(item));
|
||||||
setGraphic(hyperlink);
|
setGraphic(hyperlink);
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class TradeViewCB extends CachedViewCB implements TradeNavigator {
|
||||||
new ViewLoader(getClass().getResource(navigationItem.getFxmlUrl()), false);
|
new ViewLoader(getClass().getResource(navigationItem.getFxmlUrl()), false);
|
||||||
try {
|
try {
|
||||||
final Parent view = orderBookLoader.load();
|
final Parent view = orderBookLoader.load();
|
||||||
final Tab tab = new Tab("Orderbook");
|
final Tab tab = new Tab(direction == Direction.BUY ? "Buy Bitcoin" : "Sell Bitcoin");
|
||||||
tab.setClosable(false);
|
tab.setClosable(false);
|
||||||
tab.setContent(view);
|
tab.setContent(view);
|
||||||
tabPane.getTabs().add(tab);
|
tabPane.getTabs().add(tab);
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<Insets bottom="20.0" left="25.0" top="30.0" right="25"/>
|
<Insets bottom="20.0" left="25.0" top="30.0" right="25"/>
|
||||||
</padding>
|
</padding>
|
||||||
|
|
||||||
<TitledGroupBg text="Order book filter" GridPane.rowIndex="0" GridPane.columnIndex="0"
|
<TitledGroupBg text="Filter offers" GridPane.rowIndex="0" GridPane.columnIndex="0"
|
||||||
GridPane.rowSpan="5" GridPane.columnSpan="2"/>
|
GridPane.rowSpan="5" GridPane.columnSpan="2"/>
|
||||||
|
|
||||||
<Label text="Filter by amount or price:" GridPane.rowIndex="0" GridPane.valignment="TOP">
|
<Label text="Filter by amount or price:" GridPane.rowIndex="0" GridPane.valignment="TOP">
|
||||||
|
@ -98,12 +98,12 @@
|
||||||
|
|
||||||
<Label fx:id="extendedButton1Label" text="Payments account countries:" GridPane.columnIndex="0"
|
<Label fx:id="extendedButton1Label" text="Payments account countries:" GridPane.columnIndex="0"
|
||||||
GridPane.rowIndex="3" visible="false" managed="false"/>
|
GridPane.rowIndex="3" visible="false" managed="false"/>
|
||||||
<Button fx:id="extendedButton1" text="Open filter" GridPane.columnIndex="1"
|
<Button fx:id="extendedButton1" text="Open countries filter" GridPane.columnIndex="1"
|
||||||
GridPane.rowIndex="3" visible="false" managed="false"/>
|
GridPane.rowIndex="3" visible="false" managed="false"/>
|
||||||
|
|
||||||
<Label fx:id="extendedButton2Label" text="Payments account methods:" GridPane.columnIndex="0"
|
<Label fx:id="extendedButton2Label" text="Payments account methods:" GridPane.columnIndex="0"
|
||||||
GridPane.rowIndex="4" visible="false" managed="false"/>
|
GridPane.rowIndex="4" visible="false" managed="false"/>
|
||||||
<Button fx:id="extendedButton2" text="Open filter" GridPane.columnIndex="1"
|
<Button fx:id="extendedButton2" text="Open payment methods filter" GridPane.columnIndex="1"
|
||||||
GridPane.rowIndex="4" visible="false" managed="false">
|
GridPane.rowIndex="4" visible="false" managed="false">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets bottom="-5"/>
|
<Insets bottom="-5"/>
|
||||||
|
@ -119,10 +119,10 @@
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</HBox>
|
</HBox>
|
||||||
|
|
||||||
<TitledSeparator text="Order book for buying Bitcoin" GridPane.rowIndex="6" GridPane.columnIndex="0"
|
<TitledSeparator text="Offers" GridPane.rowIndex="6" GridPane.columnIndex="0"
|
||||||
GridPane.columnSpan="2"/>
|
GridPane.columnSpan="2"/>
|
||||||
|
|
||||||
<TableView fx:id="orderBookTable" GridPane.rowIndex="6" GridPane.columnIndex="0" GridPane.columnSpan="2"
|
<TableView fx:id="table" GridPane.rowIndex="6" GridPane.columnIndex="0" GridPane.columnSpan="2"
|
||||||
prefHeight="1500">
|
prefHeight="1500">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets top="10.0" left="-10" right="-10" bottom="-15"/>
|
<Insets top="10.0" left="-10" right="-10" bottom="-15"/>
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
@FXML Label amountBtcLabel, priceDescriptionLabel, priceFiatLabel, volumeDescriptionLabel,
|
@FXML Label amountBtcLabel, priceDescriptionLabel, priceFiatLabel, volumeDescriptionLabel,
|
||||||
volumeFiatLabel, extendedButton1Label, extendedButton2Label, extendedCheckBoxLabel;
|
volumeFiatLabel, extendedButton1Label, extendedButton2Label, extendedCheckBoxLabel;
|
||||||
@FXML InputTextField volumeTextField, amountTextField, priceTextField;
|
@FXML InputTextField volumeTextField, amountTextField, priceTextField;
|
||||||
@FXML TableView<OrderBookListItem> orderBookTable;
|
@FXML TableView<OrderBookListItem> table;
|
||||||
@FXML Button createOfferButton, showAdvancedSettingsButton, extendedButton1, extendedButton2;
|
@FXML Button createOfferButton, showAdvancedSettingsButton, extendedButton1, extendedButton2;
|
||||||
@FXML TableColumn<OrderBookListItem, OrderBookListItem> priceColumn, amountColumn, volumeColumn,
|
@FXML TableColumn<OrderBookListItem, OrderBookListItem> priceColumn, amountColumn, volumeColumn,
|
||||||
directionColumn, countryColumn, bankAccountTypeColumn;
|
directionColumn, countryColumn, bankAccountTypeColumn;
|
||||||
|
@ -118,8 +118,11 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
setBankAccountTypeColumnCellFactory();
|
setBankAccountTypeColumnCellFactory();
|
||||||
setDirectionColumnCellFactory();
|
setDirectionColumnCellFactory();
|
||||||
|
|
||||||
orderBookTable.getSortOrder().add(priceColumn);
|
table.getSortOrder().add(priceColumn);
|
||||||
orderBookTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||||
|
Label placeholder = new Label("No offers available.\nTry to change your filter or account settings.");
|
||||||
|
placeholder.setWrapText(true);
|
||||||
|
table.setPlaceholder(placeholder);
|
||||||
|
|
||||||
setupBindings();
|
setupBindings();
|
||||||
setupValidators();
|
setupValidators();
|
||||||
|
@ -138,11 +141,11 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
|
|
||||||
// setOrderBookInfo has been called before
|
// setOrderBookInfo has been called before
|
||||||
SortedList<OrderBookListItem> offerList = presentationModel.getOfferList();
|
SortedList<OrderBookListItem> offerList = presentationModel.getOfferList();
|
||||||
orderBookTable.setItems(offerList);
|
table.setItems(offerList);
|
||||||
offerList.comparatorProperty().bind(orderBookTable.comparatorProperty());
|
offerList.comparatorProperty().bind(table.comparatorProperty());
|
||||||
priceColumn.setSortType((presentationModel.getDirection() == Direction.BUY) ?
|
priceColumn.setSortType((presentationModel.getDirection() == Direction.BUY) ?
|
||||||
TableColumn.SortType.ASCENDING : TableColumn.SortType.DESCENDING);
|
TableColumn.SortType.ASCENDING : TableColumn.SortType.DESCENDING);
|
||||||
orderBookTable.sort();
|
table.sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
|
@ -255,7 +258,7 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
Navigation.Item.ACCOUNT_SETTINGS,
|
Navigation.Item.ACCOUNT_SETTINGS,
|
||||||
Navigation.Item.RESTRICTIONS);
|
Navigation.Item.RESTRICTIONS);
|
||||||
else
|
else
|
||||||
orderBookTable.getSelectionModel().clearSelection();
|
table.getSelectionModel().clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showDetailsScreen() {
|
private void showDetailsScreen() {
|
||||||
|
|
|
@ -251,6 +251,10 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
return fiatCode;
|
return fiatCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getAmount() {
|
||||||
|
return formatter.formatCoinWithCode(model.amountAsCoin.get());
|
||||||
|
}
|
||||||
|
|
||||||
String getAmountRange() {
|
String getAmountRange() {
|
||||||
return amountRange;
|
return amountRange;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,8 @@
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
<Label id="input-description-label" text="%takeOffer.amountPriceBox.amountRangeDescription"
|
<Label id="input-description-label" text="%takeOffer.amountPriceBox.amountRangeDescription"
|
||||||
prefWidth="170" textAlignment="CENTER"/>
|
prefWidth="170" textAlignment="CENTER"/>
|
||||||
<Label fx:id="amountRangeTextField" id="label-with-background" prefWidth="170" textAlignment="CENTER"/>
|
<Label fx:id="amountRangeTextField" id="label-with-background" prefWidth="170"
|
||||||
|
style=" -fx-alignment: center;"/>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|
||||||
<InfoDisplay gridPane="$gridPane" onAction="#onOpenGeneralHelp" rowIndex="2"
|
<InfoDisplay gridPane="$gridPane" onAction="#onOpenGeneralHelp" rowIndex="2"
|
||||||
|
|
|
@ -419,7 +419,7 @@ public class TakeOfferViewCB extends CachedViewCB<TakeOfferPM> {
|
||||||
|
|
||||||
addPayInfoEntry(infoGridPane, 0,
|
addPayInfoEntry(infoGridPane, 0,
|
||||||
BSResources.get("takeOffer.fundsBox.amount"),
|
BSResources.get("takeOffer.fundsBox.amount"),
|
||||||
presentationModel.amount.get());
|
presentationModel.getAmount());
|
||||||
addPayInfoEntry(infoGridPane, 1,
|
addPayInfoEntry(infoGridPane, 1,
|
||||||
presentationModel.getCollateralLabel(),
|
presentationModel.getCollateralLabel(),
|
||||||
presentationModel.collateral.get());
|
presentationModel.collateral.get());
|
||||||
|
|
|
@ -522,8 +522,7 @@ public class MessageFacade implements MessageBroker {
|
||||||
final Object object = data.object();
|
final Object object = data.object();
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
Long timeStamp = (Long) object;
|
Long timeStamp = (Long) object;
|
||||||
log.trace("Get invalidationTimestamp from DHT was successful. TimeStamp=" +
|
//log.trace("Get invalidationTimestamp from DHT was successful. TimeStamp=" + timeStamp);
|
||||||
timeStamp);
|
|
||||||
invalidationTimestamp.set(timeStamp);
|
invalidationTimestamp.set(timeStamp);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ createOffer.fundsBox.totalsNeeded.prompt=Will be calculated from the Bitcoin amo
|
||||||
createOffer.fundsBox.address=Trade wallet address:
|
createOffer.fundsBox.address=Trade wallet address:
|
||||||
createOffer.fundsBox.balance=Trade wallet balance:
|
createOffer.fundsBox.balance=Trade wallet balance:
|
||||||
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
|
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
|
||||||
createOffer.fundsBox.collateral=Refundable collateral ({0}):
|
createOffer.fundsBox.collateral=Trade bond ({0}):
|
||||||
createOffer.fundsBox.offerFee=Offer fee:
|
createOffer.fundsBox.offerFee=Offer fee:
|
||||||
createOffer.fundsBox.networkFee=Bitcoin network fee:
|
createOffer.fundsBox.networkFee=Bitcoin network fee:
|
||||||
createOffer.fundsBox.total=Total:
|
createOffer.fundsBox.total=Total:
|
||||||
|
@ -99,7 +99,7 @@ takeOffer.fundsBox.address=Trade wallet address:
|
||||||
takeOffer.fundsBox.balance=Trade wallet balance:
|
takeOffer.fundsBox.balance=Trade wallet balance:
|
||||||
takeOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds will be paid in to a locked deposit address. At the end of a successful trade you will get back your collateral and the Bitcoin amount you sold will be transferred to the buyer.
|
takeOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds will be paid in to a locked deposit address. At the end of a successful trade you will get back your collateral and the Bitcoin amount you sold will be transferred to the buyer.
|
||||||
takeOffer.fundsBox.amount=Amount to sell:
|
takeOffer.fundsBox.amount=Amount to sell:
|
||||||
takeOffer.fundsBox.collateral=Refundable collateral ({0}):
|
takeOffer.fundsBox.collateral=Trade bond ({0}):
|
||||||
takeOffer.fundsBox.offerFee=Offer fee:
|
takeOffer.fundsBox.offerFee=Offer fee:
|
||||||
takeOffer.fundsBox.networkFee=Bitcoin network fee:
|
takeOffer.fundsBox.networkFee=Bitcoin network fee:
|
||||||
takeOffer.fundsBox.total=Total:
|
takeOffer.fundsBox.total=Total:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue