mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
D5: Refactoring
This commit is contained in:
parent
ce9251b5a6
commit
1631045d7a
10 changed files with 69 additions and 43 deletions
|
@ -10,6 +10,7 @@ from UM.Math.AxisAlignedBox import AxisAlignedBox
|
|||
from UM.Application import Application
|
||||
from UM.Message import Message
|
||||
from UM.Logger import Logger
|
||||
from UM.Backend.Backend import BackendState
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
@ -67,11 +68,11 @@ class GCodeReader(MeshReader):
|
|||
backend = Application.getInstance().getBackend()
|
||||
if self.scene_node is not None and self.scene_node.getParent() is None:
|
||||
self.scene_node = None
|
||||
backend._pauseSlicing = False
|
||||
backend.backendStateChange.emit(BackendState.NotStarted)
|
||||
Application.getInstance().setHideSettings(False)
|
||||
Application.getInstance().getPrintInformation().setPreSliced(False)
|
||||
else:
|
||||
backend._pauseSlicing = True
|
||||
backend.backendStateChange.emit(BackendState.SlicingDisabled)
|
||||
Application.getInstance().getPrintInformation().setPreSliced(True)
|
||||
Application.getInstance().setHideSettings(True)
|
||||
|
||||
|
@ -135,9 +136,8 @@ class GCodeReader(MeshReader):
|
|||
self.scene_node.parentChanged.connect(self.onParentChanged)
|
||||
|
||||
backend = Application.getInstance().getBackend()
|
||||
backend._pauseSlicing = True
|
||||
backend.close()
|
||||
backend.backendStateChange.emit(3)
|
||||
backend.backendStateChange.emit(BackendState.SlicingDisabled)
|
||||
|
||||
glist = getattr(Application.getInstance().getController().getScene(), "gcode_list")
|
||||
glist.clear()
|
||||
|
|
|
@ -4,21 +4,21 @@
|
|||
from . import GCodeReader
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
i18n_catalog = i18nCatalog("uranium")
|
||||
i18n_catalog = i18nCatalog("cura")
|
||||
|
||||
def getMetaData():
|
||||
return {
|
||||
"plugin": {
|
||||
"name": i18n_catalog.i18nc("@label", "GCODE Reader"),
|
||||
"name": i18n_catalog.i18nc("@label", "G-code Reader"),
|
||||
"author": "Victor Larchenko",
|
||||
"version": "1.0",
|
||||
"description": i18n_catalog.i18nc("@info:whatsthis", "Allows displaying GCODE files."),
|
||||
"description": i18n_catalog.i18nc("@info:whatsthis", "Allows loading and displaying G-code files."),
|
||||
"api": 3
|
||||
},
|
||||
"mesh_reader": [
|
||||
{
|
||||
"extension": "gcode",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "GCODE File")
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "G-code File")
|
||||
},
|
||||
{
|
||||
"extension": "g",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue