Define gcode.gz extension in GCodeGzReader

So if you were to disable the GCodeGzReader plug-in, you will now no longer see the extension in the files you can read.

Fixes #4151.
This commit is contained in:
Ghostkeeper 2018-09-27 13:27:42 +02:00
parent 80804b232f
commit 88ba2ac345
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
2 changed files with 10 additions and 1 deletions

View file

@ -4,8 +4,16 @@
import gzip import gzip
from UM.Mesh.MeshReader import MeshReader #The class we're extending/implementing. from UM.Mesh.MeshReader import MeshReader #The class we're extending/implementing.
from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType #To add the .gcode.gz files to the MIME type database.
from UM.PluginRegistry import PluginRegistry from UM.PluginRegistry import PluginRegistry
MimeTypeDatabase.addMimeType(
MimeType(
name = "application/x-cura-compressed-gcode-file",
comment = "Cura Compressed GCode File",
suffixes = ["gcode.gz"]
)
)
## A file reader that reads gzipped g-code. ## A file reader that reads gzipped g-code.
# #

View file

@ -1,4 +1,5 @@
# Copyright (c) 2017 Aleph Objects, Inc. # Copyright (c) 2017 Aleph Objects, Inc.
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
from UM.FileHandler.FileReader import FileReader from UM.FileHandler.FileReader import FileReader
@ -15,7 +16,7 @@ MimeTypeDatabase.addMimeType(
MimeType( MimeType(
name = "application/x-cura-gcode-file", name = "application/x-cura-gcode-file",
comment = "Cura GCode File", comment = "Cura GCode File",
suffixes = ["gcode", "gcode.gz"] suffixes = ["gcode"]
) )
) )