minor fixes for payto_edit

This commit is contained in:
ThomasV 2014-06-06 07:17:47 +02:00
parent 7c3d8471e5
commit 0673df9176
2 changed files with 7 additions and 6 deletions

View File

@ -810,7 +810,8 @@ class ElectrumWindow(QMainWindow):
confirm_amount = self.config.get('confirm_amount', 100000000)
if amount >= confirm_amount:
if not self.question(_("send %(amount)s to %(address)s?")%{ 'amount' : self.format_amount(amount) + ' '+ self.base_unit(), 'address' : to_address}):
o = '\n'.join(map(lambda x:x[0], outputs))
if not self.question(_("send %(amount)s to %(address)s?")%{ 'amount' : self.format_amount(amount) + ' '+ self.base_unit(), 'address' : o}):
return
confirm_fee = self.config.get('confirm_fee', 100000)

View File

@ -40,6 +40,7 @@ class PayToEdit(QTextEdit):
self.setMinimumHeight(27)
self.setMaximumHeight(27)
self.c = None
self.textChanged.connect(self.check_text)
def lock_amount(self):
self.amount_edit.setFrozen(True)
@ -80,12 +81,13 @@ class PayToEdit(QTextEdit):
outputs = []
total = 0
self.payto_address = None
if len(lines) == 1:
try:
self.payto_address = self.parse_address(lines[0])
except:
self.payto_address = None
pass
if self.payto_address:
self.unlock_amount()
return
@ -119,7 +121,7 @@ class PayToEdit(QTextEdit):
if self.payto_address:
if not bitcoin.is_address(self.payto_address):
QMessageBox.warning(self, _('Error'), _('Invalid Bitcoin Address') + ':\n' + to_address, _('OK'))
QMessageBox.warning(self, _('Error'), _('Invalid Bitcoin Address') + ':\n' + self.payto_address, _('OK'))
return
try:
@ -165,7 +167,6 @@ class PayToEdit(QTextEdit):
tc.movePosition(QTextCursor.EndOfWord)
tc.insertText(completion.right(extra))
self.setTextCursor(tc)
self.check_text()
def textUnderCursor(self):
@ -195,7 +196,6 @@ class PayToEdit(QTextEdit):
if not self.c or not isShortcut:
QTextEdit.keyPressEvent(self, e)
self.check_text()
ctrlOrShift = e.modifiers() and (Qt.ControlModifier or Qt.ShiftModifier)