mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Create new MaterialManagementModel and move canMaterialBeRemoved
Just like the QualityManagementModel, this class is intended to be used as proxy for the material management page in the preferences. I'm intending to move all relevant pyqtSlots from the material manager into this one. The advantage of this switch is that the material manager had no well-bounded scope and so tended to become a big mess of all sorts of functions. This one has a clear scope: serve as a proxy for the buttons you can press in the preferences screen for materials. Contributes to issue CURA-6600.
This commit is contained in:
parent
36dfd23e3f
commit
5b8ed91b04
4 changed files with 46 additions and 8 deletions
|
|
@ -7,7 +7,7 @@ import QtQuick.Layouts 1.3
|
|||
import QtQuick.Dialogs 1.2
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
Item
|
||||
{
|
||||
|
|
@ -42,6 +42,11 @@ Item
|
|||
name: "cura"
|
||||
}
|
||||
|
||||
Cura.MaterialManagementModel
|
||||
{
|
||||
id: materialManagement
|
||||
}
|
||||
|
||||
function resetExpandedActiveMaterial()
|
||||
{
|
||||
materialListView.expandActiveMaterial(active_root_material_id)
|
||||
|
|
@ -147,7 +152,7 @@ Item
|
|||
id: removeMenuButton
|
||||
text: catalog.i18nc("@action:button", "Remove")
|
||||
iconName: "list-remove"
|
||||
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && base.materialManager.canMaterialBeRemoved(base.currentItem.container_node)
|
||||
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && materialManagement.canMaterialBeRemoved(base.currentItem.container_node)
|
||||
|
||||
onClicked:
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue