2020-07-21 17:03:22 -04:00
|
|
|
import QtQuick 2.13
|
2022-03-28 11:38:58 +02:00
|
|
|
import QtQuick.Controls 2.3
|
2020-07-21 17:03:22 -04:00
|
|
|
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
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
2022-03-16 22:20:03 +01:00
|
|
|
import shared.controls.chat 1.0
|
2020-07-21 17:03:22 -04:00
|
|
|
|
2021-10-06 11:16:39 +02:00
|
|
|
import "../popups"
|
2021-12-30 13:39:47 +01:00
|
|
|
import "../stores"
|
2022-06-22 15:16:21 +03:00
|
|
|
import "../controls"
|
|
|
|
import "./profile"
|
2021-10-06 11:16:39 +02:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
2021-09-09 16:03:17 +02:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2021-10-18 12:34:16 +02:00
|
|
|
import StatusQ.Controls 0.1
|
2021-09-09 16:03:17 +02:00
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
SettingsContentBase {
|
2021-10-06 11:16:39 +02:00
|
|
|
id: root
|
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
property WalletStore walletStore
|
2021-12-30 13:39:47 +01:00
|
|
|
property ProfileStore profileStore
|
2022-06-22 15:16:21 +03:00
|
|
|
property PrivacyStore privacyStore
|
2022-09-27 23:26:26 +02:00
|
|
|
property ContactsStore contactsStore
|
2022-06-22 15:16:21 +03:00
|
|
|
|
|
|
|
titleRowComponentLoader.sourceComponent: StatusButton {
|
2022-08-24 11:51:20 +02:00
|
|
|
objectName: "profileSettingsChangePasswordButton"
|
2022-06-22 15:16:21 +03:00
|
|
|
text: qsTr("Change Password")
|
|
|
|
onClicked: changePasswordModal.open()
|
2022-09-26 13:57:32 +02:00
|
|
|
enabled: !userProfile.isKeycardUser
|
2022-06-22 15:16:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
dirty: settingsView.dirty
|
|
|
|
saveChangesButtonEnabled: settingsView.valid
|
|
|
|
|
2022-09-27 23:26:26 +02:00
|
|
|
onResetChangesClicked: {
|
|
|
|
settingsView.reset()
|
|
|
|
profilePreview.reload()
|
|
|
|
}
|
|
|
|
onSaveChangesClicked: {
|
|
|
|
settingsView.save()
|
|
|
|
profilePreview.reload()
|
|
|
|
}
|
2020-07-21 17:03:22 -04:00
|
|
|
|
2022-10-20 16:41:18 +03:00
|
|
|
bottomHeaderComponents: StatusTabBar {
|
|
|
|
id: editPreviwTabBar
|
|
|
|
StatusTabButton {
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Edit")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Preview")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-07 13:45:15 +02:00
|
|
|
ColumnLayout {
|
2022-06-22 15:16:21 +03:00
|
|
|
id: layout
|
2022-05-07 13:45:15 +02:00
|
|
|
spacing: Constants.settingsSection.itemSpacing
|
|
|
|
width: root.contentWidth
|
2020-07-21 17:03:22 -04:00
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
StackLayout {
|
2022-11-11 18:46:35 +02:00
|
|
|
id: stackLayout
|
2022-06-22 15:16:21 +03:00
|
|
|
currentIndex: editPreviwTabBar.currentIndex
|
2020-07-21 17:03:22 -04:00
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
MyProfileSettingsView {
|
|
|
|
id: settingsView
|
2022-11-11 18:46:35 +02:00
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
profileStore: root.profileStore
|
|
|
|
privacyStore: root.privacyStore
|
|
|
|
walletStore: root.walletStore
|
2022-11-11 18:46:35 +02:00
|
|
|
|
|
|
|
onVisibleChanged: if (visible) stackLayout.Layout.preferredHeight = settingsView.implicitHeight
|
|
|
|
Component.onCompleted: stackLayout.Layout.preferredHeight = Qt.binding(() => settingsView.implicitHeight)
|
2022-05-07 13:45:15 +02:00
|
|
|
}
|
2022-03-16 22:20:03 +01:00
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
MyProfilePreview {
|
|
|
|
id: profilePreview
|
2022-11-11 18:46:35 +02:00
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
profileStore: root.profileStore
|
2022-09-27 23:26:26 +02:00
|
|
|
contactsStore: root.contactsStore
|
2022-11-08 21:30:50 +03:00
|
|
|
dirtyValues: settingsView.dirtyValues
|
|
|
|
dirty: settingsView.dirty
|
2022-11-11 18:46:35 +02:00
|
|
|
|
|
|
|
onVisibleChanged: if (visible) stackLayout.Layout.preferredHeight = Qt.binding(() => profilePreview.implicitHeight)
|
2022-05-07 13:45:15 +02:00
|
|
|
}
|
2022-03-16 22:20:03 +01:00
|
|
|
}
|
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
ChangePasswordModal {
|
|
|
|
id: changePasswordModal
|
|
|
|
privacyStore: root.privacyStore
|
|
|
|
anchors.centerIn: parent
|
|
|
|
onPasswordChanged: successPopup.open()
|
2020-07-21 17:03:22 -04:00
|
|
|
}
|
|
|
|
|
2022-06-22 15:16:21 +03:00
|
|
|
ChangePasswordSuccessModal {
|
|
|
|
id: successPopup
|
|
|
|
anchors.centerIn: parent
|
2020-08-19 17:01:22 -04:00
|
|
|
}
|
|
|
|
}
|
2020-07-21 17:03:22 -04:00
|
|
|
}
|