Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2016-07-29 10:01:21 +02:00
commit a19123eb66
6 changed files with 86 additions and 36 deletions

View file

@ -203,7 +203,7 @@ class CuraApplication(QtApplication):
"dialog_profile_path", "dialog_profile_path",
"dialog_material_path"]: "dialog_material_path"]:
Preferences.getInstance().addPreference("local_file/%s" % key, "~/") Preferences.getInstance().addPreference("local_file/%s" % key, os.path.expanduser("~/"))
Preferences.getInstance().setDefault("local_file/last_used_type", "text/x-gcode") Preferences.getInstance().setDefault("local_file/last_used_type", "text/x-gcode")

View file

@ -244,6 +244,7 @@ class ContainerManager(QObject):
if not type_name or entry["type"] == type_name: if not type_name or entry["type"] == type_name:
filters.append(filter_string) filters.append(filter_string)
filters.append("All Files (*)")
return filters return filters
## Export a container to a file ## Export a container to a file
@ -280,6 +281,9 @@ class ContainerManager(QObject):
return { "status": "error", "message": "Container not found"} return { "status": "error", "message": "Container not found"}
container = containers[0] container = containers[0]
if UM.Platform.isOSX() and "." in file_url:
file_url = file_url[:file_url.rfind(".")]
for suffix in mime_type.suffixes: for suffix in mime_type.suffixes:
if file_url.endswith(suffix): if file_url.endswith(suffix):
break break
@ -301,7 +305,7 @@ class ContainerManager(QObject):
with UM.SaveFile(file_url, "w") as f: with UM.SaveFile(file_url, "w") as f:
f.write(contents) f.write(contents)
return { "status": "success", "message": "Succesfully exported container"} return { "status": "success", "message": "Succesfully exported container", "path": file_url}
## Imports a profile from a file ## Imports a profile from a file
# #
@ -371,11 +375,20 @@ class ContainerManager(QObject):
"container": container_type "container": container_type
} }
suffix_list = "*." + mime_type.preferredSuffix suffix = mime_type.preferredSuffix
if UM.Platform.isOSX() and "." in suffix:
# OSX's File dialog is stupid and does not allow selecting files with a . in its name
suffix = suffix[suffix.index(".") + 1:]
suffix_list = "*." + suffix
for suffix in mime_type.suffixes: for suffix in mime_type.suffixes:
if suffix == mime_type.preferredSuffix: if suffix == mime_type.preferredSuffix:
continue continue
if UM.Platform.isOSX() and "." in suffix:
# OSX's File dialog is stupid and does not allow selecting files with a . in its name
suffix = suffix[suffix.index("."):]
suffix_list += ", *." + suffix suffix_list += ", *." + suffix
name_filter = "{0} ({1})".format(mime_type.comment, suffix_list) name_filter = "{0} ({1})".format(mime_type.comment, suffix_list)

View file

@ -150,6 +150,8 @@
"label": "Number extruders", "label": "Number extruders",
"description": "Number of extruder trains. An extruder train is the combination of a feeder, bowden tube, and nozzle.", "description": "Number of extruder trains. An extruder train is the combination of a feeder, bowden tube, and nozzle.",
"default_value": 1, "default_value": 1,
"minimum_value": "1",
"maximum_value": "16",
"type": "int", "type": "int",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false, "settable_per_extruder": false,
@ -1236,8 +1238,8 @@
"default_value": false, "default_value": false,
"enabled": "retraction_enable", "enabled": "retraction_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": true, "settable_per_extruder": true
"children": { },
"retraction_hop_only_when_collides": { "retraction_hop_only_when_collides": {
"label": "Z Hop Only Over Printed Parts", "label": "Z Hop Only Over Printed Parts",
"description": "Only perform a Z Hop when moving over printed parts which cannot be avoided by horizontal motion by Avoid Printed Parts when Traveling.", "description": "Only perform a Z Hop when moving over printed parts which cannot be avoided by horizontal motion by Avoid Printed Parts when Traveling.",
@ -1258,8 +1260,6 @@
"enabled": "retraction_enable and retraction_hop_enabled", "enabled": "retraction_enable and retraction_hop_enabled",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": true "settable_per_extruder": true
}
}
}, },
"material_standby_temperature": "material_standby_temperature":
{ {
@ -1511,15 +1511,45 @@
}, },
"speed_layer_0": { "speed_layer_0": {
"label": "Initial Layer Speed", "label": "Initial Layer Speed",
"description": "The print speed for the initial layer. A lower value is advised to improve adhesion to the build plate.", "description": "The speed for the initial layer. A lower value is advised to improve adhesion to the build plate.",
"unit": "mm/s", "unit": "mm/s",
"type": "float", "type": "float",
"default_value": 30, "default_value": 30,
"minimum_value": "0.1", "minimum_value": "0.1",
"maximum_value": "299792458000", "maximum_value": "299792458000",
"maximum_value_warning": "300", "maximum_value_warning": "300",
"settable_per_mesh": true,
"children":
{
"speed_print_layer_0":
{
"label": "Initial Layer Print Speed",
"description": "The speed of printing for the initial layer. A lower value is advised to improve adhesion to the build plate.",
"unit": "mm/s",
"type": "float",
"default_value": 30,
"value": "speed_layer_0",
"minimum_value": "0.1",
"maximum_value": "299792458000",
"maximum_value_warning": "300",
"settable_per_mesh": true "settable_per_mesh": true
}, },
"speed_travel_layer_0":
{
"label": "Initial Layer Travel Speed",
"description": "The speed of travel moves in the initial layer. A lower value is advised to prevent pulling previously printed parts away from the build plate.",
"unit": "mm/s",
"type": "float",
"default_value": 60,
"value": "speed_layer_0 * speed_travel / speed_print",
"minimum_value": "0.1",
"maximum_value": "299792458000",
"maximum_value_warning": "300",
"settable_per_mesh": true,
"settable_per_extruder": true
}
}
},
"skirt_brim_speed": { "skirt_brim_speed": {
"label": "Skirt/Brim Speed", "label": "Skirt/Brim Speed",
"description": "The speed at which the skirt and brim are printed. Normally this is done at the initial layer speed, but sometimes you might want to print the skirt or brim at a different speed.", "description": "The speed at which the skirt and brim are printed. Normally this is done at the initial layer speed, but sometimes you might want to print the skirt or brim at a different speed.",

View file

@ -30,6 +30,8 @@ Rectangle
return UM.Theme.getColor("status_paused") return UM.Theme.getColor("status_paused")
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error") else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error")
return UM.Theme.getColor("status_stopped") return UM.Theme.getColor("status_stopped")
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
return UM.Theme.getColor("status_offline")
else else
return UM.Theme.getColor("text") return UM.Theme.getColor("text")
} }
@ -41,7 +43,10 @@ Rectangle
{ {
if(!printerConnected) if(!printerConnected)
{ {
return catalog.i18nc("@label:", "Please check your printer connections") return catalog.i18nc("@label:", "Not connected to a printer")
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
{
return catalog.i18nc("@label:", "Lost connection with the printer")
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing") } else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
{ {
return catalog.i18nc("@label:", "Printing...") return catalog.i18nc("@label:", "Printing...")

View file

@ -255,7 +255,7 @@ UM.ManagementPage
else if(result.status == "success") else if(result.status == "success")
{ {
messageDialog.icon = StandardIcon.Information messageDialog.icon = StandardIcon.Information
messageDialog.text = catalog.i18nc("@info:status", "Successfully exported material to <filename>%1</filename>").arg(fileUrl) messageDialog.text = catalog.i18nc("@info:status", "Successfully exported material to <filename>%1</filename>").arg(result.path)
messageDialog.open() messageDialog.open()
} }
CuraApplication.setDefaultPath("dialog_material_path", folder) CuraApplication.setDefaultPath("dialog_material_path", folder)

View file

@ -116,6 +116,8 @@ Rectangle
return UM.Theme.getIcon("tab_monitor_paused") return UM.Theme.getIcon("tab_monitor_paused")
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error") else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error")
return UM.Theme.getIcon("tab_monitor_stopped") return UM.Theme.getIcon("tab_monitor_stopped")
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
return UM.Theme.getIcon("tab_monitor_offline")
else else
return UM.Theme.getIcon("tab_monitor") return UM.Theme.getIcon("tab_monitor")
} }