new icons to show hardware wallet pairing in status bar
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
<file>icons/file.png</file>
|
<file>icons/file.png</file>
|
||||||
<file>icons/hot_seed.png</file>
|
<file>icons/hot_seed.png</file>
|
||||||
<file>icons/keepkey.png</file>
|
<file>icons/keepkey.png</file>
|
||||||
|
<file>icons/keepkey_unpaired.png</file>
|
||||||
<file>icons/key.png</file>
|
<file>icons/key.png</file>
|
||||||
<file>icons/lock.png</file>
|
<file>icons/lock.png</file>
|
||||||
<file>icons/microphone.png</file>
|
<file>icons/microphone.png</file>
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
<file>icons/status_lagging.png</file>
|
<file>icons/status_lagging.png</file>
|
||||||
<file>icons/seal.png</file>
|
<file>icons/seal.png</file>
|
||||||
<file>icons/speaker.png</file>
|
<file>icons/speaker.png</file>
|
||||||
|
<file>icons/trezor_unpaired.png</file>
|
||||||
<file>icons/trezor.png</file>
|
<file>icons/trezor.png</file>
|
||||||
<file>icons/trustedcoin.png</file>
|
<file>icons/trustedcoin.png</file>
|
||||||
<file>icons/unconfirmed.png</file>
|
<file>icons/unconfirmed.png</file>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
icons/keepkey_unpaired.png
Normal file
BIN
icons/keepkey_unpaired.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
icons/trezor_unpaired.png
Normal file
BIN
icons/trezor_unpaired.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -385,6 +385,7 @@ class DeviceMgr(ThreadJob, PrintError):
|
|||||||
|
|
||||||
def client_for_keystore(self, plugin, handler, keystore, force_pair):
|
def client_for_keystore(self, plugin, handler, keystore, force_pair):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
|
plugin.update_status(handler, False)
|
||||||
devices = self.scan_devices()
|
devices = self.scan_devices()
|
||||||
xpub = keystore.xpub
|
xpub = keystore.xpub
|
||||||
derivation = keystore.get_derivation()
|
derivation = keystore.get_derivation()
|
||||||
@@ -392,6 +393,8 @@ class DeviceMgr(ThreadJob, PrintError):
|
|||||||
if client is None and force_pair:
|
if client is None and force_pair:
|
||||||
info = self.select_device(plugin, handler, keystore, devices)
|
info = self.select_device(plugin, handler, keystore, devices)
|
||||||
client = self.force_pair_xpub(plugin, handler, info, xpub, derivation, devices)
|
client = self.force_pair_xpub(plugin, handler, info, xpub, derivation, devices)
|
||||||
|
if client:
|
||||||
|
plugin.update_status(handler, True)
|
||||||
return client
|
return client
|
||||||
|
|
||||||
def client_by_xpub(self, plugin, xpub, handler, devices):
|
def client_by_xpub(self, plugin, xpub, handler, devices):
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ from keepkey import KeepKeyPlugin
|
|||||||
|
|
||||||
|
|
||||||
class Plugin(qt_plugin_class(KeepKeyPlugin)):
|
class Plugin(qt_plugin_class(KeepKeyPlugin)):
|
||||||
icon_file = ":icons/keepkey.png"
|
icon_paired = ":icons/keepkey.png"
|
||||||
|
icon_unpaired = ":icons/keepkey_unpaired.png"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def pin_matrix_widget_class(self):
|
def pin_matrix_widget_class(self):
|
||||||
|
|||||||
@@ -353,7 +353,3 @@ class TrezorCompatiblePlugin(HW_PluginBase):
|
|||||||
def get_tx(self, tx_hash):
|
def get_tx(self, tx_hash):
|
||||||
tx = self.prev_tx[tx_hash]
|
tx = self.prev_tx[tx_hash]
|
||||||
return self.electrum_tx_to_txtype(tx)
|
return self.electrum_tx_to_txtype(tx)
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def is_valid_seed(seed):
|
|
||||||
return True
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ from trezor import TrezorPlugin
|
|||||||
|
|
||||||
|
|
||||||
class Plugin(qt_plugin_class(TrezorPlugin)):
|
class Plugin(qt_plugin_class(TrezorPlugin)):
|
||||||
icon_file = ":icons/trezor.png"
|
icon_unpaired = ":icons/trezor_unpaired.png"
|
||||||
|
icon_paired = ":icons/trezor.png"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def pin_matrix_widget_class(self):
|
def pin_matrix_widget_class(self):
|
||||||
|
|||||||
@@ -193,15 +193,26 @@ def qt_plugin_class(base_plugin_class):
|
|||||||
for keystore in wallet.get_keystores():
|
for keystore in wallet.get_keystores():
|
||||||
if type(keystore) != self.keystore_class:
|
if type(keystore) != self.keystore_class:
|
||||||
continue
|
continue
|
||||||
tooltip = self.device + ' ' + keystore.label
|
tooltip = self.device + ' ' + (keystore.label or '')
|
||||||
button = StatusBarButton(QIcon(self.icon_file), tooltip,
|
button = StatusBarButton(QIcon(self.icon_unpaired), tooltip,
|
||||||
partial(self.settings_dialog, window, keystore))
|
partial(self.settings_dialog, window, keystore))
|
||||||
window.statusBar().addPermanentWidget(button)
|
window.statusBar().addPermanentWidget(button)
|
||||||
keystore.handler = self.create_handler(window)
|
handler = self.create_handler(window)
|
||||||
|
handler.button = button
|
||||||
|
keystore.handler = handler
|
||||||
keystore.thread = TaskThread(window, window.on_error)
|
keystore.thread = TaskThread(window, window.on_error)
|
||||||
# Trigger a pairing
|
# Trigger a pairing
|
||||||
keystore.thread.add(partial(self.get_client, keystore))
|
keystore.thread.add(partial(self.get_client, keystore))
|
||||||
|
|
||||||
|
window.connect(window, SIGNAL('keystore_status'), self._update_status)
|
||||||
|
|
||||||
|
def update_status(self, handler, paired):
|
||||||
|
handler.win.emit(SIGNAL('keystore_status'), handler, paired)
|
||||||
|
|
||||||
|
def _update_status(self, handler, paired):
|
||||||
|
icon = self.icon_paired if paired else self.icon_unpaired
|
||||||
|
handler.button.setIcon(QIcon(icon))
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def receive_menu(self, menu, addrs, wallet):
|
def receive_menu(self, menu, addrs, wallet):
|
||||||
if type(wallet) is not Standard_Wallet:
|
if type(wallet) is not Standard_Wallet:
|
||||||
@@ -222,7 +233,10 @@ def qt_plugin_class(base_plugin_class):
|
|||||||
forgotten their PIN or it is in bootloader mode.'''
|
forgotten their PIN or it is in bootloader mode.'''
|
||||||
device_id = self.device_manager().xpub_id(keystore.xpub)
|
device_id = self.device_manager().xpub_id(keystore.xpub)
|
||||||
if not device_id:
|
if not device_id:
|
||||||
info = self.device_manager().select_device(keystore.handler, self, keystore)
|
try:
|
||||||
|
info = self.device_manager().select_device(self, keystore.handler, keystore)
|
||||||
|
except UserCancelled:
|
||||||
|
return
|
||||||
device_id = info.device.id_
|
device_id = info.device.id_
|
||||||
return device_id
|
return device_id
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user