Browse Source

qt wizard WCWalletName: focus password textedit

- between the Back btn and the Next btn, the latter should have priority for focus
- but if the user needs to enter the wallet password, that textedit should have focus

closes https://github.com/spesmilo/electrum/issues/9157
related c6802adbae
master
SomberNight 1 year ago
parent
commit
1880c6a749
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/qt/wizard/wallet.py
  2. 4
      electrum/gui/qt/wizard/wizard.py

2
electrum/gui/qt/wizard/wallet.py

@ -381,7 +381,7 @@ class WCWalletName(WalletWizardComponent, Logger):
pw_label.show()
self.pw_e.show()
if not self.name_e.hasFocus():
self.pw_e.setFocus(True)
self.pw_e.setFocus()
else:
pw_label.hide()
self.pw_e.hide()

4
electrum/gui/qt/wizard/wizard.py

@ -47,10 +47,13 @@ class QEAbstractWizard(QDialog, MessageBoxMixin):
self.back_button = QPushButton(_("Back"), self)
self.back_button.clicked.connect(self.on_back_button_clicked)
self.back_button.setEnabled(False)
self.back_button.setDefault(False)
self.back_button.setAutoDefault(False)
self.next_button = QPushButton(_("Next"), self)
self.next_button.clicked.connect(self.on_next_button_clicked)
self.next_button.setEnabled(False)
self.next_button.setDefault(True)
self.next_button.setAutoDefault(True)
self.requestPrev.connect(self.on_back_button_clicked)
self.requestNext.connect(self.on_next_button_clicked)
self.logo = QLabel()
@ -126,7 +129,6 @@ class QEAbstractWizard(QDialog, MessageBoxMixin):
self.load_next_component(viewstate.view, viewstate.wizard_data, viewstate.params)
# TODO: re-test if needed on macOS
self.refresh_gui() # Need for QT on MacOSX. Lame.
self.next_button.setFocus() # setDefault() is not enough
def refresh_gui(self):
# For some reason, to refresh the GUI this needs to be called twice

Loading…
Cancel
Save