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

This commit is contained in:
Jack Ha 2017-02-23 14:24:18 +01:00
commit 4bf823cc68
3 changed files with 12 additions and 11 deletions

View File

@ -9,9 +9,10 @@ from UM.FlameProfiler import pyqtSlot
from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import QMessageBox
from UM.PluginRegistry import PluginRegistry from UM.PluginRegistry import PluginRegistry
import UM.SaveFile
import UM.Platform from UM.Platform import Platform
import UM.MimeTypeDatabase from UM.SaveFile import SaveFile
from UM.MimeTypeDatabase import MimeTypeDatabase
from UM.Logger import Logger from UM.Logger import Logger
from UM.Application import Application from UM.Application import Application
@ -325,7 +326,7 @@ class ContainerManager(QObject):
mime_type = None mime_type = None
if not file_type in self._container_name_filters: if not file_type in self._container_name_filters:
try: try:
mime_type = UM.MimeTypeDatabase.getMimeTypeForFile(file_url) mime_type = MimeTypeDatabase.getMimeTypeForFile(file_url)
except MimeTypeNotFoundError: except MimeTypeNotFoundError:
return { "status": "error", "message": "Unknown File Type" } return { "status": "error", "message": "Unknown File Type" }
else: else:
@ -336,7 +337,7 @@ 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: if Platform.isOSX() and "." in file_url:
file_url = file_url[:file_url.rfind(".")] file_url = file_url[:file_url.rfind(".")]
for suffix in mime_type.suffixes: for suffix in mime_type.suffixes:
@ -345,7 +346,7 @@ class ContainerManager(QObject):
else: else:
file_url += "." + mime_type.preferredSuffix file_url += "." + mime_type.preferredSuffix
if not UM.Platform.isWindows(): if not Platform.isWindows():
if os.path.exists(file_url): if os.path.exists(file_url):
result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"), result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"),
catalog.i18nc("@label", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_url)) catalog.i18nc("@label", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_url))
@ -360,7 +361,7 @@ class ContainerManager(QObject):
if contents is None: if contents is None:
return {"status": "error", "message": "Serialization returned None. Unable to write to file"} return {"status": "error", "message": "Serialization returned None. Unable to write to file"}
with UM.SaveFile(file_url, "w") as f: with SaveFile(file_url, "w") as f:
f.write(contents) f.write(contents)
return { "status": "success", "message": "Succesfully exported container", "path": file_url} return { "status": "success", "message": "Succesfully exported container", "path": file_url}
@ -383,7 +384,7 @@ class ContainerManager(QObject):
return { "status": "error", "message": "Invalid path" } return { "status": "error", "message": "Invalid path" }
try: try:
mime_type = UM.MimeTypeDatabase.getMimeTypeForFile(file_url) mime_type = MimeTypeDatabase.getMimeTypeForFile(file_url)
except MimeTypeNotFoundError: except MimeTypeNotFoundError:
return { "status": "error", "message": "Could not determine mime type of file" } return { "status": "error", "message": "Could not determine mime type of file" }
@ -742,7 +743,7 @@ class ContainerManager(QObject):
} }
suffix = mime_type.preferredSuffix suffix = mime_type.preferredSuffix
if UM.Platform.isOSX() and "." in suffix: if Platform.isOSX() and "." in suffix:
# OSX's File dialog is stupid and does not allow selecting files with a . in its name # OSX's File dialog is stupid and does not allow selecting files with a . in its name
suffix = suffix[suffix.index(".") + 1:] suffix = suffix[suffix.index(".") + 1:]
@ -751,7 +752,7 @@ class ContainerManager(QObject):
if suffix == mime_type.preferredSuffix: if suffix == mime_type.preferredSuffix:
continue continue
if UM.Platform.isOSX() and "." in suffix: if Platform.isOSX() and "." in suffix:
# OSX's File dialog is stupid and does not allow selecting files with a . in its name # OSX's File dialog is stupid and does not allow selecting files with a . in its name
suffix = suffix[suffix.index("."):] suffix = suffix[suffix.index("."):]

View File

@ -1285,7 +1285,7 @@
"value": "default_material_print_temperature", "value": "default_material_print_temperature",
"minimum_value": "-273.15", "minimum_value": "-273.15",
"minimum_value_warning": "0", "minimum_value_warning": "0",
"maximum_value_warning": "260", "maximum_value_warning": "270",
"enabled": "not (material_flow_dependent_temperature) and machine_gcode_flavor != \"UltiGCode\"", "enabled": "not (material_flow_dependent_temperature) and machine_gcode_flavor != \"UltiGCode\"",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": true "settable_per_extruder": true

BIN
resources/meshes/BEEVERYCREATIVE-helloBEEprusa.stl Executable file → Normal file

Binary file not shown.