|
@ -34,23 +34,14 @@ class Plugin(ColdcardPlugin, QtPluginBase): |
|
|
@hook |
|
|
@hook |
|
|
def receive_menu(self, menu, addrs, wallet): |
|
|
def receive_menu(self, menu, addrs, wallet): |
|
|
# Context menu on each address in the Addresses Tab, right click... |
|
|
# Context menu on each address in the Addresses Tab, right click... |
|
|
|
|
|
if len(addrs) != 1: |
|
|
if type(wallet) is Standard_Wallet: |
|
|
return |
|
|
keystore = wallet.get_keystore() |
|
|
for keystore in wallet.get_keystores(): |
|
|
else: |
|
|
if type(keystore) == self.keystore_class: |
|
|
# find if any devices are connected and ready to go, use first of those. |
|
|
def show_address(keystore=keystore): |
|
|
for ks in wallet.get_keystores(): |
|
|
keystore.thread.add(partial(self.show_address, wallet, addrs[0], keystore=keystore)) |
|
|
if ks.has_usable_connection_with_device(): |
|
|
device_name = "{} ({})".format(self.device, keystore.label) |
|
|
keystore = ks |
|
|
menu.addAction(_("Show on {}").format(device_name), show_address) |
|
|
break |
|
|
|
|
|
else: |
|
|
|
|
|
# don't hook into menu |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
if type(keystore) == self.keystore_class and len(addrs) == 1: |
|
|
|
|
|
def show_address(): |
|
|
|
|
|
keystore.thread.add(partial(self.show_address, wallet, addrs[0], keystore=keystore)) |
|
|
|
|
|
menu.addAction(_("Show on Coldcard ({})").format(keystore.label), show_address) |
|
|
|
|
|
|
|
|
|
|
|
@only_hook_if_libraries_available |
|
|
@only_hook_if_libraries_available |
|
|
@hook |
|
|
@hook |
|
|