Spoolman support close #1060

Refactor post_requrest
Switching to TreeView
More spool info
redesign toggle buttons
Allow spoolman while printing
Styling checkbox as switch
render Toggle switch-like
Fixed wrong timezones
Filtering spools
Removed translations of Spoolman
Spool image can be overided in theme
Added switch-on/off symbols to toggle
rename iter to i to avoid shadowing built-in function
remove redundant parenthesis
convert spoolcompare to static
merge check and treeview shared props
reduce spacing of buttons very useful for vertical/portrait
fix issue with remainings
add spoolman shortcut to extrude
Using backports.zoneinfo for python < 3.9
use decorators for properties
extract format_date function
change top row
last used sort
rebase on upstream
Fix for never used spools


Co-authored-by: alfrix <alfredomonclus@gmail.com>
This commit is contained in:
Blonďák
2023-08-19 23:43:45 +02:00
committed by GitHub
parent 65c4b172e8
commit af1de12f28
26 changed files with 1356 additions and 26 deletions

View File

@@ -894,6 +894,8 @@ class KlipperScreen(Gtk.Window):
self.files.initialize()
self.files.refresh_files()
self.init_spoolman()
logging.info("Printer initialized")
self.initialized = True
self.reinit_count = 0
@@ -919,6 +921,18 @@ class KlipperScreen(Gtk.Window):
logging.info(f"Temperature store size: {self.printer.tempstore_size}")
except KeyError:
logging.error("Couldn't get the temperature store size")
return False
def init_spoolman(self):
server_config = self.apiclient.send_request("server/config")
if server_config:
try:
server_config["result"]["config"]["spoolman"]
self.printer.enable_spoolman()
except KeyError:
logging.warning("Not using Spoolman")
return False
def show_keyboard(self, entry=None, event=None):
if self.keyboard is not None: