1
0

qt send tab: fix payto_contacts

closes https://github.com/spesmilo/electrum/issues/8313
This commit is contained in:
SomberNight
2023-04-19 16:08:24 +00:00
parent 75578d2baa
commit e617dd07a0
2 changed files with 6 additions and 3 deletions

View File

@@ -121,6 +121,7 @@ class PayToEdit(Logger, GenericInputHandler):
self.setText = self.editor.setText
self.setEnabled = self.editor.setEnabled
self.setReadOnly = self.editor.setReadOnly
self.setFocus = self.editor.setFocus
# button handlers
self.on_qr_from_camera_input_btn = partial(
self.input_qr_from_camera,
@@ -150,10 +151,13 @@ class PayToEdit(Logger, GenericInputHandler):
return self.text_edit if self.is_paytomany() else self.line_edit
def set_paytomany(self, b):
has_focus = self.editor.hasFocus()
self._is_paytomany = b
self.line_edit.setVisible(not b)
self.text_edit.setVisible(b)
self.send_tab.paytomany_menu.setChecked(b)
if has_focus:
self.editor.setFocus()
def toggle_paytomany(self):
self.set_paytomany(not self._is_paytomany)

View File

@@ -793,12 +793,11 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
def payto_contacts(self, labels):
paytos = [self.window.get_contact_payto(label) for label in labels]
self.window.show_send_tab()
self.payto_e.do_clear()
if len(paytos) == 1:
self.payto_e.setText(paytos[0])
self.amount_e.setFocus()
else:
self.payto_e.setFocus()
text = "\n".join([payto + ", 0" for payto in paytos])
self.payto_e.setText(text)
self.payto_e.setFocus()