MoreInfoWindow.qml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // PluginBrowser 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. Connections
  38. {
  39. target: CuraApplication.getCuraAppSignals()
  40. onShowMoreInfoOnAnonymousDataCollection:
  41. {
  42. baseDialog.show();
  43. }
  44. }
  45. id: textRow
  46. anchors
  47. {
  48. top: parent.top
  49. bottom: radioButtonsRow.top
  50. bottomMargin: UM.Theme.getSize("default_margin").height
  51. left: parent.left
  52. right: parent.right
  53. }
  54. Label
  55. {
  56. id: headerText
  57. anchors
  58. {
  59. top: parent.top
  60. left: parent.left
  61. right: parent.right
  62. }
  63. text: catalog.i18nc("@text:window", "Cura sends anonymous data so we can improve the print quality and user experience. Below is an example of all the data we send.")
  64. wrapMode: Text.WordWrap
  65. }
  66. TextArea
  67. {
  68. id: exampleData
  69. anchors
  70. {
  71. top: headerText.bottom
  72. topMargin: UM.Theme.getSize("default_margin").height
  73. bottom: parent.bottom
  74. bottomMargin: UM.Theme.getSize("default_margin").height
  75. left: parent.left
  76. right: parent.right
  77. }
  78. text: manager.getExampleData()
  79. readOnly: true
  80. textFormat: TextEdit.PlainText
  81. }
  82. }
  83. Column
  84. {
  85. id: radioButtonsRow
  86. width: parent.width
  87. anchors.bottom: buttonRow.top
  88. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  89. ExclusiveGroup { id: group }
  90. RadioButton
  91. {
  92. id: dontSendButton
  93. text: catalog.i18nc("@text:window", "I don't want to send these settings")
  94. exclusiveGroup: group
  95. onClicked:
  96. {
  97. baseDialog.allowSendData = !checked;
  98. }
  99. }
  100. RadioButton
  101. {
  102. id: allowSendButton
  103. text: catalog.i18nc("@text:window", "Allow sending these settings to improve Cura")
  104. exclusiveGroup: group
  105. onClicked:
  106. {
  107. baseDialog.allowSendData = checked;
  108. }
  109. }
  110. }
  111. Item
  112. {
  113. id: buttonRow
  114. anchors.bottom: parent.bottom
  115. width: parent.width
  116. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  117. UM.I18nCatalog { id: catalog; name: "cura" }
  118. Button
  119. {
  120. anchors.right: parent.right
  121. text: catalog.i18nc("@action:button", "Ok")
  122. onClicked: {
  123. baseDialog.accepted()
  124. baseDialog.hide()
  125. }
  126. }
  127. Button
  128. {
  129. anchors.left: parent.left
  130. text: catalog.i18nc("@action:button", "Cancel")
  131. onClicked: {
  132. baseDialog.rejected()
  133. baseDialog.hide()
  134. }
  135. }
  136. }
  137. }