diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 2e3d83bff..c02aed956 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -941,7 +941,7 @@ class ElectrumWindow(QMainWindow): amount = self.amount_e.get_amount() fee = self.fee_e.get_amount() - outputs = self.payto_e.get_outputs(False) + outputs = self.payto_e.get_outputs() if not is_fee: fee = None @@ -1034,12 +1034,11 @@ class ElectrumWindow(QMainWindow): if self.payment_request: outputs = self.payment_request.get_outputs() else: - try: - outputs = self.payto_e.get_outputs() - except ValueError as e: - traceback.print_exc(file=sys.stdout) - self.show_message(str(e)) + errors = self.payto_e.get_errors() + if errors: + self.show_warning(_("Invalid Lines found:") + "\n\n" + '\n'.join([ _("Line #") + str(x[0]+1) + ": " + x[1] for x in errors])) return + outputs = self.payto_e.get_outputs() if not outputs: QMessageBox.warning(self, _('Error'), _('No outputs'), _('OK')) diff --git a/gui/qt/paytoedit.py b/gui/qt/paytoedit.py index 18f62505f..4fd961755 100644 --- a/gui/qt/paytoedit.py +++ b/gui/qt/paytoedit.py @@ -23,7 +23,6 @@ from qrtextedit import QRTextEdit import re from decimal import Decimal from electrum import bitcoin -from electrum.i18n import _ RE_ADDRESS = '[1-9A-HJ-NP-Za-km-z]{26,}' RE_ALIAS = '(.*?)\s*\<([1-9A-HJ-NP-Za-km-z]{26,})\>' @@ -143,21 +142,17 @@ class PayToEdit(QRTextEdit): self.unlock_amount() - def get_outputs(self, show_err=True): + def get_errors(self): + return self.errors + + def get_outputs(self): if self.payto_address: try: amount = self.amount_edit.get_amount() except: amount = None - self.outputs = [('address', self.payto_address, amount)] - if self.errors != [] and show_err: - errtext = "" - for x in self.errors: - errtext += _("Line #") + str(x[0]+1) + ": " + x[1] + "\n" - raise ValueError(_("ABORTING! Invalid Lines found:") + "\n\n" + errtext) - return self.outputs[:]