2021-10-06 11:16:39 +02:00
import QtQuick 2.13
import QtQuick . Controls 2.13
2022-07-13 15:29:38 +03:00
import StatusQ . Core 0.1
2021-10-06 11:16:39 +02:00
import StatusQ . Components 0.1
2022-07-13 15:29:38 +03:00
import utils 1.0
2021-10-28 00:27:49 +03:00
import shared 1.0
import shared . popups 1.0
2022-07-13 15:29:38 +03:00
2021-10-06 11:16:39 +02:00
import "../panels"
Item {
2022-06-22 15:16:21 +03:00
id: root
2021-10-06 11:16:39 +02:00
property var store
2022-06-22 15:16:21 +03:00
signal menuItemClicked ( var event )
2021-10-06 11:16:39 +02:00
StatusNavigationPanelHeadline {
id: title
text: qsTr ( "Settings" )
anchors.top: parent . top
anchors.topMargin: Style . current . padding
2022-08-09 12:31:57 +03:00
anchors.left: parent . left
anchors.leftMargin: Style . current . bigPadding
2021-10-06 11:16:39 +02:00
}
2022-07-13 15:29:38 +03:00
StatusScrollView {
2022-05-31 16:32:39 +03:00
contentWidth: availableWidth
2021-10-06 11:16:39 +02:00
contentHeight: profileMenu . height + 24
anchors.right: parent . right
anchors.rightMargin: Style . current . smallPadding
anchors.left: parent . left
2022-08-09 12:31:57 +03:00
anchors.leftMargin: 0
2021-10-06 11:16:39 +02:00
anchors.top: title . bottom
2022-08-09 12:31:57 +03:00
anchors.topMargin: Style . current . halfPadding
2021-10-06 11:16:39 +02:00
anchors.bottom: parent . bottom
2022-05-31 16:32:39 +03:00
ScrollBar.horizontal.policy: ScrollBar . AlwaysOff
2021-10-06 11:16:39 +02:00
MenuPanel {
id: profileMenu
2021-12-30 13:39:47 +01:00
privacyStore: store . privacyStore
2022-06-28 14:11:18 -04:00
contactsStore: store . contactsStore
2021-10-06 11:16:39 +02:00
mainMenuItems: store . mainMenuItems
settingsMenuItems: store . settingsMenuItems
extraMenuItems: store . extraMenuItems
2022-02-11 10:44:49 +01:00
appsMenuItems: store . appsMenuItems
2021-10-06 11:16:39 +02:00
browserMenuItemEnabled: store . browserMenuItemEnabled
2022-03-07 15:34:59 -05:00
walletMenuItemEnabled: store . walletMenuItemEnabled
2022-03-23 13:56:25 +03:00
2021-10-06 11:16:39 +02:00
onMenuItemClicked: {
2022-05-26 16:40:41 +03:00
if ( menu_item . subsection === Constants . settingsSubsection . backUpSeed ) {
Global . openBackUpSeedPopup ( ) ;
2022-06-22 15:16:21 +03:00
return ;
2021-10-06 11:16:39 +02:00
}
2022-06-22 15:16:21 +03: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 ( )
Global . settingsSubsection = menu_item . subsection
2021-10-06 11:16:39 +02:00
}
}
}
ConfirmationDialog {
id: confirmDialog
2022-08-10 12:57:21 +02:00
confirmButtonObjectName: "signOutConfirmation"
2021-10-06 11:16:39 +02:00
header.title: qsTr ( "Sign out" )
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 ( )
}
}
}