mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Changed order of buttons
This commit is contained in:
parent
a7135a0f5f
commit
fa3f473b61
3 changed files with 71 additions and 12 deletions
|
@ -55,9 +55,11 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
Logger.log("w", "Could not find reader that was able to read the scene data for 3MF workspace")
|
Logger.log("w", "Could not find reader that was able to read the scene data for 3MF workspace")
|
||||||
return WorkspaceReader.PreReadResult.failed
|
return WorkspaceReader.PreReadResult.failed
|
||||||
|
|
||||||
|
|
||||||
machine_name = ""
|
machine_name = ""
|
||||||
machine_type = ""
|
machine_type = ""
|
||||||
|
variant_type_name = i18n_catalog.i18nc("@label", "Nozzle")
|
||||||
|
|
||||||
|
num_extruders = 0
|
||||||
# Check if there are any conflicts, so we can ask the user.
|
# Check if there are any conflicts, so we can ask the user.
|
||||||
archive = zipfile.ZipFile(file_name, "r")
|
archive = zipfile.ZipFile(file_name, "r")
|
||||||
cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")]
|
cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")]
|
||||||
|
@ -87,13 +89,22 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
if not definitions:
|
if not definitions:
|
||||||
definition_container = DefinitionContainer(container_id)
|
definition_container = DefinitionContainer(container_id)
|
||||||
definition_container.deserialize(archive.open(definition_container_file).read().decode("utf-8"))
|
definition_container.deserialize(archive.open(definition_container_file).read().decode("utf-8"))
|
||||||
|
|
||||||
|
else:
|
||||||
|
definition_container = definitions[0]
|
||||||
|
|
||||||
if definition_container.getMetaDataEntry("type") != "extruder":
|
if definition_container.getMetaDataEntry("type") != "extruder":
|
||||||
machine_type = definition_container.getName()
|
machine_type = definition_container.getName()
|
||||||
|
variant_type_name = definition_container.getMetaDataEntry("variants_name", variant_type_name)
|
||||||
else:
|
else:
|
||||||
if definitions[0].getMetaDataEntry("type") != "extruder":
|
num_extruders += 1
|
||||||
machine_type = definitions[0].getName()
|
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
||||||
|
if num_extruders == 0:
|
||||||
|
num_extruders = 1 # No extruder stacks found, which means there is one extruder
|
||||||
|
|
||||||
|
extruders = num_extruders * [""]
|
||||||
|
|
||||||
material_labels = []
|
material_labels = []
|
||||||
material_conflict = False
|
material_conflict = False
|
||||||
xml_material_profile = self._getXmlProfileClass()
|
xml_material_profile = self._getXmlProfileClass()
|
||||||
|
@ -138,6 +149,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
quality_type = instance_container.getName()
|
quality_type = instance_container.getName()
|
||||||
elif container_type == "user":
|
elif container_type == "user":
|
||||||
num_user_settings += len(instance_container._instances)
|
num_user_settings += len(instance_container._instances)
|
||||||
|
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
num_visible_settings = 0
|
num_visible_settings = 0
|
||||||
try:
|
try:
|
||||||
|
@ -168,6 +180,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
self._dialog.setMachineName(machine_name)
|
self._dialog.setMachineName(machine_name)
|
||||||
self._dialog.setMaterialLabels(material_labels)
|
self._dialog.setMaterialLabels(material_labels)
|
||||||
self._dialog.setMachineType(machine_type)
|
self._dialog.setMachineType(machine_type)
|
||||||
|
self._dialog.setExtruders(extruders)
|
||||||
|
self._dialog.setVariantType(variant_type_name)
|
||||||
self._dialog.setHasObjectsOnPlate(Application.getInstance().getPlatformActivity)
|
self._dialog.setHasObjectsOnPlate(Application.getInstance().getPlatformActivity)
|
||||||
self._dialog.show()
|
self._dialog.show()
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,9 @@ class WorkspaceDialog(QObject):
|
||||||
self._quality_type = ""
|
self._quality_type = ""
|
||||||
self._machine_name = ""
|
self._machine_name = ""
|
||||||
self._machine_type = ""
|
self._machine_type = ""
|
||||||
|
self._variant_type = ""
|
||||||
self._material_labels = []
|
self._material_labels = []
|
||||||
|
self._extruders = []
|
||||||
self._objects_on_plate = False
|
self._objects_on_plate = False
|
||||||
|
|
||||||
machineConflictChanged = pyqtSignal()
|
machineConflictChanged = pyqtSignal()
|
||||||
|
@ -59,6 +61,16 @@ class WorkspaceDialog(QObject):
|
||||||
objectsOnPlateChanged = pyqtSignal()
|
objectsOnPlateChanged = pyqtSignal()
|
||||||
numUserSettingsChanged = pyqtSignal()
|
numUserSettingsChanged = pyqtSignal()
|
||||||
machineTypeChanged = pyqtSignal()
|
machineTypeChanged = pyqtSignal()
|
||||||
|
variantTypeChanged = pyqtSignal()
|
||||||
|
extrudersChanged = pyqtSignal()
|
||||||
|
|
||||||
|
@pyqtProperty(str, notify=variantTypeChanged)
|
||||||
|
def variantType(self):
|
||||||
|
return self._variant_type
|
||||||
|
|
||||||
|
def setVariantType(self, variant_type):
|
||||||
|
self._variant_type = variant_type
|
||||||
|
self.variantTypeChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(str, notify=machineTypeChanged)
|
@pyqtProperty(str, notify=machineTypeChanged)
|
||||||
def machineType(self):
|
def machineType(self):
|
||||||
|
@ -92,6 +104,14 @@ class WorkspaceDialog(QObject):
|
||||||
self._material_labels = material_labels
|
self._material_labels = material_labels
|
||||||
self.materialLabelsChanged.emit()
|
self.materialLabelsChanged.emit()
|
||||||
|
|
||||||
|
@pyqtProperty("QVariantList", notify=extrudersChanged)
|
||||||
|
def extruders(self):
|
||||||
|
return self._extruders
|
||||||
|
|
||||||
|
def setExtruders(self, extruders):
|
||||||
|
self._extruders = extruders
|
||||||
|
self.extrudersChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(str, notify = machineNameChanged)
|
@pyqtProperty(str, notify = machineNameChanged)
|
||||||
def machineName(self):
|
def machineName(self):
|
||||||
return self._machine_name
|
return self._machine_name
|
||||||
|
|
|
@ -133,6 +133,30 @@ UM.Dialog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Repeater
|
||||||
|
{
|
||||||
|
model: manager.extruders
|
||||||
|
delegate: Column
|
||||||
|
{
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:label", "Extruder %1").arg(index+1)
|
||||||
|
}
|
||||||
|
width: parent.width
|
||||||
|
height: childrenRect.height
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:label", "%1 & material").arg(manager.variantType)
|
||||||
|
width: parent.width / 3
|
||||||
|
}
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: modelData
|
||||||
|
width: parent.width / 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
Item // Spacer
|
Item // Spacer
|
||||||
{
|
{
|
||||||
height: spacerHeight
|
height: spacerHeight
|
||||||
|
@ -332,19 +356,20 @@ UM.Dialog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rightButtons: [
|
rightButtons: [
|
||||||
Button
|
|
||||||
{
|
|
||||||
id: ok_button
|
|
||||||
text: catalog.i18nc("@action:button","OK");
|
|
||||||
onClicked: { manager.closeBackend(); manager.onOkButtonClicked() }
|
|
||||||
enabled: true
|
|
||||||
},
|
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: cancel_button
|
id: cancel_button
|
||||||
text: catalog.i18nc("@action:button","Cancel");
|
text: catalog.i18nc("@action:button","Cancel");
|
||||||
onClicked: { manager.onCancelButtonClicked() }
|
onClicked: { manager.onCancelButtonClicked() }
|
||||||
enabled: true
|
enabled: true
|
||||||
|
},
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
id: ok_button
|
||||||
|
text: catalog.i18nc("@action:button","Open");
|
||||||
|
onClicked: { manager.closeBackend(); manager.onOkButtonClicked() }
|
||||||
|
enabled: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue