forked from CreatBot/CreatBotKlipperScreen
screen: Catch errors on attaching panel
This commit is contained in:
21
screen.py
21
screen.py
@@ -231,18 +231,23 @@ class KlipperScreen(Gtk.Window):
|
|||||||
if hasattr(self.panels[panel_name],"process_update"):
|
if hasattr(self.panels[panel_name],"process_update"):
|
||||||
self.panels[panel_name].process_update("notify_status_update", self.printer.get_data())
|
self.panels[panel_name].process_update("notify_status_update", self.printer.get_data())
|
||||||
|
|
||||||
if remove == 2:
|
try:
|
||||||
self._remove_all_panels()
|
if remove == 2:
|
||||||
elif remove == 1:
|
self._remove_all_panels()
|
||||||
self._remove_current_panel(pop)
|
elif remove == 1:
|
||||||
|
self._remove_current_panel(pop)
|
||||||
|
|
||||||
self.add(self.panels[panel_name].get())
|
logger.debug("Attaching panel %s" % panel_name)
|
||||||
self.show_all()
|
|
||||||
|
|
||||||
if hasattr(self.panels[panel_name],"activate"):
|
self.add(self.panels[panel_name].get())
|
||||||
self.panels[panel_name].activate()
|
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
|
||||||
|
if hasattr(self.panels[panel_name],"activate"):
|
||||||
|
self.panels[panel_name].activate()
|
||||||
|
self.show_all()
|
||||||
|
except:
|
||||||
|
logger.exception("Error attaching panel")
|
||||||
|
|
||||||
self._cur_panels.append(panel_name)
|
self._cur_panels.append(panel_name)
|
||||||
logger.debug("Current panel hierarchy: %s", str(self._cur_panels))
|
logger.debug("Current panel hierarchy: %s", str(self._cur_panels))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user