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")
|
||||
return WorkspaceReader.PreReadResult.failed
|
||||
|
||||
|
||||
machine_name = ""
|
||||
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.
|
||||
archive = zipfile.ZipFile(file_name, "r")
|
||||
cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")]
|
||||
|
@ -87,13 +89,22 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
if not definitions:
|
||||
definition_container = DefinitionContainer(container_id)
|
||||
definition_container.deserialize(archive.open(definition_container_file).read().decode("utf-8"))
|
||||
|
||||
else:
|
||||
definition_container = definitions[0]
|
||||
|
||||
if definition_container.getMetaDataEntry("type") != "extruder":
|
||||
machine_type = definition_container.getName()
|
||||
variant_type_name = definition_container.getMetaDataEntry("variants_name", variant_type_name)
|
||||
else:
|
||||
if definitions[0].getMetaDataEntry("type") != "extruder":
|
||||
machine_type = definitions[0].getName()
|
||||
num_extruders += 1
|
||||
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_conflict = False
|
||||
xml_material_profile = self._getXmlProfileClass()
|
||||
|
@ -138,6 +149,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
quality_type = instance_container.getName()
|
||||
elif container_type == "user":
|
||||
num_user_settings += len(instance_container._instances)
|
||||
|
||||
Job.yieldThread()
|
||||
num_visible_settings = 0
|
||||
try:
|
||||
|
@ -168,6 +180,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
self._dialog.setMachineName(machine_name)
|
||||
self._dialog.setMaterialLabels(material_labels)
|
||||
self._dialog.setMachineType(machine_type)
|
||||
self._dialog.setExtruders(extruders)
|
||||
self._dialog.setVariantType(variant_type_name)
|
||||
self._dialog.setHasObjectsOnPlate(Application.getInstance().getPlatformActivity)
|
||||
self._dialog.show()
|
||||
|
||||
|
|
|
@ -43,7 +43,9 @@ class WorkspaceDialog(QObject):
|
|||
self._quality_type = ""
|
||||
self._machine_name = ""
|
||||
self._machine_type = ""
|
||||
self._variant_type = ""
|
||||
self._material_labels = []
|
||||
self._extruders = []
|
||||
self._objects_on_plate = False
|
||||
|
||||
machineConflictChanged = pyqtSignal()
|
||||
|
@ -59,6 +61,16 @@ class WorkspaceDialog(QObject):
|
|||
objectsOnPlateChanged = pyqtSignal()
|
||||
numUserSettingsChanged = 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)
|
||||
def machineType(self):
|
||||
|
@ -92,6 +104,14 @@ class WorkspaceDialog(QObject):
|
|||
self._material_labels = material_labels
|
||||
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)
|
||||
def machineName(self):
|
||||
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
|
||||
{
|
||||
height: spacerHeight
|
||||
|
@ -332,19 +356,20 @@ UM.Dialog
|
|||
}
|
||||
}
|
||||
rightButtons: [
|
||||
Button
|
||||
{
|
||||
id: ok_button
|
||||
text: catalog.i18nc("@action:button","OK");
|
||||
onClicked: { manager.closeBackend(); manager.onOkButtonClicked() }
|
||||
enabled: true
|
||||
},
|
||||
|
||||
Button
|
||||
{
|
||||
id: cancel_button
|
||||
text: catalog.i18nc("@action:button","Cancel");
|
||||
onClicked: { manager.onCancelButtonClicked() }
|
||||
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