fix(TabAddressSelectorView): fix propagating roles from one model to another

- namely fixes the wallet account color and keycard decoration
- adjust mock model to contain the needed role (for keycard icon)
This commit is contained in:
Lukáš Tinkl 2024-07-08 20:07:29 +02:00 committed by Lukáš Tinkl
parent 48d8846e29
commit d3b2f23fe0
3 changed files with 21 additions and 18 deletions

View File

@ -13,7 +13,8 @@ ListModel {
preferredSharingChainIds: "5:420:421613",
walletType: "",
position: 0,
canSend: true
canSend: true,
migratedToKeycard: false
},
{
name: "Hot wallet (generated)",
@ -24,7 +25,8 @@ ListModel {
preferredSharingChainIds: "5:420:421613",
walletType: Constants.generatedWalletType,
position: 3,
canSend: true
canSend: true,
migratedToKeycard: false
},
{
name: "Family (seed)",
@ -35,7 +37,8 @@ ListModel {
preferredSharingChainIds: "5:420:421613",
walletType: Constants.seedWalletType,
position: 1,
canSend: true
canSend: true,
migratedToKeycard: false
},
{
name: "Tag Heuer (watch)",
@ -46,7 +49,8 @@ ListModel {
preferredSharingChainIds: "5:420:421613",
walletType: Constants.watchWalletType,
position: 2,
canSend: false
canSend: false,
migratedToKeycard: false
},
{
name: "Fab (key)",
@ -57,7 +61,8 @@ ListModel {
preferredSharingChainIds: "5:420:421613",
walletType: Constants.keyWalletType,
position: 4,
canSend: true
canSend: true,
migratedToKeycard: true
}
]

View File

@ -246,16 +246,14 @@ StatusDialog {
AccountSelectorHeader {
id: accountSelector
model: SortFilterProxyModel {
sourceModel: SortFilterProxyModel {
sourceModel: popup.store.accounts
filters: [
ValueFilter {
roleName: "canSend"
value: true
}
]
}
sourceModel: popup.store.accounts
filters: [
ValueFilter {
roleName: "canSend"
value: true
}
]
sorters: RoleSorter { roleName: "position"; sortOrder: Qt.AscendingOrder }
proxyRoles: [
FastExpressionRole {

View File

@ -16,8 +16,6 @@ import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils
import utils 1.0
import "../panels"
import "../controls"
import "../views"
@ -137,11 +135,13 @@ Item {
}
onClicked: recipientSelected({name: model.name,
address: model.address,
color: model.color,
colorId: model.colorId,
emoji: model.emoji,
walletType: model.walletType,
currencyBalance: model.currencyBalance,
preferredSharingChainIds: model.preferredSharingChainIds},
preferredSharingChainIds: model.preferredSharingChainIds,
migratedToKeycard: model.migratedToKeycard
},
TabAddressSelectorView.Type.Account)
}