mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
CURA-4525 automatic build plate menu items using BuildPlateModel
This commit is contained in:
parent
97f61366a8
commit
bd8aa8d989
12 changed files with 131 additions and 152 deletions
|
@ -5,12 +5,12 @@ import QtQuick 2.2
|
|||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import Cura 1.2 as Cura
|
||||
|
||||
Menu
|
||||
{
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&View");
|
||||
id: menu
|
||||
id: base
|
||||
enabled: !PrintInformation.preSliced
|
||||
Instantiator
|
||||
{
|
||||
|
@ -23,30 +23,27 @@ Menu
|
|||
exclusiveGroup: group;
|
||||
onTriggered: UM.Controller.setActiveView(model.id);
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
onObjectAdded: base.insertItem(index, object)
|
||||
onObjectRemoved: base.removeItem(object)
|
||||
}
|
||||
ExclusiveGroup { id: group; }
|
||||
|
||||
MenuSeparator {}
|
||||
MenuItem {
|
||||
text: "build plate 0";
|
||||
onTriggered: CuraApplication.setActiveBuildPlate(0);
|
||||
}
|
||||
MenuItem {
|
||||
text: "build plate 1";
|
||||
onTriggered: CuraApplication.setActiveBuildPlate(1);
|
||||
}
|
||||
MenuItem {
|
||||
text: "build plate 2";
|
||||
onTriggered: CuraApplication.setActiveBuildPlate(2);
|
||||
MenuItem { action: Cura.Actions.homeCamera; }
|
||||
|
||||
MenuSeparator {}
|
||||
Instantiator
|
||||
{
|
||||
model: Cura.BuildPlateModel
|
||||
MenuItem {
|
||||
text: Cura.BuildPlateModel.getItem(index).name;
|
||||
onTriggered: Cura.BuildPlateModel.setActiveBuildPlate(Cura.BuildPlateModel.getItem(index).buildPlateNumber);
|
||||
checkable: true;
|
||||
checked: Cura.BuildPlateModel.getItem(index).buildPlateNumber == Cura.BuildPlateModel.activeBuildPlate;
|
||||
exclusiveGroup: buildPlateGroup;
|
||||
}
|
||||
onObjectAdded: base.insertItem(index, object);
|
||||
onObjectRemoved: base.removeItem(object)
|
||||
}
|
||||
ExclusiveGroup { id: buildPlateGroup; }
|
||||
|
||||
MenuItem {
|
||||
text: "New build plate";
|
||||
onTriggered: CuraApplication.newBuildPlate();
|
||||
}
|
||||
MenuSeparator {}
|
||||
MenuItem { action: Cura.Actions.homeCamera; }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue