Make machine prefix for jobname optional

CURA-1480
This commit is contained in:
fieldOfView 2016-05-13 19:04:32 +02:00
parent da872871bd
commit 12638f3601
3 changed files with 23 additions and 2 deletions

View File

@ -114,6 +114,7 @@ class CuraApplication(QtApplication):
Preferences.getInstance().addPreference("cura/active_mode", "simple")
Preferences.getInstance().addPreference("cura/recent_files", "")
Preferences.getInstance().addPreference("cura/categories_expanded", "")
Preferences.getInstance().addPreference("cura/jobname_prefix", True)
Preferences.getInstance().addPreference("view/center_on_select", True)
Preferences.getInstance().addPreference("mesh/scale_to_fit", True)
Preferences.getInstance().addPreference("mesh/scale_tiny_meshes", True)

View File

@ -31,9 +31,11 @@ UM.PreferencesPage
UM.Preferences.resetPreference("physics/automatic_push_free")
UM.Preferences.resetPreference("mesh/scale_to_fit")
UM.Preferences.resetPreference("info/send_slice_info")
UM.Preferences.resetPreference("cura/jobname_prefix")
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
scaleToFitCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
prefixJobNameCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
var defaultLanguage = UM.Preferences.getValue("general/language")
setDefaultLanguage(defaultLanguage)
@ -116,7 +118,7 @@ UM.PreferencesPage
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should objects on the platform be moved so that they no longer intersect.")
text: catalog.i18nc("@info:tooltip", "Should objects on the platform be moved so that they no longer intersect?")
CheckBox
{
@ -183,5 +185,19 @@ UM.PreferencesPage
onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
CheckBox
{
id: prefixJobNameCheckbox
text: catalog.i18nc("@option:check", "Add machine prefix to job name")
checked: boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
onCheckedChanged: UM.Preferences.setValue("cura/jobname_prefix", checked)
}
}
}
}

View File

@ -31,6 +31,7 @@ Rectangle {
function createFileName(){
var splitMachineName = UM.MachineManager.activeMachineInstance.split(" ")
var abbrMachine = ''
if ((UM.Preferences.getValue("cura/jobname_prefix"))) {
for (var i = 0; i < splitMachineName.length; i++){
if (splitMachineName[i].search(/ultimaker/i) != -1){
abbrMachine += 'UM'
@ -48,7 +49,10 @@ Rectangle {
}
}
}
printJobTextfield.text = abbrMachine + '_' + base.fileBaseName
printJobTextfield.text = abbrMachine + '_' + base.fileBaseName
} else {
printJobTextfield.text = base.fileBaseName
}
}
Connections {