Skip to content

Commit

Permalink
[SLP] Auto-name after double-click new token.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jcramer committed Jun 8, 2019
1 parent a3a8bb2 commit ca096c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions gui/qt/slp_mgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ca096c5

Please sign in to comment.