Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DAO launch popup #2688

Merged
merged 6 commits into from Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -199,6 +199,10 @@ shared.buyerUpperCase=Buyer
shared.sellerUpperCase=Seller
shared.new=NEW
shared.blindVoteTxId=Blind vote transaction ID
shared.proposal=Proposal
shared.votes=Votes
shared.learnMore=Learn more
shared.dismiss=Dismiss

####################################################################
# UI views
Expand Down Expand Up @@ -1316,7 +1320,6 @@ dao.voteReveal.txPublished=Your vote reveal transaction with transaction ID {0}
dao.results.cycles.header=Cycles
dao.results.cycles.table.header.cycle=Cycle
dao.results.cycles.table.header.numProposals=Proposals
dao.results.cycles.table.header.numVotes=Votes
dao.results.cycles.table.header.voteWeight=Vote weight
dao.results.cycles.table.header.issuance=Issuance

Expand Down Expand Up @@ -1427,7 +1430,6 @@ dao.results.cycle.duration.value={0} block(s)
dao.results.cycle.value.postFix.isDefaultValue=(default value)
dao.results.cycle.value.postFix.hasChanged=(has been changed in voting)

dao.results.invalidVotes.proposal=Proposal
dao.results.invalidVotes=We had invalid votes in that voting cycle. That can happen if a vote was \
not distributed well in the P2P network.\n{0}

Expand Down Expand Up @@ -2290,6 +2292,13 @@ popup.roundedFiatValues.msg=To increase privacy of your trade the {0} amount was
popup.info.multiplePaymentAccounts.headline=Multiple payment accounts available
popup.info.multiplePaymentAccounts.msg=You have multiple payment accounts available for this offer. Please make sure you've picked the right one.

popup.dao.launch.headline=The complete vision, realized
popup.dao.launch.governance.title=Governance
popup.dao.launch.governance=Bisq’s trading network was already decentralized. \nWith the Bisq DAO, Bisq’s leadership is now decentralized too, making Bisq exceptionally resistant to censorship.
popup.dao.launch.trading.title=Trade
popup.dao.launch.trading=Trade BSQ (colored bitcoin) to participate in Bisq governance. You can buy and sell BSQ just like any other asset on Bisq.
popup.dao.launch.cheaperFees.title=Cheaper fees
popup.dao.launch.cheaperFees=Get a 90% discount on trading fees when you use BSQ. Save money and support the project at the same time!\n\n

####################################################################
# Notifications
Expand Down
52 changes: 51 additions & 1 deletion desktop/src/main/java/bisq/desktop/bisq.css
Expand Up @@ -2054,7 +2054,7 @@ textfield */
-fx-text-fill: -bs-rd-black;
}

.dao-news-content, .dao-news-section-link, .dao-news-section-link .hyperlink {
.dao-news-content, .dao-news-section-link, .dao-news-section-link .hyperlink, .dao-launch-version {
-fx-text-fill: -bs-rd-font-light;
-fx-fill: -bs-rd-font-light;
}
Expand Down Expand Up @@ -2087,6 +2087,56 @@ textfield */
-fx-font-size: 0.923em;
}

.dao-launch-version {
-fx-font-size: 1.077em;
}

.dao-launch-headline {
-fx-font-size: 2.154em;
-fx-text-fill: -bs-rd-font-dark-grey;
-fx-font-family: "IBM Plex Sans Light";
}

.dao-launch-description {
-fx-font-size: 1.538em;
-fx-text-fill: -bs-rd-font-dark-grey;
-fx-font-family: "IBM Plex Sans Light";
}

.dao-launch-paging-button {
-fx-text-fill: -bs-rd-font-light;
-fx-fill: -bs-rd-font-light;
}

.dao-launch-tab-box {
-fx-border-style: solid;
-fx-border-width: 1 0 0 0;
-fx-border-color: -bs-rd-tab-border;
}

.slider-section-button {
-fx-cursor: hand;
-fx-background-color: transparent;
-fx-translate-y: -1;
-fx-padding: 11;
}

.slider-section-button .text {
-fx-font-size: 0.923em;
-fx-fill: -bs-rd-font-dark-grey;
-fx-font-family: "IBM Plex Sans Light";
}

.slider-section-button:selected {
-fx-border-style: solid;
-fx-border-width: 1 0 0 0;
-fx-border-color: -bs-rd-green;
}

.slider-section-button:selected .text {
-fx-fill: -bs-rd-green;
}

/********************************************************************************************************************
* *
* Notifications *
Expand Down
10 changes: 10 additions & 0 deletions desktop/src/main/java/bisq/desktop/images.css
Expand Up @@ -295,5 +295,15 @@
-fx-image: url("../../images/rejected.png");
}

#dao-screenshot-governance {
-fx-image: url("../../images/dao-screenshot-governance.png");
}

#dao-screenshot-trading {
-fx-image: url("../../images/dao-screenshot-trading.png");
}

#dao-screenshot-cheaper-fees {
-fx-image: url("../../images/dao-screenshot-cheaper-fees.png");
}

28 changes: 27 additions & 1 deletion desktop/src/main/java/bisq/desktop/main/MainView.java
Expand Up @@ -35,17 +35,21 @@
import bisq.desktop.main.offer.BuyOfferView;
import bisq.desktop.main.offer.SellOfferView;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.main.overlays.windows.DaoLaunchWindow;
import bisq.desktop.main.portfolio.PortfolioView;
import bisq.desktop.main.settings.SettingsView;
import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Transitions;

import bisq.core.exceptions.BisqException;
import bisq.core.locale.GlobalSettings;
import bisq.core.locale.Res;
import bisq.core.user.DontShowAgainLookup;
import bisq.core.util.BSFormatter;

import bisq.common.Timer;
import bisq.common.UserThread;
import bisq.common.app.DevEnv;
import bisq.common.app.Version;
import bisq.common.util.Tuple2;
import bisq.common.util.Utilities;
Expand Down Expand Up @@ -77,6 +81,7 @@
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;
Expand Down Expand Up @@ -388,9 +393,30 @@ protected Tooltip computeValue() {

model.getShowAppScreen().addListener((ov, oldValue, newValue) -> {
if (newValue) {

navigation.navigateToPreviousVisitedView();

transitions.fadeOutAndRemove(splashScreen, 1500, actionEvent -> disposeSplashScreen());
transitions.fadeOutAndRemove(splashScreen, 1500, actionEvent -> {
disposeSplashScreen();

if (DevEnv.isDaoActivated()) {
String daoLaunchPopupKey = "daoLaunchPopup";

if (DontShowAgainLookup.showAgain(daoLaunchPopupKey)) {
new DaoLaunchWindow()
.headLine(Res.get("popup.dao.launch.headline"))
.closeButtonText(Res.get("shared.dismiss"))
.actionButtonText(Res.get("shared.learnMore"))
.onAction(() -> {
GUIUtil.openWebPage("https://docs.bisq.network/dao.html");
})
.buttonAlignment(HPos.CENTER)
.show();

DontShowAgainLookup.dontShowAgain(daoLaunchPopupKey, true);
}
}
});
}
});

Expand Down
Expand Up @@ -275,7 +275,7 @@ private void onResultsListItemSelected(CycleListItem item) {
.append(Res.getWithCol("dao.results.votes.table.header.stake")).append(" ")
.append(bsqFormatter.formatCoinWithCode(Coin.valueOf(e.getStake()))).append("\n");
e.getBallotList().stream().forEach(ballot -> {
sb.append(Res.getWithCol("dao.results.invalidVotes.proposal")).append("\n\t")
sb.append(Res.getWithCol("shared.proposal")).append("\n\t")
.append(Res.getWithCol("shared.name")).append(" ")
.append(ballot.getProposal().getName()).append("\n\t");
sb.append(Res.getWithCol("dao.bond.table.column.link")).append(" ")
Expand Down Expand Up @@ -541,7 +541,7 @@ public void updateItem(final CycleListItem item, boolean empty) {
column.setComparator(Comparator.comparing(CycleListItem::getNumProposals));
votesTableView.getColumns().add(column);

column = new AutoTooltipTableColumn<>(Res.get("dao.results.cycles.table.header.numVotes"));
column = new AutoTooltipTableColumn<>(Res.get("shared.votes"));
column.setMinWidth(70);
column.setMaxWidth(70);
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
Expand Down
27 changes: 22 additions & 5 deletions desktop/src/main/java/bisq/desktop/main/overlays/Overlay.java
Expand Up @@ -66,6 +66,7 @@

import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Pos;

import javafx.beans.value.ChangeListener;

Expand Down Expand Up @@ -157,6 +158,8 @@ protected enum Type {
protected Button actionButton, secondaryActionButton;
protected AutoTooltipButton closeButton;

private HPos buttonAlignment = HPos.RIGHT;

protected Optional<Runnable> closeHandlerOptional = Optional.<Runnable>empty();
protected Optional<Runnable> actionHandlerOptional = Optional.<Runnable>empty();
protected Optional<Runnable> secondaryActionHandlerOptional = Optional.<Runnable>empty();
Expand Down Expand Up @@ -427,6 +430,11 @@ public T useShutDownButton() {
return (T) this;
}

public T buttonAlignment(HPos pos) {
this.buttonAlignment = pos;
return (T) this;
}

public T width(double width) {
this.width = width;
//noinspection unchecked
Expand Down Expand Up @@ -890,10 +898,16 @@ protected void addButtons() {
});

Pane spacer = new Pane();

HBox hBox = new HBox();
hBox.setSpacing(10);

hBox.getChildren().addAll(spacer, actionButton);
hBox.setAlignment(Pos.CENTER);

if (buttonAlignment == HPos.RIGHT)
hBox.getChildren().add(spacer);

hBox.getChildren().addAll(actionButton);

if (secondaryActionButtonText != null && secondaryActionHandlerOptional.isPresent()) {
secondaryActionButton = new AutoTooltipButton(secondaryActionButtonText);
Expand All @@ -908,17 +922,20 @@ protected void addButtons() {
if (!hideCloseButton)
hBox.getChildren().add(closeButton);

HBox.setHgrow(spacer, Priority.ALWAYS);
spacer.setMaxWidth(Double.MAX_VALUE);

GridPane.setHalignment(hBox, HPos.RIGHT);
if (buttonAlignment == HPos.RIGHT) {
HBox.setHgrow(spacer, Priority.ALWAYS);
spacer.setMaxWidth(Double.MAX_VALUE);
}

GridPane.setHalignment(hBox, buttonAlignment);
GridPane.setRowIndex(hBox, ++rowIndex);
GridPane.setColumnSpan(hBox, 2);
GridPane.setMargin(hBox, new Insets(buttonDistance, 0, 0, 0));
gridPane.getChildren().add(hBox);
} else if (!hideCloseButton) {
closeButton.setDefaultButton(true);
GridPane.setHalignment(closeButton, HPos.RIGHT);
GridPane.setHalignment(closeButton, buttonAlignment);
GridPane.setColumnSpan(closeButton, 2);
if (!showReportErrorButtons)
GridPane.setMargin(closeButton, new Insets(buttonDistance, 0, 0, 0));
Expand Down