2020-06-17 15:18:31 -04:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-28 00:27:49 +03:00
|
|
|
import shared 1.0
|
2022-06-03 13:48:03 +03:00
|
|
|
import shared.panels 1.0
|
2021-10-06 11:16:39 +02:00
|
|
|
|
|
|
|
import "stores"
|
|
|
|
import "popups"
|
|
|
|
import "views"
|
2020-05-19 14:44:45 -05:00
|
|
|
|
2021-06-16 13:15:28 +02:00
|
|
|
import StatusQ.Layout 0.1
|
2022-05-07 13:45:15 +02:00
|
|
|
import StatusQ.Controls 0.1
|
2021-06-16 13:15:28 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
StatusSectionLayout {
|
|
|
|
id: root
|
2021-06-16 13:15:28 +02:00
|
|
|
|
2021-12-30 13:39:47 +01:00
|
|
|
property ProfileSectionStore store
|
2021-12-09 14:28:02 +01:00
|
|
|
property var globalStore
|
|
|
|
property var systemPalette
|
2022-03-10 18:01:17 +01:00
|
|
|
property var emojiPopup
|
2021-12-09 14:28:02 +01:00
|
|
|
|
2022-09-13 19:17:54 +03:00
|
|
|
backButtonName: root.store.backButtonName
|
2022-08-09 18:08:39 +03:00
|
|
|
notificationCount: root.store.unreadNotificationsCount
|
|
|
|
onNotificationButtonClicked: Global.openActivityCenterPopup()
|
2022-09-13 19:17:54 +03:00
|
|
|
onBackButtonClicked: {
|
|
|
|
switch (profileContainer.currentIndex) {
|
|
|
|
case 1:
|
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.messaging)
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
walletView.resetStack();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-04 16:33:48 -05:00
|
|
|
Component.onCompleted: {
|
|
|
|
Global.privacyModuleInst = store.privacyStore.privacyModule
|
|
|
|
}
|
|
|
|
|
2021-12-09 14:28:02 +01:00
|
|
|
QtObject {
|
2022-05-07 13:45:15 +02:00
|
|
|
id: d
|
|
|
|
|
2022-09-02 17:56:14 +03:00
|
|
|
readonly property int topMargin: 0
|
2022-05-07 13:45:15 +02:00
|
|
|
readonly property int bottomMargin: 56
|
2022-09-13 19:17:54 +03:00
|
|
|
readonly property int leftMargin: 64
|
|
|
|
readonly property int rightMargin: 64
|
2022-05-07 13:45:15 +02:00
|
|
|
|
|
|
|
readonly property int contentWidth: 560
|
2021-12-09 14:28:02 +01:00
|
|
|
}
|
|
|
|
|
2021-10-06 11:16:39 +02:00
|
|
|
leftPanel: LeftTabView {
|
2020-05-19 14:44:45 -05:00
|
|
|
id: leftTab
|
2022-08-09 18:08:39 +03:00
|
|
|
store: root.store
|
2021-10-06 11:16:39 +02:00
|
|
|
anchors.fill: parent
|
2022-06-03 13:48:03 +03:00
|
|
|
anchors.topMargin: d.topMargin
|
2022-06-22 15:16:21 +03:00
|
|
|
onMenuItemClicked: {
|
|
|
|
if (profileContainer.currentItem.dirty) {
|
|
|
|
event.accepted = true;
|
|
|
|
profileContainer.currentItem.notifyDirty();
|
|
|
|
}
|
|
|
|
}
|
2020-05-19 14:44:45 -05:00
|
|
|
}
|
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
centerPanel: Item {
|
2021-06-16 13:15:28 +02:00
|
|
|
anchors.fill: parent
|
2020-08-04 18:22:51 -04:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
StackLayout {
|
|
|
|
id: profileContainer
|
2022-03-16 22:20:03 +01:00
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
readonly property var currentItem: (currentIndex >= 0 && currentIndex < children.length) ? children[currentIndex] : null
|
|
|
|
|
2022-09-02 17:56:14 +03:00
|
|
|
anchors.top: parent.top
|
2022-05-07 13:45:15 +02:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: d.bottomMargin
|
|
|
|
anchors.leftMargin: d.leftMargin
|
|
|
|
anchors.rightMargin: d.rightMargin
|
2021-06-16 13:15:28 +02:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
currentIndex: Global.settingsSubsection
|
2020-05-19 14:44:45 -05:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
onCurrentIndexChanged: {
|
|
|
|
if(visibleChildren[0] === ensContainer){
|
|
|
|
ensContainer.goToStart();
|
|
|
|
}
|
2022-09-13 19:17:54 +03:00
|
|
|
if (currentIndex === 1) {
|
|
|
|
root.store.backButtonName = root.store.getNameForSubsection(Constants.settingsSubsection.messaging);
|
|
|
|
} else {
|
|
|
|
root.store.backButtonName = "";
|
|
|
|
}
|
2022-05-07 13:45:15 +02:00
|
|
|
}
|
2020-07-21 17:03:22 -04:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
MyProfileView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-03-07 15:34:59 -05:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
walletStore: root.store.walletStore
|
|
|
|
profileStore: root.store.profileStore
|
|
|
|
privacyStore: root.store.privacyStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.profile)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-02-11 10:44:49 +01:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
ContactsView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-08-09 18:08:39 +03:00
|
|
|
contactsStore: root.store.contactsStore
|
2022-05-07 13:45:15 +02:00
|
|
|
sectionTitle: qsTr("Contacts")
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2020-05-24 18:23:00 -04:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
EnsView {
|
|
|
|
// 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.
|
|
|
|
id: ensContainer
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2020-07-21 17:03:22 -04:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
ensUsernamesStore: root.store.ensUsernamesStore
|
|
|
|
contactsStore: root.store.contactsStore
|
|
|
|
stickersStore: root.store.stickersStore
|
2020-10-21 10:45:28 -04:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
profileContentWidth: d.contentWidth
|
|
|
|
}
|
2020-05-24 18:23:00 -04:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
MessagingView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-08-09 18:08:39 +03:00
|
|
|
advancedStore: root.store.advancedStore
|
|
|
|
messagingStore: root.store.messagingStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.messaging)
|
|
|
|
contactsStore: root.store.contactsStore
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
WalletView {
|
2022-09-13 19:17:54 +03:00
|
|
|
id: walletView
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-09-13 19:17:54 +03:00
|
|
|
rootStore: root.store
|
2022-08-09 18:08:39 +03:00
|
|
|
walletStore: root.store.walletStore
|
|
|
|
emojiPopup: root.emojiPopup
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.wallet)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
AppearanceView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 13:45:15 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
appearanceStore: root.store.appearanceStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.appearance)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
2022-08-09 18:08:39 +03:00
|
|
|
systemPalette: root.systemPalette
|
2022-05-07 13:45:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
LanguageView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 13:45:15 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
languageStore: root.store.languageStore
|
|
|
|
currencyStore: root.store.walletStore.currencyStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.language)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
NotificationsView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 13:45:15 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
notificationsStore: root.store.notificationsStore
|
|
|
|
devicesStore: root.store.devicesStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.notifications)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
DevicesView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 13:45:15 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
devicesStore: root.store.devicesStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.devicesSettings)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
BrowserView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 13:45:15 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
store: root.store
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.browserSettings)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
AdvancedView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 13:45:15 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
advancedStore: root.store.advancedStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.advanced)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
AboutView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 13:45:15 +02:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
store: root.store
|
|
|
|
globalStore: root.globalStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.about)
|
2022-05-07 13:45:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-03-23 13:56:25 +03:00
|
|
|
|
|
|
|
CommunitiesView {
|
2022-06-03 18:32:03 +03:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-03-23 13:56:25 +03:00
|
|
|
|
2022-08-09 18:08:39 +03:00
|
|
|
profileSectionStore: root.store
|
|
|
|
rootStore: root.globalStore
|
|
|
|
contactStore: root.store.contactsStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.communitiesSettings)
|
2022-03-23 13:56:25 +03:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-08-16 11:19:15 +02:00
|
|
|
|
|
|
|
KeycardView {
|
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
|
|
|
|
2022-08-31 19:09:07 +02:00
|
|
|
keycardStore: root.store.keycardStore
|
|
|
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.keycard)
|
2022-08-16 11:19:15 +02:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2021-10-06 11:16:39 +02:00
|
|
|
}
|
2022-06-03 13:48:03 +03:00
|
|
|
} // Item
|
|
|
|
|
|
|
|
} // StatusAppTwoPanelLayout
|