Enable DAO menu, show dao info text and button

This commit is contained in:
Manfred Karrer 2019-01-30 08:54:54 +01:00
parent b087b95826
commit 7dc5404b84
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
3 changed files with 21 additions and 21 deletions

View File

@ -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)

View File

@ -39,7 +39,6 @@ import bisq.desktop.main.portfolio.PortfolioView;
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 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
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 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
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);

View File

@ -22,8 +22,11 @@ import bisq.desktop.common.view.FxmlView;
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 bisq.common.util.Tuple3;
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 class BsqReceiveView extends ActivatableView<GridPane, Void> {
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