|
|
@ -49,6 +49,7 @@ COLOR_UNCONFIRMED = Qt.red |
|
|
|
COLOR_UNMATURED = Qt.magenta |
|
|
|
COLOR_FROZEN = ColorScheme.BLUE.as_color(True) |
|
|
|
COLOR_LIGHTNING = Qt.yellow |
|
|
|
COLOR_FROZEN_LIGHTNING = Qt.cyan |
|
|
|
|
|
|
|
class PieChartObject: |
|
|
|
|
|
|
@ -146,19 +147,21 @@ class BalanceDialog(WindowModalDialog): |
|
|
|
self.config = parent.config |
|
|
|
self.fx = parent.fx |
|
|
|
|
|
|
|
confirmed, unconfirmed, unmatured, frozen, lightning = self.wallet.get_balances_for_piechart() |
|
|
|
confirmed, unconfirmed, unmatured, frozen, lightning, f_lightning = self.wallet.get_balances_for_piechart() |
|
|
|
|
|
|
|
frozen_str = self.config.format_amount_and_units(frozen) |
|
|
|
confirmed_str = self.config.format_amount_and_units(confirmed) |
|
|
|
unconfirmed_str = self.config.format_amount_and_units(unconfirmed) |
|
|
|
unmatured_str = self.config.format_amount_and_units(unmatured) |
|
|
|
lightning_str = self.config.format_amount_and_units(lightning) |
|
|
|
f_lightning_str = self.config.format_amount_and_units(f_lightning) |
|
|
|
|
|
|
|
frozen_fiat_str = self.fx.format_amount_and_units(frozen) if self.fx else '' |
|
|
|
confirmed_fiat_str = self.fx.format_amount_and_units(confirmed) if self.fx else '' |
|
|
|
unconfirmed_fiat_str = self.fx.format_amount_and_units(unconfirmed) if self.fx else '' |
|
|
|
unmatured_fiat_str = self.fx.format_amount_and_units(unmatured) if self.fx else '' |
|
|
|
lightning_fiat_str = self.fx.format_amount_and_units(lightning) if self.fx else '' |
|
|
|
f_lightning_fiat_str = self.fx.format_amount_and_units(f_lightning) if self.fx else '' |
|
|
|
|
|
|
|
piechart = PieChartWidget(120, [ |
|
|
|
(_('Frozen'), COLOR_FROZEN, frozen), |
|
|
@ -166,6 +169,7 @@ class BalanceDialog(WindowModalDialog): |
|
|
|
(_('Unconfirmed'), COLOR_UNCONFIRMED, unconfirmed), |
|
|
|
(_('Confirmed'), COLOR_CONFIRMED, confirmed), |
|
|
|
(_('Lightning'), COLOR_LIGHTNING, lightning), |
|
|
|
(_('Lightning frozen'), COLOR_FROZEN_LIGHTNING, f_lightning), |
|
|
|
]) |
|
|
|
|
|
|
|
vbox = QVBoxLayout() |
|
|
@ -200,6 +204,11 @@ class BalanceDialog(WindowModalDialog): |
|
|
|
grid.addWidget(QLabel(_("Lightning") + ':'), 4, 1) |
|
|
|
grid.addWidget(QLabel(lightning_str), 4, 2, alignment=Qt.AlignRight) |
|
|
|
grid.addWidget(QLabel(lightning_fiat_str), 4, 3, alignment=Qt.AlignRight) |
|
|
|
if f_lightning: |
|
|
|
grid.addWidget(LegendWidget(COLOR_FROZEN_LIGHTNING), 5, 0) |
|
|
|
grid.addWidget(QLabel(_("Lightning (frozen)") + ':'), 5, 1) |
|
|
|
grid.addWidget(QLabel(f_lightning_str), 5, 2, alignment=Qt.AlignRight) |
|
|
|
grid.addWidget(QLabel(f_lightning_fiat_str), 5, 3, alignment=Qt.AlignRight) |
|
|
|
|
|
|
|
vbox.addLayout(grid) |
|
|
|
vbox.addStretch(1) |
|
|
|