mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Update the settings menu to controls 2
CURA-8683
This commit is contained in:
parent
770f6f94c9
commit
2bad5c5cd3
8 changed files with 121 additions and 140 deletions
|
@ -51,6 +51,19 @@ Item
|
|||
|
||||
EditMenu {}
|
||||
ViewMenu {}
|
||||
|
||||
SettingsMenu
|
||||
{
|
||||
//On MacOS, don't translate the "Settings" word.
|
||||
//Qt moves the "settings" entry to a different place, and if it got renamed can't find it again when it
|
||||
//attempts to delete the item upon closing the application, causing a crash.
|
||||
//In the new location, these items are translated automatically according to the system's language.
|
||||
//For more information, see:
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*UM.ApplicationMenu
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: Cura.GlobalStacksModel {}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
|
||||
exclusiveGroup: group
|
||||
visible: !model.hasRemoteConnection
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
//Copyright (c) 2020 Ultimaker B.V.
|
||||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
UM.Menu
|
||||
{
|
||||
id: menu
|
||||
title: catalog.i18nc("@label:category menu label", "Material")
|
||||
|
@ -49,23 +49,24 @@ Menu
|
|||
enabled: updateModels
|
||||
}
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@label:category menu label", "Favorites")
|
||||
enabled: false
|
||||
visible: favoriteMaterialsModel.items.length > 0
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: favoriteMaterialsModel
|
||||
delegate: MenuItem
|
||||
delegate: UM.MenuItem
|
||||
{
|
||||
text: model.brand + " " + model.name
|
||||
checkable: true
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.root_material_id === menu.currentRootMaterialId
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
exclusiveGroup: favoriteGroup // One favorite and one item from the others can be active at the same time.
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(index)
|
||||
|
@ -81,13 +82,12 @@ Menu
|
|||
Instantiator
|
||||
{
|
||||
model: genericMaterialsModel
|
||||
delegate: MenuItem
|
||||
delegate: UM.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.root_material_id === menu.currentRootMaterialId
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
}
|
||||
onObjectAdded: genericMenu.insertItem(index, object)
|
||||
|
@ -100,7 +100,7 @@ Menu
|
|||
Instantiator
|
||||
{
|
||||
model: brandModel
|
||||
Menu
|
||||
UM.Menu
|
||||
{
|
||||
id: brandMenu
|
||||
title: brandName
|
||||
|
@ -120,47 +120,37 @@ Menu
|
|||
Instantiator
|
||||
{
|
||||
model: brandMaterialColors
|
||||
delegate: MenuItem
|
||||
delegate: UM.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.id === menu.activeMaterialId
|
||||
exclusiveGroup: group
|
||||
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
}
|
||||
onObjectAdded: brandMaterialsMenu.insertItem(index, object)
|
||||
onObjectRemoved: brandMaterialsMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
onObjectAdded: brandMenu.insertItem(index, object)
|
||||
onObjectRemoved: brandMenu.removeItem(object)
|
||||
onObjectAdded: brandMenu.insertMenu(index, object)
|
||||
onObjectRemoved: brandMenu.removeMenu(object)
|
||||
}
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
ExclusiveGroup
|
||||
{
|
||||
id: group
|
||||
}
|
||||
|
||||
ExclusiveGroup
|
||||
{
|
||||
id: favoriteGroup
|
||||
onObjectAdded: menu.insertMenu(index, object)
|
||||
onObjectRemoved: menu.removeMenu(object)
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
action: Cura.Actions.manageMaterials
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
action: Cura.Actions.marketplaceMaterials
|
||||
}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: Cura.GlobalStacksModel {}
|
||||
MenuItem
|
||||
{
|
||||
property string connectGroupName:
|
||||
{
|
||||
if("group_name" in model.metadata)
|
||||
{
|
||||
return model.metadata["group_name"]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
text: connectGroupName
|
||||
checkable: true
|
||||
visible: model.hasRemoteConnection
|
||||
checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
UM.Menu
|
||||
{
|
||||
id: menu
|
||||
id: nozzleMenu
|
||||
title: "Nozzle"
|
||||
|
||||
property int extruderIndex: 0
|
||||
|
@ -23,12 +23,13 @@ Menu
|
|||
{
|
||||
model: nozzleModel
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
text: model.hotend_name
|
||||
checkable: true
|
||||
checked: {
|
||||
var activeMachine = Cura.MachineManager.activeMachine
|
||||
property var activeMachine: Cura.MachineManager.activeMachine
|
||||
checked:
|
||||
{
|
||||
if (activeMachine === null)
|
||||
{
|
||||
return false
|
||||
|
@ -36,10 +37,8 @@ Menu
|
|||
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name)
|
||||
}
|
||||
exclusiveGroup: group
|
||||
enabled:
|
||||
{
|
||||
var activeMachine = Cura.MachineManager.activeMachine
|
||||
if (activeMachine === null)
|
||||
{
|
||||
return false
|
||||
|
@ -47,14 +46,14 @@ Menu
|
|||
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : extruder.isEnabled
|
||||
}
|
||||
onTriggered: {
|
||||
Cura.MachineManager.setVariant(menu.extruderIndex, model.container_node);
|
||||
}
|
||||
onTriggered:Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node)
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object);
|
||||
onObjectRemoved: menu.removeItem(object);
|
||||
onObjectAdded:
|
||||
{
|
||||
nozzleMenu.insertItem(index, object)
|
||||
}
|
||||
onObjectRemoved: nozzleMenu.removeItem(object)
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: group }
|
||||
}
|
||||
|
|
|
@ -1,60 +1,89 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
{
|
||||
id: menu
|
||||
// TODO Enable custom style to the menu
|
||||
// style: MenuStyle
|
||||
// {
|
||||
// frame: Rectangle
|
||||
// {
|
||||
// color: "white"
|
||||
// }
|
||||
// }
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
id: networkEnabledPrinterItem
|
||||
text: catalog.i18nc("@label:category menu label", "Network enabled printers")
|
||||
enabled: false
|
||||
visible: networkPrinterMenu.count > 0
|
||||
visible: networKPrinterInstantiator.count > 0
|
||||
}
|
||||
|
||||
NetworkPrinterMenu
|
||||
Instantiator
|
||||
{
|
||||
id: networkPrinterMenu
|
||||
id: networKPrinterInstantiator
|
||||
model: Cura.GlobalStacksModel {filterOnlineOnly: true}
|
||||
UM.MenuItem
|
||||
{
|
||||
property string connectGroupName:
|
||||
{
|
||||
if("group_name" in model.metadata)
|
||||
{
|
||||
return model.metadata["group_name"]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
text: connectGroupName
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
|
||||
onTriggered:
|
||||
{
|
||||
print(typeof(model.id))
|
||||
Cura.MachineManager.someFunction("YAY")
|
||||
Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
}
|
||||
onObjectAdded: menu.insertItem(2, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
{
|
||||
visible: networkPrinterMenu.count > 0
|
||||
visible: networKPrinterInstantiator.count > 0
|
||||
}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@label:category menu label", "Local printers")
|
||||
enabled: false
|
||||
visible: localPrinterMenu.count > 0
|
||||
}
|
||||
|
||||
LocalPrinterMenu
|
||||
UM.MenuItem
|
||||
{
|
||||
id: localPrinterMenu
|
||||
text: catalog.i18nc("@label:category menu label", "Local printers")
|
||||
enabled: false
|
||||
visible: localPrinterInstantiator.count > 0
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: group; }
|
||||
Instantiator
|
||||
{
|
||||
id: localPrinterInstantiator
|
||||
model: Cura.GlobalStacksModel {}
|
||||
|
||||
UM.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
|
||||
visible: !model.hasRemoteConnection
|
||||
height: visible ? implicitHeight: 0
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
// A bit hackish, but we have 2 items at the end, put them before that
|
||||
onObjectAdded: menu.insertItem(menu.count - 2, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
{
|
||||
visible: localPrinterMenu.count > 0
|
||||
visible: localPrinterInstantiator.count > 0
|
||||
}
|
||||
|
||||
MenuItem { action: Cura.Actions.addMachine; }
|
||||
MenuItem { action: Cura.Actions.configureMachines; }
|
||||
UM.MenuItem { action: Cura.Actions.addMachine }
|
||||
UM.MenuItem { action: Cura.Actions.configureMachines }
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
|
@ -23,11 +23,16 @@ Menu
|
|||
{
|
||||
title: modelData.name
|
||||
property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index]
|
||||
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.activeMachine.hasVariants; extruderIndex: index }
|
||||
NozzleMenu
|
||||
{
|
||||
title: Cura.MachineManager.activeDefinitionVariantsName
|
||||
shouldBeVisible: activeMachine.hasVariants
|
||||
extruderIndex: index
|
||||
}
|
||||
MaterialMenu
|
||||
{
|
||||
title: catalog.i18nc("@title:menu", "&Material")
|
||||
visible: Cura.MachineManager.activeMachine.hasMaterials
|
||||
shouldBeVisible: activeMachine.hasMaterials
|
||||
extruderIndex: index
|
||||
updateModels: false
|
||||
onAboutToShow: updateModels = true
|
||||
|
@ -39,33 +44,34 @@ Menu
|
|||
visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials
|
||||
}
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
|
||||
onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index)
|
||||
}
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Enable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
|
||||
visible: (extruder === null || extruder === undefined) ? false : !extruder.isEnabled
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(index, false)
|
||||
visible: (extruder === null || extruder === undefined) ? false : extruder.isEnabled
|
||||
enabled: Cura.MachineManager.numberExtrudersEnabled > 1
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
}
|
||||
onObjectAdded: base.insertItem(index, object)
|
||||
onObjectRemoved: base.removeItem(object)
|
||||
onObjectAdded: base.insertMenu(index, object)
|
||||
onObjectRemoved: base.removeMenu(object)
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
|
||||
MenuItem { action: Cura.Actions.configureSettingVisibility }
|
||||
UM.MenuItem { action: Cura.Actions.configureSettingVisibility }
|
||||
}
|
|
@ -15,6 +15,7 @@ MenuItem
|
|||
|
||||
implicitHeight: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("narrow_margin").height
|
||||
opacity: enabled ? 1.0 : 0.5
|
||||
height: visible ? implicitHeight: 0
|
||||
|
||||
arrow: UM.RecolorImage
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue