qt: submit final state to wizard and return proper dialog result when finished
This commit is contained in:
@@ -98,28 +98,31 @@ class QENewWalletWizard(NewWalletWizard, QEAbstractWizard):
|
|||||||
# def isMatchingSeed(self, seed, seed_again):
|
# def isMatchingSeed(self, seed, seed_again):
|
||||||
# return mnemonic.is_matching_seed(seed=seed, seed_again=seed_again)
|
# return mnemonic.is_matching_seed(seed=seed, seed_again=seed_again)
|
||||||
#
|
#
|
||||||
# @pyqtSlot('QJSValue', bool, str)
|
|
||||||
# def createStorage(self, js_data, single_password_enabled, single_password):
|
def create_storage(self, single_password: str = None):
|
||||||
# self._logger.info('Creating wallet from wizard data')
|
self._logger.info('Creating wallet from wizard data')
|
||||||
# data = js_data.toVariant()
|
# data = js_data.toVariant()
|
||||||
#
|
data = self._current.wizard_data
|
||||||
# if single_password_enabled and single_password:
|
|
||||||
# data['encrypt'] = True
|
if self.is_single_password() and single_password:
|
||||||
# data['password'] = single_password
|
data['encrypt'] = True
|
||||||
#
|
data['password'] = single_password
|
||||||
# path = os.path.join(os.path.dirname(self._daemon.daemon.config.get_wallet_path()), data['wallet_name'])
|
|
||||||
#
|
path = os.path.join(os.path.dirname(self._daemon.config.get_wallet_path()), data['wallet_name'])
|
||||||
# try:
|
|
||||||
# self.create_storage(path, data)
|
try:
|
||||||
#
|
super().create_storage(path, data)
|
||||||
# # minimally populate self after create
|
|
||||||
# self._password = data['password']
|
# minimally populate self after create
|
||||||
# self.path = path
|
self._password = data['password']
|
||||||
#
|
# self.path = path
|
||||||
# self.createSuccess.emit()
|
|
||||||
# except Exception as e:
|
# self.createSuccess.emit()
|
||||||
# self._logger.error(f"createStorage errored: {e!r}")
|
return True
|
||||||
# self.createError.emit(str(e))
|
except Exception as e:
|
||||||
|
self._logger.error(f"createStorage errored: {e!r}")
|
||||||
|
return False
|
||||||
|
# self.createError.emit(str(e))
|
||||||
|
|
||||||
|
|
||||||
class WCWalletName(WizardComponent):
|
class WCWalletName(WizardComponent):
|
||||||
|
|||||||
@@ -143,8 +143,9 @@ class QEAbstractWizard(QDialog):
|
|||||||
page.apply()
|
page.apply()
|
||||||
wd = page.wizard_data.copy()
|
wd = page.wizard_data.copy()
|
||||||
if self.is_last(wd):
|
if self.is_last(wd):
|
||||||
|
self.submit(wd)
|
||||||
self.finished(wd)
|
self.finished(wd)
|
||||||
self.close()
|
self.accept()
|
||||||
else:
|
else:
|
||||||
next = self.submit(wd)
|
next = self.submit(wd)
|
||||||
self.load_next_component(next['view'], wd)
|
self.load_next_component(next['view'], wd)
|
||||||
|
|||||||
Reference in New Issue
Block a user