mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 12:36:02 +08:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
2042cdf155
1
.gitignore
vendored
1
.gitignore
vendored
@ -44,6 +44,7 @@ plugins/cura-god-mode-plugin
|
||||
plugins/cura-big-flame-graph
|
||||
plugins/cura-siemensnx-plugin
|
||||
plugins/CuraVariSlicePlugin
|
||||
plugins/CuraLiveScriptingPlugin
|
||||
|
||||
#Build stuff
|
||||
CMakeCache.txt
|
||||
|
@ -67,7 +67,6 @@ class PrintInformation(QObject):
|
||||
self._base_name = ""
|
||||
self._abbr_machine = ""
|
||||
self._job_name = ""
|
||||
self._project_name = ""
|
||||
|
||||
Application.getInstance().globalContainerStackChanged.connect(self._updateJobName)
|
||||
Application.getInstance().fileLoaded.connect(self.setBaseName)
|
||||
@ -253,26 +252,13 @@ class PrintInformation(QObject):
|
||||
self._job_name = name
|
||||
self.jobNameChanged.emit()
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setProjectName(self, name):
|
||||
self._project_name = name
|
||||
self.setJobName(name)
|
||||
|
||||
jobNameChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(str, notify = jobNameChanged)
|
||||
def jobName(self):
|
||||
return self._job_name
|
||||
|
||||
def _updateJobName(self, is_project_name_empty = False):
|
||||
# if the project name is set, we use the project name as the job name, so the job name should not get updated
|
||||
# if a model file is loaded after that.
|
||||
if self._project_name != "":
|
||||
if is_project_name_empty:
|
||||
self._project_name = ""
|
||||
else:
|
||||
return
|
||||
|
||||
def _updateJobName(self):
|
||||
if self._base_name == "":
|
||||
self._job_name = ""
|
||||
self.jobNameChanged.emit()
|
||||
@ -298,7 +284,11 @@ class PrintInformation(QObject):
|
||||
return self._base_name
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setBaseName(self, base_name):
|
||||
def setProjectName(self, name):
|
||||
self.setBaseName(name, is_project_file = True)
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setBaseName(self, base_name, is_project_file = False):
|
||||
# Ensure that we don't use entire path but only filename
|
||||
name = os.path.basename(base_name)
|
||||
|
||||
@ -306,14 +296,16 @@ class PrintInformation(QObject):
|
||||
# extension. This cuts the extension off if necessary.
|
||||
name = os.path.splitext(name)[0]
|
||||
|
||||
# if this is a profile file, always update the job name
|
||||
# name is "" when I first had some meshes and afterwards I deleted them so the naming should start again
|
||||
is_empty = name == ""
|
||||
if is_empty or (self._base_name == "" and self._base_name != name):
|
||||
if is_project_file or (is_empty or (self._base_name == "" and self._base_name != name)):
|
||||
# remove ".curaproject" suffix from (imported) the file name
|
||||
if name.endswith(".curaproject"):
|
||||
name = name[:name.rfind(".curaproject")]
|
||||
self._base_name = name
|
||||
self._updateJobName(is_project_name_empty = is_empty)
|
||||
self._updateJobName()
|
||||
|
||||
|
||||
## Created an acronymn-like abbreviated machine name from the currently active machine name
|
||||
# Called each time the global stack is switched
|
||||
|
@ -409,7 +409,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
extruder_stack = None
|
||||
|
||||
# if extruders are defined in the machine definition use those instead
|
||||
if machine.extruders and len(machine.extruders) > 0:
|
||||
if machine.extruders and "0" in machine.extruders:
|
||||
new_extruder_id = machine.extruders["0"].getId()
|
||||
extruder_stack = machine.extruders["0"]
|
||||
|
||||
@ -449,9 +449,16 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
extruder_stack.setVariantById(variant_id)
|
||||
extruder_stack.setMaterialById("default")
|
||||
extruder_stack.setQualityById("default")
|
||||
if machine.qualityChanges.getId() != "empty_quality_changes":
|
||||
extruder_quality_changes_container = self.findInstanceContainers(name = machine.qualityChanges.getName(), extruder = extruder_id)
|
||||
if extruder_quality_changes_container:
|
||||
quality_changes_id = extruder_quality_changes_container[0].getId()
|
||||
extruder_stack.setQualityChangesById(quality_changes_id)
|
||||
|
||||
self.addContainer(extruder_stack)
|
||||
|
||||
return extruder_stack
|
||||
|
||||
# Fix the extruders that were upgraded to ExtruderStack instances during addContainer.
|
||||
# The stacks are now responsible for setting the next stack on deserialize. However,
|
||||
# due to problems with loading order, some stacks may not have the proper next stack
|
||||
|
@ -620,12 +620,17 @@ class MachineManager(QObject):
|
||||
@pyqtProperty(str, notify=activeQualityChanged)
|
||||
def activeQualityId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
quality = self._active_container_stack.qualityChanges
|
||||
if quality and not isinstance(quality, type(self._empty_quality_changes_container)):
|
||||
return quality.getId()
|
||||
quality = self._active_container_stack.quality
|
||||
if quality:
|
||||
return quality.getId()
|
||||
if isinstance(quality, type(self._empty_quality_container)):
|
||||
return ""
|
||||
quality_changes = self._active_container_stack.qualityChanges
|
||||
if quality and quality_changes:
|
||||
if isinstance(quality_changes, type(self._empty_quality_changes_container)):
|
||||
# It's a built-in profile
|
||||
return quality.getId()
|
||||
else:
|
||||
# Custom profile
|
||||
return quality_changes.getId()
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify=activeQualityChanged)
|
||||
@ -690,9 +695,9 @@ class MachineManager(QObject):
|
||||
@pyqtProperty(str, notify = activeQualityChanged)
|
||||
def activeQualityChangesId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
changes = self._active_container_stack.qualityChanges
|
||||
if changes and changes.getId() != "empty":
|
||||
return changes.getId()
|
||||
quality_changes = self._active_container_stack.qualityChanges
|
||||
if quality_changes and not isinstance(quality_changes, type(self._empty_quality_changes_container)):
|
||||
return quality_changes.getId()
|
||||
return ""
|
||||
|
||||
## Check if a container is read_only
|
||||
|
@ -746,7 +746,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
# If not extruder stacks were saved in the project file (pre 3.1) create one manually
|
||||
# We re-use the container registry's addExtruderStackForSingleExtrusionMachine method for this
|
||||
if not extruder_stacks:
|
||||
self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder")
|
||||
extruder_stacks.append(self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder"))
|
||||
|
||||
except:
|
||||
Logger.logException("w", "We failed to serialize the stack. Trying to clean up.")
|
||||
|
@ -114,8 +114,10 @@ class VersionUpgrade30to31(VersionUpgrade):
|
||||
# Copy global quality changes to extruder quality changes for single extrusion machines
|
||||
if parser["metadata"]["type"] == "quality_changes":
|
||||
all_quality_changes = self._getSingleExtrusionMachineQualityChanges(parser)
|
||||
if len(all_quality_changes) == 1 and not all_quality_changes[0].has_option("metadata", "extruder"):
|
||||
self._createExtruderQualityChangesForSingleExtrusionMachine(filename, all_quality_changes[0])
|
||||
# Note that DO NOT!!! use the quality_changes returned from _getSingleExtrusionMachineQualityChanges().
|
||||
# Those are loaded from the hard drive which are original files that haven't been upgraded yet.
|
||||
if len(all_quality_changes) == 1 and not parser.has_option("metadata", "extruder"):
|
||||
self._createExtruderQualityChangesForSingleExtrusionMachine(filename, parser)
|
||||
|
||||
# Update version numbers
|
||||
parser["general"]["version"] = "2"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,8 +5,8 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Cura 3.0\n"
|
||||
"Report-Msgid-Bugs-To: http://github.com/ultimaker/uranium\n"
|
||||
"Project-Id-Version: Cura 3.1\n"
|
||||
"Report-Msgid-Bugs-To: r.dulek@ultimaker.com\n"
|
||||
"POT-Creation-Date: 2017-11-21 16:58+0000\n"
|
||||
"PO-Revision-Date: 2017-09-20 14:31+0900\n"
|
||||
"Last-Translator: Brule\n"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -159,7 +159,7 @@ UM.PreferencesPage
|
||||
append({ text: "Nederlands", code: "nl_NL" })
|
||||
append({ text: "Polski", code: "pl_PL" })
|
||||
append({ text: "Português do Brasil", code: "pt_BR" })
|
||||
append({ text: "Русский", code: "ru_RU" })
|
||||
//Russian is disabled for being incomplete: append({ text: "Русский", code: "ru_RU" })
|
||||
append({ text: "Türkçe", code: "tr_TR" })
|
||||
append({ text: "简体中文", code: "zh_CN" })
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user