diff options
author | Konstantinos Karmas <konskarm@gmail.com> | 2021-08-23 18:07:36 +0300 |
---|---|---|
committer | Konstantinos Karmas <konskarm@gmail.com> | 2021-08-23 18:07:36 +0300 |
commit | 6ad358a55db7dfc4825233a7e453bab31931fba0 (patch) | |
tree | fc9b3b2d69c358343fe25f047419e5ae93c43279 /cura | |
parent | 78b6bf2ed4a64dfe5c0ed0288c98342c604e8d3e (diff) |
Set the job name whenever the workspaceLoaded is called
CURA-8358
Diffstat (limited to 'cura')
-rw-r--r-- | cura/UI/PrintInformation.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cura/UI/PrintInformation.py b/cura/UI/PrintInformation.py index d6bd336558..852763cbfd 100644 --- a/cura/UI/PrintInformation.py +++ b/cura/UI/PrintInformation.py @@ -67,7 +67,7 @@ class PrintInformation(QObject): self._application.globalContainerStackChanged.connect(self._updateJobName) self._application.globalContainerStackChanged.connect(self.setToZeroPrintInformation) self._application.fileLoaded.connect(self.setBaseName) - self._application.workspaceLoaded.connect(self.setProjectName) + self._application.workspaceLoaded.connect(self._onWorkspaceLoaded) self._application.getMachineManager().rootMaterialChanged.connect(self._onActiveMaterialsChanged) self._application.getInstance().getPreferences().preferenceChanged.connect(self._onPreferencesChanged) @@ -439,3 +439,7 @@ class PrintInformation(QObject): """Listen to scene changes to check if we need to reset the print information""" self.setToZeroPrintInformation(self._active_build_plate) + + def _onWorkspaceLoaded(self, new_name: str) -> None: + """Update the job name whenever a new workspace is loaded.""" + self.setJobName(os.path.splitext(os.path.basename(new_name))[0]) |