diff --git a/panels/bed_level.py b/panels/bed_level.py index e6b1d3fb..ffcd6595 100644 --- a/panels/bed_level.py +++ b/panels/bed_level.py @@ -168,5 +168,4 @@ class BedLevelPanel(ScreenPanel): def screws_tilt_calculate(self, widget): self.response_count = 0 - self._screen.add_subscription(self.panel_name) self._screen._ws.klippy.gcode_script("SCREWS_TILT_CALCULATE") diff --git a/panels/bed_mesh.py b/panels/bed_mesh.py index 234acb08..cb727ece 100644 --- a/panels/bed_mesh.py +++ b/panels/bed_mesh.py @@ -56,7 +56,6 @@ class BedMeshPanel(ScreenPanel): self.labels['main_box'] = box self.content.add(self.labels['main_box']) - self._screen.add_subscription(panel_name) def activate(self): for child in self.content.get_children(): diff --git a/panels/console.py b/panels/console.py index 6ae7fe67..180861e6 100644 --- a/panels/console.py +++ b/panels/console.py @@ -69,7 +69,6 @@ class ConsolePanel(ScreenPanel): vbox.add(sw) vbox.pack_end(ebox, False, 0, 0) self.content.add(vbox) - self._screen.add_subscription(panel_name) def add_gcode(self, type, time, message): if type == "command": diff --git a/panels/extrude.py b/panels/extrude.py index 2bd735e6..5f277f26 100644 --- a/panels/extrude.py +++ b/panels/extrude.py @@ -112,7 +112,6 @@ class ExtrudePanel(ScreenPanel): grid.attach(speedbox, 2, 2, 2, 1) self.content.add(grid) - self._screen.add_subscription(panel_name) def process_update(self, action, data): if action != "notify_status_update": diff --git a/panels/fan.py b/panels/fan.py index ee1f85f6..e3df2421 100644 --- a/panels/fan.py +++ b/panels/fan.py @@ -38,8 +38,6 @@ class FanPanel(ScreenPanel): self.content.add(box) - self._screen.add_subscription(panel_name) - def process_update(self, action, data): if (action != "notify_status_update"): return diff --git a/panels/fine_tune.py b/panels/fine_tune.py index 36853ffb..9f463bbf 100644 --- a/panels/fine_tune.py +++ b/panels/fine_tune.py @@ -118,7 +118,6 @@ class FineTunePanel(ScreenPanel): # self.panel = grid self.content.add(grid) - self._screen.add_subscription(panel_name) def process_update(self, action, data): _ = self.lang.gettext diff --git a/panels/job_status.py b/panels/job_status.py index 5ba4df9b..6bbda773 100644 --- a/panels/job_status.py +++ b/panels/job_status.py @@ -203,8 +203,6 @@ class JobStatusPanel(ScreenPanel): self.grid = grid self.content.add(grid) - - self._screen.add_subscription(panel_name) self._screen.wake_screen() def on_draw(self, da, ctx): diff --git a/panels/main_menu.py b/panels/main_menu.py index 0c2540e7..6d8aec45 100644 --- a/panels/main_menu.py +++ b/panels/main_menu.py @@ -68,8 +68,6 @@ class MainPanel(MenuPanel): self.content.add(self.grid) self.layout.show_all() - self._screen.add_subscription(panel_name) - def activate(self): return diff --git a/panels/move.py b/panels/move.py index c4c3ad2c..ca2fc316 100644 --- a/panels/move.py +++ b/panels/move.py @@ -89,7 +89,6 @@ class MovePanel(ScreenPanel): grid.attach(box, 0, 2, 4, 1) self.content.add(grid) - self._screen.add_subscription(panel_name) def process_update(self, action, data): if action != "notify_status_update": diff --git a/panels/power.py b/panels/power.py index 1ff45679..33bbd20d 100644 --- a/panels/power.py +++ b/panels/power.py @@ -33,8 +33,6 @@ class PowerPanel(ScreenPanel): self.content.add(box) - self._screen.add_subscription(panel_name) - def add_device(self, device): frame = Gtk.Frame() frame.set_property("shadow-type", Gtk.ShadowType.NONE) diff --git a/panels/preheat.py b/panels/preheat.py index b0418e6b..a216edc5 100644 --- a/panels/preheat.py +++ b/panels/preheat.py @@ -82,8 +82,6 @@ class PreheatPanel(ScreenPanel): self.content.add(grid) - self._screen.add_subscription(panel_name) - def activate(self): for x in self._printer.get_tools(): if x not in self.active_heaters: diff --git a/panels/system.py b/panels/system.py index 747ad0f2..ad9196ee 100644 --- a/panels/system.py +++ b/panels/system.py @@ -105,7 +105,6 @@ class SystemPanel(ScreenPanel): grid.attach(shutdown, 3, 2, 1, 1) self.content.add(grid) - self._screen.add_subscription(panel_name) def activate(self): self.get_updates() diff --git a/panels/temperature.py b/panels/temperature.py index 74c0a67e..afb0eb47 100644 --- a/panels/temperature.py +++ b/panels/temperature.py @@ -98,8 +98,6 @@ class TemperaturePanel(ScreenPanel): self.grid = grid self.content.add(grid) - self._screen.add_subscription(panel_name) - self.update_temp("heater_bed", 35, 40) def change_temp_delta(self, widget, tempdelta): diff --git a/panels/zcalibrate.py b/panels/zcalibrate.py index e2cb4e8a..294c3224 100644 --- a/panels/zcalibrate.py +++ b/panels/zcalibrate.py @@ -80,7 +80,6 @@ class ZCalibratePanel(ScreenPanel): self.content.add(grid) - self._screen.add_subscription(panel_name) def activate(self): if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz": diff --git a/screen.py b/screen.py index e970401c..ed99b797 100644 --- a/screen.py +++ b/screen.py @@ -329,6 +329,7 @@ class KlipperScreen(Gtk.Window): if hasattr(self.panels[panel_name], "process_update"): self.panels[panel_name].process_update("notify_status_update", self.printer.get_updates()) + self.add_subscription(panel_name) if hasattr(self.panels[panel_name], "activate"): self.panels[panel_name].activate() self.show_all() @@ -498,6 +499,7 @@ class KlipperScreen(Gtk.Window): def _remove_current_panel(self, pop=True, show=True): if len(self._cur_panels) > 0: self.base_panel.remove(self.panels[self._cur_panels[-1]].get_content()) + self.remove_subscription(self._cur_panels[-1]) if pop is True: self._cur_panels.pop() if len(self._cur_panels) > 0: @@ -506,6 +508,7 @@ class KlipperScreen(Gtk.Window): if hasattr(self.panels[self._cur_panels[-1]], "process_update"): self.panels[self._cur_panels[-1]].process_update("notify_status_update", self.printer.get_updates()) + self.add_subscription(self._cur_panels[-1]) if show is True: self.show_all()