more explicit error dialogs, when possible
This commit is contained in:
parent
77d2ae5249
commit
faa6de3b75
|
@ -24,7 +24,10 @@ def _error_dialog(reason, object):
|
|||
'and plugging it back in.' % object)
|
||||
elif reason == 'unpair':
|
||||
title = 'Unpairing failed'
|
||||
text = ('Failed to unpair\n%s\nfrom %s.' % (object.name, object.receiver.name))
|
||||
text = ('Failed to unpair\n%s\nfrom %s.'
|
||||
'\n'
|
||||
'The receiver returned an error, with no further details.'
|
||||
% (object.name, object.receiver.name))
|
||||
else:
|
||||
raise Exception("ui.error_dialog: don't know how to handle (%s, %s)", reason, object)
|
||||
|
||||
|
|
|
@ -115,11 +115,17 @@ def _pairing_failed(assistant, receiver, error):
|
|||
|
||||
header = 'Pairing failed: %s.' % error
|
||||
if 'timeout' in str(error):
|
||||
text = 'Make sure your device is within range,\nand it has a decent battery charge.'
|
||||
text = ('Make sure your device is within range,\n'
|
||||
'and it has a decent battery charge.')
|
||||
elif str(error) == 'device not supported':
|
||||
text = 'A new device was detected, but\nit is not compatible with this receiver.'
|
||||
text = ('A new device was detected, but\n'
|
||||
'it is not compatible with this receiver.')
|
||||
elif 'many' in str(error):
|
||||
text = ('The receiver only supports\n'
|
||||
'%d paired device(s).')
|
||||
else:
|
||||
text = None
|
||||
text = ('No further details are available\n'
|
||||
'about the error.')
|
||||
_create_page(assistant, Gtk.AssistantPageType.SUMMARY, header, 'dialog-error', text)
|
||||
|
||||
assistant.next_page()
|
||||
|
|
Loading…
Reference in New Issue