2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick . Controls 2.13
import QtQuick . Layouts 1.13
2020-11-03 21:04:57 +00:00
import QtGraphicalEffects 1.13
2020-05-27 21:28:25 +00:00
import "../../../../imports"
2020-06-19 18:06:58 +00:00
import "../../../../shared"
2020-09-17 16:42:59 +00:00
import "../../../../shared/status"
2020-05-27 21:28:25 +00:00
Item {
id: advancedContainer
Layout.fillHeight: true
Layout.fillWidth: true
2021-04-08 15:44:58 +00:00
clip: true
2020-05-27 21:28:25 +00:00
2021-01-14 14:12:37 +00:00
Column {
id: generalColumn
2020-05-27 21:28:25 +00:00
anchors.top: parent . top
2021-01-18 20:25:20 +00:00
anchors.topMargin: topMargin
2021-04-08 15:44:58 +00:00
width: profileContainer . profileContentWidth
2021-03-18 09:33:39 +00:00
anchors.horizontalCenter: parent . horizontalCenter
2021-01-05 16:36:42 +00:00
2021-01-19 20:51:16 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Network"
text: qsTrId ( "network" )
2021-01-19 20:51:16 +00:00
currentValue: utilsModel . getNetworkName ( )
2021-01-14 14:12:37 +00:00
onClicked: networksModal . open ( )
2021-01-05 16:36:42 +00:00
}
2021-01-14 14:12:37 +00:00
2021-01-19 20:51:16 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Fleet"
text: qsTrId ( "fleet" )
2021-01-19 20:51:16 +00:00
currentValue: profileModel . fleets . fleet
2021-01-14 14:12:37 +00:00
onClicked: fleetModal . open ( )
2021-01-05 16:36:42 +00:00
}
2021-02-22 22:10:47 +00:00
StatusSettingsLineButton {
2021-07-16 20:22:50 +00:00
//% "Minimize on close"
text: qsTrId ( "minimize-on-close" )
2021-02-22 22:10:47 +00:00
isSwitch: true
switchChecked: ! appSettings . quitOnClose
onClicked: function ( checked ) {
appSettings . quitOnClose = ! checked
}
}
2021-01-19 20:51:16 +00:00
Item {
id: spacer1
height: Style . current . bigPadding
width: parent . width
}
Separator {
anchors.topMargin: Style . current . bigPadding
anchors.left: parent . left
anchors.leftMargin: - Style . current . padding
anchors.right: parent . right
anchors.rightMargin: - Style . current . padding
}
2020-08-18 19:10:30 +00:00
2021-01-14 14:12:37 +00:00
StatusSectionHeadline {
2021-02-18 16:36:05 +00:00
//% "Experimental features"
text: qsTrId ( "experimental-features" )
2021-01-19 20:51:16 +00:00
topPadding: Style . current . bigPadding
bottomPadding: Style . current . padding
2020-06-26 14:08:08 +00:00
}
2021-01-14 14:12:37 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Wallet"
text: qsTrId ( "wallet" )
2021-01-14 14:12:37 +00:00
isSwitch: true
2021-04-23 11:43:18 +00:00
switchChecked: appSettings . isWalletEnabled
2021-04-23 10:22:07 +00:00
onClicked: {
2021-04-23 11:43:18 +00:00
if ( ! appSettings . isWalletEnabled ) {
confirmationPopup . settingsProp = "isWalletEnabled"
2021-04-23 10:22:07 +00:00
confirmationPopup . open ( )
} else {
2021-04-23 11:43:18 +00:00
appSettings . isWalletEnabled = false
2021-04-23 10:22:07 +00:00
}
2020-09-22 15:12:48 +00:00
}
}
2021-01-14 14:12:37 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Dapp Browser"
text: qsTrId ( "dapp-browser" )
2021-01-14 14:12:37 +00:00
isSwitch: true
2021-04-23 11:43:18 +00:00
switchChecked: appSettings . isBrowserEnabled
2021-04-23 10:22:07 +00:00
onClicked: {
2021-04-23 11:43:18 +00:00
if ( ! appSettings . isBrowserEnabled ) {
confirmationPopup . settingsProp = "isBrowserEnabled"
2021-04-23 10:22:07 +00:00
confirmationPopup . open ( )
} else {
2021-04-23 11:43:18 +00:00
appSettings . isBrowserEnabled = false
2021-04-23 10:22:07 +00:00
}
2020-06-18 12:03:11 +00:00
}
}
2020-11-23 19:14:48 +00:00
2021-01-14 14:12:37 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Communities"
text: qsTrId ( "communities" )
2021-01-14 14:12:37 +00:00
isSwitch: true
switchChecked: appSettings . communitiesEnabled
2021-04-23 10:22:07 +00:00
onClicked: {
if ( ! appSettings . communitiesEnabled ) {
confirmationPopup . settingsProp = "communitiesEnabled"
confirmationPopup . open ( )
} else {
appSettings . communitiesEnabled = false
}
2021-01-14 14:12:37 +00:00
}
2020-11-23 19:14:48 +00:00
}
2021-06-14 16:39:49 +00:00
StatusSettingsLineButton {
2021-07-16 20:22:50 +00:00
//% "Activity Center"
text: qsTrId ( "activity-center" )
2021-06-14 16:39:49 +00:00
isSwitch: true
switchChecked: appSettings . isActivityCenterEnabled
onClicked: {
if ( ! appSettings . isActivityCenterEnabled ) {
confirmationPopup . settingsProp = "isActivityCenterEnabled"
confirmationPopup . open ( )
} else {
appSettings . isActivityCenterEnabled = false
}
}
}
2021-06-30 18:46:26 +00:00
StatusSettingsLineButton {
2021-07-11 22:40:06 +00:00
id: onlineUsers
text: qsTr ( "Online users" )
2021-06-30 18:46:26 +00:00
isSwitch: true
switchChecked: appSettings . showOnlineUsers
onClicked: {
appSettings . showOnlineUsers = ! appSettings . showOnlineUsers
}
}
2021-07-11 22:40:06 +00:00
Loader {
active: onlineUsers . switchChecked
anchors.left: parent . left
anchors.right: parent . right
sourceComponent: StatusSettingsLineButton {
text: qsTr ( "Broadcast user status" )
isSwitch: true
switchChecked: profileModel . profile . sendUserStatus
onClicked: function ( checked ) {
2021-07-12 16:22:47 +00:00
if ( profileModel . profile . sendUserStatus !== checked ) {
profileModel . setSendUserStatus ( checked )
}
2021-07-11 22:40:06 +00:00
}
}
}
2021-07-21 13:11:27 +00:00
StatusSectionHeadline {
text: qsTr ( "Bloom filter level" )
topPadding: Style . current . bigPadding
bottomPadding: Style . current . padding
}
Row {
spacing: 11
2021-07-12 12:10:12 +00:00
Component {
id: bloomConfirmationDialogComponent
ConfirmationDialog {
2021-07-21 13:11:27 +00:00
property string mode: "normal"
2021-07-12 12:10:12 +00:00
id: confirmDialog
//% "Warning!"
title: qsTrId ( "close-app-title" )
2021-07-20 17:23:43 +00:00
confirmationText: qsTr ( "The account will be logged out. When you login again, the selected mode will be enabled" )
2021-07-12 12:10:12 +00:00
onConfirmButtonClicked: {
2021-07-21 13:11:27 +00:00
nodeModel . setBloomLevel ( mode )
2021-07-12 12:10:12 +00:00
}
onClosed: {
2021-07-21 13:11:27 +00:00
switch ( nodeModel . bloomLevel ) {
case "light" : btnBloomLight . click ( ) ; break ;
case "normal" : btnBloomNormal . click ( ) ; break ;
case "full" : btnBloomFull . click ( ) ; break ;
}
2021-07-12 12:10:12 +00:00
destroy ( )
}
}
}
2021-07-21 13:11:27 +00:00
ButtonGroup {
id: bloomGroup
}
BloomSelectorButton {
id: btnBloomLight
buttonGroup: bloomGroup
checkedByDefault: nodeModel . bloomLevel == "light"
btnText: qsTr ( "Light Node" )
onToggled: {
if ( nodeModel . bloomLevel != "light" ) {
openPopup ( bloomConfirmationDialogComponent , { mode: "light" } )
} else {
btnBloomLight . click ( )
}
}
}
BloomSelectorButton {
id: btnBloomNormal
buttonGroup: bloomGroup
checkedByDefault: nodeModel . bloomLevel == "normal"
btnText: qsTr ( "Normal" )
onToggled: {
if ( nodeModel . bloomLevel != "normal" ) {
openPopup ( bloomConfirmationDialogComponent , { mode: "normal" } )
} else {
btnBloomNormal . click ( )
}
}
}
BloomSelectorButton {
id: btnBloomFull
buttonGroup: bloomGroup
checkedByDefault: nodeModel . bloomLevel == "full"
btnText: qsTr ( "Full Node" )
onToggled: {
if ( nodeModel . bloomLevel != "full" ) {
openPopup ( bloomConfirmationDialogComponent , { mode: "full" } )
} else {
btnBloomFull . click ( )
}
}
}
2021-07-11 22:40:06 +00:00
}
2021-07-12 12:10:12 +00:00
2021-05-05 20:27:23 +00:00
// StatusSettingsLineButton {
// //% "Node Management"
// text: qsTrId("node-management")
// isSwitch: true
// switchChecked: appSettings.nodeManagementEnabled
// onClicked: {
// if (!appSettings.nodeManagementEnabled) {
// confirmationPopup.settingsProp = "nodeManagementEnabled"
// confirmationPopup.open()
// } else {
// appSettings.nodeManagementEnabled = false
// }
// }
// }
2020-07-16 06:23:00 +00:00
}
2020-08-25 09:00:03 +00:00
2021-01-14 14:12:37 +00:00
NetworksModal {
id: networksModal
2020-11-03 21:04:57 +00:00
}
2021-01-14 14:12:37 +00:00
FleetsModal {
id: fleetModal
}
2020-08-25 09:00:03 +00:00
2021-04-23 10:22:07 +00:00
ConfirmationDialog {
id: confirmationPopup
property string settingsProp: ""
height: 310
showCancelButton: true
2021-07-16 20:22:50 +00:00
//% "This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk."
confirmationText: qsTrId ( "this-feature-is-experimental-and-is-meant-for-testing-purposes-by-core-contributors-and-the-community--it-s-not-meant-for-real-use-and-makes-no-claims-of-security-or-integrity-of-funds-or-data--use-at-your-own-risk-" )
//% "I understand"
confirmButtonLabel: qsTrId ( "i-understand" )
2021-04-23 10:22:07 +00:00
onConfirmButtonClicked: {
appSettings [ settingsProp ] = true
settingsProp = ""
close ( )
}
2020-08-27 17:28:31 +00:00
2021-04-23 10:22:07 +00:00
onCancelButtonClicked: {
close ( )
}
}
2020-06-18 12:03:11 +00:00
}
/ * # # ^ # #
Designer {
D { i: 0 ; height: 400 ; width: 700 }
2020-05-27 21:28:25 +00:00
}
2020-06-18 12:03:11 +00:00
# # ^ # # * /