@@ -298,14 +298,16 @@ class BaseWizard(Logger):
|
|||||||
if not debug_msg:
|
if not debug_msg:
|
||||||
debug_msg = ' {}'.format(_('No exceptions encountered.'))
|
debug_msg = ' {}'.format(_('No exceptions encountered.'))
|
||||||
if not devices:
|
if not devices:
|
||||||
msg = ''.join([
|
msg = (_('No hardware device detected.') + '\n' +
|
||||||
_('No hardware device detected.') + '\n',
|
_('To trigger a rescan, press \'Next\'.') + '\n\n')
|
||||||
_('To trigger a rescan, press \'Next\'.') + '\n\n',
|
if sys.platform == 'win32':
|
||||||
_('If your device is not detected on Windows, go to "Settings", "Devices", "Connected devices", and do "Remove device". Then, plug your device again.') + ' ',
|
msg += _('If your device is not detected on Windows, go to "Settings", "Devices", "Connected devices", '
|
||||||
_('On Linux, you might have to add a new permission to your udev rules.') + '\n\n',
|
'and do "Remove device". Then, plug your device again.') + '\n'
|
||||||
_('Debug message') + '\n',
|
msg += _('While this is less than ideal, it might help if you run Electrum as Administrator.') + '\n'
|
||||||
debug_msg
|
else:
|
||||||
])
|
msg += _('On Linux, you might have to add a new permission to your udev rules.') + '\n'
|
||||||
|
msg += '\n\n'
|
||||||
|
msg += _('Debug message') + '\n' + debug_msg
|
||||||
self.confirm_dialog(title=title, message=msg,
|
self.confirm_dialog(title=title, message=msg,
|
||||||
run_next=lambda x: self.choose_hw_device(purpose, storage=storage))
|
run_next=lambda x: self.choose_hw_device(purpose, storage=storage))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ _logger = get_logger(__name__)
|
|||||||
try:
|
try:
|
||||||
import trezorlib
|
import trezorlib
|
||||||
import trezorlib.transport
|
import trezorlib.transport
|
||||||
|
from trezorlib.transport.bridge import BridgeTransport, call_bridge
|
||||||
|
|
||||||
from .clientbase import TrezorClientBase
|
from .clientbase import TrezorClientBase
|
||||||
|
|
||||||
@@ -137,7 +138,16 @@ class TrezorPlugin(HW_PluginBase):
|
|||||||
raise LibraryFoundButUnusable(library_version=version)
|
raise LibraryFoundButUnusable(library_version=version)
|
||||||
|
|
||||||
def enumerate(self):
|
def enumerate(self):
|
||||||
devices = trezorlib.transport.enumerate_devices()
|
# If there is a bridge, prefer that.
|
||||||
|
# On Windows, the bridge runs as Admin (and Electrum usually does not),
|
||||||
|
# so the bridge has better chances of finding devices. see #5420
|
||||||
|
# This also avoids duplicate entries.
|
||||||
|
try:
|
||||||
|
call_bridge("enumerate")
|
||||||
|
except Exception:
|
||||||
|
devices = trezorlib.transport.enumerate_devices()
|
||||||
|
else:
|
||||||
|
devices = BridgeTransport.enumerate()
|
||||||
return [Device(path=d.get_path(),
|
return [Device(path=d.get_path(),
|
||||||
interface_number=-1,
|
interface_number=-1,
|
||||||
id_=d.get_path(),
|
id_=d.get_path(),
|
||||||
|
|||||||
Reference in New Issue
Block a user