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
|
|
|
|
|
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-03-17 16:15:38 +00:00
|
|
|
property bool fetchingUpdate: aboutModule.fetching
|
|
|
|
|
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-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
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
property ListModel mainMenuItems: ListModel {
|
2022-02-25 13:32:46 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
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"})
|
|
|
|
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-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.privacyAndSecurity,
|
|
|
|
text: qsTr("Privacy and security"),
|
|
|
|
icon: "security"})
|
|
|
|
append({subsection: Constants.settingsSubsection.appearance,
|
|
|
|
text: qsTr("Appearance"),
|
|
|
|
icon: "appearance"})
|
|
|
|
append({subsection: Constants.settingsSubsection.language,
|
2022-04-01 10:30:55 +00:00
|
|
|
text: qsTr("Language & Currency"),
|
2022-02-25 13:32:46 +00:00
|
|
|
icon: "language"})
|
|
|
|
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"})
|
|
|
|
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.needHelp,
|
2022-03-03 13:16:27 +00:00
|
|
|
text: qsTr("Help & Glossary"),
|
2022-02-25 13:32:46 +00:00
|
|
|
icon: "help"})
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|