Reorganized popups

This commit is contained in:
Manfred Karrer 2016-03-02 23:28:25 +01:00
parent 1958de2be9
commit 8324c888e4
58 changed files with 610 additions and 617 deletions

View File

@ -98,7 +98,7 @@ public final class Preferences implements Persistable {
private BlockChainExplorer blockChainExplorerTestNet;
private String backupDirectory;
private boolean autoSelectArbitrators = true;
private final Map<String, Boolean> showAgainMap;
private final Map<String, Boolean> dontShowAgainMap;
private boolean tacAccepted;
private boolean useTorForBitcoinJ = true;
private Locale preferredLocale;
@ -146,7 +146,7 @@ public final class Preferences implements Persistable {
backupDirectory = persisted.getBackupDirectory();
autoSelectArbitrators = persisted.getAutoSelectArbitrators();
showAgainMap = persisted.getShowAgainMap();
dontShowAgainMap = persisted.getDontShowAgainMap();
tacAccepted = persisted.getTacAccepted();
preferredLocale = persisted.getPreferredLocale();
@ -170,7 +170,7 @@ public final class Preferences implements Persistable {
setBlockChainExplorerTestNet(blockChainExplorersTestNet.get(0));
setBlockChainExplorerMainNet(blockChainExplorersMainNet.get(0));
showAgainMap = new HashMap<>();
dontShowAgainMap = new HashMap<>();
preferredLocale = getDefaultLocale();
preferredTradeCurrency = getDefaultTradeCurrency();
@ -210,23 +210,14 @@ public final class Preferences implements Persistable {
tradeCurrenciesAsObservable.addAll(cryptoCurrencies);
}
public void dontShowAgain(String key) {
showAgainMap.put(key, false);
storage.queueUpForSave(2000);
public void dontShowAgain(String key, boolean dontShowAgain) {
dontShowAgainMap.put(key, dontShowAgain);
storage.queueUpForSave(1000);
}
public void resetDontShowAgainForType() {
showAgainMap.clear();
storage.queueUpForSave(2000);
}
public void removeDontShowAgainForType(String type) {
showAgainMap.keySet().stream().forEach(key -> {
if (key.startsWith(type + "_"))
showAgainMap.put(key, true);
});
storage.queueUpForSave(2000);
dontShowAgainMap.clear();
storage.queueUpForSave(1000);
}
private void updateTradeCurrencies(ListChangeListener.Change<? extends TradeCurrency> change) {
@ -443,18 +434,12 @@ public final class Preferences implements Persistable {
return autoSelectArbitrators;
}
public Map<String, Boolean> getShowAgainMap() {
return showAgainMap;
public Map<String, Boolean> getDontShowAgainMap() {
return dontShowAgainMap;
}
public boolean showAgain(String key) {
// if we add new and those are not in our stored map we display by default the new popup
if (!showAgainMap.containsKey(key)) {
showAgainMap.put(key, true);
storage.queueUpForSave(2000);
}
return showAgainMap.get(key);
return !dontShowAgainMap.containsKey(key) || !dontShowAgainMap.get(key);
}
public boolean getTacAccepted() {

View File

@ -35,9 +35,9 @@ import io.bitsquare.gui.common.view.guice.InjectorViewFactory;
import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.MainViewModel;
import io.bitsquare.gui.main.debug.DebugView;
import io.bitsquare.gui.main.popups.EmptyWalletPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.SendAlertMessagePopup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.EmptyWalletWindow;
import io.bitsquare.gui.main.overlays.windows.SendAlertMessageWindow;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.p2p.P2PService;
import io.bitsquare.storage.Storage;
@ -219,14 +219,14 @@ public class BitsquareApp extends Application {
private void showSendAlertMessagePopup() {
AlertManager alertManager = injector.getInstance(AlertManager.class);
new SendAlertMessagePopup()
new SendAlertMessageWindow()
.onAddAlertMessage((alert, privKeyString) -> alertManager.addAlertMessageIfKeyIsValid(alert, privKeyString))
.onRemoveAlertMessage(privKeyString -> alertManager.removeAlertMessageIfKeyIsValid(privKeyString))
.show();
}
private void showEmptyWalletPopup() {
injector.getInstance(EmptyWalletPopup.class).show();
injector.getInstance(EmptyWalletWindow.class).show();
}
private void showErrorPopup(Throwable throwable, boolean doShutDown) {

View File

@ -27,8 +27,7 @@ import io.bitsquare.common.crypto.KeyStorage;
import io.bitsquare.crypto.EncryptionServiceModule;
import io.bitsquare.gui.GuiModule;
import io.bitsquare.gui.common.view.CachingViewLoader;
import io.bitsquare.gui.main.intructions.InstructionCenter;
import io.bitsquare.gui.main.notifications.NotificationCenter;
import io.bitsquare.gui.main.overlays.notifications.NotificationCenter;
import io.bitsquare.p2p.P2PModule;
import io.bitsquare.storage.Storage;
import io.bitsquare.trade.TradeModule;
@ -62,7 +61,6 @@ class BitsquareAppModule extends AppModule {
bind(User.class).in(Singleton.class);
bind(Preferences.class).in(Singleton.class);
bind(NotificationCenter.class).in(Singleton.class);
bind(InstructionCenter.class).in(Singleton.class);
bind(Clock.class).in(Singleton.class);
File storageDir = new File(env.getRequiredProperty(Storage.DIR_KEY));

View File

@ -21,7 +21,7 @@ import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;

View File

@ -23,7 +23,7 @@ import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.TxConfidenceListener;
import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.user.Preferences;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;

View File

@ -31,7 +31,8 @@ import io.bitsquare.gui.main.funds.FundsView;
import io.bitsquare.gui.main.markets.MarketView;
import io.bitsquare.gui.main.offer.BuyOfferView;
import io.bitsquare.gui.main.offer.SellOfferView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.portfolio.PortfolioView;
import io.bitsquare.gui.main.settings.SettingsView;
import io.bitsquare.gui.util.Transitions;
@ -90,7 +91,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
private Label btcSplashInfo;
private List<String> persistedFilesCorrupted;
private BorderPane baseApplicationContainer;
private Popup p2PNetworkWarnMsgPopup, btcNetworkWarnMsgPopup;
private Overlay<Popup> p2PNetworkWarnMsgPopup, btcNetworkWarnMsgPopup;
private static StackPane rootContainer;
@Inject

View File

@ -40,11 +40,11 @@ import io.bitsquare.gui.common.model.ViewModel;
import io.bitsquare.gui.components.BalanceTextField;
import io.bitsquare.gui.components.BalanceWithConfirmationTextField;
import io.bitsquare.gui.components.TxIdTextField;
import io.bitsquare.gui.main.notifications.NotificationCenter;
import io.bitsquare.gui.main.popups.DisplayAlertMessagePopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.TacPopup;
import io.bitsquare.gui.main.popups.WalletPasswordPopup;
import io.bitsquare.gui.main.overlays.notifications.NotificationCenter;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.DisplayAlertMessageWindow;
import io.bitsquare.gui.main.overlays.windows.TacWindow;
import io.bitsquare.gui.main.overlays.windows.WalletPasswordWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.CurrencyUtil;
@ -89,9 +89,9 @@ public class MainViewModel implements ViewModel {
private final DisputeManager disputeManager;
private final Preferences preferences;
private final AlertManager alertManager;
private final WalletPasswordPopup walletPasswordPopup;
private final WalletPasswordWindow walletPasswordWindow;
private final NotificationCenter notificationCenter;
private final TacPopup tacPopup;
private final TacWindow tacWindow;
private Clock clock;
private final Navigation navigation;
private final BSFormatter formatter;
@ -149,8 +149,8 @@ public class MainViewModel implements ViewModel {
PriceFeed priceFeed,
ArbitratorManager arbitratorManager, P2PService p2PService, TradeManager tradeManager,
OpenOfferManager openOfferManager, DisputeManager disputeManager, Preferences preferences,
User user, AlertManager alertManager, WalletPasswordPopup walletPasswordPopup,
NotificationCenter notificationCenter, TacPopup tacPopup, Clock clock,
User user, AlertManager alertManager, WalletPasswordWindow walletPasswordWindow,
NotificationCenter notificationCenter, TacWindow tacWindow, Clock clock,
Navigation navigation, BSFormatter formatter) {
this.priceFeed = priceFeed;
this.user = user;
@ -163,9 +163,9 @@ public class MainViewModel implements ViewModel {
this.disputeManager = disputeManager;
this.preferences = preferences;
this.alertManager = alertManager;
this.walletPasswordPopup = walletPasswordPopup;
this.walletPasswordWindow = walletPasswordWindow;
this.notificationCenter = notificationCenter;
this.tacPopup = tacPopup;
this.tacWindow = tacWindow;
this.clock = clock;
this.navigation = navigation;
this.formatter = formatter;
@ -426,7 +426,7 @@ public class MainViewModel implements ViewModel {
(openOfferManager.getOpenOffers().size() > 0
|| tradeManager.getTrades().size() > 0
|| disputeManager.getDisputesAsObservableList().size() > 0)) {
walletPasswordPopup.onAesKey(aesKey -> tradeWalletService.setAesKey(aesKey)).show();
walletPasswordWindow.onAesKey(aesKey -> tradeWalletService.setAesKey(aesKey)).show();
}
walletService.addBalanceListener(new BalanceListener() {
@Override
@ -447,7 +447,7 @@ public class MainViewModel implements ViewModel {
setupDevDummyPaymentAccount();
setupMarketPriceFeed();
tacPopup.showIfNeeded();
tacWindow.showIfNeeded();
showAppScreen.set(true);
}
@ -512,15 +512,15 @@ public class MainViewModel implements ViewModel {
else if (trade.getCheckPaymentTimeAsBlockHeight() > 0 && bestChainHeight >= trade.getCheckPaymentTimeAsBlockHeight())
trade.setTradePeriodState(Trade.TradePeriodState.HALF_REACHED);
String id;
String key;
String limitDate = formatter.addBlocksToNowDateFormatted(trade.getOpenDisputeTimeAsBlockHeight() - tradeWalletService.getBestChainHeight());
switch (trade.getTradePeriodState()) {
case NORMAL:
break;
case HALF_REACHED:
id = "displayHalfTradePeriodOver" + trade.getId();
if (preferences.showAgain(id) && !BitsquareApp.DEV_MODE) {
preferences.dontShowAgain(id);
key = "displayHalfTradePeriodOver" + trade.getId();
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) {
preferences.dontShowAgain(key, true);
new Popup().warning("Your trade with ID " + trade.getShortId() +
" has reached the half of the max. allowed trading period and " +
"is still not completed.\n\n" +
@ -530,9 +530,9 @@ public class MainViewModel implements ViewModel {
}
break;
case TRADE_PERIOD_OVER:
id = "displayTradePeriodOver" + trade.getId();
if (preferences.showAgain(id) && !BitsquareApp.DEV_MODE) {
preferences.dontShowAgain(id);
key = "displayTradePeriodOver" + trade.getId();
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) {
preferences.dontShowAgain(key, true);
new Popup().warning("Your trade with ID " + trade.getShortId() +
" has reached the max. allowed trading period and is " +
"not completed.\n\n" +
@ -624,7 +624,7 @@ public class MainViewModel implements ViewModel {
user.setDisplayedAlert(alert);
if (alert != null && !alreadyDisplayed) {
new DisplayAlertMessagePopup().alertMessage(alert).show();
new DisplayAlertMessageWindow().alertMessage(alert).show();
}
}

View File

@ -24,8 +24,8 @@ import io.bitsquare.common.UserThread;
import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.main.popups.EnterPrivKeyPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.EnterPrivKeyWindow;
import io.bitsquare.gui.util.FormBuilder;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Layout;
@ -57,7 +57,7 @@ public class ArbitratorRegistrationView extends ActivatableViewAndModel<VBox, Ar
private Button revokeButton;
private ChangeListener<Arbitrator> arbitratorChangeListener;
private EnterPrivKeyPopup enterPrivKeyPopup;
private EnterPrivKeyWindow enterPrivKeyWindow;
private ListChangeListener<String> listChangeListener;
@ -94,9 +94,9 @@ public class ArbitratorRegistrationView extends ActivatableViewAndModel<VBox, Ar
model.myArbitratorProperty.addListener(arbitratorChangeListener);
updateLanguageList();
if (model.registrationPubKeyAsHex.get() == null && enterPrivKeyPopup == null) {
enterPrivKeyPopup = new EnterPrivKeyPopup();
enterPrivKeyPopup.onClose(() -> enterPrivKeyPopup = null)
if (model.registrationPubKeyAsHex.get() == null && enterPrivKeyWindow == null) {
enterPrivKeyWindow = new EnterPrivKeyWindow();
enterPrivKeyWindow.onClose(() -> enterPrivKeyWindow = null)
.onKey(privKey -> model.setPrivKeyAndCheckPubKey(privKey))
.width(700)
.show();

View File

@ -23,7 +23,7 @@ import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.TitledGroupBg;
import io.bitsquare.gui.components.paymentmethods.BlockChainForm;
import io.bitsquare.gui.components.paymentmethods.PaymentMethodForm;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.FormBuilder;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Layout;

View File

@ -22,7 +22,7 @@ import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.TableGroupHeadline;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.LanguageUtil;

View File

@ -20,7 +20,7 @@ package io.bitsquare.gui.main.account.content.backup;
import io.bitsquare.app.BitsquareEnvironment;
import io.bitsquare.gui.common.view.ActivatableView;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.user.Preferences;

View File

@ -22,7 +22,7 @@ import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.TitledGroupBg;
import io.bitsquare.gui.components.paymentmethods.*;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.FormBuilder;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Layout;

View File

@ -26,7 +26,7 @@ import io.bitsquare.gui.common.view.ActivatableView;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.PasswordTextField;
import io.bitsquare.gui.components.TitledGroupBg;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.validation.InputValidator;
import io.bitsquare.gui.util.validation.PasswordValidator;

View File

@ -24,8 +24,8 @@ import io.bitsquare.btc.WalletService;
import io.bitsquare.common.UserThread;
import io.bitsquare.gui.common.view.ActivatableView;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.WalletPasswordPopup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.WalletPasswordWindow;
import io.bitsquare.gui.util.Layout;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
@ -54,7 +54,7 @@ import static javafx.beans.binding.Bindings.createBooleanBinding;
@FxmlView
public class SeedWordsView extends ActivatableView<GridPane, Void> {
private final WalletService walletService;
private final WalletPasswordPopup walletPasswordPopup;
private final WalletPasswordWindow walletPasswordWindow;
private Button restoreButton;
private TextArea seedWordsTextArea;
@ -75,9 +75,9 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
private SeedWordsView(WalletService walletService, WalletPasswordPopup walletPasswordPopup) {
private SeedWordsView(WalletService walletService, WalletPasswordWindow walletPasswordWindow) {
this.walletService = walletService;
this.walletPasswordPopup = walletPasswordPopup;
this.walletPasswordWindow = walletPasswordWindow;
}
@Override
@ -126,7 +126,7 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
private void askForPassword() {
walletPasswordPopup.onAesKey(aesKey -> {
walletPasswordWindow.onAesKey(aesKey -> {
Wallet wallet = walletService.getWallet();
KeyCrypter keyCrypter = wallet.getKeyCrypter();
keyChainSeed = wallet.getKeyChainSeed();

View File

@ -22,9 +22,9 @@ import io.bitsquare.arbitration.DisputeManager;
import io.bitsquare.common.crypto.KeyRing;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.main.disputes.trader.TraderDisputeView;
import io.bitsquare.gui.main.popups.ContractPopup;
import io.bitsquare.gui.main.popups.DisputeSummaryPopup;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.overlays.windows.ContractWindow;
import io.bitsquare.gui.main.overlays.windows.DisputeSummaryWindow;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.trade.TradeManager;
import javafx.collections.transformation.FilteredList;
@ -38,10 +38,10 @@ public class ArbitratorDisputeView extends TraderDisputeView {
@Inject
public ArbitratorDisputeView(DisputeManager disputeManager, KeyRing keyRing, TradeManager tradeManager, Stage stage,
BSFormatter formatter, DisputeSummaryPopup disputeSummaryPopup,
ContractPopup contractPopup, TradeDetailsPopup tradeDetailsPopup) {
BSFormatter formatter, DisputeSummaryWindow disputeSummaryWindow,
ContractWindow contractWindow, TradeDetailsWindow tradeDetailsWindow) {
super(disputeManager, keyRing, tradeManager, stage, formatter,
disputeSummaryPopup, contractPopup, tradeDetailsPopup);
disputeSummaryWindow, contractWindow, tradeDetailsWindow);
}
@Override

View File

@ -30,10 +30,10 @@ import io.bitsquare.gui.common.view.ActivatableView;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.components.TableGroupHeadline;
import io.bitsquare.gui.main.popups.ContractPopup;
import io.bitsquare.gui.main.popups.DisputeSummaryPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.ContractWindow;
import io.bitsquare.gui.main.overlays.windows.DisputeSummaryWindow;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.GUIUtil;
import io.bitsquare.p2p.network.Connection;
@ -80,9 +80,9 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
private final TradeManager tradeManager;
private final Stage stage;
private final BSFormatter formatter;
private final DisputeSummaryPopup disputeSummaryPopup;
private final ContractPopup contractPopup;
private final TradeDetailsPopup tradeDetailsPopup;
private final DisputeSummaryWindow disputeSummaryWindow;
private final ContractWindow contractWindow;
private final TradeDetailsWindow tradeDetailsWindow;
private final List<Attachment> tempAttachments = new ArrayList<>();
@ -110,16 +110,16 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
@Inject
public TraderDisputeView(DisputeManager disputeManager, KeyRing keyRing, TradeManager tradeManager, Stage stage,
BSFormatter formatter, DisputeSummaryPopup disputeSummaryPopup,
ContractPopup contractPopup, TradeDetailsPopup tradeDetailsPopup) {
BSFormatter formatter, DisputeSummaryWindow disputeSummaryWindow,
ContractWindow contractWindow, TradeDetailsWindow tradeDetailsWindow) {
this.disputeManager = disputeManager;
this.keyRing = keyRing;
this.tradeManager = tradeManager;
this.stage = stage;
this.formatter = formatter;
this.disputeSummaryPopup = disputeSummaryPopup;
this.contractPopup = contractPopup;
this.tradeDetailsPopup = tradeDetailsPopup;
this.disputeSummaryWindow = disputeSummaryWindow;
this.contractWindow = contractWindow;
this.tradeDetailsWindow = tradeDetailsWindow;
}
@Override
@ -198,7 +198,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
///////////////////////////////////////////////////////////////////////////////////////////
private void onOpenContract(Dispute dispute) {
contractPopup.show(dispute);
contractWindow.show(dispute);
}
private void onSendMessage(String inputText, Dispute dispute) {
@ -256,7 +256,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private void onCloseDispute(Dispute dispute) {
disputeSummaryPopup.onFinalizeDispute(() -> messagesAnchorPane.getChildren().remove(messagesInputBox))
disputeSummaryWindow.onFinalizeDispute(() -> messagesAnchorPane.getChildren().remove(messagesInputBox))
.show(dispute);
}
@ -654,7 +654,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
if (tradeOptional.isPresent()) {
field.setMouseTransparent(false);
field.setTooltip(new Tooltip("Open popup for details"));
field.setOnAction(event -> tradeDetailsPopup.show(tradeOptional.get()));
field.setOnAction(event -> tradeDetailsWindow.show(tradeOptional.get()));
} else {
field.setMouseTransparent(true);
}

View File

@ -26,7 +26,7 @@ import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.funds.reserved.ReservedView;
import io.bitsquare.gui.main.funds.transactions.TransactionsView;
import io.bitsquare.gui.main.funds.withdrawal.WithdrawalView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.user.Preferences;
import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
@ -86,7 +86,7 @@ public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
navigation.navigateTo(MainView.class, FundsView.class, TransactionsView.class);
String key = "tradeWalletInfoAtFunds";
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE)
if (!BitsquareApp.DEV_MODE)
new Popup().backgroundInfo("Bitsquare does not use a single application wallet, but dedicated wallets for every trade.\n\n" +
"Funding of the wallet will be done when needed, for instance when you create or take an offer.\n" +
"Withdrawing funds can be done after a trade is completed.\n\n" +

View File

@ -25,9 +25,9 @@ import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.common.view.ActivatableView;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.trade.Tradable;
import io.bitsquare.trade.Trade;
@ -62,8 +62,8 @@ public class ReservedView extends ActivatableView<VBox, Void> {
private final OpenOfferManager openOfferManager;
private final Preferences preferences;
private final BSFormatter formatter;
private final OfferDetailsPopup offerDetailsPopup;
private final TradeDetailsPopup tradeDetailsPopup;
private final OfferDetailsWindow offerDetailsWindow;
private final TradeDetailsWindow tradeDetailsWindow;
private final ObservableList<ReservedListItem> reservedAddresses = FXCollections.observableArrayList();
private BalanceListener balanceListener;
@ -74,14 +74,14 @@ public class ReservedView extends ActivatableView<VBox, Void> {
@Inject
private ReservedView(WalletService walletService, TradeManager tradeManager, OpenOfferManager openOfferManager, Preferences preferences,
BSFormatter formatter, OfferDetailsPopup offerDetailsPopup, TradeDetailsPopup tradeDetailsPopup) {
BSFormatter formatter, OfferDetailsWindow offerDetailsWindow, TradeDetailsWindow tradeDetailsWindow) {
this.walletService = walletService;
this.tradeManager = tradeManager;
this.openOfferManager = openOfferManager;
this.preferences = preferences;
this.formatter = formatter;
this.offerDetailsPopup = offerDetailsPopup;
this.tradeDetailsPopup = tradeDetailsPopup;
this.offerDetailsWindow = offerDetailsWindow;
this.tradeDetailsWindow = tradeDetailsWindow;
}
@ -157,9 +157,9 @@ public class ReservedView extends ActivatableView<VBox, Void> {
if (tradableOptional.isPresent()) {
Tradable tradable = tradableOptional.get();
if (tradable instanceof Trade) {
tradeDetailsPopup.show((Trade) tradable);
tradeDetailsWindow.show((Trade) tradable);
} else if (tradable instanceof OpenOffer) {
offerDetailsPopup.show(tradable.getOffer());
offerDetailsWindow.show(tradable.getOffer());
}
}
}

View File

@ -25,9 +25,9 @@ import io.bitsquare.gui.common.view.ActivatableView;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.AddressWithIconAndDirection;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.trade.Tradable;
import io.bitsquare.trade.Trade;
@ -72,9 +72,9 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
private final FailedTradesManager failedTradesManager;
private final BSFormatter formatter;
private final Preferences preferences;
private final TradeDetailsPopup tradeDetailsPopup;
private final TradeDetailsWindow tradeDetailsWindow;
private final DisputeManager disputeManager;
private final OfferDetailsPopup offerDetailsPopup;
private final OfferDetailsWindow offerDetailsWindow;
private WalletEventListener walletEventListener;
@ -85,9 +85,9 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
@Inject
private TransactionsView(WalletService walletService, TradeManager tradeManager, OpenOfferManager openOfferManager,
ClosedTradableManager closedTradableManager, FailedTradesManager failedTradesManager,
BSFormatter formatter, Preferences preferences, TradeDetailsPopup tradeDetailsPopup,
BSFormatter formatter, Preferences preferences, TradeDetailsWindow tradeDetailsWindow,
DisputeManager disputeManager,
OfferDetailsPopup offerDetailsPopup) {
OfferDetailsWindow offerDetailsWindow) {
this.walletService = walletService;
this.tradeManager = tradeManager;
this.openOfferManager = openOfferManager;
@ -95,9 +95,9 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
this.failedTradesManager = failedTradesManager;
this.formatter = formatter;
this.preferences = preferences;
this.tradeDetailsPopup = tradeDetailsPopup;
this.tradeDetailsWindow = tradeDetailsWindow;
this.disputeManager = disputeManager;
this.offerDetailsPopup = offerDetailsPopup;
this.offerDetailsWindow = offerDetailsWindow;
}
@Override
@ -222,9 +222,9 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
private void openDetailPopup(TransactionsListItem item) {
if (item.getTradable() instanceof OpenOffer)
offerDetailsPopup.show(item.getTradable().getOffer());
offerDetailsWindow.show(item.getTradable().getOffer());
else if (item.getTradable() instanceof Trade)
tradeDetailsPopup.show((Trade) item.getTradable());
tradeDetailsWindow.show((Trade) item.getTradable());
}

View File

@ -28,10 +28,10 @@ import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.common.view.ActivatableView;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.popups.WalletPasswordPopup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import io.bitsquare.gui.main.overlays.windows.WalletPasswordWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.BtcAddressValidator;
import io.bitsquare.trade.Tradable;
@ -86,9 +86,9 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
private final BSFormatter formatter;
private final Preferences preferences;
private final BtcAddressValidator btcAddressValidator;
private final WalletPasswordPopup walletPasswordPopup;
private final OfferDetailsPopup offerDetailsPopup;
private final TradeDetailsPopup tradeDetailsPopup;
private final WalletPasswordWindow walletPasswordWindow;
private final OfferDetailsWindow offerDetailsWindow;
private final TradeDetailsWindow tradeDetailsWindow;
private final ObservableList<WithdrawalListItem> fundedAddresses = FXCollections.observableArrayList();
private Set<WithdrawalListItem> selectedItems = new HashSet<>();
private BalanceListener balanceListener;
@ -104,8 +104,8 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
ClosedTradableManager closedTradableManager,
FailedTradesManager failedTradesManager, OpenOfferManager openOfferManager,
BSFormatter formatter, Preferences preferences,
BtcAddressValidator btcAddressValidator, WalletPasswordPopup walletPasswordPopup,
OfferDetailsPopup offerDetailsPopup, TradeDetailsPopup tradeDetailsPopup) {
BtcAddressValidator btcAddressValidator, WalletPasswordWindow walletPasswordWindow,
OfferDetailsWindow offerDetailsWindow, TradeDetailsWindow tradeDetailsWindow) {
this.walletService = walletService;
this.tradeManager = tradeManager;
this.closedTradableManager = closedTradableManager;
@ -114,9 +114,9 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
this.formatter = formatter;
this.preferences = preferences;
this.btcAddressValidator = btcAddressValidator;
this.walletPasswordPopup = walletPasswordPopup;
this.offerDetailsPopup = offerDetailsPopup;
this.tradeDetailsPopup = tradeDetailsPopup;
this.walletPasswordWindow = walletPasswordWindow;
this.offerDetailsWindow = offerDetailsWindow;
this.tradeDetailsWindow = tradeDetailsWindow;
}
@Override
@ -270,9 +270,9 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
if (tradableOptional.isPresent()) {
Tradable tradable = tradableOptional.get();
if (tradable instanceof Trade) {
tradeDetailsPopup.show((Trade) tradable);
tradeDetailsWindow.show((Trade) tradable);
} else if (tradable instanceof OpenOffer) {
offerDetailsPopup.show(tradable.getOffer());
offerDetailsWindow.show(tradable.getOffer());
}
}
}
@ -313,7 +313,7 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
private void doWithdraw(Coin amount, FutureCallback<Transaction> callback) {
if (walletService.getWallet().isEncrypted()) {
walletPasswordPopup.onAesKey(aesKey -> sendFunds(amount, aesKey, callback)).show();
walletPasswordWindow.onAesKey(aesKey -> sendFunds(amount, aesKey, callback)).show();
} else {
sendFunds(amount, null, callback);
}

View File

@ -18,7 +18,7 @@
package io.bitsquare.gui.main.help;
import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,15 +0,0 @@
package io.bitsquare.gui.main.intructions;
import com.google.inject.Inject;
import io.bitsquare.gui.main.popups.Popup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Instruction extends Popup {
private static final Logger log = LoggerFactory.getLogger(Instruction.class);
@Inject
public Instruction() {
}
}

View File

@ -1,17 +0,0 @@
package io.bitsquare.gui.main.intructions;
import com.google.inject.Inject;
import io.bitsquare.trade.TradeManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class InstructionCenter {
private final Logger log = LoggerFactory.getLogger(InstructionCenter.class);
private final TradeManager tradeManager;
@Inject
public InstructionCenter(TradeManager tradeManager) {
this.tradeManager = tradeManager;
}
}

View File

@ -28,7 +28,7 @@ import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.offer.createoffer.CreateOfferView;
import io.bitsquare.gui.main.offer.offerbook.OfferBookView;
import io.bitsquare.gui.main.offer.takeoffer.TakeOfferView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.trade.offer.Offer;

View File

@ -29,9 +29,9 @@ import io.bitsquare.btc.pricefeed.PriceFeed;
import io.bitsquare.common.UserThread;
import io.bitsquare.common.crypto.KeyRing;
import io.bitsquare.gui.common.model.ActivatableDataModel;
import io.bitsquare.gui.main.notifications.Notification;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.WalletPasswordPopup;
import io.bitsquare.gui.main.overlays.notifications.Notification;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.WalletPasswordWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.Country;
import io.bitsquare.locale.TradeCurrency;
@ -75,7 +75,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
private final KeyRing keyRing;
private final P2PService p2PService;
private final PriceFeed priceFeed;
private final WalletPasswordPopup walletPasswordPopup;
private final WalletPasswordWindow walletPasswordWindow;
private final BlockchainService blockchainService;
private final BSFormatter formatter;
private final String offerId;
@ -107,6 +107,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
private PaymentAccount paymentAccount;
private boolean isTabSelected;
private Notification walletFundedNotification;
///////////////////////////////////////////////////////////////////////////////////////////
@ -116,7 +117,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
@Inject
CreateOfferDataModel(OpenOfferManager openOfferManager, WalletService walletService, TradeWalletService tradeWalletService,
Preferences preferences, User user, KeyRing keyRing, P2PService p2PService, PriceFeed priceFeed,
WalletPasswordPopup walletPasswordPopup, BlockchainService blockchainService, BSFormatter formatter) {
WalletPasswordWindow walletPasswordWindow, BlockchainService blockchainService, BSFormatter formatter) {
this.openOfferManager = openOfferManager;
this.walletService = walletService;
this.tradeWalletService = tradeWalletService;
@ -125,7 +126,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
this.keyRing = keyRing;
this.p2PService = p2PService;
this.priceFeed = priceFeed;
this.walletPasswordPopup = walletPasswordPopup;
this.walletPasswordWindow = walletPasswordWindow;
this.blockchainService = blockchainService;
this.formatter = formatter;
@ -273,7 +274,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
void onPlaceOffer(Offer offer, TransactionResultHandler resultHandler) {
if (walletService.getWallet().isEncrypted() && tradeWalletService.getAesKey() == null) {
walletPasswordPopup.onAesKey(aesKey -> {
walletPasswordWindow.onAesKey(aesKey -> {
tradeWalletService.setAesKey(aesKey);
doPlaceOffer(offer, resultHandler);
}).show();
@ -384,12 +385,15 @@ class CreateOfferDataModel extends ActivatableDataModel {
if (isWalletFunded.get()) {
walletService.removeBalanceListener(balanceListener);
new Notification()
.headLine("Trading wallet update")
.notification("Your trading wallet is sufficiently funded.\n" +
"Amount: " + formatter.formatCoinWithCode(totalToPayAsCoin.get()))
.autoClose()
.show();
if (walletFundedNotification == null) {
walletFundedNotification = new Notification()
.headLine("Trading wallet update")
.notification("Your trading wallet is sufficiently funded.\n" +
"Amount: " + formatter.formatCoinWithCode(totalToPayAsCoin.get()))
.autoClose();
walletFundedNotification.show();
}
}
}

View File

@ -38,8 +38,8 @@ import io.bitsquare.gui.main.account.settings.AccountSettingsView;
import io.bitsquare.gui.main.funds.FundsView;
import io.bitsquare.gui.main.funds.withdrawal.WithdrawalView;
import io.bitsquare.gui.main.offer.OfferView;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.main.portfolio.PortfolioView;
import io.bitsquare.gui.main.portfolio.openoffer.OpenOffersView;
import io.bitsquare.gui.util.FormBuilder;
@ -74,7 +74,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateOfferViewModel> {
private final Navigation navigation;
private final OfferDetailsPopup offerDetailsPopup;
private final OfferDetailsWindow offerDetailsWindow;
private ScrollPane scrollPane;
private GridPane gridPane;
@ -120,11 +120,11 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
private CreateOfferView(CreateOfferViewModel model, Navigation navigation, OfferDetailsPopup offerDetailsPopup, Preferences preferences) {
private CreateOfferView(CreateOfferViewModel model, Navigation navigation, OfferDetailsWindow offerDetailsWindow, Preferences preferences) {
super(model);
this.navigation = navigation;
this.offerDetailsPopup = offerDetailsPopup;
this.offerDetailsWindow = offerDetailsWindow;
this.preferences = preferences;
}
@ -228,21 +228,16 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
private void onPlaceOffer() {
if (model.isBootstrapped()) {
Offer offer = model.createAndGetOffer();
String id = "CreateOfferConfirmation";
if (preferences.showAgain(id)) {
offerDetailsPopup.onPlaceOffer(model::onPlaceOffer)
.dontShowAgainId(id)
if (model.hasAcceptedArbitrators()) {
Offer offer = model.createAndGetOffer();
offerDetailsWindow.onPlaceOffer(model::onPlaceOffer)
.show(offer);
} else {
if (model.hasAcceptedArbitrators()) {
model.onPlaceOffer(offer);
} else {
new Popup().warning("You have no arbitrator selected.\n" +
"Please select at least one arbitrator.").show();
navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, ArbitratorSelectionView.class);
}
new Popup().warning("You have no arbitrator selected.\n" +
"You need to select at least one arbitrator.")
.actionButtonText("Go to \"Arbitrator selection\"")
.onAction(() -> navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, ArbitratorSelectionView.class))
.show();
}
} else {
new Popup().warning("You need to wait until your client is bootstrapped in the network.\n" +
@ -259,37 +254,33 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
paymentAccountsComboBox.setMouseTransparent(true);
if (!BitsquareApp.DEV_MODE) {
String id = "securityDepositInfo";
if (model.dataModel.getPreferences().showAgain(id)) {
new Popup().backgroundInfo("To ensure that both traders follow the trade protocol they need to pay a security deposit.\n\n" +
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader.\n" +
"It will be refunded to you after the trade has successfully completed.")
.closeButtonText("I want to learn more")
.onClose(() -> Utilities.openWebPage("https://bitsquare.io/faq#6"))
.actionButtonText("I understand")
.onAction(() -> {
})
.dontShowAgainId(id, preferences)
.show();
}
String key = "securityDepositInfo";
new Popup().backgroundInfo("To ensure that both traders follow the trade protocol they need to pay a security deposit.\n\n" +
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader.\n" +
"It will be refunded to you after the trade has successfully completed.")
.closeButtonText("I want to learn more")
.onClose(() -> Utilities.openWebPage("https://bitsquare.io/faq#6"))
.actionButtonText("I understand")
.onAction(() -> {
})
.dontShowAgainId(key, preferences)
.show();
id = "createOfferFundWalletInfo";
if (model.dataModel.getPreferences().showAgain(id)) {
String tradeAmountText = model.isSellOffer() ? "the trade amount, " : "";
new Popup().headLine("Fund your trading wallet").instruction("You need to pay in " +
model.totalToPay.get() + " to your local Bitsquare trading wallet.\n" +
"The amount is the sum of " + tradeAmountText + "the security deposit, the trading fee and " +
"the bitcoin mining fee.\n\n" +
"Please send from your external Bitcoin wallet the exact amount to the address: " +
model.getAddressAsString() + "\n" +
"(you can copy the address in the screen below after closing that popup)\n\n" +
"Make sure you use a sufficiently high mining fee of at least " +
model.formatter.formatCoinWithCode(FeePolicy.getMinRequiredFeeForFundingTx()) +
" to avoid problems that your transaction does not get confirmed in the blockchain.\n\n" +
"You can see the status of your incoming payment and all the details in the screen below.")
.dontShowAgainId(id, preferences)
.show();
}
key = "createOfferFundWalletInfo";
String tradeAmountText = model.isSellOffer() ? "the trade amount, " : "";
new Popup().headLine("Fund your trading wallet").instruction("You need to pay in " +
model.totalToPay.get() + " to your local Bitsquare trading wallet.\n" +
"The amount is the sum of " + tradeAmountText + "the security deposit, the trading fee and " +
"the bitcoin mining fee.\n\n" +
"Please send from your external Bitcoin wallet the exact amount to the address: " +
model.getAddressAsString() + "\n" +
"(you can copy the address in the screen below after closing that popup)\n\n" +
"Make sure you use a sufficiently high mining fee of at least " +
model.formatter.formatCoinWithCode(FeePolicy.getMinRequiredFeeForFundingTx()) +
" to avoid problems that your transaction does not get confirmed in the blockchain.\n\n" +
"You can see the status of your incoming payment and all the details in the screen below.")
.dontShowAgainId(key, preferences)
.show();
}
nextButton.setVisible(false);

View File

@ -30,8 +30,8 @@ import io.bitsquare.gui.main.account.settings.AccountSettingsView;
import io.bitsquare.gui.main.funds.FundsView;
import io.bitsquare.gui.main.funds.withdrawal.WithdrawalView;
import io.bitsquare.gui.main.offer.OfferView;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.TradeCurrency;
@ -57,7 +57,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookViewModel> {
private final Navigation navigation;
private final OfferDetailsPopup offerDetailsPopup;
private final OfferDetailsWindow offerDetailsWindow;
private ComboBox<TradeCurrency> currencyComboBox;
private ComboBox<PaymentMethod> paymentMethodComboBox;
@ -75,11 +75,11 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
OfferBookView(OfferBookViewModel model, Navigation navigation, OfferDetailsPopup offerDetailsPopup) {
OfferBookView(OfferBookViewModel model, Navigation navigation, OfferDetailsWindow offerDetailsWindow) {
super(model);
this.navigation = navigation;
this.offerDetailsPopup = offerDetailsPopup;
this.offerDetailsWindow = offerDetailsWindow;
}
@Override
@ -445,7 +445,7 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
if (item != null && !empty) {
field = new HyperlinkWithIcon(model.getPaymentMethod(item), true);
field.setOnAction(event -> offerDetailsPopup.show(item.getOffer()));
field.setOnAction(event -> offerDetailsWindow.show(item.getOffer()));
field.setTooltip(new Tooltip(model.getPaymentMethodToolTip(item)));
setGraphic(field);
} else {

View File

@ -30,9 +30,9 @@ import io.bitsquare.btc.pricefeed.PriceFeed;
import io.bitsquare.common.UserThread;
import io.bitsquare.common.handlers.ResultHandler;
import io.bitsquare.gui.common.model.ActivatableDataModel;
import io.bitsquare.gui.main.notifications.Notification;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.popups.WalletPasswordPopup;
import io.bitsquare.gui.main.overlays.notifications.Notification;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.WalletPasswordWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.TradeCurrency;
@ -68,7 +68,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
private final TradeWalletService tradeWalletService;
private final WalletService walletService;
private final User user;
private final WalletPasswordPopup walletPasswordPopup;
private final WalletPasswordWindow walletPasswordWindow;
private final Preferences preferences;
private final PriceFeed priceFeed;
private final BlockchainService blockchainService;
@ -92,6 +92,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
private BalanceListener balanceListener;
private PaymentAccount paymentAccount;
private boolean isTabSelected;
private Notification walletFundedNotification;
///////////////////////////////////////////////////////////////////////////////////////////
@ -101,14 +102,14 @@ class TakeOfferDataModel extends ActivatableDataModel {
@Inject
TakeOfferDataModel(TradeManager tradeManager, TradeWalletService tradeWalletService,
WalletService walletService, User user, WalletPasswordPopup walletPasswordPopup,
WalletService walletService, User user, WalletPasswordWindow walletPasswordWindow,
Preferences preferences, PriceFeed priceFeed, BlockchainService blockchainService,
BSFormatter formatter) {
this.tradeManager = tradeManager;
this.tradeWalletService = tradeWalletService;
this.walletService = walletService;
this.user = user;
this.walletPasswordPopup = walletPasswordPopup;
this.walletPasswordWindow = walletPasswordWindow;
this.preferences = preferences;
this.priceFeed = priceFeed;
this.blockchainService = blockchainService;
@ -222,7 +223,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
// have it persisted as well.
void onTakeOffer(TradeResultHandler tradeResultHandler) {
if (walletService.getWallet().isEncrypted() && tradeWalletService.getAesKey() == null) {
walletPasswordPopup.onAesKey(aesKey -> {
walletPasswordWindow.onAesKey(aesKey -> {
tradeWalletService.setAesKey(aesKey);
doTakeOffer(tradeResultHandler);
}).show();
@ -327,12 +328,14 @@ class TakeOfferDataModel extends ActivatableDataModel {
if (isWalletFunded.get()) {
walletService.removeBalanceListener(balanceListener);
new Notification()
.headLine("Trading wallet update")
.notification("Your trading wallet is sufficiently funded.\n" +
"Amount: " + formatter.formatCoinWithCode(totalToPayAsCoin.get()))
.autoClose()
.show();
if (walletFundedNotification == null) {
walletFundedNotification = new Notification()
.headLine("Trading wallet update")
.notification("Your trading wallet is sufficiently funded.\n" +
"Amount: " + formatter.formatCoinWithCode(totalToPayAsCoin.get()))
.autoClose();
walletFundedNotification.show();
}
}
}

View File

@ -35,8 +35,9 @@ import io.bitsquare.gui.main.account.settings.AccountSettingsView;
import io.bitsquare.gui.main.funds.FundsView;
import io.bitsquare.gui.main.funds.withdrawal.WithdrawalView;
import io.bitsquare.gui.main.offer.OfferView;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.main.portfolio.PortfolioView;
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesView;
import io.bitsquare.gui.util.BSFormatter;
@ -72,7 +73,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOfferViewModel> {
private final Navigation navigation;
private final BSFormatter formatter;
private final OfferDetailsPopup offerDetailsPopup;
private final OfferDetailsWindow offerDetailsWindow;
private final Preferences preferences;
private ScrollPane scrollPane;
private GridPane gridPane;
@ -102,7 +103,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private Subscription showTransactionPublishedScreenSubscription;
private Subscription showCheckAvailabilityPopupSubscription;
private SimpleBooleanProperty errorPopupDisplayed;
private Popup isOfferAvailablePopup;
private Overlay<Popup> isOfferAvailablePopup;
private ChangeListener<Coin> feeFromFundingTxListener;
@ -112,12 +113,12 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
@Inject
private TakeOfferView(TakeOfferViewModel model, Navigation navigation, BSFormatter formatter,
OfferDetailsPopup offerDetailsPopup, Preferences preferences) {
OfferDetailsWindow offerDetailsWindow, Preferences preferences) {
super(model);
this.navigation = navigation;
this.formatter = formatter;
this.offerDetailsPopup = offerDetailsPopup;
this.offerDetailsWindow = offerDetailsWindow;
this.preferences = preferences;
}
@ -374,21 +375,16 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
///////////////////////////////////////////////////////////////////////////////////////////
private void onTakeOffer() {
Offer offer = model.getOffer();
String id = "TakeOfferConfirmation";
if (preferences.showAgain(id)) {
offerDetailsPopup.onTakeOffer(() -> model.onTakeOffer())
.dontShowAgainId(id)
.show(offer, model.dataModel.amountAsCoin.get());
} else {
if (model.hasAcceptedArbitrators()) {
model.onTakeOffer();
} else {
new Popup().warning("You have no arbitrator selected.\n" +
"Please select at least one arbitrator.").show();
if (model.hasAcceptedArbitrators()) {
offerDetailsWindow.onTakeOffer(() -> model.onTakeOffer())
.show(model.getOffer(), model.dataModel.amountAsCoin.get());
navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, ArbitratorSelectionView.class);
}
} else {
new Popup().warning("You have no arbitrator selected.\n" +
"You need to select at least one arbitrator.")
.actionButtonText("Go to \"Arbitrator selection\"")
.onAction(() -> navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, ArbitratorSelectionView.class))
.show();
}
}
@ -402,36 +398,32 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
volumeTextField.setMouseTransparent(true);
if (!BitsquareApp.DEV_MODE) {
String id = "securityDepositInfo";
if (model.dataModel.getPreferences().showAgain(id)) {
new Popup().backgroundInfo("To ensure that both traders follow the trade protocol they need to pay a security deposit.\n\n" +
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader.\n" +
"It will be refunded to you after the trade has successfully completed.")
.closeButtonText("I want to learn more")
.onClose(() -> Utilities.openWebPage("https://bitsquare.io/faq#6"))
.actionButtonText("I understand")
.onAction(() -> {
})
.dontShowAgainId(id, preferences)
.show();
}
String key = "securityDepositInfo";
new Popup().backgroundInfo("To ensure that both traders follow the trade protocol they need to pay a security deposit.\n\n" +
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader.\n" +
"It will be refunded to you after the trade has successfully completed.")
.closeButtonText("I want to learn more")
.onClose(() -> Utilities.openWebPage("https://bitsquare.io/faq#6"))
.actionButtonText("I understand")
.onAction(() -> {
})
.dontShowAgainId(key, preferences)
.show();
id = "takeOfferFundWalletInfo";
if (model.dataModel.getPreferences().showAgain(id)) {
String tradeAmountText = model.isSeller() ? "the trade amount, " : "";
new Popup().headLine("Fund your trading wallet").instruction("You need to pay in " +
model.totalToPay.get() + " to your local Bitsquare trading wallet.\n" +
"The amount is the sum of " + tradeAmountText + "the security deposit, the trading fee and " +
"the bitcoin mining fee.\n\n" +
"Please send from your external Bitcoin wallet the exact amount to the address: " +
model.getAddressAsString() + "\n(you can copy the address in the screen below after closing that popup)\n\n" +
"Make sure you use a sufficiently high mining fee of at least " +
model.formatter.formatCoinWithCode(FeePolicy.getMinRequiredFeeForFundingTx()) +
" to avoid problems that your transaction does not get confirmed in the blockchain.\n\n" +
"You can see the status of your incoming payment and all the details in the screen below.")
.dontShowAgainId(id, preferences)
.show();
}
key = "takeOfferFundWalletInfo";
String tradeAmountText = model.isSeller() ? "the trade amount, " : "";
new Popup().headLine("Fund your trading wallet").instruction("You need to pay in " +
model.totalToPay.get() + " to your local Bitsquare trading wallet.\n" +
"The amount is the sum of " + tradeAmountText + "the security deposit, the trading fee and " +
"the bitcoin mining fee.\n\n" +
"Please send from your external Bitcoin wallet the exact amount to the address: " +
model.getAddressAsString() + "\n(you can copy the address in the screen below after closing that popup)\n\n" +
"Make sure you use a sufficiently high mining fee of at least " +
model.formatter.formatCoinWithCode(FeePolicy.getMinRequiredFeeForFundingTx()) +
" to avoid problems that your transaction does not get confirmed in the blockchain.\n\n" +
"You can see the status of your incoming payment and all the details in the screen below.")
.dontShowAgainId(key, preferences)
.show();
}
nextButton.setVisible(false);

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays;
import de.jensd.fx.fontawesome.AwesomeIcon;
import io.bitsquare.common.Timer;
@ -47,7 +47,7 @@ import java.util.Optional;
import static io.bitsquare.gui.util.FormBuilder.addCheckBox;
public class Popup {
public abstract class Overlay<T extends Overlay> {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
protected final static double DEFAULT_WIDTH = 600;
@ -72,8 +72,8 @@ public class Popup {
protected Label headLineLabel;
protected String dontShowAgainId;
private Preferences preferences;
private ChangeListener<Number> positionListener;
private Timer centerTime;
protected ChangeListener<Number> positionListener;
protected Timer centerTime;
protected double buttonDistance = 20;
private String type;
private AwesomeIcon awesomeIcon;
@ -83,25 +83,30 @@ public class Popup {
// Public API
///////////////////////////////////////////////////////////////////////////////////////////
public Popup() {
public Overlay() {
}
public void show() {
createGridPane();
addHeadLine();
addSeparator();
if (dontShowAgainId == null || preferences == null || preferences.showAgain(dontShowAgainId)) {
createGridPane();
addHeadLine();
addSeparator();
if (showProgressIndicator)
addProgressIndicator();
if (showProgressIndicator)
addProgressIndicator();
addMessage();
if (showReportErrorButtons)
addReportErrorButtons();
addMessage();
if (showReportErrorButtons)
addReportErrorButtons();
addCloseButton();
addDontShowAgainCheckBox();
applyStyles();
PopupManager.queueForDisplay(this);
addCloseButton();
addDontShowAgainCheckBox();
applyStyles();
onShow();
}
}
protected void onShow() {
}
public void hide() {
@ -126,11 +131,14 @@ public class Popup {
log.warn("Stage is null");
cleanup();
PopupManager.isHidden(Popup.this);
onHidden();
}
});
}
protected void onHidden() {
}
protected void animateHide(Runnable onFinishedHandler) {
onFinishedHandler.run();
}
@ -139,76 +147,76 @@ public class Popup {
}
public Popup onClose(Runnable closeHandler) {
public T onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
return (T) this;
}
public Popup onAction(Runnable actionHandler) {
public T onAction(Runnable actionHandler) {
this.actionHandlerOptional = Optional.of(actionHandler);
return this;
return (T) this;
}
public Popup headLine(String headLine) {
public T headLine(String headLine) {
this.headLine = headLine;
return this;
return (T) this;
}
public Popup notification(String message) {
public T notification(String message) {
type = "notification";
if (headLine == null)
this.headLine = "Notification";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup instruction(String message) {
public T instruction(String message) {
type = "instruction";
if (headLine == null)
this.headLine = "Instruction";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup backgroundInfo(String message) {
public T backgroundInfo(String message) {
type = "backgroundInfo";
if (headLine == null)
this.headLine = "Background information";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup feedback(String message) {
public T feedback(String message) {
type = "feedback";
if (headLine == null)
this.headLine = "Feedback";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup confirmation(String message) {
public T confirmation(String message) {
type = "confirmation";
if (headLine == null)
this.headLine = "Confirmation";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup information(String message) {
public T information(String message) {
type = "information";
if (headLine == null)
this.headLine = "Information";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup warning(String message) {
public T warning(String message) {
type = "warning";
awesomeIcon = AwesomeIcon.LIGHTBULB;
@ -216,54 +224,54 @@ public class Popup {
this.headLine = "Warning";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup error(String message) {
public T error(String message) {
type = "error";
showReportErrorButtons();
if (headLine == null)
this.headLine = "Error";
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup showReportErrorButtons() {
public T showReportErrorButtons() {
this.showReportErrorButtons = true;
return this;
return (T) this;
}
public Popup message(String message) {
public T message(String message) {
this.message = message;
setTruncatedMessage();
return this;
return (T) this;
}
public Popup closeButtonText(String closeButtonText) {
public T closeButtonText(String closeButtonText) {
this.closeButtonText = closeButtonText;
return this;
return (T) this;
}
public Popup actionButtonText(String actionButtonText) {
public T actionButtonText(String actionButtonText) {
this.actionButtonText = actionButtonText;
return this;
return (T) this;
}
public Popup width(double width) {
public T width(double width) {
this.width = width;
return this;
return (T) this;
}
public Popup showProgressIndicator() {
public T showProgressIndicator() {
this.showProgressIndicator = true;
return this;
return (T) this;
}
public Popup dontShowAgainId(String dontShowAgainId, Preferences preferences) {
this.dontShowAgainId = type + "_" + dontShowAgainId;
public T dontShowAgainId(String key, Preferences preferences) {
this.dontShowAgainId = key;
this.preferences = preferences;
return this;
return (T) this;
}
///////////////////////////////////////////////////////////////////////////////////////////
@ -458,15 +466,12 @@ public class Popup {
gridPane.getChildren().add(progressIndicator);
}
private void addDontShowAgainCheckBox() {
protected void addDontShowAgainCheckBox() {
if (dontShowAgainId != null && preferences != null) {
CheckBox dontShowAgainCheckBox = addCheckBox(gridPane, rowIndex, "Don't show again", buttonDistance - 1);
GridPane.setColumnIndex(dontShowAgainCheckBox, 0);
GridPane.setHalignment(dontShowAgainCheckBox, HPos.LEFT);
dontShowAgainCheckBox.setOnAction(e -> {
if (dontShowAgainCheckBox.isSelected())
preferences.dontShowAgain(dontShowAgainId);
});
dontShowAgainCheckBox.setOnAction(e -> preferences.dontShowAgain(dontShowAgainId, dontShowAgainCheckBox.isSelected()));
}
}

View File

@ -1,8 +1,8 @@
package io.bitsquare.gui.main.notifications;
package io.bitsquare.gui.main.overlays.notifications;
import io.bitsquare.common.Timer;
import io.bitsquare.common.UserThread;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.Overlay;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
@ -18,7 +18,7 @@ import javafx.util.Duration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Notification extends Popup {
public class Notification extends Overlay<Notification> {
private static final Logger log = LoggerFactory.getLogger(Notification.class);
private boolean hasBeenDisplayed;
private boolean autoClose;
@ -29,26 +29,30 @@ public class Notification extends Popup {
NotificationCenter.add(this);
}
public Notification headLine(String headLine) {
return (Notification) super.headLine(headLine);
public void onReadyForDisplay() {
super.display();
if (autoClose && autoCloseTimer == null)
autoCloseTimer = UserThread.runAfter(this::hide, 5);
}
@Override
protected void onShow() {
NotificationManager.queueForDisplay(this);
}
@Override
protected void onHidden() {
NotificationManager.onHidden(this);
}
public Notification tradeHeadLine(String tradeId) {
return headLine("Notification for trade with ID " + tradeId);
}
public Notification notification(String message) {
return (Notification) super.notification(message);
}
public Notification disputeHeadLine(String tradeId) {
return headLine("Support ticket for trade with ID " + tradeId);
}
public Notification message(String message) {
return (Notification) super.message(message);
}
@Override
protected void addSeparator() {
// dont show a separator
@ -60,19 +64,12 @@ public class Notification extends Popup {
hasBeenDisplayed = true;
}
public Notification autoClose() {
autoClose = true;
return this;
}
@Override
public void display() {
super.display();
if (autoClose && autoCloseTimer == null)
autoCloseTimer = UserThread.runAfter(this::hide, 5);
}
@Override
protected void animateHide(Runnable onFinishedHandler) {
if (autoCloseTimer != null) {

View File

@ -1,4 +1,4 @@
package io.bitsquare.gui.main.notifications;
package io.bitsquare.gui.main.overlays.notifications;
import com.google.inject.Inject;
import io.bitsquare.app.Log;

View File

@ -0,0 +1,40 @@
package io.bitsquare.gui.main.overlays.notifications;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
public class NotificationManager {
private static final Logger log = LoggerFactory.getLogger(NotificationManager.class);
private static final Queue<Notification> popups = new LinkedBlockingQueue<>(5);
private static Notification displayedPopup;
public static void queueForDisplay(Notification popup) {
boolean result = popups.offer(popup);
if (!result)
log.warn("The capacity is full with popups in the queue.\n\t" +
"Not added new popup=" + popup);
displayNext();
}
public static void onHidden(Notification popup) {
if (displayedPopup == null || displayedPopup == popup) {
displayedPopup = null;
displayNext();
} else {
log.warn("We got a isHidden called with a wrong popup.\n\t" +
"popup (argument)=" + popup + "\n\tdisplayedPopup=" + displayedPopup);
}
}
private static void displayNext() {
if (displayedPopup == null) {
if (!popups.isEmpty()) {
displayedPopup = popups.poll();
displayedPopup.onReadyForDisplay();
}
}
}
}

View File

@ -0,0 +1,40 @@
/*
* This file is part of Bitsquare.
*
* Bitsquare is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.overlays.popups;
import io.bitsquare.gui.main.overlays.Overlay;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Popup<T extends Overlay> extends Overlay<Popup> {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
public void onReadyForDisplay() {
super.display();
}
@Override
protected void onShow() {
PopupManager.queueForDisplay(this);
}
@Override
protected void onHidden() {
PopupManager.onHidden(this);
}
}

View File

@ -1,4 +1,4 @@
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.popups;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -6,12 +6,12 @@ import org.slf4j.LoggerFactory;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
class PopupManager {
public class PopupManager {
private static final Logger log = LoggerFactory.getLogger(PopupManager.class);
private static final Queue<Popup> popups = new LinkedBlockingQueue<>(3);
private static final Queue<Popup> popups = new LinkedBlockingQueue<>(5);
private static Popup displayedPopup;
static void queueForDisplay(Popup popup) {
public static void queueForDisplay(Popup popup) {
boolean result = popups.offer(popup);
if (!result)
log.warn("The capacity is full with popups in the queue.\n\t" +
@ -19,7 +19,7 @@ class PopupManager {
displayNext();
}
static void isHidden(Popup popup) {
public static void onHidden(Popup popup) {
if (displayedPopup == null || displayedPopup == popup) {
displayedPopup = null;
displayNext();
@ -33,7 +33,7 @@ class PopupManager {
if (displayedPopup == null) {
if (!popups.isEmpty()) {
displayedPopup = popups.poll();
displayedPopup.display();
displayedPopup.onReadyForDisplay();
}
}
}

View File

@ -15,10 +15,11 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import com.google.common.base.Joiner;
import io.bitsquare.arbitration.Dispute;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
@ -38,12 +39,11 @@ import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import java.util.List;
import java.util.Optional;
import static io.bitsquare.gui.util.FormBuilder.*;
public class ContractPopup extends Popup {
protected static final Logger log = LoggerFactory.getLogger(ContractPopup.class);
public class ContractWindow extends Overlay<ContractWindow> {
protected static final Logger log = LoggerFactory.getLogger(ContractWindow.class);
private final BSFormatter formatter;
private Dispute dispute;
@ -54,11 +54,11 @@ public class ContractPopup extends Popup {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public ContractPopup(BSFormatter formatter) {
public ContractWindow(BSFormatter formatter) {
this.formatter = formatter;
}
public ContractPopup show(Dispute dispute) {
public void show(Dispute dispute) {
this.dispute = dispute;
rowIndex = -1;
@ -66,12 +66,6 @@ public class ContractPopup extends Popup {
createGridPane();
addContent();
display();
return this;
}
public ContractPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -15,27 +15,24 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.alert.Alert;
import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.overlays.Overlay;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Optional;
import static com.google.common.base.Preconditions.checkNotNull;
import static io.bitsquare.gui.util.FormBuilder.addLabelHyperlinkWithIcon;
import static io.bitsquare.gui.util.FormBuilder.addMultilineLabel;
public class DisplayAlertMessagePopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(DisplayAlertMessagePopup.class);
private Label msgLabel;
public class DisplayAlertMessageWindow extends Overlay<DisplayAlertMessageWindow> {
private static final Logger log = LoggerFactory.getLogger(DisplayAlertMessageWindow.class);
private Alert alert;
@ -43,7 +40,7 @@ public class DisplayAlertMessagePopup extends Popup {
// Public API
///////////////////////////////////////////////////////////////////////////////////////////
public DisplayAlertMessagePopup() {
public DisplayAlertMessageWindow() {
}
public void show() {
@ -55,26 +52,21 @@ public class DisplayAlertMessagePopup extends Popup {
addSeparator();
addContent();
applyStyles();
PopupManager.queueForDisplay(this);
display();
}
public DisplayAlertMessagePopup alertMessage(Alert alert) {
public DisplayAlertMessageWindow alertMessage(Alert alert) {
this.alert = alert;
return this;
}
public DisplayAlertMessagePopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Protected
///////////////////////////////////////////////////////////////////////////////////////////
private void addContent() {
checkNotNull(alert, "alertMessage must not be null");
msgLabel = addMultilineLabel(gridPane, ++rowIndex, alert.message, 10);
addMultilineLabel(gridPane, ++rowIndex, alert.message, 10);
if (alert.isUpdateInfo) {
headLine = "Important update information!";
headLineLabel.setStyle("-fx-text-fill: -fx-accent; -fx-font-weight: bold; -fx-font-size: 22;");

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.arbitration.Dispute;
import io.bitsquare.arbitration.DisputeManager;
@ -26,6 +26,8 @@ import io.bitsquare.btc.TradeWalletService;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.exceptions.TransactionVerificationException;
import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.gui.util.Transitions;
@ -53,9 +55,9 @@ import java.util.Optional;
import static io.bitsquare.gui.util.FormBuilder.*;
public class DisputeSummaryPopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(DisputeSummaryPopup.class);
public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
private static final Logger log = LoggerFactory.getLogger(DisputeSummaryWindow.class);
private final BSFormatter formatter;
private final DisputeManager disputeManager;
private final WalletService walletService;
@ -83,7 +85,7 @@ public class DisputeSummaryPopup extends Popup {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public DisputeSummaryPopup(BSFormatter formatter, DisputeManager disputeManager, WalletService walletService, TradeWalletService tradeWalletService) {
public DisputeSummaryWindow(BSFormatter formatter, DisputeManager disputeManager, WalletService walletService, TradeWalletService tradeWalletService) {
this.formatter = formatter;
this.disputeManager = disputeManager;
this.walletService = walletService;
@ -97,15 +99,10 @@ public class DisputeSummaryPopup extends Popup {
width = 850;
createGridPane();
addContent();
PopupManager.queueForDisplay(this);
display();
}
public DisputeSummaryPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
public DisputeSummaryPopup onFinalizeDispute(Runnable finalizeDisputeHandler) {
public DisputeSummaryWindow onFinalizeDispute(Runnable finalizeDisputeHandler) {
this.finalizeDisputeHandlerOptional = Optional.of(finalizeDisputeHandler);
return this;
}

View File

@ -15,12 +15,14 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.btc.Restrictions;
import io.bitsquare.btc.WalletService;
import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.components.InputTextField;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Transitions;
import javafx.geometry.Insets;
@ -39,14 +41,13 @@ import org.spongycastle.crypto.params.KeyParameter;
import javax.inject.Inject;
import java.time.Duration;
import java.util.Optional;
import static io.bitsquare.gui.util.FormBuilder.*;
public class EmptyWalletPopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(EmptyWalletPopup.class);
public class EmptyWalletWindow extends Overlay<EmptyWalletWindow> {
private static final Logger log = LoggerFactory.getLogger(EmptyWalletWindow.class);
private final WalletService walletService;
private final WalletPasswordPopup walletPasswordPopup;
private final WalletPasswordWindow walletPasswordWindow;
private final BSFormatter formatter;
private Button emptyWalletButton;
private InputTextField addressInputTextField;
@ -58,9 +59,9 @@ public class EmptyWalletPopup extends Popup {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public EmptyWalletPopup(WalletService walletService, WalletPasswordPopup walletPasswordPopup, BSFormatter formatter) {
public EmptyWalletWindow(WalletService walletService, WalletPasswordWindow walletPasswordWindow, BSFormatter formatter) {
this.walletService = walletService;
this.walletPasswordPopup = walletPasswordPopup;
this.walletPasswordWindow = walletPasswordWindow;
this.formatter = formatter;
}
@ -74,12 +75,7 @@ public class EmptyWalletPopup extends Popup {
addSeparator();
addContent();
applyStyles();
PopupManager.queueForDisplay(this);
}
public EmptyWalletPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
display();
}
///////////////////////////////////////////////////////////////////////////////////////////
@ -106,7 +102,7 @@ public class EmptyWalletPopup extends Popup {
emptyWalletButton.setOnAction(e -> {
if (addressInputTextField.getText().length() > 0 && isBalanceSufficient) {
if (walletService.getWallet().isEncrypted()) {
walletPasswordPopup
walletPasswordWindow
.onClose(() -> blurAgain())
.onAesKey(aesKey -> doEmptyWallet(aesKey))
.show();

View File

@ -15,10 +15,12 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.app.BitsquareApp;
import io.bitsquare.gui.components.InputTextField;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import javafx.beans.value.ChangeListener;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
@ -26,9 +28,7 @@ import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import java.util.Optional;
public class EnterPrivKeyPopup extends Popup {
public class EnterPrivKeyWindow extends Overlay<EnterPrivKeyWindow> {
private Button unlockButton;
private InputTextField keyInputTextField;
private PrivKeyHandler privKeyHandler;
@ -48,7 +48,7 @@ public class EnterPrivKeyPopup extends Popup {
// Public API
///////////////////////////////////////////////////////////////////////////////////////////
public EnterPrivKeyPopup() {
public EnterPrivKeyWindow() {
if (keyInputTextField != null)
keyInputTextField.textProperty().addListener(changeListener);
}
@ -68,15 +68,10 @@ public class EnterPrivKeyPopup extends Popup {
addInputFields();
addButtons();
applyStyles();
PopupManager.queueForDisplay(this);
display();
}
public EnterPrivKeyPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
public EnterPrivKeyPopup onKey(PrivKeyHandler privKeyHandler) {
public EnterPrivKeyWindow onKey(PrivKeyHandler privKeyHandler) {
this.privKeyHandler = privKeyHandler;
return this;
}

View File

@ -15,7 +15,7 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import com.google.common.base.Joiner;
import io.bitsquare.common.crypto.KeyRing;
@ -25,6 +25,8 @@ import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.account.AccountView;
import io.bitsquare.gui.main.account.content.arbitratorselection.ArbitratorSelectionView;
import io.bitsquare.gui.main.account.settings.AccountSettingsView;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
@ -37,6 +39,7 @@ import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.image.ImageView;
import org.bitcoinj.core.Coin;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
@ -49,8 +52,8 @@ import java.util.function.Consumer;
import static io.bitsquare.gui.util.FormBuilder.*;
public class OfferDetailsPopup extends Popup {
protected static final Logger log = LoggerFactory.getLogger(OfferDetailsPopup.class);
public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
protected static final Logger log = LoggerFactory.getLogger(OfferDetailsWindow.class);
private final BSFormatter formatter;
protected final Preferences preferences;
@ -68,7 +71,7 @@ public class OfferDetailsPopup extends Popup {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public OfferDetailsPopup(BSFormatter formatter, Preferences preferences, User user, KeyRing keyRing, Navigation navigation) {
public OfferDetailsWindow(BSFormatter formatter, Preferences preferences, User user, KeyRing keyRing, Navigation navigation) {
this.formatter = formatter;
this.preferences = preferences;
this.user = user;
@ -76,7 +79,7 @@ public class OfferDetailsPopup extends Popup {
this.navigation = navigation;
}
public OfferDetailsPopup show(Offer offer, Coin tradeAmount) {
public void show(Offer offer, Coin tradeAmount) {
this.offer = offer;
this.tradeAmount = tradeAmount;
@ -85,39 +88,28 @@ public class OfferDetailsPopup extends Popup {
createGridPane();
addContent();
display();
return this;
}
public OfferDetailsPopup show(Offer offer) {
public void show(Offer offer) {
this.offer = offer;
rowIndex = -1;
width = 850;
createGridPane();
addContent();
display();
return this;
}
public OfferDetailsPopup dontShowAgainId(String dontShowAgainId) {
this.dontShowAgainId = dontShowAgainId;
return this;
}
public OfferDetailsPopup onPlaceOffer(Consumer<Offer> placeOfferHandler) {
public OfferDetailsWindow onPlaceOffer(Consumer<Offer> placeOfferHandler) {
this.placeOfferHandlerOptional = Optional.of(placeOfferHandler);
return this;
}
public OfferDetailsPopup onTakeOffer(Runnable takeOfferHandler) {
public OfferDetailsWindow onTakeOffer(Runnable takeOfferHandler) {
this.takeOfferHandlerOptional = Optional.of(takeOfferHandler);
return this;
}
public OfferDetailsPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
///////////////////////////////////////////////////////////////////////////////////////////
@ -241,15 +233,23 @@ public class OfferDetailsPopup extends Popup {
@NotNull
private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
boolean isBuyOffer = offer.getDirection() == Offer.Direction.BUY;
boolean isBuyerRole = isPlaceOffer ? isBuyOffer : !isBuyOffer;
String placeOffer = isBuyerRole ? "Confirm place offer for buying bitcoin" : "Confirm place offer for selling bitcoin";
String takeOffer = isBuyerRole ? "Confirm take offer for buying bitcoin" : "Confirm take offer for selling bitcoin";
Tuple2<Button, Button> tuple = add2ButtonsAfterGroup(gridPane,
++rowIndex,
isPlaceOffer ? "Confirm place offer" : "Confirm take offer",
isPlaceOffer ? placeOffer : takeOffer,
"Cancel");
Button placeButton = tuple.first;
boolean isBuyOffer = offer.getDirection() == Offer.Direction.BUY;
boolean isBuyStyle = isPlaceOffer ? isBuyOffer : !isBuyOffer;
placeButton.setId(isBuyStyle ? "buy-button" : "sell-button");
ImageView iconView = new ImageView();
iconView.setId(isBuyerRole ? "image-buy-white" : "image-sell-white");
placeButton.setGraphicTextGap(10);
placeButton.setGraphic(iconView);
placeButton.setId(isBuyerRole ? "buy-button" : "sell-button");
placeButton.setOnAction(e -> {
if (user.getAcceptedArbitrators().size() > 0) {

View File

@ -15,9 +15,10 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.common.handlers.ResultHandler;
import io.bitsquare.gui.main.overlays.Overlay;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
@ -25,12 +26,10 @@ import javafx.scene.layout.HBox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Optional;
import static io.bitsquare.gui.util.FormBuilder.addMultilineLabel;
public class OpenEmergencyTicketPopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(OpenEmergencyTicketPopup.class);
public class OpenEmergencyTicketWindow extends Overlay<OpenEmergencyTicketWindow> {
private static final Logger log = LoggerFactory.getLogger(OpenEmergencyTicketWindow.class);
private Button openTicketButton;
private ResultHandler openTicketHandler;
@ -39,7 +38,7 @@ public class OpenEmergencyTicketPopup extends Popup {
// Public API
///////////////////////////////////////////////////////////////////////////////////////////
public OpenEmergencyTicketPopup() {
public OpenEmergencyTicketWindow() {
}
public void show() {
@ -52,18 +51,14 @@ public class OpenEmergencyTicketPopup extends Popup {
addSeparator();
addContent();
applyStyles();
PopupManager.queueForDisplay(this);
display();
}
public OpenEmergencyTicketPopup onOpenTicket(ResultHandler openTicketHandler) {
public OpenEmergencyTicketWindow onOpenTicket(ResultHandler openTicketHandler) {
this.openTicketHandler = openTicketHandler;
return this;
}
public OpenEmergencyTicketPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Protected

View File

@ -15,9 +15,10 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.main.overlays.Overlay;
import javafx.collections.FXCollections;
import javafx.geometry.Insets;
import javafx.scene.control.ComboBox;
@ -36,8 +37,8 @@ import java.util.function.Consumer;
import static io.bitsquare.gui.util.FormBuilder.addLabelComboBox;
import static io.bitsquare.gui.util.FormBuilder.addMultilineLabel;
public class SelectDepositTxPopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(SelectDepositTxPopup.class);
public class SelectDepositTxWindow extends Overlay<SelectDepositTxWindow> {
private static final Logger log = LoggerFactory.getLogger(SelectDepositTxWindow.class);
private ComboBox<Transaction> transactionsComboBox;
private List<Transaction> transaction;
private Optional<Consumer<Transaction>> selectHandlerOptional;
@ -48,7 +49,7 @@ public class SelectDepositTxPopup extends Popup {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public SelectDepositTxPopup() {
public SelectDepositTxWindow() {
}
public void show() {
@ -62,15 +63,15 @@ public class SelectDepositTxPopup extends Popup {
addContent();
addCloseButton();
applyStyles();
PopupManager.queueForDisplay(this);
display();
}
public SelectDepositTxPopup onSelect(Consumer<Transaction> selectHandler) {
public SelectDepositTxWindow onSelect(Consumer<Transaction> selectHandler) {
this.selectHandlerOptional = Optional.of(selectHandler);
return this;
}
public SelectDepositTxPopup transactions(List<Transaction> transaction) {
public SelectDepositTxWindow transactions(List<Transaction> transaction) {
this.transaction = transaction;
return this;
}

View File

@ -15,12 +15,14 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.alert.Alert;
import io.bitsquare.app.BitsquareApp;
import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.components.InputTextField;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
@ -31,12 +33,10 @@ import javafx.scene.layout.HBox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Optional;
import static io.bitsquare.gui.util.FormBuilder.*;
public class SendAlertMessagePopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(SendAlertMessagePopup.class);
public class SendAlertMessageWindow extends Overlay<SendAlertMessageWindow> {
private static final Logger log = LoggerFactory.getLogger(SendAlertMessageWindow.class);
private Button sendButton;
private SendAlertMessageHandler sendAlertMessageHandler;
private RemoveAlertMessageHandler removeAlertMessageHandler;
@ -58,7 +58,7 @@ public class SendAlertMessagePopup extends Popup {
// Public API
///////////////////////////////////////////////////////////////////////////////////////////
public SendAlertMessagePopup() {
public SendAlertMessageWindow() {
}
public void show() {
@ -71,24 +71,19 @@ public class SendAlertMessagePopup extends Popup {
addSeparator();
addContent();
applyStyles();
PopupManager.queueForDisplay(this);
display();
}
public SendAlertMessagePopup onAddAlertMessage(SendAlertMessageHandler sendAlertMessageHandler) {
public SendAlertMessageWindow onAddAlertMessage(SendAlertMessageHandler sendAlertMessageHandler) {
this.sendAlertMessageHandler = sendAlertMessageHandler;
return this;
}
public SendAlertMessagePopup onRemoveAlertMessage(RemoveAlertMessageHandler removeAlertMessageHandler) {
public SendAlertMessageWindow onRemoveAlertMessage(RemoveAlertMessageHandler removeAlertMessageHandler) {
this.removeAlertMessageHandler = removeAlertMessageHandler;
return this;
}
public SendAlertMessagePopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Protected
///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -1,21 +1,23 @@
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import com.google.inject.Inject;
import io.bitsquare.app.BitsquareApp;
import io.bitsquare.btc.BitcoinNetwork;
import io.bitsquare.common.UserThread;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.user.Preferences;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.TimeUnit;
public class TacPopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(TacPopup.class);
public class TacWindow extends Overlay<TacWindow> {
private static final Logger log = LoggerFactory.getLogger(TacWindow.class);
private final Preferences preferences;
@Inject
public TacPopup(Preferences preferences) {
public TacWindow(Preferences preferences) {
this.preferences = preferences;
}
@ -60,4 +62,10 @@ public class TacPopup extends Popup {
super.show();
}
}
@Override
protected void onShow() {
display();
}
}

View File

@ -15,9 +15,10 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.arbitration.DisputeManager;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources;
@ -38,12 +39,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import java.util.Optional;
import static io.bitsquare.gui.util.FormBuilder.*;
public class TradeDetailsPopup extends Popup {
protected static final Logger log = LoggerFactory.getLogger(TradeDetailsPopup.class);
public class TradeDetailsWindow extends Overlay<TradeDetailsWindow> {
protected static final Logger log = LoggerFactory.getLogger(TradeDetailsWindow.class);
private final BSFormatter formatter;
private final DisputeManager disputeManager;
@ -58,13 +58,13 @@ public class TradeDetailsPopup extends Popup {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public TradeDetailsPopup(BSFormatter formatter, DisputeManager disputeManager, TradeManager tradeManager) {
public TradeDetailsWindow(BSFormatter formatter, DisputeManager disputeManager, TradeManager tradeManager) {
this.formatter = formatter;
this.disputeManager = disputeManager;
this.tradeManager = tradeManager;
}
public TradeDetailsPopup show(Trade trade) {
public void show(Trade trade) {
this.trade = trade;
rowIndex = -1;
@ -72,13 +72,8 @@ public class TradeDetailsPopup extends Popup {
createGridPane();
addContent();
display();
return this;
}
public TradeDetailsPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Protected

View File

@ -15,11 +15,13 @@
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
*/
package io.bitsquare.gui.main.popups;
package io.bitsquare.gui.main.overlays.windows;
import io.bitsquare.btc.WalletService;
import io.bitsquare.crypto.ScryptUtil;
import io.bitsquare.gui.components.PasswordTextField;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.Transitions;
import io.bitsquare.gui.util.validation.PasswordValidator;
import javafx.beans.value.ChangeListener;
@ -37,10 +39,9 @@ import org.spongycastle.crypto.params.KeyParameter;
import javax.inject.Inject;
import java.time.Duration;
import java.util.Optional;
public class WalletPasswordPopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(WalletPasswordPopup.class);
public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
private static final Logger log = LoggerFactory.getLogger(WalletPasswordWindow.class);
private final WalletService walletService;
private Button unlockButton;
private AesKeyHandler aesKeyHandler;
@ -68,7 +69,7 @@ public class WalletPasswordPopup extends Popup {
}
@Inject
public WalletPasswordPopup(WalletService walletService) {
public WalletPasswordWindow(WalletService walletService) {
this.walletService = walletService;
}
@ -87,15 +88,11 @@ public class WalletPasswordPopup extends Popup {
addInputFields();
addButtons();
applyStyles();
PopupManager.queueForDisplay(this);
display();
}
public WalletPasswordPopup onClose(Runnable closeHandler) {
this.closeHandlerOptional = Optional.of(closeHandler);
return this;
}
public WalletPasswordPopup onAesKey(AesKeyHandler aesKeyHandler) {
public WalletPasswordWindow onAesKey(AesKeyHandler aesKeyHandler) {
this.aesKeyHandler = aesKeyHandler;
return this;
}

View File

@ -20,8 +20,8 @@ package io.bitsquare.gui.main.portfolio.closedtrades;
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.trade.Tradable;
import io.bitsquare.trade.Trade;
@ -43,15 +43,15 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
TableColumn<ClosedTradableListItem, ClosedTradableListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, dateColumn, tradeIdColumn, stateColumn;
private final BSFormatter formatter;
private final OfferDetailsPopup offerDetailsPopup;
private final TradeDetailsPopup tradeDetailsPopup;
private final OfferDetailsWindow offerDetailsWindow;
private final TradeDetailsWindow tradeDetailsWindow;
@Inject
public ClosedTradesView(ClosedTradesViewModel model, BSFormatter formatter, OfferDetailsPopup offerDetailsPopup, TradeDetailsPopup tradeDetailsPopup) {
public ClosedTradesView(ClosedTradesViewModel model, BSFormatter formatter, OfferDetailsWindow offerDetailsWindow, TradeDetailsWindow tradeDetailsWindow) {
super(model);
this.formatter = formatter;
this.offerDetailsPopup = offerDetailsPopup;
this.tradeDetailsPopup = tradeDetailsPopup;
this.offerDetailsWindow = offerDetailsWindow;
this.tradeDetailsWindow = tradeDetailsWindow;
}
@Override
@ -94,9 +94,9 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
field.setOnAction(event -> {
Tradable tradable = item.getTradable();
if (tradable instanceof Trade)
tradeDetailsPopup.show((Trade) tradable);
tradeDetailsWindow.show((Trade) tradable);
else if (tradable instanceof OpenOffer)
offerDetailsPopup.show(tradable.getOffer());
offerDetailsWindow.show(tradable.getOffer());
});
field.setTooltip(new Tooltip("Open popup for details"));
setGraphic(field);

View File

@ -20,7 +20,7 @@ package io.bitsquare.gui.main.portfolio.failedtrades;
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.fxml.FXML;
import javafx.scene.control.*;
@ -37,12 +37,12 @@ public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTrades
@FXML
TableColumn<FailedTradesListItem, FailedTradesListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, dateColumn, tradeIdColumn, stateColumn;
private final TradeDetailsPopup tradeDetailsPopup;
private final TradeDetailsWindow tradeDetailsWindow;
@Inject
public FailedTradesView(FailedTradesViewModel model, TradeDetailsPopup tradeDetailsPopup) {
public FailedTradesView(FailedTradesViewModel model, TradeDetailsWindow tradeDetailsWindow) {
super(model);
this.tradeDetailsPopup = tradeDetailsPopup;
this.tradeDetailsWindow = tradeDetailsWindow;
}
@Override
@ -81,7 +81,7 @@ public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTrades
super.updateItem(item, empty);
if (item != null && !empty) {
field = new HyperlinkWithIcon(model.getTradeId(item), true);
field.setOnAction(event -> tradeDetailsPopup.show(item.getTrade()));
field.setOnAction(event -> tradeDetailsWindow.show(item.getTrade()));
field.setTooltip(new Tooltip("Open popup for details"));
setGraphic(field);
} else {

View File

@ -24,8 +24,8 @@ import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.funds.FundsView;
import io.bitsquare.gui.main.funds.withdrawal.WithdrawalView;
import io.bitsquare.gui.main.popups.OfferDetailsPopup;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow;
import io.bitsquare.trade.offer.OpenOffer;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.fxml.FXML;
@ -45,13 +45,13 @@ public class OpenOffersView extends ActivatableViewAndModel<VBox, OpenOffersView
TableColumn<OpenOfferListItem, OpenOfferListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, dateColumn, offerIdColumn, removeItemColumn;
private final Navigation navigation;
private final OfferDetailsPopup offerDetailsPopup;
private final OfferDetailsWindow offerDetailsWindow;
@Inject
public OpenOffersView(OpenOffersViewModel model, Navigation navigation, OfferDetailsPopup offerDetailsPopup) {
public OpenOffersView(OpenOffersViewModel model, Navigation navigation, OfferDetailsWindow offerDetailsWindow) {
super(model);
this.navigation = navigation;
this.offerDetailsPopup = offerDetailsPopup;
this.offerDetailsWindow = offerDetailsWindow;
}
@Override
@ -119,7 +119,7 @@ public class OpenOffersView extends ActivatableViewAndModel<VBox, OpenOffersView
if (item != null && !empty) {
field = new HyperlinkWithIcon(model.getTradeId(item), true);
field.setOnAction(event -> offerDetailsPopup.show(item.getOffer()));
field.setOnAction(event -> offerDetailsWindow.show(item.getOffer()));
field.setTooltip(new Tooltip("Open popup for details"));
setGraphic(field);
} else {

View File

@ -32,9 +32,9 @@ import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.common.model.ActivatableDataModel;
import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.disputes.DisputesView;
import io.bitsquare.gui.main.notifications.NotificationCenter;
import io.bitsquare.gui.main.popups.SelectDepositTxPopup;
import io.bitsquare.gui.main.popups.WalletPasswordPopup;
import io.bitsquare.gui.main.overlays.notifications.NotificationCenter;
import io.bitsquare.gui.main.overlays.windows.SelectDepositTxWindow;
import io.bitsquare.gui.main.overlays.windows.WalletPasswordWindow;
import io.bitsquare.payment.PaymentAccountContractData;
import io.bitsquare.trade.BuyerTrade;
import io.bitsquare.trade.SellerTrade;
@ -71,7 +71,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
private final KeyRing keyRing;
public final DisputeManager disputeManager;
public final Navigation navigation;
private final WalletPasswordPopup walletPasswordPopup;
private final WalletPasswordWindow walletPasswordWindow;
private final NotificationCenter notificationCenter;
final ObservableList<PendingTradesListItem> list = FXCollections.observableArrayList();
@ -91,7 +91,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
@Inject
public PendingTradesDataModel(TradeManager tradeManager, WalletService walletService, TradeWalletService tradeWalletService,
User user, KeyRing keyRing, DisputeManager disputeManager, Preferences preferences,
Navigation navigation, WalletPasswordPopup walletPasswordPopup, NotificationCenter notificationCenter) {
Navigation navigation, WalletPasswordWindow walletPasswordWindow, NotificationCenter notificationCenter) {
this.tradeManager = tradeManager;
this.walletService = walletService;
this.tradeWalletService = tradeWalletService;
@ -100,7 +100,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
this.disputeManager = disputeManager;
this.preferences = preferences;
this.navigation = navigation;
this.walletPasswordPopup = walletPasswordPopup;
this.walletPasswordWindow = walletPasswordWindow;
this.notificationCenter = notificationCenter;
tradesListChangeListener = change -> onListChanged();
@ -150,7 +150,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
public void onWithdrawRequest(String toAddress, ResultHandler resultHandler, FaultHandler faultHandler) {
checkNotNull(getTrade(), "trade must not be null");
if (walletService.getWallet().isEncrypted()) {
walletPasswordPopup.onAesKey(aesKey -> doWithdrawRequest(toAddress, aesKey, resultHandler, faultHandler)).show();
walletPasswordWindow.onAesKey(aesKey -> doWithdrawRequest(toAddress, aesKey, resultHandler, faultHandler)).show();
} else
doWithdrawRequest(toAddress, null, resultHandler, faultHandler);
}
@ -327,7 +327,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
if (candidates.size() == 1)
doOpenDispute(isSupportTicket, candidates.get(0));
else if (candidates.size() > 1)
new SelectDepositTxPopup().transactions(candidates)
new SelectDepositTxWindow().transactions(candidates)
.onSelect(transaction -> doOpenDispute(isSupportTicket, transaction))
.closeButtonText("Cancel")
.show();

View File

@ -22,8 +22,8 @@ import io.bitsquare.common.UserThread;
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.HyperlinkWithIcon;
import io.bitsquare.gui.main.popups.OpenEmergencyTicketPopup;
import io.bitsquare.gui.main.popups.TradeDetailsPopup;
import io.bitsquare.gui.main.overlays.windows.OpenEmergencyTicketWindow;
import io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow;
import io.bitsquare.gui.util.BSFormatter;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.event.EventHandler;
@ -49,7 +49,7 @@ import javax.inject.Inject;
@FxmlView
public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTradesViewModel> {
private final TradeDetailsPopup tradeDetailsPopup;
private final TradeDetailsWindow tradeDetailsWindow;
private final BSFormatter formatter;
@FXML
TableView<PendingTradesListItem> table;
@ -73,9 +73,9 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public PendingTradesView(PendingTradesViewModel model, TradeDetailsPopup tradeDetailsPopup, BSFormatter formatter) {
public PendingTradesView(PendingTradesViewModel model, TradeDetailsWindow tradeDetailsWindow, BSFormatter formatter) {
super(model);
this.tradeDetailsPopup = tradeDetailsPopup;
this.tradeDetailsWindow = tradeDetailsWindow;
this.formatter = formatter;
}
@ -96,7 +96,7 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
// we use a hidden emergency shortcut to open support ticket
keyEventEventHandler = event -> {
if (new KeyCodeCombination(KeyCode.O, KeyCombination.SHORTCUT_DOWN).match(event))
new OpenEmergencyTicketPopup().onOpenTicket(model.dataModel::onOpenSupportTicket).show();
new OpenEmergencyTicketWindow().onOpenTicket(model.dataModel::onOpenSupportTicket).show();
};
}
@ -218,7 +218,7 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
if (item != null && !empty) {
field = new HyperlinkWithIcon(item.getTrade().getShortId(), true);
field.setOnAction(event -> tradeDetailsPopup.show(item.getTrade()));
field.setOnAction(event -> tradeDetailsWindow.show(item.getTrade()));
field.setTooltip(new Tooltip("Open popup for details"));
setGraphic(field);
} else {

View File

@ -23,7 +23,7 @@ import io.bitsquare.common.Clock;
import io.bitsquare.gui.components.TitledGroupBg;
import io.bitsquare.gui.components.TxIdTextField;
import io.bitsquare.gui.components.paymentmethods.PaymentMethodForm;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesViewModel;
import io.bitsquare.gui.main.portfolio.pendingtrades.TradeSubView;
import io.bitsquare.gui.util.Layout;

View File

@ -22,7 +22,8 @@ import io.bitsquare.common.util.Tuple3;
import io.bitsquare.gui.components.TextFieldWithCopyIcon;
import io.bitsquare.gui.components.TitledGroupBg;
import io.bitsquare.gui.components.paymentmethods.*;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesViewModel;
import io.bitsquare.gui.main.portfolio.pendingtrades.steps.TradeStepView;
import io.bitsquare.gui.util.Layout;
@ -47,6 +48,7 @@ public class BuyerStep2View extends TradeStepView {
private Label statusLabel;
private ProgressIndicator statusProgressIndicator;
private Subscription tradeStatePropertySubscription;
private Overlay attentionRequiredPopup;
///////////////////////////////////////////////////////////////////////////////////////////
@ -65,8 +67,8 @@ public class BuyerStep2View extends TradeStepView {
tradeStatePropertySubscription = EasyBind.subscribe(trade.stateProperty(), state -> {
if (state.equals(Trade.State.DEPOSIT_CONFIRMED)) {
PaymentAccountContractData paymentAccountContractData = model.dataModel.getSellersPaymentAccountContractData();
String id = "StartPaymentPopup_" + trade.getId();
if (preferences.showAgain(id) && !BitsquareApp.DEV_MODE) {
String key = "StartPaymentPopup_" + trade.getId();
if (attentionRequiredPopup == null && !BitsquareApp.DEV_MODE) {
String message = "";
if (paymentAccountContractData instanceof BlockChainAccountContractData)
message = "Your trade has reached at least one blockchain confirmation.\n\n" +
@ -88,10 +90,11 @@ public class BuyerStep2View extends TradeStepView {
"DO NOT use any additional notice in the reference text like " +
"Bitcoin, Btc or Bitsquare.";
new Popup().headLine("Attention required for trade with ID " + trade.getShortId())
attentionRequiredPopup = new Popup().headLine("Attention required for trade with ID " + trade.getShortId())
.instruction(message)
.dontShowAgainId(id, preferences)
.show();
.dontShowAgainId(key, preferences);
attentionRequiredPopup.show();
}
}
});

View File

@ -25,7 +25,7 @@ import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.funds.FundsView;
import io.bitsquare.gui.main.funds.transactions.TransactionsView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesViewModel;
import io.bitsquare.gui.main.portfolio.pendingtrades.steps.TradeStepView;
import io.bitsquare.gui.util.BSFormatter;
@ -119,28 +119,26 @@ public class BuyerStep5View extends TradeStepView {
reviewWithdrawal();
});
String id = "tradeCompleteInfo";
String key = "tradeCompleteInfo";
if (BitsquareApp.DEV_MODE)
withdrawAddressTextField.setText("mi8k5f9L972VgDaT4LgjAhriC9hHEPL7EW");
else
new Popup().headLine("Trade completed")
.instruction("You can withdraw your funds now to your external Bitcoin wallet.")
.dontShowAgainId(id, preferences)
.dontShowAgainId(key, preferences)
.show();
}
private void doWithdrawal() {
model.dataModel.onWithdrawRequest(withdrawAddressTextField.getText(),
() -> {
String id = "tradeCompleteWithdrawCompletedInfo";
if (preferences.showAgain(id)) {
new Popup().headLine("Withdrawal completed").instruction("Your completed trades are stored under \"Portfolio/History\".\n" +
"You can review all your bitcoin transactions under \"Funds/Transactions\"")
.actionButtonText("Go to \"Transactions\"")
.onAction(() -> model.dataModel.navigation.navigateTo(MainView.class, FundsView.class, TransactionsView.class))
.dontShowAgainId(id, preferences)
.show();
}
String key = "tradeCompleteWithdrawCompletedInfo";
new Popup().headLine("Withdrawal completed").instruction("Your completed trades are stored under \"Portfolio/History\".\n" +
"You can review all your bitcoin transactions under \"Funds/Transactions\"")
.actionButtonText("Go to \"Transactions\"")
.onAction(() -> model.dataModel.navigation.navigateTo(MainView.class, FundsView.class, TransactionsView.class))
.dontShowAgainId(key, preferences)
.show();
withdrawButton.setDisable(true);
},
(errorMessage, throwable) -> {
@ -166,20 +164,24 @@ public class BuyerStep5View extends TradeStepView {
doWithdrawal();
} else {
BSFormatter formatter = model.formatter;
String id = "reviewWithdrawalAtTradeComplete";
new Popup().headLine("Confirm withdrawal request")
.confirmation("Sending: " + formatter.formatCoinWithCode(senderAmount) + "\n" +
"From address: " + fromAddresses + "\n" +
"To receiving address: " + toAddresses + ".\n" +
"Required transaction fee is: " + formatter.formatCoinWithCode(requiredFee) + "\n\n" +
"The recipient will receive: " + formatter.formatCoinWithCode(receiverAmount) + "\n\n" +
"Are you sure you want to withdraw that amount?")
.actionButtonText("Yes")
.onAction(this::doWithdrawal)
.closeButtonText("Cancel")
.onClose(() -> withdrawButton.setDisable(false))
.dontShowAgainId(id, preferences)
.show();
String key = "reviewWithdrawalAtTradeComplete";
if (preferences.showAgain(key)) {
new Popup().headLine("Confirm withdrawal request")
.confirmation("Sending: " + formatter.formatCoinWithCode(senderAmount) + "\n" +
"From address: " + fromAddresses + "\n" +
"To receiving address: " + toAddresses + ".\n" +
"Required transaction fee is: " + formatter.formatCoinWithCode(requiredFee) + "\n\n" +
"The recipient will receive: " + formatter.formatCoinWithCode(receiverAmount) + "\n\n" +
"Are you sure you want to withdraw that amount?")
.actionButtonText("Yes")
.onAction(this::doWithdrawal)
.closeButtonText("Cancel")
.onClose(() -> withdrawButton.setDisable(false))
.dontShowAgainId(key, preferences)
.show();
} else {
doWithdrawal();
}
}
} catch (AddressFormatException e) {

View File

@ -21,7 +21,8 @@ import io.bitsquare.app.BitsquareApp;
import io.bitsquare.common.util.Tuple3;
import io.bitsquare.gui.components.TextFieldWithCopyIcon;
import io.bitsquare.gui.components.TitledGroupBg;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.Overlay;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesViewModel;
import io.bitsquare.gui.main.portfolio.pendingtrades.steps.TradeStepView;
import io.bitsquare.gui.util.Layout;
@ -48,6 +49,7 @@ public class SellerStep3View extends TradeStepView {
private Label statusLabel;
private ProgressIndicator statusProgressIndicator;
private Subscription tradeStatePropertySubscription;
private Overlay attentionRequiredPopup;
///////////////////////////////////////////////////////////////////////////////////////////
@ -56,7 +58,6 @@ public class SellerStep3View extends TradeStepView {
public SellerStep3View(PendingTradesViewModel model) {
super(model);
}
@Override
@ -66,8 +67,8 @@ public class SellerStep3View extends TradeStepView {
tradeStatePropertySubscription = EasyBind.subscribe(trade.stateProperty(), state -> {
if (state.equals(Trade.State.FIAT_PAYMENT_STARTED_MSG_RECEIVED)) {
PaymentAccountContractData paymentAccountContractData = model.dataModel.getSellersPaymentAccountContractData();
String id = "ConfirmPaymentPopup_" + trade.getId();
if (preferences.showAgain(id) && !BitsquareApp.DEV_MODE) {
String key = "ConfirmPaymentPopup_" + trade.getId();
if (attentionRequiredPopup == null && !BitsquareApp.DEV_MODE) {
String message;
String tradeAmountWithCode = model.formatter.formatFiatWithCode(trade.getTradeVolume());
String currencyName = CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode());
@ -87,10 +88,11 @@ public class SellerStep3View extends TradeStepView {
tradeAmountWithCode + " from the bitcoin buyer.\n\n" +
"The reference text of the transaction is: \"" + trade.getShortId() + "\"";
}
new Popup().headLine("Attention required for trade with ID " + trade.getShortId())
attentionRequiredPopup = new Popup().headLine("Attention required for trade with ID " + trade.getShortId())
.instruction(message)
.dontShowAgainId(id, preferences)
.show();
.dontShowAgainId(key, preferences);
attentionRequiredPopup.show();
}
}

View File

@ -24,7 +24,7 @@ import io.bitsquare.common.Clock;
import io.bitsquare.gui.common.model.Activatable;
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.p2p.P2PService;
import io.bitsquare.p2p.network.Statistic;

View File

@ -23,7 +23,7 @@ import io.bitsquare.gui.common.model.Activatable;
import io.bitsquare.gui.common.view.ActivatableViewAndModel;
import io.bitsquare.gui.common.view.FxmlView;
import io.bitsquare.gui.components.TitledGroupBg;
import io.bitsquare.gui.main.popups.Popup;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.*;
@ -67,6 +67,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
private ComboBox<FiatCurrency> fiatCurrenciesComboBox;
private ListView<CryptoCurrency> cryptoCurrenciesListView;
private ComboBox<CryptoCurrency> cryptoCurrenciesComboBox;
private Button resetDontShowAgainButton;
// private ListChangeListener<TradeCurrency> displayCurrenciesListChangeListener;
final ObservableList<String> btcDenominations = FXCollections.observableArrayList(Preferences.getBtcDenominations());
final ObservableList<BlockChainExplorer> blockExplorers;
@ -77,7 +78,6 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
public final ObservableList<CryptoCurrency> cryptoCurrencies;
public final ObservableList<CryptoCurrency> allCryptoCurrencies;
public final ObservableList<TradeCurrency> tradeCurrencies;
private Button resetDontShowAgainButton;
///////////////////////////////////////////////////////////////////////////////////////////
@ -293,12 +293,8 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
TitledGroupBg titledGroupBg = addTitledGroupBg(root, ++gridRow, 4, "Display options", Layout.GROUP_DISTANCE);
GridPane.setColumnSpan(titledGroupBg, 4);
useAnimationsCheckBox = addLabelCheckBox(root, gridRow, "Use animations:", "", Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
Tuple2<Label, Button> labelButton = addLabelButton(root, gridRow, "Reset all don't show again flags:", "", Layout.FIRST_ROW_AND_GROUP_DISTANCE);
resetDontShowAgainButton = labelButton.second;
GridPane.setColumnIndex(labelButton.first, 2);
GridPane.setColumnIndex(resetDontShowAgainButton, 3);
useEffectsCheckBox = addLabelCheckBox(root, ++gridRow, "Use effects:", "").second;
resetDontShowAgainButton = addLabelButton(root, ++gridRow, "Reset all don't show again flags:", "Reset", 0).second;
}
///////////////////////////////////////////////////////////////////////////////////////////
@ -429,6 +425,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
useAnimationsCheckBox.setOnAction(null);
useEffectsCheckBox.setOnAction(null);
autoSelectArbitratorsCheckBox.setOnAction(null);
resetDontShowAgainButton.setOnAction(null);
}