Skip to content
Snippets Groups Projects
Commit e3f43ce8 authored by Vincent Texier's avatar Vincent Texier
Browse files

[enh] add expiresOn date on smith page

fix selected account appeared in invite and certify selectors
parent ccfce016
No related branches found
No related tags found
No related merge requests found
......@@ -194,6 +194,10 @@ class SmithWidget(QWidget, Ui_SmithWidget):
self.loaderIconLabel.show()
self.fetch_authority_status_from_network_timer.start()
# exclude new operating account from dependant list
self.init_invite_account_combo_box()
self.init_certify_smith_combo_box()
def init_account_combo_box(self) -> None:
"""
Init combobox with validated identity accounts (with wallets)
......@@ -276,6 +280,8 @@ class SmithWidget(QWidget, Ui_SmithWidget):
]
for account in accounts:
# exclude selected operating account
if self.account is not None and self.account.address != account.address:
self.inviteAccountComboBox.addItem(
account.name if account.name is not None else account.address,
userData=account.address,
......@@ -342,7 +348,11 @@ class SmithWidget(QWidget, Ui_SmithWidget):
account = self.application.accounts.get_by_identity_index(
smith.identity_index
)
if account is not None:
if (
account is not None
and self.account is not None
and account.address != self.account.address
):
self.certifySmithComboBox.addItem(
account.name if account.name is not None else account.address,
userData=smith.identity_index,
......@@ -773,9 +783,26 @@ class SmithWidget(QWidget, Ui_SmithWidget):
)
if self.smith is not None:
self.membershipValueLabel.setText(
display_smith_status[self.smith.status.value]
status_string = display_smith_status[self.smith.status.value]
if self.smith.expire_on is not None:
datetime_from_block = (
self.application.block_time.get_datetime_from_block(
self.smith.expire_on
)
)
if datetime_from_block is not None:
expire_on_localized_datetime_string = self.locale().toString(
datetime_from_block,
QLocale.dateTimeFormat(self.locale(), QLocale.ShortFormat),
)
self.membershipValueLabel.setToolTip(
self._("block #{block}").format(block=self.smith.expire_on)
)
status_string = (
f"{status_string} ({expire_on_localized_datetime_string})"
)
self.membershipValueLabel.setText(status_string)
else:
self.membershipValueLabel.setText(self._("No"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment