1
0

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
This commit is contained in:
SomberNight
2024-08-13 04:05:03 +00:00
parent a19e14bc2c
commit 3d3e6f812c
2 changed files with 4 additions and 2 deletions

View File

@@ -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()

View File

@@ -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