MoreInfoWindow.qml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Window 2.2
  5. import QtQuick.Controls 1.4
  6. import QtQuick.Controls.Styles 1.4
  7. import UM 1.3 as UM
  8. import Cura 1.0 as Cura
  9. UM.Dialog
  10. {
  11. id: baseDialog
  12. title: catalog.i18nc("@title:window", "More information on anonymous data collection")
  13. visible: false
  14. minimumWidth: 500 * screenScaleFactor
  15. minimumHeight: 400 * screenScaleFactor
  16. width: minimumWidth
  17. height: minimumHeight
  18. property bool allowSendData: true // for saving the user's choice
  19. onAccepted: manager.setSendSliceInfo(allowSendData)
  20. onVisibilityChanged:
  21. {
  22. if (visible)
  23. {
  24. baseDialog.allowSendData = UM.Preferences.getValue("info/send_slice_info");
  25. if (baseDialog.allowSendData)
  26. {
  27. allowSendButton.checked = true;
  28. }
  29. else
  30. {
  31. dontSendButton.checked = true;
  32. }
  33. }
  34. }
  35. Item
  36. {
  37. id: textRow
  38. anchors
  39. {
  40. top: parent.top
  41. bottom: radioButtonsRow.top
  42. bottomMargin: UM.Theme.getSize("default_margin").height
  43. left: parent.left
  44. right: parent.right
  45. }
  46. Label
  47. {
  48. id: headerText
  49. anchors
  50. {
  51. top: parent.top
  52. left: parent.left
  53. right: parent.right
  54. }
  55. text: catalog.i18nc("@text:window", "Cura sends anonymous data to Ultimaker in order to improve the print quality and user experience. Below is an example of all the data that is sent.")
  56. wrapMode: Text.WordWrap
  57. }
  58. TextArea
  59. {
  60. id: exampleData
  61. anchors
  62. {
  63. top: headerText.bottom
  64. topMargin: UM.Theme.getSize("default_margin").height
  65. bottom: parent.bottom
  66. bottomMargin: UM.Theme.getSize("default_margin").height
  67. left: parent.left
  68. right: parent.right
  69. }
  70. text: manager.getExampleData()
  71. readOnly: true
  72. textFormat: TextEdit.PlainText
  73. }
  74. }
  75. Column
  76. {
  77. id: radioButtonsRow
  78. width: parent.width
  79. anchors.bottom: buttonRow.top
  80. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  81. ExclusiveGroup { id: group }
  82. RadioButton
  83. {
  84. id: dontSendButton
  85. text: catalog.i18nc("@text:window", "I don't want to send these data")
  86. exclusiveGroup: group
  87. onClicked:
  88. {
  89. baseDialog.allowSendData = !checked;
  90. }
  91. }
  92. RadioButton
  93. {
  94. id: allowSendButton
  95. text: catalog.i18nc("@text:window", "Allow sending these data to Ultimaker and help us improve Cura")
  96. exclusiveGroup: group
  97. onClicked:
  98. {
  99. baseDialog.allowSendData = checked;
  100. }
  101. }
  102. }
  103. Item
  104. {
  105. id: buttonRow
  106. anchors.bottom: parent.bottom
  107. width: parent.width
  108. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  109. UM.I18nCatalog { id: catalog; name: "cura" }
  110. Button
  111. {
  112. anchors.right: parent.right
  113. text: catalog.i18nc("@action:button", "OK")
  114. onClicked:
  115. {
  116. baseDialog.accepted()
  117. baseDialog.hide()
  118. }
  119. }
  120. Button
  121. {
  122. anchors.left: parent.left
  123. text: catalog.i18nc("@action:button", "Cancel")
  124. onClicked:
  125. {
  126. baseDialog.rejected()
  127. baseDialog.hide()
  128. }
  129. }
  130. }
  131. }