remove unsused method

This commit is contained in:
Iuri Matias 2020-05-21 11:31:37 -04:00
parent 7cd9ceac28
commit 81a478d797
2 changed files with 21 additions and 27 deletions

View File

@ -25,7 +25,7 @@ QtObject:
type OnboardingView* = ref object of QAbstractListModel type OnboardingView* = ref object of QAbstractListModel
addresses*: seq[Address] addresses*: seq[Address]
model: AccountModel model: AccountModel
m_generatedAddresses: string # m_generatedAddresses: string
doStoreAccountAndLogin: proc(model: AccountModel, selectedAccount: int, password: string): string doStoreAccountAndLogin: proc(model: AccountModel, selectedAccount: int, password: string): string
doGenerateRandomAccountAndLogin: proc(events: EventEmitter) doGenerateRandomAccountAndLogin: proc(events: EventEmitter)
@ -46,9 +46,6 @@ QtObject:
result.addresses = @[] result.addresses = @[]
result.setup result.setup
proc addAddressToList*(self: OnboardingView, username: string, identicon: string, key: string) {.slot.} = proc addAddressToList*(self: OnboardingView, username: string, identicon: string, key: string) {.slot.} =
self.beginInsertRows(newQModelIndex(), self.addresses.len, self.addresses.len) self.beginInsertRows(newQModelIndex(), self.addresses.len, self.addresses.len)
self.addresses.add(Address(username : username, self.addresses.add(Address(username : username,
@ -77,35 +74,32 @@ QtObject:
AddressRoles.Identicon.int:"identicon", AddressRoles.Identicon.int:"identicon",
AddressRoles.Key.int:"key" }.toTable AddressRoles.Key.int:"key" }.toTable
# proc getGeneratedAddresses*(self: OnboardingView): string {.slot.} =
# result = self.m_generatedAddresses
# proc generatedAddressesChanged*(self: OnboardingView,
# generatedAddresses: string) {.signal.}
# proc setGeneratedAddresses*(self: OnboardingView, generatedAddresses: string) {.slot.} =
# if self.m_generatedAddresses == generatedAddresses:
# return
# self.m_generatedAddresses = generatedAddresses
# self.generatedAddressesChanged(generatedAddresses)
proc getGeneratedAddresses*(self: OnboardingView): string {.slot.} = # QtProperty[string]generatedAddresses:
result = self.m_generatedAddresses # read = getGeneratedAddresses
# write = setGeneratedAddresses
proc generatedAddressesChanged*(self: OnboardingView, # notify = generatedAddressesChanged
generatedAddresses: string) {.signal.}
proc setGeneratedAddresses*(self: OnboardingView, generatedAddresses: string) {.slot.} =
if self.m_generatedAddresses == generatedAddresses:
return
self.m_generatedAddresses = generatedAddresses
self.generatedAddressesChanged(generatedAddresses)
QtProperty[string]generatedAddresses:
read = getGeneratedAddresses
write = setGeneratedAddresses
notify = generatedAddressesChanged
# QML functions # QML functions
proc generateAddresses*(self: OnboardingView) {.slot.} = # proc generateAddresses*(self: OnboardingView) {.slot.} =
self.setGeneratedAddresses(status_accounts.generateAddresses()) # self.setGeneratedAddresses(status_accounts.generateAddresses())
proc generateAlias*(self: OnboardingView, publicKey: string): string {.slot.} = # proc generateAlias*(self: OnboardingView, publicKey: string): string {.slot.} =
result = $libstatus.generateAlias(publicKey.toGoString) # result = $libstatus.generateAlias(publicKey.toGoString)
proc identicon*(self: OnboardingView, publicKey: string): string {.slot.} = # proc identicon*(self: OnboardingView, publicKey: string): string {.slot.} =
result = $libstatus.identicon(publicKey.toGoString) # result = $libstatus.identicon(publicKey.toGoString)
# proc storeAccountAndLogin(self: OnboardingView, selectedAccount: string, password: string): string {.slot.} = # proc storeAccountAndLogin(self: OnboardingView, selectedAccount: string, password: string): string {.slot.} =
proc storeAccountAndLogin(self: OnboardingView, selectedAccountIndex: int, password: string): string {.slot.} = proc storeAccountAndLogin(self: OnboardingView, selectedAccountIndex: int, password: string): string {.slot.} =

View File

@ -9,7 +9,7 @@ SwipeView {
anchors.fill: parent anchors.fill: parent
currentIndex: 0 currentIndex: 0
property string strGeneratedAccounts: onboardingLogic.generatedAddresses // property string strGeneratedAccounts: onboardingLogic.generatedAddresses
// property var generatedAccounts: {} // property var generatedAccounts: {}
// signal storeAccountAndLoginResult(response: var) // signal storeAccountAndLoginResult(response: var)
signal storeAccountAndLoginResult() signal storeAccountAndLoginResult()