From 7dc5404b843365a4449575026efc007a99b47ee7 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 30 Jan 2019 08:54:54 +0100 Subject: [PATCH 1/5] Enable DAO menu, show dao info text and button --- .../resources/i18n/displayStrings.properties | 8 ++++++- .../main/java/bisq/desktop/main/MainView.java | 22 ++----------------- .../dao/wallet/receive/BsqReceiveView.java | 12 ++++++++++ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 4c3c27d9dcc..a82ca487baa 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1634,8 +1634,14 @@ dao.wallet.dashboard.burntTx=No. of all fee payments transactions dao.wallet.dashboard.price=Latest BSQ/BTC trade price (in Bisq) dao.wallet.dashboard.marketCap=Market capitalisation (based on trade price) -dao.wallet.receive.fundYourWallet=Fund your BSQ wallet +dao.wallet.receive.fundYourWallet=Your BSQ receive address dao.wallet.receive.bsqAddress=BSQ wallet address +dao.wallet.receive.daoInfo=The Bisq DAO is not enabled yet.\n\n\ + If you have contributed to Bisq please use the \ + BSQ address above and send it to the Bisq founder so your BSQ address gets added to the genesis distribution.\n\n\ + Please find more information about the Bisq DAO and the process how to get added to the genesis distribution \ + at: https://bisq.network/dao +dao.wallet.receive.daoInfo.button=Learn more about the Bisq DAO dao.wallet.send.sendFunds=Send funds dao.wallet.send.sendBtcFunds=Send non-BSQ funds (BTC) diff --git a/desktop/src/main/java/bisq/desktop/main/MainView.java b/desktop/src/main/java/bisq/desktop/main/MainView.java index a674acd9f80..82f30d010ee 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainView.java +++ b/desktop/src/main/java/bisq/desktop/main/MainView.java @@ -39,7 +39,6 @@ import bisq.desktop.main.settings.SettingsView; import bisq.desktop.util.Transitions; -import bisq.core.app.BisqEnvironment; import bisq.core.exceptions.BisqException; import bisq.core.locale.Res; import bisq.core.util.BSFormatter; @@ -184,27 +183,10 @@ protected void initialize() { JFXBadge portfolioButtonWithBadge = new JFXBadge(portfolioButton); JFXBadge disputesButtonWithBadge = new JFXBadge(disputesButton); - final Region daoButtonSpacer = getNavigationSpacer(); - - if (!BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) { - daoButton.setVisible(false); - daoButton.setManaged(false); - daoButtonSpacer.setVisible(false); - daoButtonSpacer.setManaged(false); - } - root.sceneProperty().addListener((observable, oldValue, newValue) -> { if (newValue != null) { newValue.addEventHandler(KeyEvent.KEY_RELEASED, keyEvent -> { - // TODO can be removed once DAO is released - if (Utilities.isAltOrCtrlPressed(KeyCode.D, keyEvent)) { - if (BisqEnvironment.getBaseCurrencyNetwork().isBitcoin()) { - daoButton.setVisible(true); - daoButton.setManaged(true); - daoButtonSpacer.setVisible(true); - daoButtonSpacer.setManaged(true); - } - } else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT1, keyEvent)) { + if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT1, keyEvent)) { marketButton.fire(); } else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT2, keyEvent)) { buyButton.fire(); @@ -264,7 +246,7 @@ protected void initialize() { HBox.setHgrow(primaryNav, Priority.SOMETIMES); HBox secondaryNav = new HBox(disputesButtonWithBadge, getNavigationSpacer(), settingsButton, - getNavigationSpacer(), accountButton, daoButtonSpacer, daoButton); + getNavigationSpacer(), accountButton, getNavigationSpacer(), daoButton); secondaryNav.getStyleClass().add("nav-secondary"); HBox.setHgrow(secondaryNav, Priority.SOMETIMES); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java index 148975bddd2..0618fa1b742 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java @@ -22,8 +22,11 @@ import bisq.desktop.components.BsqAddressTextField; import bisq.desktop.components.TitledGroupBg; import bisq.desktop.main.dao.wallet.BsqBalanceUtil; +import bisq.desktop.util.FormBuilder; +import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; +import bisq.core.app.BisqEnvironment; import bisq.core.btc.wallet.BsqWalletService; import bisq.core.locale.Res; import bisq.core.util.BsqFormatter; @@ -32,6 +35,7 @@ import javax.inject.Inject; +import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; @@ -71,6 +75,14 @@ public void initialize() { Layout.FIRST_ROW_AND_GROUP_DISTANCE); addressTextField = tuple.second; GridPane.setColumnSpan(tuple.third, 3); + + if (!BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) { + FormBuilder.addMultilineLabel(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo")); + Button daoInfoButton = FormBuilder.addButton(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo.button")); + daoInfoButton.setOnAction(e -> { + GUIUtil.openWebPage("https://bisq.network/dao"); + }); + } } @Override From 36c286de5d8b599e5edfb9882e5a659cf2c2a9ab Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 30 Jan 2019 09:02:27 +0100 Subject: [PATCH 2/5] Add distance to button --- .../bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java index 0618fa1b742..152061e822c 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java @@ -78,7 +78,7 @@ public void initialize() { if (!BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) { FormBuilder.addMultilineLabel(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo")); - Button daoInfoButton = FormBuilder.addButton(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo.button")); + Button daoInfoButton = FormBuilder.addButton(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo.button"), 10); daoInfoButton.setOnAction(e -> { GUIUtil.openWebPage("https://bisq.network/dao"); }); From 6dece782dede85a36a2fa9b81c3f3742384467e6 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 30 Jan 2019 09:02:48 +0100 Subject: [PATCH 3/5] Remove line break --- core/src/main/resources/i18n/displayStrings.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index a82ca487baa..e9c31f15636 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1638,7 +1638,7 @@ dao.wallet.receive.fundYourWallet=Your BSQ receive address dao.wallet.receive.bsqAddress=BSQ wallet address dao.wallet.receive.daoInfo=The Bisq DAO is not enabled yet.\n\n\ If you have contributed to Bisq please use the \ - BSQ address above and send it to the Bisq founder so your BSQ address gets added to the genesis distribution.\n\n\ + BSQ address above and send it to the Bisq founder so your BSQ address gets added to the genesis distribution.\n\ Please find more information about the Bisq DAO and the process how to get added to the genesis distribution \ at: https://bisq.network/dao dao.wallet.receive.daoInfo.button=Learn more about the Bisq DAO From e8d0ed15045a385825aca59e3871887b550f6113 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 30 Jan 2019 11:08:34 +0100 Subject: [PATCH 4/5] Add more DAO info text and buttons. Remove other tabs --- .../resources/i18n/displayStrings.properties | 15 +++-- .../java/bisq/desktop/main/dao/DaoView.java | 11 ++-- .../dao/wallet/receive/BsqReceiveView.java | 58 ++++++++++++++----- 3 files changed, 57 insertions(+), 27 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index e9c31f15636..38e17f6d810 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1636,12 +1636,17 @@ dao.wallet.dashboard.marketCap=Market capitalisation (based on trade price) dao.wallet.receive.fundYourWallet=Your BSQ receive address dao.wallet.receive.bsqAddress=BSQ wallet address -dao.wallet.receive.daoInfo=The Bisq DAO is not enabled yet.\n\n\ - If you have contributed to Bisq please use the \ - BSQ address above and send it to the Bisq founder so your BSQ address gets added to the genesis distribution.\n\ - Please find more information about the Bisq DAO and the process how to get added to the genesis distribution \ - at: https://bisq.network/dao + +dao.wallet.receive.dao.headline=The Bisq DAO +dao.wallet.receive.daoInfo=Just as the Bisq exchange is decentralized and censorship-resistant, so is its governance \ + model — and the Bisq DAO and BSQ token are the tools that make it possible. dao.wallet.receive.daoInfo.button=Learn more about the Bisq DAO +dao.wallet.receive.daoTestnetInfo=The mainnet Bisq DAO is not launched yet but you can learn about the Bisq DAO by \ + running it on testnet. +dao.wallet.receive.daoTestnetInfo.button=How to run the Bisq DAO on testnet +dao.wallet.receive.daoContributorInfo=If you have contributed to Bisq please use the \ + BSQ address below and make a request for taking part of the BSQ genesis distribution. +dao.wallet.receive.daoContributorInfo.button=How to be part of the BSQ genesis distribution dao.wallet.send.sendFunds=Send funds dao.wallet.send.sendBtcFunds=Send non-BSQ funds (BTC) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/DaoView.java b/desktop/src/main/java/bisq/desktop/main/dao/DaoView.java index 40b44d471a4..dc7669480ee 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/DaoView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/DaoView.java @@ -34,8 +34,6 @@ import bisq.core.app.BisqEnvironment; import bisq.core.locale.Res; -import bisq.common.app.DevEnv; - import javax.inject.Inject; import javafx.fxml.FXML; @@ -78,12 +76,13 @@ public void initialize() { bondingTab.setClosable(false); burnBsqTab.setClosable(false); - root.getTabs().addAll(bsqWalletTab, proposalsTab, bondingTab, burnBsqTab); - - if (!BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq() || !DevEnv.isDaoPhase2Activated()) { - bondingTab.setDisable(true); + if (!BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) { proposalsTab.setDisable(true); + bondingTab.setDisable(true); burnBsqTab.setDisable(true); + root.getTabs().addAll(bsqWalletTab); + } else { + root.getTabs().addAll(bsqWalletTab, proposalsTab, bondingTab, burnBsqTab); } navigationListener = viewPath -> { diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java index 152061e822c..e1e7c82bd24 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java @@ -65,36 +65,62 @@ private BsqReceiveView(BsqWalletService bsqWalletService, BsqFormatter bsqFormat @Override public void initialize() { - gridRow = bsqBalanceUtil.addGroup(root, gridRow); - - TitledGroupBg titledGroupBg = addTitledGroupBg(root, ++gridRow, 1, - Res.get("dao.wallet.receive.fundYourWallet"), Layout.GROUP_DISTANCE); - GridPane.setColumnSpan(titledGroupBg, 3); - Tuple3 tuple = addLabelBsqAddressTextField(root, gridRow, - Res.get("dao.wallet.receive.bsqAddress"), - Layout.FIRST_ROW_AND_GROUP_DISTANCE); - addressTextField = tuple.second; - GridPane.setColumnSpan(tuple.third, 3); - - if (!BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) { - FormBuilder.addMultilineLabel(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo")); - Button daoInfoButton = FormBuilder.addButton(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo.button"), 10); + if (BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) { + gridRow = bsqBalanceUtil.addGroup(root, gridRow); + + TitledGroupBg titledGroupBg = addTitledGroupBg(root, ++gridRow, 1, + Res.get("dao.wallet.receive.fundYourWallet"), Layout.GROUP_DISTANCE); + GridPane.setColumnSpan(titledGroupBg, 3); + Tuple3 tuple = addLabelBsqAddressTextField(root, gridRow, + Res.get("dao.wallet.receive.bsqAddress"), + Layout.FIRST_ROW_AND_GROUP_DISTANCE); + addressTextField = tuple.second; + GridPane.setColumnSpan(tuple.third, 3); + } else { + addTitledGroupBg(root, gridRow, 1, + Res.get("dao.wallet.receive.dao.headline"), 0); + FormBuilder.addMultilineLabel(root, gridRow, Res.get("dao.wallet.receive.daoInfo"), 10); + + Button daoInfoButton = FormBuilder.addButton(root, ++gridRow, Res.get("dao.wallet.receive.daoInfo.button")); daoInfoButton.setOnAction(e -> { GUIUtil.openWebPage("https://bisq.network/dao"); }); + + FormBuilder.addMultilineLabel(root, ++gridRow, Res.get("dao.wallet.receive.daoTestnetInfo")); + Button daoContributorInfoButton = FormBuilder.addButton(root, ++gridRow, Res.get("dao.wallet.receive.daoTestnetInfo.button")); + daoContributorInfoButton.setOnAction(e -> { + GUIUtil.openWebPage("https://bisq.network/dao-testnet"); + }); + + FormBuilder.addMultilineLabel(root, ++gridRow, Res.get("dao.wallet.receive.daoContributorInfo")); + + Button daoTestnetInfoButton = FormBuilder.addButton(root, ++gridRow, Res.get("dao.wallet.receive.daoContributorInfo.button")); + daoTestnetInfoButton.setOnAction(e -> { + GUIUtil.openWebPage("https://bisq.network/dao-genesis"); + }); + + addTitledGroupBg(root, ++gridRow, 1, + Res.get("dao.wallet.receive.fundYourWallet"), 20); + Tuple3 tuple = addLabelBsqAddressTextField(root, gridRow, + Res.get("dao.wallet.receive.bsqAddress"), + 40); + addressTextField = tuple.second; + GridPane.setColumnSpan(tuple.third, 3); } } @Override protected void activate() { - bsqBalanceUtil.activate(); + if (BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) + bsqBalanceUtil.activate(); addressTextField.setAddress(bsqFormatter.getBsqAddressStringFromAddress(bsqWalletService.getUnusedAddress())); } @Override protected void deactivate() { - bsqBalanceUtil.deactivate(); + if (BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) + bsqBalanceUtil.deactivate(); } } From 4a709cbd97d04ea76c68be5f1ca4fb94d0b2f5ac Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 30 Jan 2019 13:00:19 +0100 Subject: [PATCH 5/5] Fix group separation line issue --- .../bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java index e1e7c82bd24..72f8f138fc6 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java @@ -77,7 +77,7 @@ public void initialize() { addressTextField = tuple.second; GridPane.setColumnSpan(tuple.third, 3); } else { - addTitledGroupBg(root, gridRow, 1, + addTitledGroupBg(root, gridRow, 6, Res.get("dao.wallet.receive.dao.headline"), 0); FormBuilder.addMultilineLabel(root, gridRow, Res.get("dao.wallet.receive.daoInfo"), 10);