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"
Item {
2022-06-22 12:16:21 +00:00
id: root
2021-10-06 09:16:39 +00:00
property var store
2022-06-22 12:16:21 +00:00
signal menuItemClicked ( var event )
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 {
2022-05-31 13:32:39 +00:00
contentWidth: availableWidth
2021-10-06 09:16:39 +00:00
contentHeight: profileMenu . height + 24
anchors.right: parent . right
anchors.rightMargin: Style . current . smallPadding
anchors.left: parent . left
2022-08-09 09:31:57 +00:00
anchors.leftMargin: 0
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
2022-05-31 13:32:39 +00:00
ScrollBar.horizontal.policy: ScrollBar . AlwaysOff
2021-10-06 09:16:39 +00:00
MenuPanel {
id: profileMenu
2021-12-30 12:39:47 +00:00
privacyStore: store . privacyStore
2022-06-28 18:11:18 +00:00
contactsStore: store . contactsStore
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
2021-10-06 09:16:39 +00:00
browserMenuItemEnabled: store . browserMenuItemEnabled
2022-03-07 20:34:59 +00:00
walletMenuItemEnabled: store . walletMenuItemEnabled
2022-03-23 10:56:25 +00:00
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 ( )
Global . settingsSubsection = menu_item . subsection
2021-10-06 09:16:39 +00:00
}
}
}
ConfirmationDialog {
id: confirmDialog
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 ( )
}
}
}