123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- // Copyright (c) 2022 UltiMaker
- // Cura is released under the terms of the LGPLv3 or higher.
- import QtQuick 2.10
- import QtQuick.Controls 2.3
- import QtQuick.Window 2.2
- import UM 1.5 as UM
- import Cura 1.1 as Cura
- Window
- {
- UM.I18nCatalog { id: catalog; name: "cura" }
- id: baseDialog
- title: catalog.i18nc("@title:window", "More information on anonymous data collection")
- visible: false
- modality: Qt.ApplicationModal
- minimumWidth: 500 * screenScaleFactor
- minimumHeight: 400 * screenScaleFactor
- width: minimumWidth
- height: minimumHeight
- color: UM.Theme.getColor("main_background")
- property bool allowSendData: true // for saving the user's choice
- onVisibilityChanged:
- {
- if (visible)
- {
- baseDialog.allowSendData = UM.Preferences.getValue("info/send_slice_info")
- if (baseDialog.allowSendData)
- {
- allowSendButton.checked = true
- }
- else
- {
- dontSendButton.checked = true
- }
- }
- }
- // Main content area
- Item
- {
- anchors.fill: parent
- anchors.margins: UM.Theme.getSize("default_margin").width
- Item // Text part
- {
- id: textRow
- anchors
- {
- top: parent.top
- bottom: radioButtonsRow.top
- bottomMargin: UM.Theme.getSize("default_margin").height
- left: parent.left
- right: parent.right
- }
- UM.Label
- {
- id: headerText
- anchors
- {
- top: parent.top
- left: parent.left
- right: parent.right
- }
- text: catalog.i18nc("@text:window", "UltiMaker Cura collects anonymous data in order to improve the print quality and user experience. Below is an example of all the data that is shared:")
- wrapMode: Text.WordWrap
- }
- Cura.ScrollableTextArea
- {
- anchors
- {
- top: headerText.bottom
- topMargin: UM.Theme.getSize("default_margin").height
- bottom: parent.bottom
- bottomMargin: UM.Theme.getSize("default_margin").height
- left: parent.left
- right: parent.right
- }
- textArea.text: (manager === null) ? "" : manager.getExampleData()
- textArea.textFormat: Text.RichText
- textArea.wrapMode: Text.Wrap
- textArea.readOnly: true
- }
- }
- Column // Radio buttons for agree and disagree
- {
- id: radioButtonsRow
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: buttonRow.top
- anchors.bottomMargin: UM.Theme.getSize("default_margin").height
- Cura.RadioButton
- {
- id: dontSendButton
- text: catalog.i18nc("@text:window", "I don't want to send anonymous data")
- onClicked:
- {
- baseDialog.allowSendData = !checked
- }
- }
- Cura.RadioButton
- {
- id: allowSendButton
- text: catalog.i18nc("@text:window", "Allow sending anonymous data")
- onClicked:
- {
- baseDialog.allowSendData = checked
- }
- }
- }
- Item // Bottom buttons
- {
- id: buttonRow
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- height: childrenRect.height
- Cura.PrimaryButton
- {
- anchors.right: parent.right
- text: catalog.i18nc("@action:button", "OK")
- onClicked:
- {
- manager.setSendSliceInfo(allowSendData)
- baseDialog.hide()
- }
- }
- Cura.SecondaryButton
- {
- anchors.left: parent.left
- text: catalog.i18nc("@action:button", "Cancel")
- onClicked:
- {
- baseDialog.hide()
- }
- }
- }
- }
- }
|