macros: hide load and unload (use them in the extrude panel)
This commit is contained in:
parent
8391fdf83e
commit
7f00a37244
@ -49,9 +49,6 @@ class Panel(ScreenPanel):
|
|||||||
self.reload_macros()
|
self.reload_macros()
|
||||||
|
|
||||||
def add_gcode_macro(self, macro):
|
def add_gcode_macro(self, macro):
|
||||||
# Support for hiding macros by name
|
|
||||||
if macro.startswith("_"):
|
|
||||||
return
|
|
||||||
section = self._printer.get_macro(macro)
|
section = self._printer.get_macro(macro)
|
||||||
if section:
|
if section:
|
||||||
if "rename_existing" in section:
|
if "rename_existing" in section:
|
||||||
@ -134,7 +131,9 @@ class Panel(ScreenPanel):
|
|||||||
def load_gcode_macros(self):
|
def load_gcode_macros(self):
|
||||||
for macro in self._printer.get_gcode_macros():
|
for macro in self._printer.get_gcode_macros():
|
||||||
macro = macro[12:].strip()
|
macro = macro[12:].strip()
|
||||||
if macro.startswith("_"): # Support for hiding macros by name
|
# Support for hiding macros by _
|
||||||
|
if macro.startswith("_") or macro.upper() in ('LOAD_FILAMENT', 'UNLOAD_FILAMENT'):
|
||||||
|
logging.info(f"Skipping macro {macro}")
|
||||||
continue
|
continue
|
||||||
self.options[macro] = {
|
self.options[macro] = {
|
||||||
"name": macro,
|
"name": macro,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user