2021-10-06 09:16:39 +00:00
import QtQuick 2.13
import QtQuick . Controls 2.13
2022-07-13 12:29:38 +00:00
import StatusQ . Core 0.1
2021-10-06 09:16:39 +00:00
import StatusQ . Components 0.1
2022-07-13 12:29:38 +00:00
import utils 1.0
2021-10-27 21:27:49 +00:00
import shared 1.0
import shared . popups 1.0
2022-07-13 12:29:38 +00:00
2021-10-06 09:16:39 +00:00
import "../panels"
2024-05-22 08:13:39 +00:00
import AppLayouts . Profile . stores 1.0
2021-10-06 09:16:39 +00:00
Item {
2022-06-22 12:16:21 +00:00
id: root
2021-10-06 09:16:39 +00:00
2024-05-22 08:13:39 +00:00
property ProfileSectionStore store
2021-10-06 09:16:39 +00:00
2022-06-22 12:16:21 +00:00
signal menuItemClicked ( var event )
2024-10-18 21:43:29 +00:00
property alias settingsSubsection: profileMenu . settingsSubsection
2021-10-06 09:16:39 +00:00
StatusNavigationPanelHeadline {
id: title
text: qsTr ( "Settings" )
anchors.top: parent . top
anchors.topMargin: Style . current . padding
2022-08-09 09:31:57 +00:00
anchors.left: parent . left
anchors.leftMargin: Style . current . bigPadding
2021-10-06 09:16:39 +00:00
}
2022-07-13 12:29:38 +00:00
StatusScrollView {
2023-05-31 20:58:23 +00:00
id: scrollView
2022-05-31 13:32:39 +00:00
contentWidth: availableWidth
2023-03-20 12:29:05 +00:00
contentHeight: profileMenu . height + Style . current . bigPadding
2021-10-06 09:16:39 +00:00
anchors.right: parent . right
anchors.left: parent . left
2023-09-22 09:58:02 +00:00
leftPadding: Style . current . halfPadding
2021-10-06 09:16:39 +00:00
anchors.top: title . bottom
2022-08-09 09:31:57 +00:00
anchors.topMargin: Style . current . halfPadding
2021-10-06 09:16:39 +00:00
anchors.bottom: parent . bottom
MenuPanel {
id: profileMenu
2023-05-31 20:58:23 +00:00
width: scrollView . availableWidth
2021-12-30 12:39:47 +00:00
privacyStore: store . privacyStore
2022-06-28 18:11:18 +00:00
contactsStore: store . contactsStore
2023-06-15 08:53:35 +00:00
devicesStore: store . devicesStore
2021-10-06 09:16:39 +00:00
mainMenuItems: store . mainMenuItems
settingsMenuItems: store . settingsMenuItems
extraMenuItems: store . extraMenuItems
2022-02-11 09:44:49 +00:00
appsMenuItems: store . appsMenuItems
2022-03-07 20:34:59 +00:00
walletMenuItemEnabled: store . walletMenuItemEnabled
2022-03-23 10:56:25 +00:00
2024-03-05 07:02:41 +00:00
objectName: "leftTabViewProfileMenu"
2021-10-06 09:16:39 +00:00
onMenuItemClicked: {
2022-05-26 13:40:41 +00:00
if ( menu_item . subsection === Constants . settingsSubsection . backUpSeed ) {
Global . openBackUpSeedPopup ( ) ;
2022-06-22 12:16:21 +00:00
return ;
2021-10-06 09:16:39 +00:00
}
2022-06-22 12:16:21 +00:00
let event = { accepted: false , item: menu_item . subsection } ;
root . menuItemClicked ( event ) ;
if ( event . accepted )
return ;
if ( menu_item . subsection === Constants . settingsSubsection . signout )
return confirmDialog . open ( )
2024-10-18 21:43:29 +00:00
profileMenu . settingsSubsection = menu_item . subsection
2021-10-06 09:16:39 +00:00
}
}
}
ConfirmationDialog {
id: confirmDialog
2022-08-10 10:57:21 +00:00
confirmButtonObjectName: "signOutConfirmation"
2023-05-23 12:46:16 +00:00
headerSettings.title: qsTr ( "Sign out" )
2021-10-06 09:16:39 +00:00
confirmationText: qsTr ( "Make sure you have your account password and seed phrase stored. Without them you can lock yourself out of your account and lose funds." )
confirmButtonLabel: qsTr ( "Sign out & Quit" )
onConfirmButtonClicked: {
Qt . quit ( )
}
}
}