Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions BlocksScreen/lib/panels/mainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ def event(self, event: QtCore.QEvent) -> bool:
self.messageReceivedEvent(event)
return True
return False

if event.type() == events.PrintStart.type():
self.disable_tab_bar()
self.ui.extruder_temp_display.clicked.disconnect()
Expand All @@ -641,10 +640,10 @@ def event(self, event: QtCore.QEvent) -> bool:
)
return False

if event.type() == (
events.PrintError.type()
or events.PrintComplete.type()
or events.PrintCancelled.type()
if event.type() in (
events.PrintError.type(),
events.PrintComplete.type(),
events.PrintCancelled.type(),
):
self.enable_tab_bar()
self.ui.extruder_temp_display.clicked.disconnect()
Expand Down
1 change: 0 additions & 1 deletion BlocksScreen/lib/panels/printTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ def setProperty(self, name: str, value: typing.Any) -> bool:
def handle_cancel_print(self) -> None:
"""Handles the print cancel action"""
self.ws.api.cancel_print()
self.on_cancel_print.emit()
self.loadscreen.show()
self.loadscreen.setModal(True)
self.loadwidget.set_status_message("Cancelling print...\nPlease wait")
Expand Down
36 changes: 36 additions & 0 deletions BlocksScreen/lib/panels/widgets/jobStatusPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,42 @@ def _handle_print_state(self, state: str) -> None:
self.show_request.emit()
lstate = "start"
elif lstate in invalid_states:
if lstate == "complete":
try:
instance = QtWidgets.QApplication.instance()
if instance:
instance.postEvent(self.window(), events.PrintComplete(data={}))
else:
raise TypeError("QApplication.instance expected non None value")
except Exception as e:
logger.debug(
"Unexpected error while completing print job start event: %s", e
)
# this one must stay bc of moonraker cancel there
if lstate == "cancelled":
print_cancel_event = events.PrintCancelled(data={})
try:
instance = QtWidgets.QApplication.instance()
if instance:
instance.postEvent(self.window(), print_cancel_event)
else:
raise TypeError("QApplication.instance expected non None value")
except Exception as e:
logger.debug(
"Unexpected error while completing print job start event: %s", e
)
if lstate == "error":
print_error_event = events.PrintError(data={})
try:
instance = QtWidgets.QApplication.instance()
if instance:
instance.postEvent(self.window(), print_error_event)
else:
raise TypeError("QApplication.instance expected non None value")
except Exception as e:
logger.debug(
"Unexpected error while completing print job start event: %s", e
)
self._current_file_name = ""
self._internal_print_status = ""
self.total_layers = "?"
Expand Down
Loading