WorkspaceSummaryDialog.qml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. // Copyright (c) 2016 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 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. minimumWidth: 500 * screenScaleFactor
  13. minimumHeight: 400 * screenScaleFactor
  14. width: minimumWidth
  15. height: minimumHeight
  16. property int spacerHeight: 10 * screenScaleFactor
  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.fill: parent
  33. UM.SettingDefinitionsModel
  34. {
  35. id: definitionsModel
  36. containerId: Cura.MachineManager.activeDefinitionId
  37. showAll: true
  38. exclude: ["command_line_settings"]
  39. showAncestors: true
  40. expanded: ["*"]
  41. visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
  42. }
  43. UM.I18nCatalog
  44. {
  45. id: catalog
  46. name: "cura"
  47. }
  48. SystemPalette
  49. {
  50. id: palette
  51. }
  52. Column
  53. {
  54. anchors.fill: parent
  55. spacing: 2 * screenScaleFactor
  56. Label
  57. {
  58. id: titleLabel
  59. text: catalog.i18nc("@action:title", "Summary - Cura Project")
  60. font.pointSize: 18
  61. }
  62. Rectangle
  63. {
  64. id: separator
  65. color: palette.text
  66. width: parent.width
  67. height: 1
  68. }
  69. Item // Spacer
  70. {
  71. height: spacerHeight
  72. width: height
  73. }
  74. Label
  75. {
  76. text: catalog.i18nc("@action:label", "Printer settings")
  77. font.bold: true
  78. }
  79. Row
  80. {
  81. width: parent.width
  82. height: childrenRect.height
  83. Label
  84. {
  85. text: catalog.i18nc("@action:label", "Type")
  86. width: (parent.width / 3) | 0
  87. }
  88. Label
  89. {
  90. text: Cura.MachineManager.activeDefinitionName
  91. width: (parent.width / 3) | 0
  92. }
  93. }
  94. Row
  95. {
  96. width: parent.width
  97. height: childrenRect.height
  98. Label
  99. {
  100. text: catalog.i18nc("@action:label", "Name")
  101. width: (parent.width / 3) | 0
  102. }
  103. Label
  104. {
  105. text: Cura.MachineManager.activeMachineName
  106. width: (parent.width / 3) | 0
  107. }
  108. }
  109. Column
  110. {
  111. width: parent.width
  112. visible: Cura.MachineManager.hasVariantBuildplates
  113. Item // Spacer
  114. {
  115. height: spacerHeight
  116. width: height
  117. }
  118. Row
  119. {
  120. width: parent.width
  121. height: childrenRect.height
  122. Label
  123. {
  124. text: catalog.i18nc("@action:label", "Build plate")
  125. width: (parent.width / 3) | 0
  126. }
  127. Label
  128. {
  129. text: Cura.MachineManager.activeVariantBuildplateName
  130. width: (parent.width / 3) | 0
  131. }
  132. }
  133. }
  134. Repeater
  135. {
  136. model: Cura.MachineManager.activeMaterialNames
  137. delegate: Column
  138. {
  139. Item // Spacer
  140. {
  141. height: spacerHeight
  142. width: height
  143. }
  144. Label
  145. {
  146. text: catalog.i18nc("@action:label", "Extruder %1").arg(index+1)
  147. }
  148. height: childrenRect.height
  149. width: parent.width
  150. Row
  151. {
  152. width: parent.width
  153. height: childrenRect.height
  154. Label
  155. {
  156. text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
  157. width: (parent.width / 3) | 0
  158. }
  159. Label
  160. {
  161. text: Cura.MachineManager.activeVariantNames[index] + ", " + modelData
  162. width: (parent.width / 3) | 0
  163. }
  164. }
  165. }
  166. }
  167. Item // Spacer
  168. {
  169. height: spacerHeight
  170. width: height
  171. }
  172. Label
  173. {
  174. text: catalog.i18nc("@action:label", "Profile settings")
  175. font.bold: true
  176. }
  177. Row
  178. {
  179. width: parent.width
  180. Label
  181. {
  182. text: catalog.i18nc("@action:label", "Not in profile")
  183. width: (parent.width / 3) | 0
  184. }
  185. Label
  186. {
  187. text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
  188. width: (parent.width / 3) | 0
  189. }
  190. visible: Cura.MachineManager.numUserSettings
  191. }
  192. Row
  193. {
  194. width: parent.width
  195. height: childrenRect.height
  196. Label
  197. {
  198. text: catalog.i18nc("@action:label", "Name")
  199. width: (parent.width / 3) | 0
  200. }
  201. Label
  202. {
  203. text: Cura.MachineManager.activeQualityName
  204. width: (parent.width / 3) | 0
  205. }
  206. }
  207. Item // Spacer
  208. {
  209. height: spacerHeight
  210. width: height
  211. }
  212. Label
  213. {
  214. text: catalog.i18nc("@action:label", "Setting visibility")
  215. font.bold: true
  216. }
  217. Row
  218. {
  219. width: parent.width
  220. height: childrenRect.height
  221. Label
  222. {
  223. text: catalog.i18nc("@action:label", "Visible settings:")
  224. width: (parent.width / 3) | 0
  225. }
  226. Label
  227. {
  228. text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
  229. width: (parent.width / 3) | 0
  230. }
  231. }
  232. Item // Spacer
  233. {
  234. height: spacerHeight
  235. width: height
  236. }
  237. }
  238. CheckBox
  239. {
  240. id: dontShowAgainCheckbox
  241. anchors.bottom: cancel_button.top
  242. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  243. anchors.left: parent.left
  244. text: catalog.i18nc("@action:label", "Don't show project summary on save again")
  245. checked: dontShowAgain
  246. }
  247. Button
  248. {
  249. id: cancel_button
  250. anchors.bottom: parent.bottom
  251. anchors.right: ok_button.left
  252. anchors.rightMargin: 2
  253. text: catalog.i18nc("@action:button","Cancel");
  254. enabled: true
  255. onClicked: close()
  256. }
  257. Button
  258. {
  259. id: ok_button
  260. anchors.bottom: parent.bottom
  261. anchors.right: parent.right
  262. text: catalog.i18nc("@action:button","Save");
  263. enabled: true
  264. onClicked: {
  265. close()
  266. yes()
  267. }
  268. }
  269. }
  270. }