WorkspaceSummaryDialog.qml 7.2 KB

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