diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2017-11-22 12:17:53 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2017-11-22 12:17:53 +0300 |
commit | f8fe6cd455a60ba5d20c9112eefa66b0c1a74523 (patch) | |
tree | afdaf29a0e7a0106aa643cbbbac89fd7a100f127 /cura/PrintInformation.py | |
parent | aeb478bb4bd944249fa7107ec404b446c94d0da1 (diff) |
Treat project files the same way as model files for job name
CURA-4553
Diffstat (limited to 'cura/PrintInformation.py')
-rw-r--r-- | cura/PrintInformation.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 0a5db439c3..3cced2f85c 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -67,11 +67,9 @@ 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) - Application.getInstance().workspaceLoaded.connect(self.setProjectName) Preferences.getInstance().preferenceChanged.connect(self._onPreferencesChanged) self._active_material_container = None @@ -253,26 +251,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() @@ -313,7 +298,7 @@ class PrintInformation(QObject): 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 |