mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Added warning when trying to load project with objects on buildplate
CURA-1263
This commit is contained in:
parent
5d1ba828bc
commit
a0813b3af3
3 changed files with 24 additions and 0 deletions
|
@ -145,6 +145,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
self._dialog.setActiveMode(active_mode)
|
||||
self._dialog.setMachineName(machine_name)
|
||||
self._dialog.setMaterialLabels(material_labels)
|
||||
self._dialog.setHasObjectsOnPlate(Application.getInstance().getPlatformActivity)
|
||||
self._dialog.show()
|
||||
|
||||
# Block until the dialog is closed.
|
||||
|
|
|
@ -38,6 +38,7 @@ class WorkspaceDialog(QObject):
|
|||
self._quality_type = ""
|
||||
self._machine_name = ""
|
||||
self._material_labels = []
|
||||
self._objects_on_plate = False
|
||||
|
||||
machineConflictChanged = pyqtSignal()
|
||||
qualityChangesConflictChanged = pyqtSignal()
|
||||
|
@ -49,6 +50,15 @@ class WorkspaceDialog(QObject):
|
|||
qualityTypeChanged = pyqtSignal()
|
||||
machineNameChanged = pyqtSignal()
|
||||
materialLabelsChanged = pyqtSignal()
|
||||
objectsOnPlateChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(bool, notify=objectsOnPlateChanged)
|
||||
def hasObjectsOnPlate(self):
|
||||
return self._objects_on_plate
|
||||
|
||||
def setHasObjectsOnPlate(self, objects_on_plate):
|
||||
self._objects_on_plate = objects_on_plate
|
||||
self.objectsOnPlateChanged.emit()
|
||||
|
||||
@pyqtProperty("QVariantList", notify = materialLabelsChanged)
|
||||
def materialLabels(self):
|
||||
|
|
|
@ -284,6 +284,19 @@ UM.Dialog
|
|||
width: parent.width / 3
|
||||
}
|
||||
}
|
||||
Item // Spacer
|
||||
{
|
||||
height: spacerHeight
|
||||
width: height
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the buildplate")
|
||||
visible: manager.hasObjectsOnPlate
|
||||
color: "red"
|
||||
width: parent.width
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
}
|
||||
rightButtons: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue