Closed satiowadahc closed 4 months ago
@c-morley
if self.state.magic_comments["disable_preview"]:
LOG.info("Preview Disabled by comments")
self.ui.gcodegraphics.show_program = False
return
elif os.stat(file_name).st_size < self.max_graphics_file_size:
self.ui.gcodegraphics.show_program = True
else:
self.ui.gcodegraphics.show_program = False
LOG.warning(f"File To Large ({os.stat(file_name).st_size/1000000} mb), Preview disabled")
This is how I use it on my GUI, opinion if this should be moved into gcode graphics or leave it to each GUI's preferences?
As long as the max file size can be arbitrarily set relatively easily, I like consistency between the GUIs.
Set a default max file size, check with INI for updated value, then add getter/setters?
I'd think just a function to set it would be fine. A GUI then could set it if it's required, I suspect it won't happen often. What do you think?
I have assigned this to @c-morley to decide whether to merge or not. I don't know enough to decide.
Thank you.
Replacing #2887, now rebased on master.