From e496637b4b7942f438cb108408790f2e37891dab Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Wed, 2 Sep 2020 22:44:49 -0500 Subject: [PATCH] Remove NewTradeProtocolLaunchWindow and badges for dao and account Those have been added for 1.2 and are not new anymore. --- .../main/java/bisq/desktop/main/MainView.java | 9 +- .../java/bisq/desktop/main/MainViewModel.java | 14 -- .../windows/NewTradeProtocolLaunchWindow.java | 191 ------------------ 3 files changed, 1 insertion(+), 213 deletions(-) delete mode 100644 desktop/src/main/java/bisq/desktop/main/overlays/windows/NewTradeProtocolLaunchWindow.java diff --git a/desktop/src/main/java/bisq/desktop/main/MainView.java b/desktop/src/main/java/bisq/desktop/main/MainView.java index abbe3b641af..0b76f0d672b 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainView.java +++ b/desktop/src/main/java/bisq/desktop/main/MainView.java @@ -89,7 +89,6 @@ import javafx.beans.binding.ObjectBinding; import javafx.beans.property.BooleanProperty; -import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.beans.value.ChangeListener; @@ -191,10 +190,6 @@ protected void initialize() { JFXBadge portfolioButtonWithBadge = new JFXBadge(portfolioButton); JFXBadge supportButtonWithBadge = new JFXBadge(supportButton); - JFXBadge daoButtonWithBadge = new JFXBadge(daoButton); - daoButtonWithBadge.getStyleClass().add("new"); - JFXBadge accountButtonWithBadge = new JFXBadge(accountButton); - accountButtonWithBadge.getStyleClass().add("new"); Locale locale = GlobalSettings.getLocale(); DecimalFormat currencyFormat = (DecimalFormat) NumberFormat.getNumberInstance(locale); @@ -326,7 +321,7 @@ protected Tooltip computeValue() { HBox.setHgrow(primaryNav, Priority.SOMETIMES); HBox secondaryNav = new HBox(supportButtonWithBadge, getNavigationSpacer(), settingsButton, - getNavigationSpacer(), accountButtonWithBadge, getNavigationSpacer(), daoButtonWithBadge); + getNavigationSpacer(), getNavigationSpacer()); secondaryNav.getStyleClass().add("nav-secondary"); HBox.setHgrow(secondaryNav, Priority.SOMETIMES); @@ -369,8 +364,6 @@ protected Tooltip computeValue() { setupBadge(portfolioButtonWithBadge, model.getNumPendingTrades(), model.getShowPendingTradesNotification()); setupBadge(supportButtonWithBadge, model.getNumOpenSupportTickets(), model.getShowOpenSupportTicketsNotification()); - setupBadge(daoButtonWithBadge, new SimpleStringProperty(Res.get("shared.new")), model.getShowDaoUpdatesNotification()); - setupBadge(accountButtonWithBadge, new SimpleStringProperty(Res.get("shared.new")), model.getShowAccountUpdatesNotification()); navigation.addListener(viewPath -> { if (viewPath.size() != 2 || viewPath.indexOf(MainView.class) != 0) diff --git a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java index cdd3cbe2bfc..dce9a56ab6f 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java @@ -25,7 +25,6 @@ import bisq.desktop.main.overlays.notifications.NotificationCenter; import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.windows.DisplayAlertMessageWindow; -import bisq.desktop.main.overlays.windows.NewTradeProtocolLaunchWindow; import bisq.desktop.main.overlays.windows.TacWindow; import bisq.desktop.main.overlays.windows.TorNetworkSettingsWindow; import bisq.desktop.main.overlays.windows.UpdateRevolutAccountWindow; @@ -276,7 +275,6 @@ void onSplashScreenRemoved() { // in MainView showAppScreen handler notificationCenter.onAllServicesAndViewsInitialized(); - maybeAddNewTradeProtocolLaunchWindowToQueue(); maybeShowPopupsFromQueue(); } @@ -681,18 +679,6 @@ public BooleanProperty getShowAccountUpdatesNotification() { return accountPresentation.getShowAccountUpdatesNotification(); } - private void maybeAddNewTradeProtocolLaunchWindowToQueue() { - String newTradeProtocolWithAccountSigningLaunchPopupKey = "newTradeProtocolWithAccountSigningLaunchPopup"; - if (DontShowAgainLookup.showAgain(newTradeProtocolWithAccountSigningLaunchPopupKey)) { - NewTradeProtocolLaunchWindow newTradeProtocolLaunchWindow = new NewTradeProtocolLaunchWindow() - .headLine(Res.get("popup.news.launch.headline")); - newTradeProtocolLaunchWindow.setDisplayOrderPriority(1); - popupQueue.add(newTradeProtocolLaunchWindow); - - DontShowAgainLookup.dontShowAgain(newTradeProtocolWithAccountSigningLaunchPopupKey, true); - } - } - private void maybeShowPopupsFromQueue() { if (!popupQueue.isEmpty()) { Overlay overlay = popupQueue.poll(); diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/NewTradeProtocolLaunchWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/NewTradeProtocolLaunchWindow.java deleted file mode 100644 index 646791a6879..00000000000 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/NewTradeProtocolLaunchWindow.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * This file is part of Bisq. - * - * Bisq 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. - * - * Bisq 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 Bisq. If not, see . - */ - -package bisq.desktop.main.overlays.windows; - -import bisq.desktop.app.BisqAppMain; -import bisq.desktop.components.AutoTooltipLabel; -import bisq.desktop.components.ExternalHyperlink; -import bisq.desktop.components.HyperlinkWithIcon; -import bisq.desktop.main.overlays.Overlay; -import bisq.desktop.util.FormBuilder; -import bisq.desktop.util.GUIUtil; - -import bisq.core.locale.Res; -import bisq.core.user.DontShowAgainLookup; - -import de.jensd.fx.fontawesome.AwesomeIcon; -import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; - -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.control.Separator; -import javafx.scene.image.ImageView; -import javafx.scene.layout.GridPane; -import javafx.scene.layout.HBox; -import javafx.scene.layout.Priority; -import javafx.scene.layout.VBox; -import javafx.scene.text.TextAlignment; - -import javafx.geometry.HPos; -import javafx.geometry.Insets; -import javafx.geometry.Orientation; -import javafx.geometry.Pos; - -import lombok.extern.slf4j.Slf4j; - -import org.jetbrains.annotations.NotNull; - -import static bisq.desktop.util.FormBuilder.addLabel; - -@Slf4j -public class NewTradeProtocolLaunchWindow extends Overlay { - - - /////////////////////////////////////////////////////////////////////////////////////////// - // Public API - /////////////////////////////////////////////////////////////////////////////////////////// - - @Override - public void show() { - width = 680; - hideCloseButton(); - super.show(); - } - - - /////////////////////////////////////////////////////////////////////////////////////////// - // Protected - /////////////////////////////////////////////////////////////////////////////////////////// - - @Override - protected void createGridPane() { - super.createGridPane(); - gridPane.setVgap(10); - gridPane.getColumnConstraints().get(0).setHalignment(HPos.CENTER); - gridPane.setPadding(new Insets(84)); - } - - @Override - protected void addHeadLine() { - - Label versionNumber = new AutoTooltipLabel(BisqAppMain.DEFAULT_APP_NAME + " v1.2"); - versionNumber.getStyleClass().add("news-version"); - HBox.setHgrow(versionNumber, Priority.ALWAYS); - versionNumber.setMaxWidth(Double.MAX_VALUE); - - Button closeButton = FormBuilder.getIconButton(MaterialDesignIcon.CLOSE, - "close-icon", "1.231em"); - closeButton.setOnAction(event -> hide()); - HBox.setHgrow(closeButton, Priority.NEVER); - - HBox header = new HBox(versionNumber, closeButton); - - GridPane.setRowIndex(header, ++rowIndex); - GridPane.setColumnSpan(header, 2); - gridPane.getChildren().add(header); - - headLineLabel = addLabel(gridPane, ++rowIndex, headLine); - headLineLabel.getStyleClass().add("popup-headline-information"); - headlineIcon = new Label(); - headlineIcon.getStyleClass().add("popup-icon-information"); - headlineIcon.setManaged(true); - headlineIcon.setVisible(true); - FormBuilder.getIconForLabel(AwesomeIcon.INFO_SIGN, headlineIcon, "1em"); - - headLineLabel.setGraphic(headlineIcon); - GridPane.setHalignment(headLineLabel, HPos.LEFT); - GridPane.setColumnSpan(headLineLabel, 2); - } - - @Override - protected void addMessage() { - createContent(); - } - - @Override - protected void onShow() { - display(); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Private - /////////////////////////////////////////////////////////////////////////////////////////// - - private void createContent() { - HBox content = new HBox(); - content.setMinWidth(680); - content.setAlignment(Pos.TOP_LEFT); - content.setSpacing(40); - - VBox accountSigning = getFeatureBox(Res.get("popup.news.launch.accountSigning.headline"), - Res.get("popup.news.launch.accountSigning.description"), - "image-account-signing-screenshot", - "https://docs.bisq.network/payment-methods#account-signing"); - - VBox newTradeProtocol = getFeatureBox(Res.get("popup.news.launch.ntp.headline"), - Res.get("popup.news.launch.ntp.description"), - "image-new-trade-protocol-screenshot", - "https://docs.bisq.network/trading-rules"); - - content.getChildren().addAll(accountSigning, new Separator(Orientation.VERTICAL), newTradeProtocol); - - GridPane.setMargin(content, new Insets(10, 0, 0, 0)); - GridPane.setRowIndex(content, ++rowIndex); - GridPane.setColumnSpan(content, 2); - GridPane.setHgrow(content, Priority.ALWAYS); - gridPane.getChildren().add(content); - } - - @NotNull - private VBox getFeatureBox(String title, String description, String imageId, String url) { - Label featureTitle = new Label(title); - featureTitle.setTextAlignment(TextAlignment.LEFT); - featureTitle.getStyleClass().add("news-feature-headline"); - - ImageView sectionScreenshot = new ImageView(); - sectionScreenshot.setId(imageId); - - HBox imageContainer = new HBox(sectionScreenshot); - imageContainer.getStyleClass().add("news-feature-image"); - - Label featureDescription = new Label(description); - featureDescription.setTextAlignment(TextAlignment.LEFT); - featureDescription.getStyleClass().add("news-feature-description"); - featureDescription.setWrapText(true); - - HyperlinkWithIcon learnMore = new ExternalHyperlink(Res.get("shared.learnMore"), "highlight"); - learnMore.setOnAction(event -> { - - if (DontShowAgainLookup.showAgain(GUIUtil.OPEN_WEB_PAGE_KEY)) { - hide(); - GUIUtil.openWebPage(url, true, () -> { - this.rowIndex = -1; - this.show(); - }); - } else { - GUIUtil.openWebPage(url); - } - }); - - VBox vBox = new VBox(featureTitle, imageContainer, featureDescription, learnMore); - vBox.setAlignment(Pos.CENTER_LEFT); - vBox.setSpacing(20); - vBox.setMaxWidth(300); - return vBox; - } -}