From ca096c5f7906eea47f73a106758e1cf0b988b17b Mon Sep 17 00:00:00 2001 From: James Cramer Date: Sat, 8 Jun 2019 11:58:19 -0400 Subject: [PATCH] [SLP] Auto-name after double-click new token. This was already handled when the user would right-click->Add Token, but double-clicking would not autofill the token's wallet name. I also changed the text from "right-click to add" to "double-click to add" for newly received tokens. --- RELEASE-NOTES | 1 + gui/qt/slp_mgt.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 747188a25074..05c78ff6081c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -111,6 +111,7 @@ Electron Cash - SLP Token Edition - Other bug fixes including: SLP fee calculations improved, incorrect password after completing token creation would cause crash - Use separate change addresses in transactions having both BCH and SLP change when possible - Auto-detect receipt of Genesis minting batons or coins +- Auto-name newly received tokens within Add Token Dialog after double-click (this was already implemented for right-click > Add token) - Disable change address options in preferences - Allow OP_RETURN entry in SLP wallets, but disable when a token is selected - Reordered Send Tab amount input fields and moved token selector above amount inputs diff --git a/gui/qt/slp_mgt.py b/gui/qt/slp_mgt.py index 3bca38be8a7d..0a5f2b96ff61 100644 --- a/gui/qt/slp_mgt.py +++ b/gui/qt/slp_mgt.py @@ -78,7 +78,10 @@ def on_doubleclick(self, item, column): self.editItem(item, column) else: token_id = item.data(0, Qt.UserRole) - SlpAddTokenDialog(self.parent, token_id_hex = token_id, token_name=item.text(1) ) + if('unknown-' in item.text(1)): + SlpAddTokenDialog(self.parent, token_id_hex = token_id, allow_overwrite=True) + else: + SlpAddTokenDialog(self.parent, token_id_hex = token_id, token_name=item.text(1)) def create_menu(self, position): menu = QMenu() @@ -138,7 +141,7 @@ def on_update(self): balancestr = format_satoshis_nofloat(calculated_balance, decimal_point=decimals, num_zeros=decimals) balancestr += ' '*(9-decimals) else: - balancestr = "right-click to add" + balancestr = "double-click to add" try: self.parent.wallet.get_slp_token_baton(token_id)