WorkspaceSummaryDialog.qml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. // Copyright (c) 2016 Ultimaker B.V.
  2. // Cura is released under the terms of the AGPLv3 or higher.
  3. import QtQuick 2.1
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Layouts 1.1
  6. import QtQuick.Window 2.1
  7. import UM 1.2 as UM
  8. import Cura 1.0 as Cura
  9. UM.Dialog
  10. {
  11. title: catalog.i18nc("@title:window", "Save Project")
  12. width: 550
  13. minimumWidth: 550
  14. height: 350
  15. minimumHeight: 350
  16. property int spacerHeight: 10
  17. property bool dontShowAgain: true
  18. signal yes();
  19. onClosing:
  20. {
  21. UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked)
  22. }
  23. onVisibleChanged:
  24. {
  25. if(visible)
  26. {
  27. dontShowAgain = !UM.Preferences.getValue("cura/dialog_on_project_save")
  28. }
  29. }
  30. Item
  31. {
  32. anchors.top: parent.top
  33. anchors.bottom: parent.bottom
  34. anchors.left: parent.left
  35. anchors.right: parent.right
  36. anchors.topMargin: 20
  37. anchors.bottomMargin: 20
  38. anchors.leftMargin:20
  39. anchors.rightMargin: 20
  40. UM.SettingDefinitionsModel
  41. {
  42. id: definitionsModel
  43. containerId: Cura.MachineManager.activeDefinitionId
  44. showAll: true
  45. exclude: ["command_line_settings"]
  46. showAncestors: true
  47. expanded: ["*"]
  48. visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
  49. }
  50. UM.I18nCatalog
  51. {
  52. id: catalog;
  53. name: "cura";
  54. }
  55. Column
  56. {
  57. anchors.fill: parent
  58. spacing: 2
  59. Label
  60. {
  61. id: titleLabel
  62. text: catalog.i18nc("@action:title", "Summary - Cura Project")
  63. font.pixelSize: 22
  64. }
  65. Rectangle
  66. {
  67. id: separator
  68. color: "black"
  69. width: parent.width
  70. height: 1
  71. }
  72. Item // Spacer
  73. {
  74. height: spacerHeight
  75. width: height
  76. }
  77. Label
  78. {
  79. text: catalog.i18nc("@action:label", "Printer settings")
  80. font.bold: true
  81. }
  82. Row
  83. {
  84. width: parent.width
  85. height: childrenRect.height
  86. Label
  87. {
  88. text: catalog.i18nc("@action:label", "Type")
  89. width: parent.width / 3
  90. }
  91. Label
  92. {
  93. text: Cura.MachineManager.activeDefinitionName
  94. width: parent.width / 3
  95. }
  96. }
  97. Row
  98. {
  99. width: parent.width
  100. height: childrenRect.height
  101. Label
  102. {
  103. text: catalog.i18nc("@action:label", "Name")
  104. width: parent.width / 3
  105. }
  106. Label
  107. {
  108. text: Cura.MachineManager.activeMachineName
  109. width: parent.width / 3
  110. }
  111. }
  112. Repeater
  113. {
  114. model: Cura.MachineManager.activeMaterialNames
  115. delegate: Column
  116. {
  117. Item // Spacer
  118. {
  119. height: spacerHeight
  120. width: height
  121. }
  122. Label
  123. {
  124. text: catalog.i18nc("@action:label", "Extruder %1").arg(index+1)
  125. }
  126. height: childrenRect.height
  127. width: parent.width
  128. Row
  129. {
  130. width: parent.width
  131. height: childrenRect.height
  132. Label
  133. {
  134. text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
  135. width: parent.width / 3
  136. }
  137. Label
  138. {
  139. text: Cura.MachineManager.activeVariantNames[index] + ", " + modelData
  140. width: parent.width / 3
  141. }
  142. }
  143. }
  144. }
  145. Item // Spacer
  146. {
  147. height: spacerHeight
  148. width: height
  149. }
  150. Label
  151. {
  152. text: catalog.i18nc("@action:label", "Profile settings")
  153. font.bold: true
  154. }
  155. Row
  156. {
  157. width: parent.width
  158. Label
  159. {
  160. text: catalog.i18nc("@action:label", "Not in profile")
  161. width: parent.width / 3
  162. }
  163. Label
  164. {
  165. text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
  166. width: parent.width / 3
  167. }
  168. visible: Cura.MachineManager.numUserSettings
  169. }
  170. Row
  171. {
  172. width: parent.width
  173. height: childrenRect.height
  174. Label
  175. {
  176. text: catalog.i18nc("@action:label", "Name")
  177. width: parent.width / 3
  178. }
  179. Label
  180. {
  181. text: Cura.MachineManager.activeQualityName
  182. width: parent.width / 3
  183. }
  184. }
  185. Item // Spacer
  186. {
  187. height: spacerHeight
  188. width: height
  189. }
  190. Label
  191. {
  192. text: catalog.i18nc("@action:label", "Setting visibility")
  193. font.bold: true
  194. }
  195. Row
  196. {
  197. width: parent.width
  198. height: childrenRect.height
  199. Label
  200. {
  201. text: catalog.i18nc("@action:label", "Visible settings:")
  202. width: parent.width / 3
  203. }
  204. Label
  205. {
  206. text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
  207. width: parent.width / 3
  208. }
  209. }
  210. CheckBox
  211. {
  212. id: dontShowAgainCheckbox
  213. text: catalog.i18nc("@action:label", "Don't show project summary on save again")
  214. checked: dontShowAgain
  215. }
  216. }
  217. Button
  218. {
  219. id: ok_button
  220. text: catalog.i18nc("@action:button","Save");
  221. enabled: true
  222. onClicked: {
  223. close()
  224. yes()
  225. }
  226. anchors.bottomMargin: - 0.5 * height
  227. anchors.bottom: parent.bottom
  228. anchors.right: parent.right
  229. }
  230. Button
  231. {
  232. id: cancel_button
  233. text: catalog.i18nc("@action:button","Cancel");
  234. enabled: true
  235. onClicked: close()
  236. anchors.bottom: parent.bottom
  237. anchors.right: ok_button.left
  238. anchors.bottomMargin: - 0.5 * height
  239. anchors.rightMargin:2
  240. }
  241. }
  242. }