WorkspaceSummaryDialog.qml 7.9 KB

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