mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 07:09:02 +08:00
Rename id to objectId to prevent issues with built-in property id
This commit is contained in:
parent
e6bd9f8cc6
commit
0c606c4d6f
24
Printer.qml
24
Printer.qml
@ -221,23 +221,23 @@ UM.MainWindow {
|
||||
deleteSelection.onTriggered: UM.Controller.removeSelection();
|
||||
|
||||
deleteObject.onTriggered: {
|
||||
if(objectContextMenu.id != 0) {
|
||||
Printer.deleteObject(objectContextMenu.id);
|
||||
objectContextMenu.id = 0;
|
||||
if(objectContextMenu.objectId != 0) {
|
||||
Printer.deleteObject(objectContextMenu.objectId);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
multiplyObject.onTriggered: {
|
||||
if(objectContextMenu.id != 0) {
|
||||
Printer.multiplyObject(objectContextMenu.id, 1);
|
||||
objectContextMenu.id = 0;
|
||||
if(objectContextMenu.objectId != 0) {
|
||||
Printer.multiplyObject(objectContextMenu.objectId, 1);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
centerObject.onTriggered: {
|
||||
if(objectContextMenu.id != 0) {
|
||||
Printer.centerObject(objectContextMenu.id);
|
||||
objectContextMenu.id = 0;
|
||||
if(objectContextMenu.objectId != 0) {
|
||||
Printer.centerObject(objectContextMenu.objectId);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ UM.MainWindow {
|
||||
Menu {
|
||||
id: objectContextMenu;
|
||||
|
||||
property variant id: -1;
|
||||
property variant objectId: -1;
|
||||
|
||||
MenuItem { action: actions.centerObject; }
|
||||
MenuItem { action: actions.deleteObject; }
|
||||
@ -280,10 +280,10 @@ UM.MainWindow {
|
||||
Connections {
|
||||
target: UM.Controller
|
||||
onContextMenuRequested: {
|
||||
if(id == 0) {
|
||||
if(objectId == 0) {
|
||||
contextMenu.popup();
|
||||
} else {
|
||||
objectContextMenu.id = id;
|
||||
objectContextMenu.objectId = objectId;
|
||||
objectContextMenu.popup();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user