SettingVisibilityPresetsMenu.qml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Controls 1.4
  5. import UM 1.2 as UM
  6. import Cura 1.0 as Cura
  7. Menu
  8. {
  9. id: menu
  10. title: catalog.i18nc("@action:inmenu", "Visible Settings")
  11. property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel()
  12. signal showAllSettings()
  13. Instantiator
  14. {
  15. model: settingVisibilityPresetsModel
  16. MenuItem
  17. {
  18. text: model.name
  19. checkable: true
  20. checked: model.id == settingVisibilityPresetsModel.activePreset
  21. exclusiveGroup: group
  22. onTriggered:
  23. {
  24. settingVisibilityPresetsModel.setActivePreset(model.id);
  25. showSettingVisibilityProfile();
  26. }
  27. }
  28. onObjectAdded: menu.insertItem(index, object)
  29. onObjectRemoved: menu.removeItem(object)
  30. }
  31. MenuSeparator {}
  32. MenuItem
  33. {
  34. text: catalog.i18nc("@action:inmenu", "Show All Settings")
  35. checkable: false
  36. exclusiveGroup: group
  37. onTriggered:
  38. {
  39. showAllSettings();
  40. }
  41. }
  42. MenuSeparator {}
  43. MenuItem
  44. {
  45. text: catalog.i18nc("@action:inmenu", "Manage Setting Visibility...")
  46. iconName: "configure"
  47. onTriggered: Cura.Actions.configureSettingVisibility.trigger()
  48. }
  49. ExclusiveGroup { id: group }
  50. }