2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2022-06-03 10:48:03 +00:00
|
|
|
import shared.panels 1.0
|
2023-01-18 09:25:36 +00:00
|
|
|
import shared.stores 1.0 as SharedStores
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import "stores"
|
|
|
|
import "popups"
|
|
|
|
import "views"
|
2020-05-19 19:44:45 +00:00
|
|
|
|
2021-06-16 11:15:28 +00:00
|
|
|
import StatusQ.Layout 0.1
|
2022-05-07 11:45:15 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-06-16 11:15:28 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
StatusSectionLayout {
|
|
|
|
id: root
|
2021-06-16 11:15:28 +00:00
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property ProfileSectionStore store
|
2021-12-09 13:28:02 +00:00
|
|
|
property var globalStore
|
|
|
|
property var systemPalette
|
2022-03-10 17:01:17 +00:00
|
|
|
property var emojiPopup
|
2023-04-04 11:31:04 +00:00
|
|
|
property var networkConnectionStore
|
2021-12-09 13:28:02 +00:00
|
|
|
|
2022-09-13 16:17:54 +00:00
|
|
|
backButtonName: root.store.backButtonName
|
2022-10-26 16:00:20 +00:00
|
|
|
notificationCount: activityCenterStore.unreadNotificationsCount
|
2023-02-07 15:53:56 +00:00
|
|
|
hasUnseenNotifications: activityCenterStore.hasUnseenNotifications
|
2022-10-18 09:06:18 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
onNotificationButtonClicked: Global.openActivityCenterPopup()
|
2022-09-13 16:17:54 +00:00
|
|
|
onBackButtonClicked: {
|
2022-12-14 13:59:14 +00:00
|
|
|
switch (Global.settingsSubsection) {
|
2022-10-18 09:06:18 +00:00
|
|
|
case Constants.settingsSubsection.contacts:
|
2022-09-13 16:17:54 +00:00
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.messaging)
|
|
|
|
break;
|
2022-10-18 09:06:18 +00:00
|
|
|
case Constants.settingsSubsection.wallet:
|
2022-12-14 13:59:14 +00:00
|
|
|
walletView.item.resetStack()
|
2022-09-13 16:17:54 +00:00
|
|
|
break;
|
2022-10-11 12:15:33 +00:00
|
|
|
case Constants.settingsSubsection.keycard:
|
2022-12-14 13:59:14 +00:00
|
|
|
keycardView.item.handleBackAction()
|
2022-10-11 12:15:33 +00:00
|
|
|
break;
|
2022-09-13 16:17:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
profileContainer.currentIndex = -1
|
|
|
|
profileContainer.currentIndex = Qt.binding(() => Global.settingsSubsection)
|
|
|
|
}
|
|
|
|
|
2021-12-09 13:28:02 +00:00
|
|
|
QtObject {
|
2022-05-07 11:45:15 +00:00
|
|
|
id: d
|
|
|
|
|
2022-09-13 16:17:54 +00:00
|
|
|
readonly property int leftMargin: 64
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
readonly property int contentWidth: 560
|
2021-12-09 13:28:02 +00:00
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
leftPanel: LeftTabView {
|
2022-08-09 15:08:39 +00:00
|
|
|
store: root.store
|
2021-10-06 09:16:39 +00:00
|
|
|
anchors.fill: parent
|
2022-06-22 12:16:21 +00:00
|
|
|
onMenuItemClicked: {
|
|
|
|
if (profileContainer.currentItem.dirty) {
|
|
|
|
event.accepted = true;
|
|
|
|
profileContainer.currentItem.notifyDirty();
|
|
|
|
}
|
|
|
|
}
|
2020-05-19 19:44:45 +00:00
|
|
|
}
|
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
centerPanel: StackLayout {
|
|
|
|
id: profileContainer
|
2022-03-16 21:20:03 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
readonly property var currentItem: (currentIndex >= 0 && currentIndex < children.length) ? children[currentIndex].item : null
|
2022-06-22 12:16:21 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: d.leftMargin
|
|
|
|
|
|
|
|
currentIndex: Global.settingsSubsection
|
|
|
|
|
|
|
|
onCurrentIndexChanged: {
|
2023-01-24 17:31:20 +00:00
|
|
|
if (!!children[currentIndex] && !children[currentIndex].active)
|
2022-12-14 13:59:14 +00:00
|
|
|
children[currentIndex].active = true
|
|
|
|
|
|
|
|
root.store.backButtonName = ""
|
|
|
|
|
2023-05-01 20:32:36 +00:00
|
|
|
if (currentIndex === Constants.settingsSubsection.contacts) {
|
2022-12-14 13:59:14 +00:00
|
|
|
root.store.backButtonName = root.store.getNameForSubsection(Constants.settingsSubsection.messaging)
|
|
|
|
} else if (currentIndex === Constants.settingsSubsection.wallet) {
|
|
|
|
walletView.item.resetStack()
|
|
|
|
} else if (currentIndex === Constants.settingsSubsection.keycard) {
|
|
|
|
keycardView.item.handleBackAction()
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: MyProfileView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
walletStore: root.store.walletStore
|
|
|
|
profileStore: root.store.profileStore
|
|
|
|
privacyStore: root.store.privacyStore
|
2022-09-27 21:26:26 +00:00
|
|
|
contactsStore: root.store.contactsStore
|
2023-02-28 15:00:10 +00:00
|
|
|
communitiesModel: root.store.communitiesList
|
2022-08-09 15:08:39 +00:00
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.profile)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: ContactsView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-08-09 15:08:39 +00:00
|
|
|
contactsStore: root.store.contactsStore
|
2022-05-07 11:45:15 +00:00
|
|
|
sectionTitle: qsTr("Contacts")
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2020-05-24 22:23:00 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
id: ensContainer
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: EnsView {
|
2022-05-07 11:45:15 +00:00
|
|
|
// TODO: we need to align structure for the entire this part using `SettingsContentBase` as root component
|
|
|
|
// TODO: handle structure for this subsection to match style used in onther sections
|
|
|
|
// using `SettingsContentBase` component as base.
|
2022-12-14 13:59:14 +00:00
|
|
|
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-08-09 15:08:39 +00:00
|
|
|
ensUsernamesStore: root.store.ensUsernamesStore
|
|
|
|
contactsStore: root.store.contactsStore
|
|
|
|
stickersStore: root.store.stickersStore
|
2023-04-04 11:31:04 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2022-05-07 11:45:15 +00:00
|
|
|
profileContentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2020-05-24 22:23:00 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: MessagingView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-08-09 15:08:39 +00:00
|
|
|
advancedStore: root.store.advancedStore
|
|
|
|
messagingStore: root.store.messagingStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.messaging)
|
|
|
|
contactsStore: root.store.contactsStore
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
id: walletView
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: WalletView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-09-13 16:17:54 +00:00
|
|
|
rootStore: root.store
|
2022-08-09 15:08:39 +00:00
|
|
|
walletStore: root.store.walletStore
|
|
|
|
emojiPopup: root.emojiPopup
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.wallet)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
onLoaded: root.store.backButtonName = ""
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: AppearanceView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
appearanceStore: root.store.appearanceStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.appearance)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
2022-08-09 15:08:39 +00:00
|
|
|
systemPalette: root.systemPalette
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: LanguageView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
languageStore: root.store.languageStore
|
2023-01-18 09:25:36 +00:00
|
|
|
currencyStore: SharedStores.RootStore.currencyStore
|
2022-08-09 15:08:39 +00:00
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.language)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: NotificationsView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
notificationsStore: root.store.notificationsStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.notifications)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
2023-03-14 02:52:16 +00:00
|
|
|
sourceComponent: SyncingView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2023-03-14 02:52:16 +00:00
|
|
|
profileStore: root.store.profileStore
|
2022-08-09 15:08:39 +00:00
|
|
|
devicesStore: root.store.devicesStore
|
2023-02-27 13:36:54 +00:00
|
|
|
privacyStore: root.store.privacyStore
|
2023-06-14 13:02:57 +00:00
|
|
|
advancedStore: root.store.advancedStore
|
2023-03-14 02:52:16 +00:00
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.syncingSettings)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: BrowserView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
store: root.store
|
2022-10-25 13:57:04 +00:00
|
|
|
accountSettings: localAccountSensitiveSettings
|
2022-08-09 15:08:39 +00:00
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.browserSettings)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: AdvancedView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2023-04-26 15:46:04 +00:00
|
|
|
messagingStore: root.store.messagingStore
|
2022-08-09 15:08:39 +00:00
|
|
|
advancedStore: root.store.advancedStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.advanced)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: AboutView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-08-09 15:08:39 +00:00
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.about)
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
2022-10-13 19:02:40 +00:00
|
|
|
|
|
|
|
store: QtObject {
|
2023-01-31 15:52:57 +00:00
|
|
|
readonly property bool isProduction: production
|
|
|
|
|
2022-10-13 19:02:40 +00:00
|
|
|
function checkForUpdates() {
|
|
|
|
return root.store.checkForUpdates()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCurrentVersion() {
|
|
|
|
return root.store.getCurrentVersion()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getReleaseNotes() {
|
2023-01-31 15:52:57 +00:00
|
|
|
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/%1".arg(getCurrentVersion()) :
|
|
|
|
"https://github.com/status-im/status-desktop/"
|
|
|
|
|
|
|
|
openLink(link)
|
2022-10-13 19:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function openLink(url) {
|
|
|
|
Global.openLink(url)
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-10-13 19:02:40 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-03-23 10:56:25 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
2023-01-24 17:31:20 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2022-12-14 13:59:14 +00:00
|
|
|
sourceComponent: CommunitiesView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-03-23 10:56:25 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
profileSectionStore: root.store
|
|
|
|
rootStore: root.globalStore
|
|
|
|
contactStore: root.store.contactsStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.communitiesSettings)
|
2022-03-23 10:56:25 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
2022-08-16 09:19:15 +00:00
|
|
|
|
2022-12-14 13:59:14 +00:00
|
|
|
Loader {
|
|
|
|
id: keycardView
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
sourceComponent: KeycardView {
|
2022-08-16 09:19:15 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
profileSectionStore: root.store
|
2022-08-31 17:09:07 +00:00
|
|
|
keycardStore: root.store.keycardStore
|
2022-12-16 09:37:08 +00:00
|
|
|
emojiPopup: root.emojiPopup
|
2022-08-31 17:09:07 +00:00
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.keycard)
|
2022-10-11 12:15:33 +00:00
|
|
|
mainSectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.keycard)
|
2022-08-16 09:19:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
2022-12-14 13:59:14 +00:00
|
|
|
}
|
|
|
|
}
|