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

Move BSQ dashboard into separate Facts & Figures section #2513

Merged
merged 7 commits into from Mar 27, 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
4 changes: 4 additions & 0 deletions core/src/main/java/bisq/core/util/BSFormatter.java
Expand Up @@ -421,6 +421,10 @@ public String formatPrice(Price price, MonetaryFormat fiatPriceFormat, boolean a
}
}

public String formatPrice(Price price, boolean appendCurrencyCode) {
return formatPrice(price, fiatPriceFormat, true);
}

public String formatPrice(Price price) {
return formatPrice(price, fiatPriceFormat, false);
}
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/bisq/core/util/BsqFormatter.java
Expand Up @@ -124,6 +124,10 @@ public String formatBSQSatoshis(long satoshi) {
return super.formatCoin(satoshi, coinFormat);
}

public String formatBSQSatoshisWithCode(long satoshi) {
return super.formatCoinWithCode(satoshi, coinFormat);
}

public String formatBTCSatoshis(long satoshi) {
return super.formatCoin(satoshi, btcCoinFormat);
}
Expand Down
56 changes: 33 additions & 23 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -198,6 +198,7 @@ shared.actions=Actions
shared.buyerUpperCase=Buyer
shared.sellerUpperCase=Seller
shared.new=NEW
shared.new=NEW

####################################################################
# UI views
Expand Down Expand Up @@ -1268,6 +1269,7 @@ account.notifications.priceAlert.warning.lowerPriceTooHigh=The lower price must
# DAO
####################################################################

dao.tab.factsAndFigures=Facts & Figures
dao.tab.bsqWallet=BSQ wallet
dao.tab.proposals=Governance
dao.tab.bonding=Bonding
Expand Down Expand Up @@ -1755,29 +1757,6 @@ dao.wallet.menuItem.receive=Receive
dao.wallet.menuItem.transactions=Transactions

dao.wallet.dashboard.myBalance=My wallet balance
dao.wallet.dashboard.distribution=Distribution of all BSQ
dao.wallet.dashboard.locked=Global state of locked BSQ
dao.wallet.dashboard.market=Market data
dao.wallet.dashboard.genesis=Genesis transaction
dao.wallet.dashboard.txDetails=BSQ transactions statistics
dao.wallet.dashboard.genesisBlockHeight=Genesis block height
dao.wallet.dashboard.genesisTxId=Genesis transaction ID
dao.wallet.dashboard.genesisIssueAmount=BSQ issued at genesis transaction
dao.wallet.dashboard.compRequestIssueAmount=BSQ issued for compensation requests
dao.wallet.dashboard.reimbursementAmount=BSQ issued for reimbursement requests
dao.wallet.dashboard.availableAmount=Total available BSQ
dao.wallet.dashboard.burntAmount=Burned BSQ (fees)
dao.wallet.dashboard.totalLockedUpAmount=Locked up in bonds
dao.wallet.dashboard.totalUnlockingAmount=Unlocking BSQ from bonds
dao.wallet.dashboard.totalUnlockedAmount=Unlocked BSQ from bonds
dao.wallet.dashboard.totalConfiscatedAmount=Confiscated BSQ from bonds
dao.wallet.dashboard.allTx=No. of all BSQ transactions
dao.wallet.dashboard.utxo=No. of all unspent transaction outputs
dao.wallet.dashboard.compensationIssuanceTx=No. of all compensation request issuance transactions
dao.wallet.dashboard.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions
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=Your BSQ receive address
dao.wallet.receive.bsqAddress=BSQ wallet address (Fresh unused address)
Expand Down Expand Up @@ -1939,6 +1918,37 @@ dao.monitor.blindVote.table.hash=Hash of blind vote state
dao.monitor.blindVote.table.prev=Previous hash
dao.monitor.blindVote.table.numBlindVotes=No. blind votes

dao.factsAndFigures.menuItem.supply=BSQ Supply
dao.factsAndFigures.menuItem.transactions=BSQ Transactions

dao.factsAndFigures.dashboard.marketPrice=Market data
dao.factsAndFigures.dashboard.price=Latest BSQ/BTC trade price (in Bisq)
dao.factsAndFigures.dashboard.marketCap=Market capitalisation (based on trade price)
dao.factsAndFigures.dashboard.availableAmount=Total available BSQ

dao.factsAndFigures.supply.issued=BSQ issued
dao.factsAndFigures.supply.genesisIssueAmount=BSQ issued at genesis transaction
dao.factsAndFigures.supply.compRequestIssueAmount=BSQ issued for compensation requests
dao.factsAndFigures.supply.reimbursementAmount=BSQ issued for reimbursement requests

dao.factsAndFigures.supply.burnt=BSQ burnt

dao.factsAndFigures.supply.locked=Global state of locked BSQ
dao.factsAndFigures.supply.totalLockedUpAmount=Locked up in bonds
dao.factsAndFigures.supply.totalUnlockingAmount=Unlocking BSQ from bonds
dao.factsAndFigures.supply.totalUnlockedAmount=Unlocked BSQ from bonds
dao.factsAndFigures.supply.totalConfiscatedAmount=Confiscated BSQ from bonds
dao.factsAndFigures.supply.burntAmount=Burned BSQ (fees)

dao.factsAndFigures.transactions.genesis=Genesis transaction
dao.factsAndFigures.transactions.genesisBlockHeight=Genesis block height
dao.factsAndFigures.transactions.genesisTxId=Genesis transaction ID
dao.factsAndFigures.transactions.txDetails=BSQ transactions statistics
dao.factsAndFigures.transactions.allTx=No. of all BSQ transactions
dao.factsAndFigures.transactions.utxo=No. of all unspent transaction outputs
dao.factsAndFigures.transactions.compensationIssuanceTx=No. of all compensation request issuance transactions
dao.factsAndFigures.transactions.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions
dao.factsAndFigures.transactions.burntTx=No. of all fee payments transactions

####################################################################
# Windows
Expand Down
27 changes: 21 additions & 6 deletions desktop/src/main/java/bisq/desktop/bisq.css
Expand Up @@ -1682,41 +1682,45 @@ textfield */
* *
********************************************************************************************************************/

#charts .chart-legend {
.chart-pane {
-fx-background-color: -bs-rd-white;
}

#charts .chart-legend, #charts-dao .chart-legend {
-fx-font-size: 1.077em;
-fx-alignment: center;
}

#charts .axis, #price-chart .axis, #volume-chart .axis {
#charts .axis, #price-chart .axis, #volume-chart .axis, #charts-dao .axis {
-fx-tick-label-fill: -bs-rd-font-lighter;
-fx-tick-label-font-size: 0.769em;
}

#charts .chart-plot-background {
#charts .chart-plot-background, #charts-dao .chart-plot-background {
-fx-background-color: -bs-rd-white;
}

#charts .default-color0.chart-area-symbol {
-fx-background-color: -bs-sell, -bs-rd-white;
}

#charts .default-color1.chart-area-symbol {
#charts .default-color1.chart-area-symbol, #charts-dao .default-color0.chart-area-symbol {
-fx-background-color: -bs-buy, -bs-rd-white;
}

#charts .default-color0.chart-series-area-line {
-fx-stroke: -bs-sell;
}

#charts .default-color1.chart-series-area-line {
#charts .default-color1.chart-series-area-line, #charts-dao .default-color0.chart-series-area-line {
-fx-stroke: -bs-buy;
}

#charts .default-color0.chart-series-area-fill {
-fx-fill: -bs-sell-transparent;
}

#charts .default-color1.chart-series-area-fill {
#charts .default-color1.chart-series-area-fill, #charts-dao .default-color0.chart-series-area-fill {
-fx-fill: -bs-buy-transparent;
}

Expand Down Expand Up @@ -2071,6 +2075,17 @@ textfield */
-fx-text-fill: -bs-rd-error-red;
}

.dao-kpi-big {
-fx-font-size: 1.923em;
-fx-text-fill: -bs-rd-black;
-fx-font-family: "IBM Plex Sans Light";
}

.dao-kpi-subtext {
-fx-text-fill: -bs-rd-font-light;
-fx-font-size: 0.923em;
}

/********************************************************************************************************************
* *
* Notifications *
Expand Down
36 changes: 23 additions & 13 deletions desktop/src/main/java/bisq/desktop/main/dao/DaoView.java
Expand Up @@ -27,11 +27,12 @@
import bisq.desktop.main.MainView;
import bisq.desktop.main.dao.bonding.BondingView;
import bisq.desktop.main.dao.burnbsq.BurnBsqView;
import bisq.desktop.main.dao.economy.EconomyView;
import bisq.desktop.main.dao.governance.GovernanceView;
import bisq.desktop.main.dao.monitor.MonitorView;
import bisq.desktop.main.dao.news.NewsView;
import bisq.desktop.main.dao.wallet.BsqWalletView;
import bisq.desktop.main.dao.wallet.dashboard.BsqDashboardView;
import bisq.desktop.main.dao.wallet.send.BsqSendView;
import bisq.desktop.main.overlays.popups.Popup;

import bisq.core.dao.governance.votereveal.VoteRevealService;
Expand All @@ -53,7 +54,7 @@
public class DaoView extends ActivatableViewAndModel<TabPane, Activatable> {

@FXML
private Tab bsqWalletTab, proposalsTab, bondingTab, burnBsqTab, daoNewsTab, monitor;
private Tab bsqWalletTab, proposalsTab, bondingTab, burnBsqTab, daoNewsTab, monitorTab, factsAndFiguresTab;

private Navigation.Listener navigationListener;
private ChangeListener<Tab> tabChangeListener;
Expand All @@ -77,46 +78,49 @@ private DaoView(CachingViewLoader viewLoader, VoteRevealService voteRevealServic

@Override
public void initialize() {
factsAndFiguresTab = new Tab(Res.get("dao.tab.factsAndFigures").toUpperCase());
bsqWalletTab = new Tab(Res.get("dao.tab.bsqWallet").toUpperCase());
proposalsTab = new Tab(Res.get("dao.tab.proposals").toUpperCase());
bondingTab = new Tab(Res.get("dao.tab.bonding").toUpperCase());
burnBsqTab = new Tab(Res.get("dao.tab.proofOfBurn").toUpperCase());
monitor = new Tab(Res.get("dao.tab.monitor").toUpperCase());
monitorTab = new Tab(Res.get("dao.tab.monitor").toUpperCase());

factsAndFiguresTab.setClosable(false);
bsqWalletTab.setClosable(false);
proposalsTab.setClosable(false);
bondingTab.setClosable(false);
burnBsqTab.setClosable(false);
monitor.setClosable(false);
monitorTab.setClosable(false);

if (!DevEnv.isDaoActivated()) {
factsAndFiguresTab.setDisable(true);
bsqWalletTab.setDisable(true);
proposalsTab.setDisable(true);
bondingTab.setDisable(true);
burnBsqTab.setDisable(true);
monitor.setDisable(true);
monitorTab.setDisable(true);

daoNewsTab = new Tab(Res.get("dao.tab.news").toUpperCase());

root.getTabs().add(daoNewsTab);
} else {
root.getTabs().addAll(bsqWalletTab, proposalsTab, bondingTab, burnBsqTab, monitor);
root.getTabs().addAll(factsAndFiguresTab, bsqWalletTab, proposalsTab, bondingTab, burnBsqTab, monitorTab);
}

navigationListener = viewPath -> {
if (viewPath.size() == 3 && viewPath.indexOf(DaoView.class) == 1) {
if (proposalsTab == null && viewPath.get(2).equals(BsqWalletView.class))
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class);
if (proposalsTab == null && viewPath.get(2).equals(EconomyView.class))
navigation.navigateTo(MainView.class, DaoView.class, EconomyView.class);
else
loadView(viewPath.tip());
}
};

tabChangeListener = (ov, oldValue, newValue) -> {
if (newValue == bsqWalletTab) {
Class<? extends View> selectedViewClass = bsqWalletView.getSelectedViewClass();
Class<? extends View> selectedViewClass = bsqWalletView != null ? bsqWalletView.getSelectedViewClass() : null;
if (selectedViewClass == null)
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class, BsqDashboardView.class);
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class, BsqSendView.class);
else
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class, selectedViewClass);
} else if (newValue == proposalsTab) {
Expand All @@ -125,7 +129,9 @@ public void initialize() {
navigation.navigateTo(MainView.class, DaoView.class, BondingView.class);
} else if (newValue == burnBsqTab) {
navigation.navigateTo(MainView.class, DaoView.class, BurnBsqView.class);
} else if (newValue == monitor) {
} else if (newValue == factsAndFiguresTab) {
navigation.navigateTo(MainView.class, DaoView.class, EconomyView.class);
} else if (newValue == monitorTab) {
navigation.navigateTo(MainView.class, DaoView.class, MonitorView.class);
}
};
Expand All @@ -147,7 +153,9 @@ else if (selectedItem == bondingTab)
navigation.navigateTo(MainView.class, DaoView.class, BondingView.class);
else if (selectedItem == burnBsqTab)
navigation.navigateTo(MainView.class, DaoView.class, BurnBsqView.class);
else if (selectedItem == monitor)
else if (selectedItem == factsAndFiguresTab)
navigation.navigateTo(MainView.class, DaoView.class, EconomyView.class);
else if (selectedItem == monitorTab)
navigation.navigateTo(MainView.class, DaoView.class, MonitorView.class);
}
} else {
Expand Down Expand Up @@ -182,9 +190,11 @@ private void loadView(Class<? extends View> viewClass) {
} else if (view instanceof BurnBsqView) {
selectedTab = burnBsqTab;
} else if (view instanceof MonitorView) {
selectedTab = monitor;
selectedTab = monitorTab;
} else if (view instanceof NewsView) {
selectedTab = daoNewsTab;
} else if (view instanceof EconomyView) {
selectedTab = factsAndFiguresTab;
}

selectedTab.setContent(view.getRoot());
Expand Down
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ 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 <http://www.gnu.org/licenses/>.
-->


<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<AnchorPane fx:id="root" fx:controller="bisq.desktop.main.dao.economy.EconomyView"
xmlns:fx="http://javafx.com/fxml">

<VBox fx:id="leftVBox" prefWidth="240" spacing="5" AnchorPane.bottomAnchor="20" AnchorPane.leftAnchor="15"
AnchorPane.topAnchor="15"/>

<ScrollPane fitToWidth="true" fitToHeight="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="270.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<AnchorPane fx:id="content"/>
</ScrollPane>

</AnchorPane>