Skip to content

Commit 2d523c2

Browse files
authored
Bugfix cancel unlockign buttons (#95)
* Refacotr: capitalise a word * bugfix: unblocks tabs on standby
1 parent 969e1a0 commit 2d523c2

2 files changed

Lines changed: 28 additions & 5 deletions

File tree

BlocksScreen/lib/panels/filamentTab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def on_extruder_update(
127127

128128
if self.target_temp != 0:
129129
if self.current_temp == self.target_temp:
130-
self.loadscreen.set_status_message("Extruder heated up \n please wait")
130+
self.loadscreen.set_status_message("Extruder heated up \n Please wait")
131131
return
132132

133133
if field == "temperature":

BlocksScreen/lib/panels/printTab.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ def __init__(
176176
self.jobStatusPage_widget.on_print_stats_update
177177
)
178178

179+
self.printer.print_stats_update[str, str].connect(
180+
self.on_print_stats_update
181+
)
182+
self.printer.print_stats_update[str, dict].connect(
183+
self.on_print_stats_update
184+
)
185+
self.printer.print_stats_update[str, float].connect(
186+
self.on_print_stats_update
187+
)
188+
179189
self.printer.gcode_move_update[str, list].connect(
180190
self.jobStatusPage_widget.on_gcode_move_update
181191
)
@@ -256,11 +266,27 @@ def __init__(
256266
self.delete_file
257267
)
258268

259-
260269
self.change_page(
261270
self.indexOf(self.print_page)
262271
) # force set the initial page
263272

273+
@QtCore.pyqtSlot(str, dict, name="on_print_stats_update")
274+
@QtCore.pyqtSlot(str, float, name="on_print_stats_update")
275+
@QtCore.pyqtSlot(str, str, name="on_print_stats_update")
276+
def on_print_stats_update(
277+
self, field: str, value: dict | float | str
278+
) -> None:
279+
"""
280+
unblocks tabs if on standby
281+
"""
282+
if isinstance(value, str):
283+
if "state" in field:
284+
if value in ("standby"):
285+
self.on_cancel_print.emit()
286+
287+
288+
289+
264290
@QtCore.pyqtSlot(str, int, "PyQt_PyObject", name="on_numpad_request")
265291
@QtCore.pyqtSlot(
266292
str, int, "PyQt_PyObject", int, int, name="on_numpad_request"
@@ -317,9 +343,6 @@ def on_dialog_button_clicked(self, button_name: str) -> None:
317343
self.dialogPage.hide()
318344

319345

320-
321-
322-
323346
def paintEvent(self, a0: QtGui.QPaintEvent) -> None:
324347
"""
325348
REFACTOR: Instead of using a background svg pixmap just draw the

0 commit comments

Comments
 (0)