mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 14:45:55 +08:00
Remove back Cura.ExtrudersModel{}, because if retrieve the model from backend
the tabs cannot be removed after model update. The QML bug CURA-6036
This commit is contained in:
parent
1ac5403c21
commit
7cf1df7435
@ -13,10 +13,22 @@ import Cura 1.0 as Cura
|
|||||||
Cura.MachineAction
|
Cura.MachineAction
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
property var extrudersModel: Cura.ExtrudersModel{} // Do not retrieve the Model from a backend. Otherwise the tabs
|
||||||
|
// in tabView will not removed/updated. Probably QML bug
|
||||||
|
property int extruderTabsCount: 0
|
||||||
|
|
||||||
property var activeMachineId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.id : ""
|
property var activeMachineId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.id : ""
|
||||||
|
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: base.extrudersModel
|
||||||
|
onModelChanged:
|
||||||
|
{
|
||||||
|
var extruderCount = base.extrudersModel.count;
|
||||||
|
base.extruderTabsCount = extruderCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: dialog ? dialog : null
|
target: dialog ? dialog : null
|
||||||
@ -346,22 +358,11 @@ Cura.MachineAction
|
|||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
id: extruderTabsRepeater
|
id: extruderTabsRepeater
|
||||||
model: base.extrudersModel
|
model: base.extruderTabsCount
|
||||||
|
|
||||||
|
|
||||||
onItemAdded:
|
|
||||||
{
|
|
||||||
settingsTabs.addTab(index + 1, item)
|
|
||||||
}
|
|
||||||
|
|
||||||
onItemRemoved:
|
|
||||||
{
|
|
||||||
settingsTabs.removeTab(index + 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tab
|
Tab
|
||||||
{
|
{
|
||||||
title: model.name
|
title: base.extrudersModel.getItem(index).name
|
||||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Column
|
Column
|
||||||
|
Loading…
x
Reference in New Issue
Block a user