SettingVisibilityPresetsMenu.qml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.items
  16. MenuItem
  17. {
  18. text: modelData.name
  19. checkable: true
  20. checked: modelData.presetId == settingVisibilityPresetsModel.activePreset
  21. exclusiveGroup: group
  22. onTriggered:
  23. {
  24. settingVisibilityPresetsModel.setActivePreset(modelData.presetId);
  25. }
  26. }
  27. onObjectAdded: menu.insertItem(index, object)
  28. onObjectRemoved: menu.removeItem(object)
  29. }
  30. MenuSeparator {}
  31. MenuItem
  32. {
  33. text: catalog.i18nc("@action:inmenu", "Show All Settings")
  34. checkable: false
  35. exclusiveGroup: group
  36. onTriggered:
  37. {
  38. showAllSettings();
  39. }
  40. }
  41. MenuSeparator {}
  42. MenuItem
  43. {
  44. text: catalog.i18nc("@action:inmenu", "Manage Setting Visibility...")
  45. iconName: "configure"
  46. onTriggered: Cura.Actions.configureSettingVisibility.trigger()
  47. }
  48. ExclusiveGroup { id: group }
  49. }