mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
T553: Fixed job name
This commit is contained in:
parent
4ba8033c2a
commit
9da00563e5
2 changed files with 32 additions and 28 deletions
|
@ -49,6 +49,8 @@ class PrintInformation(QObject):
|
|||
self._material_lengths = []
|
||||
self._material_weights = []
|
||||
|
||||
self._pre_sliced = False
|
||||
|
||||
self._backend = Application.getInstance().getBackend()
|
||||
if self._backend:
|
||||
self._backend.printDurationMessage.connect(self._onPrintDurationMessage)
|
||||
|
@ -122,7 +124,9 @@ class PrintInformation(QObject):
|
|||
def createJobName(self, base_name):
|
||||
base_name = self._stripAccents(base_name)
|
||||
self._setAbbreviatedMachineName()
|
||||
if Preferences.getInstance().getValue("cura/jobname_prefix"):
|
||||
if self._pre_sliced:
|
||||
return "Pre-sliced_" + base_name
|
||||
elif Preferences.getInstance().getValue("cura/jobname_prefix"):
|
||||
return self._abbr_machine + "_" + base_name
|
||||
else:
|
||||
return base_name
|
||||
|
@ -150,4 +154,4 @@ class PrintInformation(QObject):
|
|||
|
||||
## Utility method that strips accents from characters (eg: â -> a)
|
||||
def _stripAccents(self, str):
|
||||
return ''.join(char for char in unicodedata.normalize('NFD', str) if unicodedata.category(char) != 'Mn')
|
||||
return ''.join(char for char in unicodedata.normalize('NFD', str) if unicodedata.category(char) != 'Mn')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue