From 389aeb9b951e4c272fec994b4f8e568fc9a04769 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Fri, 22 Apr 2022 09:52:55 +0200 Subject: [PATCH] Switch to open offers after creating a new offer --- .../src/main/resources/i18n/displayStrings.properties | 2 -- .../main/java/bisq/desktop/main/offer/OfferView.java | 11 +++++++++++ .../desktop/main/offer/bisq_v1/MutableOfferView.java | 10 +--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index cc5e2932148..a5b56056d98 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -433,7 +433,6 @@ offerbook.info.sellAboveMarketPrice=You will get {0} more than the current marke offerbook.info.buyBelowMarketPrice=You will pay {0} less than the current market price (updated every minute). offerbook.info.buyAtFixedPrice=You will buy at this fixed price. offerbook.info.sellAtFixedPrice=You will sell at this fixed price. -offerbook.info.noArbitrationInUserLanguage=In case of a dispute, please note that arbitration for this offer will be handled in {0}. Language is currently set to {1}. offerbook.info.roundedFiatVolume=The amount was rounded to increase the privacy of your trade. offerbook.info.accountCreated.headline=Congratulations offerbook.info.accountCreated.message=You''ve just successfully created a BSQ payment account.\n\ @@ -585,7 +584,6 @@ takeOffer.takeOfferFundWalletInfo.headline=Fund your trade takeOffer.takeOfferFundWalletInfo.tradeAmount=- Trade amount: {0} \n takeOffer.takeOfferFundWalletInfo.msg=You need to deposit {0} to take this offer.\n\nThe amount is the sum of:\n{1}- Your security deposit: {2}\n- Trading fee: {3}\n- Total mining fees: {4}\n\nYou can choose between two options when funding your trade:\n- Use your Bisq wallet (convenient, but transactions may be linkable) OR\n- Transfer from an external wallet (potentially more private)\n\nYou will see all funding options and details after closing this popup. takeOffer.alreadyPaidInFunds=If you have already paid in funds you can withdraw it in the \"Funds/Send funds\" screen. -takeOffer.paymentInfo=Payment info takeOffer.setAmountPrice=Set amount takeOffer.alreadyFunded.askCancel=You have already funded that offer.\nIf you cancel now, your funds will be moved to your local Bisq wallet and are available for withdrawal in the \"Funds/Send funds\" screen.\nAre you sure you want to cancel? takeOffer.failed.offerNotAvailable=Take offer request failed because the offer is not available anymore. Maybe another trader has taken the offer in the meantime. diff --git a/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java index 74398890213..20a976928a9 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java @@ -33,6 +33,8 @@ import bisq.desktop.main.offer.offerbook.OtherOfferBookView; import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookView; import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookViewModel; +import bisq.desktop.main.portfolio.PortfolioView; +import bisq.desktop.main.portfolio.openoffer.OpenOffersView; import bisq.desktop.util.GUIUtil; import bisq.core.locale.CurrencyUtil; @@ -48,12 +50,15 @@ import bisq.network.p2p.P2PService; +import bisq.common.UserThread; + import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.beans.value.ChangeListener; import java.util.Optional; +import java.util.concurrent.TimeUnit; import org.jetbrains.annotations.NotNull; @@ -309,7 +314,13 @@ private void loadCreateViewClass(OfferBookView offerBookView, ((ClosableView) view).setCloseHandler(() -> { offerBookView.enableCreateOfferButton(); ((SelectableView) view).onTabSelected(false); + //reset tab navigation.navigateTo(MainView.class, this.getClass(), viewClass); + //go to open offers + UserThread.runAfter(() -> + navigation.navigateTo(MainView.class, PortfolioView.class, + OpenOffersView.class), + 100, TimeUnit.MILLISECONDS); }); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/MutableOfferView.java index ce6cd07d069..220942115f7 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/MutableOfferView.java @@ -43,8 +43,6 @@ import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.windows.OfferDetailsWindow; import bisq.desktop.main.overlays.windows.QRCodeWindow; -import bisq.desktop.main.portfolio.PortfolioView; -import bisq.desktop.main.portfolio.openoffer.OpenOffersView; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; @@ -812,13 +810,7 @@ private void createListeners() { .feedback(Res.get("createOffer.success.info")) .dontShowAgainId(key) .actionButtonTextWithGoTo("navigation.portfolio.myOpenOffers") - .onAction(() -> { - UserThread.runAfter(() -> - navigation.navigateTo(MainView.class, PortfolioView.class, - OpenOffersView.class), - 100, TimeUnit.MILLISECONDS); - close(); - }) + .onAction(this::close) .onClose(this::close) .show(), 1);