Use MimeTypeDatabase to find loaded file extension and set proper project name

CURA-5323
This commit is contained in:
Aleksei S 2018-05-08 10:47:59 +02:00
parent 304c23b87e
commit 9779c41071
3 changed files with 35 additions and 18 deletions

View file

@ -5,10 +5,20 @@ from UM.FileHandler.FileReader import FileReader
from UM.Mesh.MeshReader import MeshReader
from UM.i18n import i18nCatalog
from UM.Preferences import Preferences
from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType
catalog = i18nCatalog("cura")
from . import MarlinFlavorParser, RepRapFlavorParser
MimeTypeDatabase.addMimeType(
MimeType(
name = "application/x-cura-gcode-file",
comment = "Cura GCode File",
suffixes = ["gcode", "gcode.gz"]
)
)
# Class for loading and parsing G-code files
class GCodeReader(MeshReader):