mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 13:47:51 -06:00
Prevent showing custom profiles twice and fix separator in the profiles dropdown
CURA-1887
This commit is contained in:
parent
2a949237c1
commit
4aa95ab317
1 changed files with 16 additions and 7 deletions
|
@ -13,7 +13,10 @@ import Cura 1.0 as Cura
|
||||||
|
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
model: UM.InstanceContainersModel { filter: menu.getFilter({ "read_only": true }); }
|
model: UM.InstanceContainersModel
|
||||||
|
{
|
||||||
|
filter: menu.getFilter({ "read_only": true });
|
||||||
|
}
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
{
|
{
|
||||||
|
@ -32,13 +35,11 @@ import Cura 1.0 as Cura
|
||||||
|
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
|
id: customProfileInstantiator
|
||||||
model: UM.InstanceContainersModel
|
model: UM.InstanceContainersModel
|
||||||
{
|
{
|
||||||
id: customProfilesModel;
|
|
||||||
filter: menu.getFilter({ "read_only": false });
|
filter: menu.getFilter({ "read_only": false });
|
||||||
onRowsInserted: customSeparator.visible = rowCount() > 1
|
onModelReset: customSeparator.visible = rowCount() > 0
|
||||||
onRowsRemoved: customSeparator.visible = rowCount() > 1
|
|
||||||
onModelReset: customSeparator.visible = rowCount() > 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
|
@ -50,8 +51,16 @@ import Cura 1.0 as Cura
|
||||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
onObjectAdded: menu.insertItem(index, object);
|
onObjectAdded:
|
||||||
onObjectRemoved: menu.removeItem(object);
|
{
|
||||||
|
customSeparator.visible = model.rowCount() > 0;
|
||||||
|
menu.insertItem(index, object);
|
||||||
|
}
|
||||||
|
onObjectRemoved:
|
||||||
|
{
|
||||||
|
customSeparator.visible = model.rowCount() > 0;
|
||||||
|
menu.removeItem(object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExclusiveGroup { id: group; }
|
ExclusiveGroup { id: group; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue