Make BlurManager static

This commit is contained in:
Manfred Karrer 2015-05-17 00:20:30 +02:00
parent 8d32f87409
commit 68a4178bf3
18 changed files with 70 additions and 83 deletions

View file

@ -610,7 +610,7 @@ public class WalletService {
@Override @Override
protected void doneDownload() { protected void doneDownload() {
super.doneDownload(); super.doneDownload();
Threading.USER_THREAD.execute(() -> this.percentage.set(1)); Threading.USER_THREAD.execute(() -> this.percentage.set(1d));
} }
public ReadOnlyDoubleProperty percentageProperty() { public ReadOnlyDoubleProperty percentageProperty() {

View file

@ -30,7 +30,7 @@ public class BootstrapNodes {
public static final int BASE_PORT = 7366; // port will be evaluated from btc network 7366 for mainnet, 7367 for testnet and 7368 for regtest public static final int BASE_PORT = 7366; // port will be evaluated from btc network 7366 for mainnet, 7367 for testnet and 7368 for regtest
private static List<Node> bootstrapNodes = Arrays.asList( private static List<Node> bootstrapNodes = Arrays.asList(
//Node.at("digitalocean1.bitsquare.io", "188.226.179.109", BASE_PORT), Node.at("digitalocean1.bitsquare.io", "188.226.179.109", BASE_PORT),
Node.at("aws1.bitsquare.io", "52.24.144.42", BASE_PORT), Node.at("aws1.bitsquare.io", "52.24.144.42", BASE_PORT),
Node.at("aws2.bitsquare.io", "52.11.125.194", BASE_PORT) Node.at("aws2.bitsquare.io", "52.11.125.194", BASE_PORT)
); );

View file

@ -127,10 +127,9 @@ public final class Node {
@Override @Override
public String toString() { public String toString() {
return Objects.toStringHelper(Node.class.getSimpleName()) return "Node with: " +
.add("name", name) "name='" + name + '\'' +
.add("ip", ip) ", ip='" + ip + '\'' +
.add("port", port) ", port=" + port;
.toString();
} }
} }

View file

@ -60,7 +60,7 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
public class BitsquareApp extends Application { public class BitsquareApp extends Application {
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class); private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
public static final boolean DEV_MODE = true; public static final boolean DEV_MODE = false;
private static Environment env; private static Environment env;
@ -138,8 +138,8 @@ public class BitsquareApp extends Application {
new KeyCodeCombination(KeyCode.Q, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) new KeyCodeCombination(KeyCode.Q, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
stop(); stop();
else if (new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) else if (new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
if (BitsquareApp.DEV_MODE) //if (BitsquareApp.DEV_MODE)
showDebugWindow(); showDebugWindow();
}); });
// configure the primary stage // configure the primary stage

View file

@ -24,7 +24,7 @@ import java.util.List;
public class OverlayManager { public class OverlayManager {
private final List<OverlayListener> listeners = new ArrayList<>(); private final static List<OverlayListener> listeners = new ArrayList<>();
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -35,19 +35,19 @@ public class OverlayManager {
public OverlayManager() { public OverlayManager() {
} }
public void blurContent() { public static void blurContent() {
listeners.stream().forEach(OverlayListener::onBlurContentRequested); listeners.stream().forEach(OverlayListener::onBlurContentRequested);
} }
public void removeBlurContent() { public static void removeBlurContent() {
listeners.stream().forEach(OverlayListener::onRemoveBlurContentRequested); listeners.stream().forEach(OverlayListener::onRemoveBlurContentRequested);
} }
public void addListener(OverlayListener listener) { public static void addListener(OverlayListener listener) {
listeners.add(listener); listeners.add(listener);
} }
public void removeListener(OverlayListener listener) { public static void removeListener(OverlayListener listener) {
listeners.remove(listener); listeners.remove(listener);
} }

View file

@ -55,8 +55,6 @@ public class AddressTextField extends AnchorPane {
private final StringProperty paymentLabel = new SimpleStringProperty(); private final StringProperty paymentLabel = new SimpleStringProperty();
private final ObjectProperty<Coin> amountAsCoin = new SimpleObjectProperty<>(); private final ObjectProperty<Coin> amountAsCoin = new SimpleObjectProperty<>();
private OverlayManager overlayManager;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Constructor // Constructor
@ -114,16 +112,14 @@ public class AddressTextField extends AnchorPane {
popOver.setDetachedTitle("Scan QR code for this address"); popOver.setDetachedTitle("Scan QR code for this address");
popOver.setDetached(true); popOver.setDetached(true);
popOver.setOnHiding(windowEvent -> { popOver.setOnHiding(windowEvent -> {
if (overlayManager != null) OverlayManager.removeBlurContent();
overlayManager.removeBlurContent();
}); });
Window window = getScene().getWindow(); Window window = getScene().getWindow();
double x = Math.round(window.getX() + (window.getWidth() - 320) / 2); double x = Math.round(window.getX() + (window.getWidth() - 320) / 2);
double y = Math.round(window.getY() + (window.getHeight() - 240) / 2); double y = Math.round(window.getY() + (window.getHeight() - 240) / 2);
popOver.show(getScene().getWindow(), x, y); popOver.show(getScene().getWindow(), x, y);
if (overlayManager != null) OverlayManager.blurContent();
overlayManager.blurContent();
} }
}); });
@ -176,11 +172,6 @@ public class AddressTextField extends AnchorPane {
this.paymentLabel.set(paymentLabel); this.paymentLabel.set(paymentLabel);
} }
// TODO find better solution without OverlayManager dependency
public void setOverlayManager(OverlayManager overlayManager) {
this.overlayManager = overlayManager;
}
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Private // Private

View file

@ -39,15 +39,8 @@ public class Popups {
public static Stage primaryStage; public static Stage primaryStage;
// TODO just temporary, class will be removed completely
public static void setOverlayManager(OverlayManager overlayManager) {
Popups.overlayManager = overlayManager;
}
private static OverlayManager overlayManager;
public static void removeBlurContent() { public static void removeBlurContent() {
overlayManager.removeBlurContent(); OverlayManager.removeBlurContent();
} }
// Information // Information
@ -56,7 +49,7 @@ public class Popups {
} }
public static void openInfoPopup(String masthead, String message) { public static void openInfoPopup(String masthead, String message) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.close")) { actions.add(new AbstractAction(BSResources.get("shared.close")) {
@Override @Override
@ -84,7 +77,7 @@ public class Popups {
} }
public static Action openConfirmPopup(String title, String masthead, String message) { public static Action openConfirmPopup(String title, String masthead, String message) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.ok")) { actions.add(new AbstractAction(BSResources.get("shared.ok")) {
@Override @Override
@ -123,7 +116,7 @@ public class Popups {
} }
public static void openWarningPopup(String title, String masthead, String message) { public static void openWarningPopup(String title, String masthead, String message) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.close")) { actions.add(new AbstractAction(BSResources.get("shared.close")) {
@Override @Override
@ -156,7 +149,7 @@ public class Popups {
} }
public static void openErrorPopup(String title, String masthead, String message) { public static void openErrorPopup(String title, String masthead, String message) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.close")) { actions.add(new AbstractAction(BSResources.get("shared.close")) {
@Override @Override
@ -189,7 +182,7 @@ public class Popups {
} }
private static void openExceptionPopup(Throwable throwable, String title, String masthead, String message) { private static void openExceptionPopup(Throwable throwable, String title, String masthead, String message) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.close")) { actions.add(new AbstractAction(BSResources.get("shared.close")) {
@Override @Override

View file

@ -66,7 +66,6 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
private final ViewLoader viewLoader; private final ViewLoader viewLoader;
private final Navigation navigation; private final Navigation navigation;
private final OverlayManager overlayManager;
private final Transitions transitions; private final Transitions transitions;
private final String title; private final String title;
private ChangeListener<String> walletServiceErrorMsgListener; private ChangeListener<String> walletServiceErrorMsgListener;
@ -84,12 +83,11 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
private List<String> persistedFilesCorrupted; private List<String> persistedFilesCorrupted;
@Inject @Inject
public MainView(MainViewModel model, CachingViewLoader viewLoader, Navigation navigation, OverlayManager overlayManager, Transitions transitions, public MainView(MainViewModel model, CachingViewLoader viewLoader, Navigation navigation, Transitions transitions,
@Named(MainView.TITLE_KEY) String title) { @Named(MainView.TITLE_KEY) String title) {
super(model); super(model);
this.viewLoader = viewLoader; this.viewLoader = viewLoader;
this.navigation = navigation; this.navigation = navigation;
this.overlayManager = overlayManager;
this.transitions = transitions; this.transitions = transitions;
this.title = title; this.title = title;
} }
@ -497,9 +495,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
} }
private void configureBlurring(Node node) { private void configureBlurring(Node node) {
Popups.setOverlayManager(overlayManager); OverlayManager.addListener(new OverlayManager.OverlayListener() {
overlayManager.addListener(new OverlayManager.OverlayListener() {
@Override @Override
public void onBlurContentRequested() { public void onBlurContentRequested() {
transitions.blur(node); transitions.blur(node);

View file

@ -160,6 +160,8 @@ class MainViewModel implements ViewModel {
setBitcoinNetworkSyncProgress((double) newValue); setBitcoinNetworkSyncProgress((double) newValue);
}); });
setBitcoinNetworkSyncProgress(walletService.downloadPercentageProperty().get()); setBitcoinNetworkSyncProgress(walletService.downloadPercentageProperty().get());
// Sometimes we don't get the updates, so add an additional setter after 2 seconds
Utilities.setTimeout(2000, () -> setBitcoinNetworkSyncProgress(walletService.downloadPercentageProperty().get()));
walletService.numPeersProperty().addListener((observable, oldValue, newValue) -> { walletService.numPeersProperty().addListener((observable, oldValue, newValue) -> {

View file

@ -62,12 +62,10 @@ public class FiatAccountView extends ActivatableViewAndModel<GridPane, FiatAccou
private Wizard wizard; private Wizard wizard;
private final OverlayManager overlayManager;
@Inject @Inject
public FiatAccountView(FiatAccountViewModel model, OverlayManager overlayManager) { public FiatAccountView(FiatAccountViewModel model) {
super(model); super(model);
this.overlayManager = overlayManager;
} }
@Override @Override
@ -202,7 +200,7 @@ public class FiatAccountView extends ActivatableViewAndModel<GridPane, FiatAccou
model.getCountryNotInAcceptedCountriesList().addListener((ov, oldValue, newValue) -> { model.getCountryNotInAcceptedCountriesList().addListener((ov, oldValue, newValue) -> {
if (newValue) { if (newValue) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.no")) { actions.add(new AbstractAction(BSResources.get("shared.no")) {
@Override @Override
@ -228,7 +226,7 @@ public class FiatAccountView extends ActivatableViewAndModel<GridPane, FiatAccou
if (Popups.isYes(response)) if (Popups.isYes(response))
model.addCountryToAcceptedCountriesList(); model.addCountryToAcceptedCountriesList();
overlayManager.removeBlurContent(); OverlayManager.removeBlurContent();
} }
}); });

View file

@ -54,12 +54,9 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
private Wizard wizard; private Wizard wizard;
private final OverlayManager overlayManager;
@Inject @Inject
private RegistrationView(RegistrationViewModel model, OverlayManager overlayManager) { private RegistrationView(RegistrationViewModel model) {
super(model); super(model);
this.overlayManager = overlayManager;
} }
@Override @Override
@ -69,9 +66,6 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
addressTextField.setPaymentLabel(model.getPaymentLabel()); addressTextField.setPaymentLabel(model.getPaymentLabel());
addressTextField.setAddress(model.getAddressAsString()); addressTextField.setAddress(model.getAddressAsString());
// TODO find better solution
addressTextField.setOverlayManager(overlayManager);
balanceTextField.setup(model.getWalletService(), model.address.get(), balanceTextField.setup(model.getWalletService(), model.address.get(),
model.getFormatter()); model.getFormatter());
@ -94,7 +88,7 @@ public class RegistrationView extends InitializableView<GridPane, RegistrationVi
model.showTransactionPublishedScreen.addListener((o, oldValue, newValue) -> { model.showTransactionPublishedScreen.addListener((o, oldValue, newValue) -> {
if (newValue) { if (newValue) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
/* actions.add(new AbstractAction(BSResources.get("shared.copyTxId")) { /* actions.add(new AbstractAction(BSResources.get("shared.copyTxId")) {

View file

@ -56,7 +56,7 @@
<Label text="Withdraw to address:" GridPane.rowIndex="2"/> <Label text="Withdraw to address:" GridPane.rowIndex="2"/>
<TextField fx:id="withdrawToTextField" GridPane.rowIndex="2" GridPane.columnIndex="1"/> <TextField fx:id="withdrawToTextField" GridPane.rowIndex="2" GridPane.columnIndex="1"/>
<Button text="Withdraw" defaultButton="true" onAction="#onWithdraw" GridPane.rowIndex="3" <Button fx:id="withdrawButton" text="Withdraw" defaultButton="true" onAction="#onWithdraw" GridPane.rowIndex="3"
GridPane.columnIndex="1"/> GridPane.columnIndex="1"/>
<columnConstraints> <columnConstraints>

View file

@ -27,6 +27,8 @@ import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.Popups; import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.util.BSFormatter; import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.GUIUtil; import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.gui.util.validation.BtcAddressValidator;
import io.bitsquare.gui.util.validation.BtcValidator;
import io.bitsquare.trade.TradeManager; import io.bitsquare.trade.TradeManager;
import io.bitsquare.trade.offer.OpenOfferManager; import io.bitsquare.trade.offer.OpenOfferManager;
@ -43,6 +45,7 @@ import java.util.stream.Stream;
import javax.inject.Inject; import javax.inject.Inject;
import javafx.beans.binding.Bindings;
import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
@ -60,8 +63,8 @@ import org.jetbrains.annotations.NotNull;
@FxmlView @FxmlView
public class WithdrawalView extends ActivatableViewAndModel { public class WithdrawalView extends ActivatableViewAndModel {
@FXML Button withdrawButton;
@FXML TableView<WithdrawalListItem> table; @FXML TableView<WithdrawalListItem> table;
@FXML Button addNewAddressButton;
@FXML TextField withdrawFromTextField, withdrawToTextField, amountTextField; @FXML TextField withdrawFromTextField, withdrawToTextField, amountTextField;
@FXML TableColumn<WithdrawalListItem, WithdrawalListItem> labelColumn, addressColumn, balanceColumn, copyColumn, @FXML TableColumn<WithdrawalListItem, WithdrawalListItem> labelColumn, addressColumn, balanceColumn, copyColumn,
confidenceColumn; confidenceColumn;
@ -70,14 +73,19 @@ public class WithdrawalView extends ActivatableViewAndModel {
private TradeManager tradeManager; private TradeManager tradeManager;
private OpenOfferManager openOfferManager; private OpenOfferManager openOfferManager;
private final BSFormatter formatter; private final BSFormatter formatter;
private final BtcAddressValidator btcAddressValidator;
private final BtcValidator btcValidator;
private final ObservableList<WithdrawalListItem> addressList = FXCollections.observableArrayList(); private final ObservableList<WithdrawalListItem> addressList = FXCollections.observableArrayList();
@Inject @Inject
private WithdrawalView(WalletService walletService, TradeManager tradeManager, OpenOfferManager openOfferManager, BSFormatter formatter) { private WithdrawalView(WalletService walletService, TradeManager tradeManager, OpenOfferManager openOfferManager, BSFormatter formatter,
BtcAddressValidator btcAddressValidator, BtcValidator btcValidator) {
this.walletService = walletService; this.walletService = walletService;
this.tradeManager = tradeManager; this.tradeManager = tradeManager;
this.openOfferManager = openOfferManager; this.openOfferManager = openOfferManager;
this.formatter = formatter; this.formatter = formatter;
this.btcAddressValidator = btcAddressValidator;
this.btcValidator = btcValidator;
} }
@ -92,8 +100,16 @@ public class WithdrawalView extends ActivatableViewAndModel {
setConfidenceColumnCellFactory(); setConfidenceColumnCellFactory();
} }
private boolean areInputsValid() {
return btcAddressValidator.validate(withdrawFromTextField.getText()).and(
btcAddressValidator.validate(withdrawToTextField.getText())).and(
btcValidator.validate(amountTextField.getText())).isValid;
}
@Override @Override
public void doActivate() { public void doActivate() {
withdrawButton.disableProperty().bind(Bindings.createBooleanBinding(() -> !areInputsValid(),
withdrawFromTextField.textProperty(), amountTextField.textProperty(), withdrawToTextField.textProperty()));
table.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> { table.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
if (newValue != null) { if (newValue != null) {
@ -124,6 +140,7 @@ public class WithdrawalView extends ActivatableViewAndModel {
@Override @Override
public void doDeactivate() { public void doDeactivate() {
addressList.forEach(WithdrawalListItem::cleanup); addressList.forEach(WithdrawalListItem::cleanup);
withdrawButton.disableProperty().unbind();
} }
@FXML @FXML
@ -178,6 +195,13 @@ public class WithdrawalView extends ActivatableViewAndModel {
Popups.openErrorPopup("Insufficient amount", Popups.openErrorPopup("Insufficient amount",
"The amount to transfer is lower the the transaction fee and the min. possible tx value."); "The amount to transfer is lower the the transaction fee and the min. possible tx value.");
} }
withdrawFromTextField.setText("");
withdrawFromTextField.setPromptText("Select a source address from the table");
amountTextField.setText("");
amountTextField.setPromptText("");
withdrawToTextField.setText("");
withdrawToTextField.setPromptText("");
} }
private void fillList() { private void fillList() {

View file

@ -78,7 +78,6 @@ import static javafx.beans.binding.Bindings.createStringBinding;
public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateOfferViewModel> { public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateOfferViewModel> {
private final Navigation navigation; private final Navigation navigation;
private final OverlayManager overlayManager;
@FXML ScrollPane scrollPane; @FXML ScrollPane scrollPane;
@FXML ImageView imageView; @FXML ImageView imageView;
@ -124,12 +123,10 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Inject @Inject
private CreateOfferView(CreateOfferViewModel model, Navigation navigation, private CreateOfferView(CreateOfferViewModel model, Navigation navigation) {
OverlayManager overlayManager) {
super(model); super(model);
this.navigation = navigation; this.navigation = navigation;
this.overlayManager = overlayManager;
} }
@Override @Override
@ -287,7 +284,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
} }
if (newValue) { if (newValue) {
overlayManager.blurContent(); OverlayManager.blurContent();
// Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added // Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added
// our own actions. // our own actions.
@ -390,7 +387,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
void onShowPayFundsScreen() { void onShowPayFundsScreen() {
if (!BitsquareApp.DEV_MODE) { if (!BitsquareApp.DEV_MODE) {
if (model.getDisplaySecurityDepositInfo()) { if (model.getDisplaySecurityDepositInfo()) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.close")) { actions.add(new AbstractAction(BSResources.get("shared.close")) {
@Override @Override

View file

@ -78,7 +78,6 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
private final Navigation navigation; private final Navigation navigation;
private final OverlayManager overlayManager;
private final OptionalBtcValidator optionalBtcValidator; private final OptionalBtcValidator optionalBtcValidator;
private final OptionalFiatValidator optionalFiatValidator; private final OptionalFiatValidator optionalFiatValidator;
private OfferView.OfferActionHandler offerActionHandler; private OfferView.OfferActionHandler offerActionHandler;
@ -91,13 +90,11 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
@Inject @Inject
OfferBookView(OfferBookViewModel model, OfferBookView(OfferBookViewModel model,
Navigation navigation, Navigation navigation,
OverlayManager overlayManager,
OptionalBtcValidator optionalBtcValidator, OptionalBtcValidator optionalBtcValidator,
OptionalFiatValidator optionalFiatValidator) { OptionalFiatValidator optionalFiatValidator) {
super(model); super(model);
this.navigation = navigation; this.navigation = navigation;
this.overlayManager = overlayManager;
this.optionalBtcValidator = optionalBtcValidator; this.optionalBtcValidator = optionalBtcValidator;
this.optionalFiatValidator = optionalFiatValidator; this.optionalFiatValidator = optionalFiatValidator;
} }
@ -225,7 +222,7 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
} }
private void openSetupScreen() { private void openSetupScreen() {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.ok")) { actions.add(new AbstractAction(BSResources.get("shared.ok")) {
@Override @Override
@ -344,7 +341,7 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
private void openRestrictionsWarning(String restrictionsInfo) { private void openRestrictionsWarning(String restrictionsInfo) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.yes")) { actions.add(new AbstractAction(BSResources.get("shared.yes")) {
@Override @Override

View file

@ -74,7 +74,6 @@ import static javafx.beans.binding.Bindings.createStringBinding;
public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOfferViewModel> { public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOfferViewModel> {
private final Navigation navigation; private final Navigation navigation;
private final OverlayManager overlayManager;
@FXML ScrollPane scrollPane; @FXML ScrollPane scrollPane;
@FXML ImageView imageView; @FXML ImageView imageView;
@ -113,12 +112,10 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@Inject @Inject
private TakeOfferView(TakeOfferViewModel model, Navigation navigation, private TakeOfferView(TakeOfferViewModel model, Navigation navigation) {
OverlayManager overlayManager) {
super(model); super(model);
this.navigation = navigation; this.navigation = navigation;
this.overlayManager = overlayManager;
createListeners(); createListeners();
} }
@ -211,7 +208,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
} }
if (newValue) { if (newValue) {
overlayManager.blurContent(); OverlayManager.blurContent();
// Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added // Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added
// our own actions. // our own actions.
@ -375,7 +372,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private void setupPaymentScreen() { private void setupPaymentScreen() {
if (!BitsquareApp.DEV_MODE) { if (!BitsquareApp.DEV_MODE) {
if (model.getDisplaySecurityDepositInfo()) { if (model.getDisplaySecurityDepositInfo()) {
overlayManager.blurContent(); OverlayManager.blurContent();
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(BSResources.get("shared.close")) { actions.add(new AbstractAction(BSResources.get("shared.close")) {
@Override @Override

View file

@ -81,7 +81,6 @@ public class ConfirmFiatReceivedView extends TradeStepDetailsView {
private void onPaymentReceived(ActionEvent actionEvent) { private void onPaymentReceived(ActionEvent actionEvent) {
log.debug("onPaymentReceived"); log.debug("onPaymentReceived");
model.fiatPaymentReceived();
confirmFiatReceivedButton.setDisable(true); confirmFiatReceivedButton.setDisable(true);
statusLabel.setText("Sending message to trading peer..."); statusLabel.setText("Sending message to trading peer...");
statusProgressIndicator.setVisible(true); statusProgressIndicator.setVisible(true);
@ -89,6 +88,8 @@ public class ConfirmFiatReceivedView extends TradeStepDetailsView {
root = statusProgressIndicator.getScene().getRoot(); root = statusProgressIndicator.getScene().getRoot();
// We deactivate mouse interaction to avoid that user leaves screen // We deactivate mouse interaction to avoid that user leaves screen
root.setMouseTransparent(true); root.setMouseTransparent(true);
model.fiatPaymentReceived();
} }

View file

@ -106,10 +106,8 @@ public class NetworkSettingsView extends InitializableView {
} }
}); });
Action response = Popups.openConfirmPopup("Info", "", Action response = Popups.openConfirmPopup("Info", "You need to restart the application to apply the change of the Bitcoin network.",
"You need to restart the application to apply the change of the Bitcoin network." + "Do you want to shutdown now?", actions);
"\n\nDo you want to shutdown now?",
actions);
if (Popups.isYes(response)) if (Popups.isYes(response))
BitsquareApp.shutDownHandler.run(); BitsquareApp.shutDownHandler.run();