|
|
|
|
@ -680,11 +680,18 @@ class GenericInputHandler:
|
|
|
|
|
return |
|
|
|
|
if not data: |
|
|
|
|
data = '' |
|
|
|
|
try: |
|
|
|
|
if allow_multi: |
|
|
|
|
new_text = self.text() + data + '\n' # TODO: unused? |
|
|
|
|
text = self.text() |
|
|
|
|
if data in text: |
|
|
|
|
return |
|
|
|
|
if text and not text.endswith('\n'): |
|
|
|
|
text += '\n' |
|
|
|
|
text += data |
|
|
|
|
text += '\n' |
|
|
|
|
setText(text) |
|
|
|
|
else: |
|
|
|
|
new_text = data |
|
|
|
|
try: |
|
|
|
|
setText(new_text) |
|
|
|
|
except Exception as e: |
|
|
|
|
show_error(_('Invalid payment identifier in QR') + ':\n' + repr(e)) |
|
|
|
|
@ -725,11 +732,18 @@ class GenericInputHandler:
|
|
|
|
|
show_error(_("No QR code was found on the screen.")) |
|
|
|
|
return |
|
|
|
|
data = scanned_qr[0].data |
|
|
|
|
try: |
|
|
|
|
if allow_multi: |
|
|
|
|
new_text = self.text() + data + '\n' # TODO: unused? |
|
|
|
|
text = self.text() |
|
|
|
|
if data in text: |
|
|
|
|
return |
|
|
|
|
if text and not text.endswith('\n'): |
|
|
|
|
text += '\n' |
|
|
|
|
text += data |
|
|
|
|
text += '\n' |
|
|
|
|
setText(text) |
|
|
|
|
else: |
|
|
|
|
new_text = data |
|
|
|
|
try: |
|
|
|
|
setText(new_text) |
|
|
|
|
except Exception as e: |
|
|
|
|
show_error(_('Invalid payment identifier in QR') + ':\n' + repr(e)) |
|
|
|
|
|