2021-10-06 09:16:39 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import utils 1.0
|
|
|
|
|
2022-04-19 11:13:57 +00:00
|
|
|
import AppLayouts.Chat.stores 1.0
|
2024-03-29 11:43:49 +00:00
|
|
|
import AppLayouts.Communities.stores 1.0
|
|
|
|
import AppLayouts.Profile.helpers 1.0
|
|
|
|
|
|
|
|
import StatusQ.Core.Utils 0.1
|
2022-04-19 11:13:57 +00:00
|
|
|
|
2023-12-11 09:47:30 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
QtObject {
|
|
|
|
id: root
|
2022-10-01 12:07:14 +00:00
|
|
|
|
2022-09-13 16:17:54 +00:00
|
|
|
property string backButtonName
|
2022-10-01 12:07:14 +00:00
|
|
|
|
2021-10-13 21:31:04 +00:00
|
|
|
property var aboutModuleInst: aboutModule
|
2023-03-24 12:48:33 +00:00
|
|
|
property var mainModuleInst: mainModule
|
2021-12-29 15:09:29 +00:00
|
|
|
property var profileSectionModuleInst: profileSectionModule
|
2021-12-27 11:04:10 +00:00
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
readonly property bool fetchingUpdate: aboutModuleInst.fetching
|
2022-03-17 16:15:38 +00:00
|
|
|
|
2021-12-31 12:29:51 +00:00
|
|
|
property ContactsStore contactsStore: ContactsStore {
|
|
|
|
contactsModule: profileSectionModuleInst.contactsModule
|
|
|
|
}
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
property AdvancedStore advancedStore: AdvancedStore {
|
2023-10-03 13:30:42 +00:00
|
|
|
walletModule: profileSectionModuleInst.walletModule
|
2021-12-29 15:09:29 +00:00
|
|
|
advancedModule: profileSectionModuleInst.advancedModule
|
2021-12-14 18:47:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-07 20:34:59 +00:00
|
|
|
property MessagingStore messagingStore: MessagingStore {
|
|
|
|
privacyModule: profileSectionModuleInst.privacyModule
|
|
|
|
syncModule: profileSectionModuleInst.syncModule
|
2022-08-02 18:37:27 +00:00
|
|
|
wakuModule: profileSectionModuleInst.wakuModule
|
2021-12-27 11:04:10 +00:00
|
|
|
}
|
|
|
|
|
2022-03-07 20:34:59 +00:00
|
|
|
property DevicesStore devicesStore: DevicesStore {
|
|
|
|
devicesModule: profileSectionModuleInst.devicesModule
|
2021-12-27 16:40:46 +00:00
|
|
|
}
|
|
|
|
|
2021-12-28 14:43:25 +00:00
|
|
|
property NotificationsStore notificationsStore: NotificationsStore {
|
2021-12-29 15:09:29 +00:00
|
|
|
notificationsModule: profileSectionModuleInst.notificationsModule
|
2021-12-28 14:43:25 +00:00
|
|
|
}
|
|
|
|
|
2021-12-29 09:53:56 +00:00
|
|
|
property LanguageStore languageStore: LanguageStore {
|
2021-12-29 15:09:29 +00:00
|
|
|
languageModule: profileSectionModuleInst.languageModule
|
2021-12-29 09:53:56 +00:00
|
|
|
}
|
|
|
|
|
2021-12-29 10:32:43 +00:00
|
|
|
property AppearanceStore appearanceStore: AppearanceStore {
|
|
|
|
}
|
|
|
|
|
2021-12-29 15:09:29 +00:00
|
|
|
property ProfileStore profileStore: ProfileStore {
|
|
|
|
profileModule: profileSectionModuleInst.profileModule
|
|
|
|
}
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property PrivacyStore privacyStore: PrivacyStore {
|
|
|
|
privacyModule: profileSectionModuleInst.privacyModule
|
|
|
|
}
|
|
|
|
|
2022-01-17 08:56:44 +00:00
|
|
|
property EnsUsernamesStore ensUsernamesStore: EnsUsernamesStore {
|
|
|
|
ensUsernamesModule: profileSectionModuleInst.ensUsernamesModule
|
|
|
|
}
|
2021-12-13 14:24:21 +00:00
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
property WalletStore walletStore: WalletStore {
|
2023-08-04 12:41:57 +00:00
|
|
|
walletModule: profileSectionModuleInst.walletModule
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 09:19:15 +00:00
|
|
|
property KeycardStore keycardStore: KeycardStore {
|
|
|
|
keycardModule: profileSectionModuleInst.keycardModule
|
|
|
|
}
|
|
|
|
|
2022-04-19 11:13:57 +00:00
|
|
|
property var stickersModuleInst: stickersModule
|
2024-05-22 08:13:39 +00:00
|
|
|
property StickersStore stickersStore: StickersStore {
|
2022-04-19 11:13:57 +00:00
|
|
|
stickersModule: stickersModuleInst
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
|
2023-03-15 13:35:03 +00:00
|
|
|
property bool walletMenuItemEnabled: profileStore.isWalletEnabled
|
2022-03-23 10:56:25 +00:00
|
|
|
|
2023-02-14 09:20:53 +00:00
|
|
|
property var communitiesModuleInst: Global.appIsReady? communitiesModule : null
|
2024-02-15 09:25:40 +00:00
|
|
|
|
2023-12-11 09:47:30 +00:00
|
|
|
property var communitiesList: SortFilterProxyModel {
|
|
|
|
sourceModel: root.mainModuleInst.sectionsModel
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "sectionType"
|
|
|
|
value: Constants.appSection.community
|
|
|
|
}
|
|
|
|
}
|
2022-03-23 10:56:25 +00:00
|
|
|
property var communitiesProfileModule: profileSectionModuleInst.communitiesModule
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
property ListModel mainMenuItems: ListModel {
|
2022-02-25 13:32:46 +00:00
|
|
|
Component.onCompleted: {
|
2022-05-26 13:40:41 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.backUpSeed,
|
|
|
|
text: qsTr("Back up seed phrase"),
|
|
|
|
icon: "seed-phrase"})
|
2022-02-25 13:32:46 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.profile,
|
2022-03-03 13:16:27 +00:00
|
|
|
text: qsTr("Profile"),
|
2022-02-25 13:32:46 +00:00
|
|
|
icon: "profile"})
|
2024-02-09 11:31:37 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.password,
|
|
|
|
text: qsTr("Password"),
|
2024-02-26 18:54:05 +00:00
|
|
|
icon: "password"})
|
2022-08-16 09:19:15 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.keycard,
|
|
|
|
text: qsTr("Keycard"),
|
|
|
|
icon: "keycard"})
|
2022-02-25 13:32:46 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.ensUsernames,
|
|
|
|
text: qsTr("ENS usernames"),
|
2024-07-18 20:10:24 +00:00
|
|
|
icon: "username",
|
2024-08-03 07:49:14 +00:00
|
|
|
isExperimental: true,
|
|
|
|
experimentalTooltip: qsTr("This section is going through a redesign.")
|
|
|
|
})
|
2023-03-14 02:52:16 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.syncingSettings,
|
|
|
|
text: qsTr("Syncing"),
|
2024-07-30 16:55:03 +00:00
|
|
|
icon: "rotate",
|
2024-08-03 07:49:14 +00:00
|
|
|
isExperimental: true,
|
|
|
|
experimentalTooltip: qsTr("Connection problems can happen.<br>If they do, please use the Enter a Seed Phrase feature instead.")
|
|
|
|
})
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
property ListModel appsMenuItems: ListModel {
|
2022-02-25 13:32:46 +00:00
|
|
|
Component.onCompleted: {
|
2022-03-07 20:34:59 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.messaging,
|
|
|
|
text: qsTr("Messaging"),
|
|
|
|
icon: "chat"})
|
2022-02-25 13:32:46 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.wallet,
|
|
|
|
text: qsTr("Wallet"),
|
|
|
|
icon: "wallet"})
|
2022-03-23 10:56:25 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.communitiesSettings,
|
|
|
|
text: qsTr("Communities"),
|
|
|
|
icon: "communities"})
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property ListModel settingsMenuItems: ListModel {
|
2022-02-25 13:32:46 +00:00
|
|
|
Component.onCompleted: {
|
2024-07-15 13:34:40 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.privacyAndSecurity,
|
|
|
|
text: qsTr("Privacy and security"),
|
|
|
|
icon: "security"})
|
2022-02-25 13:32:46 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.appearance,
|
|
|
|
text: qsTr("Appearance"),
|
|
|
|
icon: "appearance"})
|
|
|
|
append({subsection: Constants.settingsSubsection.notifications,
|
2022-04-04 11:09:23 +00:00
|
|
|
text: qsTr("Notifications & Sounds"),
|
2022-02-25 13:32:46 +00:00
|
|
|
icon: "notification"})
|
2022-05-26 13:40:41 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.language,
|
|
|
|
text: qsTr("Language & Currency"),
|
|
|
|
icon: "language"})
|
2022-02-25 13:32:46 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.advanced,
|
|
|
|
text: qsTr("Advanced"),
|
|
|
|
icon: "settings"})
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property ListModel extraMenuItems: ListModel {
|
2022-02-25 13:32:46 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
append({subsection: Constants.settingsSubsection.about,
|
|
|
|
text: qsTr("About"),
|
|
|
|
icon: "info"})
|
|
|
|
append({subsection: Constants.settingsSubsection.signout,
|
|
|
|
text: qsTr("Sign out & Quit"),
|
|
|
|
icon: "logout"})
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
readonly property alias ownShowcaseCommunitiesModel: ownShowcaseModels.adaptedCommunitiesSourceModel
|
|
|
|
readonly property alias ownShowcaseAccountsModel: ownShowcaseModels.adaptedAccountsSourceModel
|
|
|
|
readonly property alias ownShowcaseCollectiblesModel: ownShowcaseModels.adaptedCollectiblesSourceModel
|
|
|
|
readonly property alias ownShowcaseSocialLinksModel: ownShowcaseModels.adaptedSocialLinksSourceModel
|
|
|
|
|
|
|
|
readonly property alias contactShowcaseCommunitiesModel: contactShowcaseModels.adaptedCommunitiesSourceModel
|
|
|
|
readonly property alias contactShowcaseAccountsModel: contactShowcaseModels.adaptedAccountsSourceModel
|
|
|
|
readonly property alias contactShowcaseCollectiblesModel: contactShowcaseModels.adaptedCollectiblesSourceModel
|
|
|
|
readonly property alias contactShowcaseSocialLinksModel: contactShowcaseModels.adaptedSocialLinksSourceModel
|
|
|
|
|
|
|
|
function requestContactShowcase(address) {
|
|
|
|
root.contactsStore.requestProfileShowcase(address)
|
|
|
|
}
|
|
|
|
|
|
|
|
function requestOwnShowcase() {
|
|
|
|
root.profileStore.requestProfileShowcasePreferences()
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property QObject d: QObject {
|
|
|
|
ProfileShowcaseSettingsModelAdapter {
|
|
|
|
id: ownShowcaseModels
|
|
|
|
communitiesSourceModel: root.communitiesList
|
|
|
|
communitiesShowcaseModel: root.profileStore.showcasePreferencesCommunitiesModel
|
|
|
|
accountsSourceModel: root.walletStore.ownAccounts
|
|
|
|
accountsShowcaseModel: root.profileStore.showcasePreferencesAccountsModel
|
|
|
|
collectiblesSourceModel: root.walletStore.collectibles
|
|
|
|
collectiblesShowcaseModel: root.profileStore.showcasePreferencesCollectiblesModel
|
|
|
|
socialLinksSourceModel: root.profileStore.showcasePreferencesSocialLinksModel
|
|
|
|
}
|
|
|
|
|
|
|
|
ProfileShowcaseModelAdapter {
|
|
|
|
id: contactShowcaseModels
|
|
|
|
communitiesSourceModel: root.communitiesModuleInst.model
|
|
|
|
communitiesShowcaseModel: root.contactsStore.showcaseContactCommunitiesModel
|
|
|
|
accountsSourceModel: root.contactsStore.showcaseContactAccountsModel
|
|
|
|
collectiblesSourceModel: root.contactsStore.showcaseCollectiblesModel
|
|
|
|
collectiblesShowcaseModel: root.contactsStore.showcaseContactCollectiblesModel
|
|
|
|
socialLinksSourceModel: root.contactsStore.showcaseContactSocialLinksModel
|
|
|
|
|
|
|
|
isAddressSaved: (address) => {
|
|
|
|
return false
|
|
|
|
}
|
2024-04-07 22:00:16 +00:00
|
|
|
isShowcaseLoading: root.contactsStore.isShowcaseForAContactLoading
|
2024-03-29 11:43:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
function getCurrentVersion() {
|
2021-10-13 21:31:04 +00:00
|
|
|
return aboutModuleInst.getCurrentVersion()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
2023-07-26 14:34:21 +00:00
|
|
|
function getStatusGoVersion() {
|
|
|
|
return aboutModuleInst.getStatusGoVersion()
|
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
function nodeVersion() {
|
2021-10-13 21:31:04 +00:00
|
|
|
return aboutModuleInst.nodeVersion()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function checkForUpdates() {
|
2021-12-23 13:45:52 +00:00
|
|
|
aboutModuleInst.checkForUpdates()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
function getNameForSubsection(subsection) {
|
|
|
|
let i = 0;
|
|
|
|
for (; i < mainMenuItems.count; i++) {
|
|
|
|
let elem = mainMenuItems.get(i)
|
|
|
|
if(elem.subsection === subsection)
|
|
|
|
return elem.text
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i=0; i < appsMenuItems.count; i++) {
|
|
|
|
let elem = appsMenuItems.get(i)
|
|
|
|
if(elem.subsection === subsection)
|
|
|
|
return elem.text
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i=0; i < settingsMenuItems.count; i++) {
|
|
|
|
let elem = settingsMenuItems.get(i)
|
|
|
|
if(elem.subsection === subsection)
|
|
|
|
return elem.text
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i=0; i < extraMenuItems.count; i++) {
|
|
|
|
let elem = extraMenuItems.get(i)
|
|
|
|
if(elem.subsection === subsection)
|
|
|
|
return elem.text
|
|
|
|
}
|
|
|
|
|
|
|
|
return ""
|
|
|
|
}
|
2023-12-20 10:46:33 +00:00
|
|
|
|
|
|
|
function addressWasShown(address) {
|
|
|
|
return root.mainModuleInst.addressWasShown(address)
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|