WorkspaceSummaryDialog.qml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. Repeater
  110. {
  111. model: Cura.MachineManager.activeMaterialNames
  112. delegate: Column
  113. {
  114. Item // Spacer
  115. {
  116. height: spacerHeight
  117. width: height
  118. }
  119. Label
  120. {
  121. text: catalog.i18nc("@action:label", "Extruder %1").arg(index+1)
  122. }
  123. height: childrenRect.height
  124. width: parent.width
  125. Row
  126. {
  127. width: parent.width
  128. height: childrenRect.height
  129. Label
  130. {
  131. text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
  132. width: (parent.width / 3) | 0
  133. }
  134. Label
  135. {
  136. text: Cura.MachineManager.activeVariantNames[index] + ", " + modelData
  137. width: (parent.width / 3) | 0
  138. }
  139. }
  140. }
  141. }
  142. Item // Spacer
  143. {
  144. height: spacerHeight
  145. width: height
  146. }
  147. Label
  148. {
  149. text: catalog.i18nc("@action:label", "Profile settings")
  150. font.bold: true
  151. }
  152. Row
  153. {
  154. width: parent.width
  155. Label
  156. {
  157. text: catalog.i18nc("@action:label", "Not in profile")
  158. width: (parent.width / 3) | 0
  159. }
  160. Label
  161. {
  162. text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
  163. width: (parent.width / 3) | 0
  164. }
  165. visible: Cura.MachineManager.numUserSettings
  166. }
  167. Row
  168. {
  169. width: parent.width
  170. height: childrenRect.height
  171. Label
  172. {
  173. text: catalog.i18nc("@action:label", "Name")
  174. width: (parent.width / 3) | 0
  175. }
  176. Label
  177. {
  178. text: Cura.MachineManager.activeQualityName
  179. width: (parent.width / 3) | 0
  180. }
  181. }
  182. Item // Spacer
  183. {
  184. height: spacerHeight
  185. width: height
  186. }
  187. Label
  188. {
  189. text: catalog.i18nc("@action:label", "Setting visibility")
  190. font.bold: true
  191. }
  192. Row
  193. {
  194. width: parent.width
  195. height: childrenRect.height
  196. Label
  197. {
  198. text: catalog.i18nc("@action:label", "Visible settings:")
  199. width: (parent.width / 3) | 0
  200. }
  201. Label
  202. {
  203. text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
  204. width: (parent.width / 3) | 0
  205. }
  206. }
  207. Item // Spacer
  208. {
  209. height: spacerHeight
  210. width: height
  211. }
  212. }
  213. CheckBox
  214. {
  215. id: dontShowAgainCheckbox
  216. anchors.bottom: cancel_button.top
  217. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  218. anchors.left: parent.left
  219. text: catalog.i18nc("@action:label", "Don't show project summary on save again")
  220. checked: dontShowAgain
  221. }
  222. Button
  223. {
  224. id: cancel_button
  225. anchors.bottom: parent.bottom
  226. anchors.right: ok_button.left
  227. anchors.rightMargin: 2
  228. text: catalog.i18nc("@action:button","Cancel");
  229. enabled: true
  230. onClicked: close()
  231. }
  232. Button
  233. {
  234. id: ok_button
  235. anchors.bottom: parent.bottom
  236. anchors.right: parent.right
  237. text: catalog.i18nc("@action:button","Save");
  238. enabled: true
  239. onClicked: {
  240. close()
  241. yes()
  242. }
  243. }
  244. }
  245. }