1
0

qt: allow opening BalanceDialog if warning

Allow to open the BalanceDialog, by clicking on the Pie Diagram in the
bottom left corner of the main window, if there is an active warning,
even if the wallets balance is 0. Right now the user can see the
warning icon for the lighting channel reserve, but cannot click on the
icon to read the actual warning if there is no balance in the wallet.
This commit is contained in:
f321x
2025-10-29 10:50:56 +01:00
parent bf0ebc8d2b
commit 6484947485
2 changed files with 5 additions and 1 deletions

View File

@@ -105,6 +105,10 @@ class BalanceToolButton(QToolButton, PieChartObject):
self._update_size() self._update_size()
self._warning = False self._warning = False
@property
def has_warning(self) -> bool:
return bool(self._warning)
def update_list(self, l, warning: bool): def update_list(self, l, warning: bool):
self._warning = warning self._warning = warning
self._list = l self._list = l

View File

@@ -1804,7 +1804,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
def show_balance_dialog(self): def show_balance_dialog(self):
balance = self.wallet.get_balances_for_piechart().total() balance = self.wallet.get_balances_for_piechart().total()
if balance == 0: if balance == 0 and not self.balance_label.has_warning:
return return
from .balance_dialog import BalanceDialog from .balance_dialog import BalanceDialog
d = BalanceDialog(self, wallet=self.wallet) d = BalanceDialog(self, wallet=self.wallet)