Wallet: add missing notification on keypairImportModule change

Closes: #16773
This commit is contained in:
Michał Cieślak 2024-12-11 14:17:52 +01:00 committed by Anthony Laibe
parent 47324b2354
commit aa7a6300b1
4 changed files with 14 additions and 2 deletions

View File

@ -102,10 +102,12 @@ method destroyKeypairImportPopup*(self: Module) =
self.view.emitDestroyKeypairImportPopup()
self.keypairImportModule.delete
self.keypairImportModule = nil
self.view.emitKeypairImportModuleChangedSignal()
method runKeypairImportPopup*(self: Module, keyUid: string, mode: ImportKeypairModuleMode) =
self.keypairImportModule = keypair_import_module.newModule(self, self.events, self.accountsService,
self.walletAccountService, self.devicesService)
self.view.emitKeypairImportModuleChangedSignal()
self.keypairImportModule.load(keyUid, mode)
method getKeypairImportModule*(self: Module): QVariant =

View File

@ -29,10 +29,14 @@ QtObject:
proc runKeypairImportPopup*(self: View, keyUid: string, mode: int) {.slot.} =
self.delegate.runKeypairImportPopup(keyUid, ImportKeypairModuleMode(mode))
proc keypairImportModuleChanged*(self: View) {.signal.}
proc emitKeypairImportModuleChangedSignal*(self: View) =
self.keypairImportModuleChanged()
proc getKeypairImportModule(self: View): QVariant {.slot.} =
return self.delegate.getKeypairImportModule()
QtProperty[QVariant] keypairImportModule:
read = getKeypairImportModule
notify = keypairImportModuleChanged
proc displayKeypairImportPopup*(self: View) {.signal.}
proc emitDisplayKeypairImportPopup*(self: View) =

View File

@ -487,6 +487,7 @@ method destroyKeypairImportPopup*(self: Module) =
self.view.emitDestroyKeypairImportPopup()
self.keypairImportModule.delete
self.keypairImportModule = nil
self.view.emitKeypairImportModuleChangedSignal()
method runKeypairImportPopup*(self: Module) =
if self.filter.addresses.len != 1:
@ -497,6 +498,7 @@ method runKeypairImportPopup*(self: Module) =
self.keypairImportModule = keypair_import_module.newModule(self, self.events, self.accountsService,
self.walletAccountService, self.devicesService)
self.keypairImportModule.load(keypair.keyUid, ImportKeypairModuleMode.SelectImportMethod)
self.view.emitKeypairImportModuleChangedSignal()
method getKeypairImportModule*(self: Module): QVariant =
if self.keypairImportModule.isNil:
@ -542,4 +544,4 @@ method reloadAccountTokens*(self: Module) =
self.controller.reloadAccountTokens()
method isChecksumValidForAddress*(self: Module, address: string): bool =
return self.controller.isChecksumValidForAddress(address)
return self.controller.isChecksumValidForAddress(address)

View File

@ -223,10 +223,14 @@ QtObject:
proc runKeypairImportPopup*(self: View) {.slot.} =
self.delegate.runKeypairImportPopup()
proc keypairImportModuleChanged*(self: View) {.signal.}
proc emitKeypairImportModuleChangedSignal*(self: View) =
self.keypairImportModuleChanged()
proc getKeypairImportModule(self: View): QVariant {.slot.} =
return self.delegate.getKeypairImportModule()
QtProperty[QVariant] keypairImportModule:
read = getKeypairImportModule
notify = keypairImportModuleChanged
proc displayKeypairImportPopup*(self: View) {.signal.}
proc emitDisplayKeypairImportPopup*(self: View) =
@ -308,4 +312,4 @@ QtObject:
notify = isAccountTokensReloadingChanged
proc isChecksumValidForAddress*(self: View, address: string): bool {.slot.} =
return self.delegate.isChecksumValidForAddress(address)
return self.delegate.isChecksumValidForAddress(address)