WorkspaceSummaryDialog.qml 10 KB

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