macros: hide macros with rename_existing (equal to Mainsail)
This commit is contained in:
parent
35e2a46852
commit
8391fdf83e
@ -52,7 +52,15 @@ class Panel(ScreenPanel):
|
|||||||
# Support for hiding macros by name
|
# Support for hiding macros by name
|
||||||
if macro.startswith("_"):
|
if macro.startswith("_"):
|
||||||
return
|
return
|
||||||
|
section = self._printer.get_macro(macro)
|
||||||
|
if section:
|
||||||
|
if "rename_existing" in section:
|
||||||
|
return
|
||||||
|
if "gcode" in section:
|
||||||
|
gcode = section["gcode"].split("\n")
|
||||||
|
else:
|
||||||
|
logging.debug(f"Couldn't load {macro}\n{section}")
|
||||||
|
return
|
||||||
name = Gtk.Label()
|
name = Gtk.Label()
|
||||||
name.set_markup(f"<big><b>{macro}</b></big>")
|
name.set_markup(f"<big><b>{macro}</b></big>")
|
||||||
name.set_hexpand(True)
|
name.set_hexpand(True)
|
||||||
@ -80,12 +88,6 @@ class Panel(ScreenPanel):
|
|||||||
"params": {},
|
"params": {},
|
||||||
}
|
}
|
||||||
pattern = r'params\.(?P<param>..*)\|default\((?P<default>..*)\).*'
|
pattern = r'params\.(?P<param>..*)\|default\((?P<default>..*)\).*'
|
||||||
gcode = self._printer.get_macro(macro)
|
|
||||||
if gcode and "gcode" in gcode:
|
|
||||||
gcode = gcode["gcode"].split("\n")
|
|
||||||
else:
|
|
||||||
logging.debug(f"Couldn't load {macro}\n{gcode}")
|
|
||||||
return
|
|
||||||
i = 0
|
i = 0
|
||||||
for line in gcode:
|
for line in gcode:
|
||||||
if line.startswith("{") and "params." in line:
|
if line.startswith("{") and "params." in line:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user