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
|
|
|
|
|
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
|
|
|
|
|
|
|
property var activityCenterModuleInst: activityCenterModule
|
|
|
|
property var activityCenterList: activityCenterModuleInst.activityNotificationsModel
|
2022-08-09 15:08:39 +00:00
|
|
|
property int unreadNotificationsCount: activityCenterList.unreadCount
|
2021-10-06 09:16:39 +00:00
|
|
|
|
2021-10-13 21:31:04 +00:00
|
|
|
property var aboutModuleInst: aboutModule
|
|
|
|
|
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 {
|
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
|
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 {
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
property var stickersStore: StickersStore {
|
|
|
|
stickersModule: stickersModuleInst
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
|
2021-10-20 09:50:50 +00:00
|
|
|
property bool browserMenuItemEnabled: localAccountSensitiveSettings.isBrowserEnabled
|
2022-03-07 20:34:59 +00:00
|
|
|
property bool walletMenuItemEnabled: localAccountSensitiveSettings.isWalletEnabled
|
2022-03-23 10:56:25 +00:00
|
|
|
|
|
|
|
property var communitiesModuleInst: communitiesModule
|
|
|
|
property var communitiesList: communitiesModuleInst.model
|
|
|
|
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"})
|
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"),
|
|
|
|
icon: "username"})
|
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-03 13:16:27 +00:00
|
|
|
append({subsection: Constants.settingsSubsection.browserSettings,
|
|
|
|
text: qsTr("Browser"),
|
|
|
|
icon: "browser"})
|
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: {
|
|
|
|
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.devicesSettings,
|
|
|
|
text: qsTr("Devices settings"),
|
|
|
|
icon: "mobile"})
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 10:56:25 +00:00
|
|
|
function importCommunity(communityKey) {
|
|
|
|
root.communitiesModuleInst.importCommunity(communityKey);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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 ""
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|