WorkspaceSummaryDialog.qml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. // Copyright (c) 2018 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. function accept() { // pressing enter will call this function
  20. close();
  21. yes();
  22. }
  23. onClosing:
  24. {
  25. UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked)
  26. }
  27. onVisibleChanged:
  28. {
  29. if(visible)
  30. {
  31. dontShowAgain = !UM.Preferences.getValue("cura/dialog_on_project_save")
  32. }
  33. }
  34. Item
  35. {
  36. anchors.fill: parent
  37. UM.SettingDefinitionsModel
  38. {
  39. id: definitionsModel
  40. containerId: Cura.MachineManager.activeDefinitionId
  41. showAll: true
  42. exclude: ["command_line_settings"]
  43. showAncestors: true
  44. expanded: ["*"]
  45. visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
  46. }
  47. UM.I18nCatalog
  48. {
  49. id: catalog
  50. name: "cura"
  51. }
  52. SystemPalette
  53. {
  54. id: palette
  55. }
  56. Label
  57. {
  58. id: mainHeading
  59. width: parent.width
  60. text: catalog.i18nc("@action:title", "Summary - Cura Project")
  61. font.pointSize: 18
  62. anchors.top: parent.top
  63. }
  64. ScrollView
  65. {
  66. id: scroll
  67. width: parent.width
  68. anchors
  69. {
  70. top: mainHeading.bottom
  71. topMargin: UM.Theme.getSize("default_margin").height
  72. bottom: controls.top
  73. bottomMargin: UM.Theme.getSize("default_margin").height
  74. }
  75. style: UM.Theme.styles.scrollview
  76. ColumnLayout
  77. {
  78. spacing: UM.Theme.getSize("default_margin").height
  79. Column
  80. {
  81. Label
  82. {
  83. id: settingsHeading
  84. text: catalog.i18nc("@action:label", "Printer settings")
  85. font.bold: true
  86. }
  87. Row
  88. {
  89. width: parent.width
  90. height: childrenRect.height
  91. Label
  92. {
  93. text: catalog.i18nc("@action:label", "Type")
  94. width: Math.floor(scroll.width / 3) | 0
  95. }
  96. Label
  97. {
  98. text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name
  99. width: Math.floor(scroll.width / 3) | 0
  100. }
  101. }
  102. Row
  103. {
  104. width: parent.width
  105. height: childrenRect.height
  106. Label
  107. {
  108. text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
  109. width: Math.floor(scroll.width / 3) | 0
  110. }
  111. Label
  112. {
  113. text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
  114. width: Math.floor(scroll.width / 3) | 0
  115. }
  116. }
  117. }
  118. Row
  119. {
  120. visible: Cura.MachineManager.hasVariantBuildplates
  121. width: parent.width
  122. height: childrenRect.height
  123. Label
  124. {
  125. text: catalog.i18nc("@action:label", "Build plate")
  126. width: Math.floor(scroll.width / 3) | 0
  127. }
  128. Label
  129. {
  130. text: Cura.MachineManager.activeVariantBuildplateName
  131. width: Math.floor(scroll.width / 3) | 0
  132. }
  133. }
  134. Repeater
  135. {
  136. width: parent.width
  137. height: childrenRect.height
  138. model: Cura.MachineManager.currentExtruderPositions
  139. delegate: Column
  140. {
  141. height: childrenRect.height
  142. width: parent.width
  143. Label
  144. {
  145. text: {
  146. var extruder = Number(modelData)
  147. var extruder_id = ""
  148. if(!isNaN(extruder))
  149. {
  150. extruder_id = extruder + 1 // The extruder counter start from One and not Zero
  151. }
  152. else
  153. {
  154. extruder_id = modelData
  155. }
  156. return catalog.i18nc("@action:label", "Extruder %1").arg(extruder_id)
  157. }
  158. font.bold: true
  159. }
  160. Row
  161. {
  162. width: parent.width
  163. height: childrenRect.height
  164. Label
  165. {
  166. text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
  167. width: Math.floor(scroll.width / 3) | 0
  168. }
  169. Label
  170. {
  171. text: Cura.MachineManager.activeVariantNames[modelData] + ", " + Cura.MachineManager.getExtruder(modelData).material.name
  172. width: Math.floor(scroll.width / 3) | 0
  173. }
  174. }
  175. }
  176. }
  177. Column
  178. {
  179. width: parent.width
  180. height: childrenRect.height
  181. Label
  182. {
  183. text: catalog.i18nc("@action:label", "Profile settings")
  184. font.bold: true
  185. }
  186. Row
  187. {
  188. width: parent.width
  189. Label
  190. {
  191. text: catalog.i18nc("@action:label", "Not in profile")
  192. width: Math.floor(scroll.width / 3) | 0
  193. }
  194. Label
  195. {
  196. text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
  197. width: Math.floor(scroll.width / 3) | 0
  198. }
  199. visible: Cura.MachineManager.numUserSettings
  200. }
  201. Row
  202. {
  203. width: parent.width
  204. height: childrenRect.height
  205. Label
  206. {
  207. text: catalog.i18nc("@action:label", "Name")
  208. width: Math.floor(scroll.width / 3) | 0
  209. }
  210. Label
  211. {
  212. text: Cura.MachineManager.activeQualityOrQualityChangesName
  213. width: Math.floor(scroll.width / 3) | 0
  214. }
  215. }
  216. }
  217. Column
  218. {
  219. width: parent.width
  220. height: childrenRect.height
  221. Label
  222. {
  223. text: catalog.i18nc("@action:label", "Setting visibility")
  224. font.bold: true
  225. }
  226. Row
  227. {
  228. width: parent.width
  229. height: childrenRect.height
  230. Label
  231. {
  232. text: catalog.i18nc("@action:label", "Visible settings:")
  233. width: Math.floor(scroll.width / 3) | 0
  234. }
  235. Label
  236. {
  237. text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
  238. width: Math.floor(scroll.width / 3) | 0
  239. }
  240. }
  241. }
  242. }
  243. }
  244. Item
  245. {
  246. id: controls
  247. width: parent.width
  248. height: childrenRect.height
  249. anchors.bottom: parent.bottom
  250. CheckBox
  251. {
  252. id: dontShowAgainCheckbox
  253. anchors.left: parent.left
  254. text: catalog.i18nc("@action:label", "Don't show project summary on save again")
  255. checked: dontShowAgain
  256. }
  257. Button
  258. {
  259. id: cancel_button
  260. anchors
  261. {
  262. right: ok_button.left
  263. rightMargin: UM.Theme.getSize("default_margin").width
  264. }
  265. text: catalog.i18nc("@action:button","Cancel");
  266. enabled: true
  267. onClicked: close()
  268. }
  269. Button
  270. {
  271. id: ok_button
  272. anchors.right: parent.right
  273. text: catalog.i18nc("@action:button","Save");
  274. enabled: true
  275. onClicked:
  276. {
  277. close()
  278. yes()
  279. }
  280. }
  281. }
  282. }
  283. }