diff --git a/src/main/java/io/bitsquare/gui/components/Popups.java b/src/main/java/io/bitsquare/gui/components/Popups.java index 81a6574b92..d0143cafa1 100644 --- a/src/main/java/io/bitsquare/gui/components/Popups.java +++ b/src/main/java/io/bitsquare/gui/components/Popups.java @@ -50,11 +50,11 @@ public class Popups { private static OverlayManager overlayManager; // Information - public static void openInfo(String message) { - openInfo(null, message); + public static void openInfoPopup(String message) { + openInfoPopup(null, message); } - public static void openInfo(String masthead, String message) { + public static void openInfoPopup(String masthead, String message) { overlayManager.blurContent(); List actions = new ArrayList<>(); actions.add(new AbstractAction(BSResources.get("shared.close")) { @@ -65,10 +65,10 @@ public class Popups { overlayManager.removeBlurContent(); } }); - openInfo(masthead, message, actions); + openInfoPopup(masthead, message, actions); } - public static void openInfo(String masthead, String message, List actions) { + public static void openInfoPopup(String masthead, String message, List actions) { Dialogs.create() .owner(BitSquareUI.getPrimaryStage()) .message(message) diff --git a/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java index 5e70b8ef4b..e361bccbc7 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java @@ -180,7 +180,7 @@ public class FiatAccountViewCB extends CachedViewCB implements Co InputValidator.ValidationResult result = presentationModel.requestSaveBankAccount(); if (result.isValid) { selectionComboBox.getSelectionModel().select(null); - Popups.openInfo("Your payments account has been saved.", + Popups.openInfoPopup("Your payments account has been saved.", "You can add more accounts or continue to the next step."); } } diff --git a/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java index a232190f79..43406c72f2 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java @@ -124,7 +124,7 @@ public class IrcAccountViewCB extends CachedViewCB implements Cont setupBindings(); Platform.runLater(() -> { - Popups.openInfo("Demo setup for simulating the banking transfer", + Popups.openInfoPopup("Demo setup for simulating the banking transfer", "For demo purposes we use a special setup so that users can simulate the banking transfer when " + "meeting in an IRC chat room.\n" + "You need to define your IRC nickname and later in the trade process you can find your " + diff --git a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java index ed5bc93670..219d340e52 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java @@ -130,7 +130,7 @@ public class RegistrationViewCB extends CachedViewCB implements } }); - Popups.openInfo(BSResources.get("You have been successfully registered."), + Popups.openInfoPopup(BSResources.get("You have been successfully registered."), BSResources.get("Congratulation you have been successfully registered.\n\n" + " You can now start trading."), actions); diff --git a/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java b/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java index a80f34e72e..29776715d0 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java @@ -195,7 +195,7 @@ public class CreateOfferViewCB extends CachedViewCB { overlayManager.removeBlurContent(); } }); - Popups.openInfo("To ensure that both traders behave fair they need to pay a security deposit.", + Popups.openInfoPopup("To ensure that both traders behave fair they need to pay a security deposit.", "The deposit will stay in your local trading wallet until the offer gets accepted by " + "another trader. " + "\nIt will be refunded to you after the trade has successfully completed.", @@ -374,7 +374,7 @@ public class CreateOfferViewCB extends CachedViewCB { } }); - Popups.openInfo(BSResources.get("createOffer.success.headline"), + Popups.openInfoPopup(BSResources.get("createOffer.success.headline"), BSResources.get("createOffer.success.info"), actions); } diff --git a/src/main/java/io/bitsquare/gui/main/trade/orderbook/OrderBookViewCB.java b/src/main/java/io/bitsquare/gui/main/trade/orderbook/OrderBookViewCB.java index a6a19e9975..c19392c66a 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/orderbook/OrderBookViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/trade/orderbook/OrderBookViewCB.java @@ -245,15 +245,22 @@ public class OrderBookViewCB extends CachedViewCB { Navigation.Item.ACCOUNT_SETUP); } }); - Popups.openInfo("You don't have setup a trading account.", + Popups.openInfoPopup("You don't have setup a trading account.", "You need to setup your trading account before you can trade.", actions); } private void takeOffer(Offer offer) { + if (presentationModel.isRegistered()) { - ((TradeNavigator) parent).takeOffer(presentationModel.getAmountAsCoin(), - presentationModel.getPriceAsCoin(), offer); + if (offer.getDirection() == Direction.BUY) { + ((TradeNavigator) parent).takeOffer(presentationModel.getAmountAsCoin(), + presentationModel.getPriceAsCoin(), offer); + } + else { + Popups.openInfoPopup("Not implemented yet", + "At the moment you can only take offers in the Sell BTC screen."); + } } else { openSetupScreen(); diff --git a/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java b/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java index 5f3cdfc15b..4fc08d6fc9 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java @@ -211,7 +211,7 @@ public class TakeOfferViewCB extends CachedViewCB { overlayManager.removeBlurContent(); } }); - Popups.openInfo("To ensure that both traders behave fair they need to pay a security deposit.", + Popups.openInfoPopup("To ensure that both traders behave fair they need to pay a security deposit.", "The deposit will stay in your local trading wallet until the offer gets accepted by " + "another trader. " + "\nIt will be refunded to you after the trade has successfully completed.", @@ -350,7 +350,7 @@ public class TakeOfferViewCB extends CachedViewCB { } }); - Popups.openInfo(BSResources.get("takeOffer.success.headline"), + Popups.openInfoPopup(BSResources.get("takeOffer.success.headline"), BSResources.get("takeOffer.success.info"), actions); }