mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 16:27:51 -06:00
Add local setting to monitor use of USB writing
CURA-12150
This commit is contained in:
parent
6157310242
commit
04a6ecf7ca
1 changed files with 4 additions and 0 deletions
|
@ -97,6 +97,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
CuraApplication.getInstance().getOnExitCallbackManager().addCallback(self._checkActivePrintingUponAppExit)
|
CuraApplication.getInstance().getOnExitCallbackManager().addCallback(self._checkActivePrintingUponAppExit)
|
||||||
|
|
||||||
|
CuraApplication.getInstance().getPreferences().addPreference("usb_printing/enabled", False)
|
||||||
|
|
||||||
# This is a callback function that checks if there is any printing in progress via USB when the application tries
|
# This is a callback function that checks if there is any printing in progress via USB when the application tries
|
||||||
# to exit. If so, it will show a confirmation before
|
# to exit. If so, it will show a confirmation before
|
||||||
def _checkActivePrintingUponAppExit(self) -> None:
|
def _checkActivePrintingUponAppExit(self) -> None:
|
||||||
|
@ -144,6 +146,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
CuraApplication.getInstance().getController().setActiveStage("MonitorStage")
|
CuraApplication.getInstance().getController().setActiveStage("MonitorStage")
|
||||||
|
|
||||||
|
CuraApplication.getInstance().getPreferences().setValue("usb_printing/enabled", True)
|
||||||
|
|
||||||
#Find the g-code to print.
|
#Find the g-code to print.
|
||||||
gcode_textio = StringIO()
|
gcode_textio = StringIO()
|
||||||
gcode_writer = cast(MeshWriter, PluginRegistry.getInstance().getPluginObject("GCodeWriter"))
|
gcode_writer = cast(MeshWriter, PluginRegistry.getInstance().getPluginObject("GCodeWriter"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue