mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 22:35:03 -06: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
1 changed files with 15 additions and 14 deletions
|
@ -13,10 +13,22 @@ import Cura 1.0 as Cura
|
|||
Cura.MachineAction
|
||||
{
|
||||
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 : ""
|
||||
|
||||
Connections
|
||||
{
|
||||
target: base.extrudersModel
|
||||
onModelChanged:
|
||||
{
|
||||
var extruderCount = base.extrudersModel.count;
|
||||
base.extruderTabsCount = extruderCount;
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: dialog ? dialog : null
|
||||
|
@ -346,22 +358,11 @@ Cura.MachineAction
|
|||
Repeater
|
||||
{
|
||||
id: extruderTabsRepeater
|
||||
model: base.extrudersModel
|
||||
|
||||
|
||||
onItemAdded:
|
||||
{
|
||||
settingsTabs.addTab(index + 1, item)
|
||||
}
|
||||
|
||||
onItemRemoved:
|
||||
{
|
||||
settingsTabs.removeTab(index + 1)
|
||||
}
|
||||
model: base.extruderTabsCount
|
||||
|
||||
Tab
|
||||
{
|
||||
title: model.name
|
||||
title: base.extrudersModel.getItem(index).name
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Column
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue