Browse Source

Merge pull request #8870 from accumulator/wizard_component_race

qt: wizard: move page.on_ready() to just after construction
master
accumulator 2 years ago committed by GitHub
parent
commit
620b46780b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      electrum/gui/qt/wizard/wizard.py

8
electrum/gui/qt/wizard/wizard.py

@ -46,8 +46,10 @@ 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.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.requestPrev.connect(self.on_back_button_clicked)
self.requestNext.connect(self.on_next_button_clicked)
@ -144,12 +146,14 @@ class QEAbstractWizard(QDialog, MessageBoxMixin):
raise e
page.wizard_data = copy.deepcopy(wdata)
page.params = params
page.updated.connect(self.on_page_updated)
page.on_ready() # call before component emits any signals
self._logger.debug(f'load_next_component: {page=!r}')
page.updated.connect(self.on_page_updated)
# add to stack and update wizard
self.main_widget.setCurrentIndex(self.main_widget.addWidget(page))
page.on_ready()
page.apply()
self.update()

Loading…
Cancel
Save