UCPDialog.qml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // Copyright (c) 2024 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import QtQuick.Layouts 1.3
  6. import QtQuick.Window 2.2
  7. import UM 1.5 as UM
  8. import Cura 1.1 as Cura
  9. UM.Dialog
  10. {
  11. id: exportDialog
  12. title: catalog.i18nc("@title:window", "Export Universal Cura Project")
  13. margin: UM.Theme.getSize("default_margin").width
  14. minimumWidth: UM.Theme.getSize("modal_window_minimum").width
  15. minimumHeight: UM.Theme.getSize("modal_window_minimum").height
  16. backgroundColor: UM.Theme.getColor("detail_background")
  17. property bool dontShowAgain: false
  18. function storeDontShowAgain()
  19. {
  20. UM.Preferences.setValue("cura/dialog_on_ucp_project_save", !dontShowAgainCheckbox.checked)
  21. UM.Preferences.setValue("cura/asked_dialog_on_ucp_project_save", false)
  22. }
  23. onVisibleChanged:
  24. {
  25. if(visible && UM.Preferences.getValue("cura/asked_dialog_on_ucp_project_save"))
  26. {
  27. dontShowAgain = !UM.Preferences.getValue("cura/dialog_on_ucp_project_save")
  28. }
  29. }
  30. headerComponent: Rectangle
  31. {
  32. height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").height
  33. color: UM.Theme.getColor("main_background")
  34. ColumnLayout
  35. {
  36. id: headerColumn
  37. anchors.top: parent.top
  38. anchors.left: parent.left
  39. anchors.right: parent.right
  40. anchors.topMargin: UM.Theme.getSize("default_margin").height
  41. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  42. anchors.rightMargin: anchors.leftMargin
  43. UM.Label
  44. {
  45. id: titleLabel
  46. text: catalog.i18nc("@action:title", "Summary - Universal Cura Project")
  47. font: UM.Theme.getFont("large")
  48. }
  49. UM.Label
  50. {
  51. id: descriptionLabel
  52. text: catalog.i18nc("@action:description", "When exporting a Universal Cura Project, all the models present on the build plate will be included with their current position, orientation and scale. You can also select which per-extruder or per-model settings should be included to ensure a proper printing of the batch, even on different printers.")
  53. font: UM.Theme.getFont("default")
  54. wrapMode: Text.Wrap
  55. Layout.maximumWidth: headerColumn.width
  56. }
  57. }
  58. }
  59. Rectangle
  60. {
  61. anchors.fill: parent
  62. color: UM.Theme.getColor("main_background")
  63. UM.I18nCatalog { id: catalog; name: "cura" }
  64. ListView
  65. {
  66. id: settingsExportList
  67. anchors.fill: parent
  68. anchors.margins: UM.Theme.getSize("default_margin").width
  69. spacing: UM.Theme.getSize("thick_margin").height
  70. model: settingsExportModel.settingsGroups
  71. clip: true
  72. ScrollBar.vertical: UM.ScrollBar { id: verticalScrollBar }
  73. delegate: SettingsSelectionGroup { Layout.margins: 0 }
  74. }
  75. }
  76. leftButtons:
  77. [
  78. UM.CheckBox
  79. {
  80. id: dontShowAgainCheckbox
  81. text: catalog.i18nc("@action:label", "Don't show project summary on save again")
  82. checked: dontShowAgain
  83. }
  84. ]
  85. rightButtons:
  86. [
  87. Cura.TertiaryButton
  88. {
  89. text: catalog.i18nc("@action:button", "Cancel")
  90. onClicked: reject()
  91. },
  92. Cura.PrimaryButton
  93. {
  94. text: catalog.i18nc("@action:button", "Save project")
  95. onClicked: accept()
  96. }
  97. ]
  98. buttonSpacing: UM.Theme.getSize("wide_margin").width
  99. onClosing:
  100. {
  101. storeDontShowAgain()
  102. manager.notifyClosed()
  103. }
  104. onRejected: storeDontShowAgain()
  105. onAccepted: storeDontShowAgain()
  106. }