Preferences: lazy loading on connect, on by default

Off reads the whole app from app.sab when connecting. Read at each connect, so a
change takes effect on the next one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 14:13:41 +03:00
co-authored by Claude Opus 5.5
parent cb0196caa7
commit 7ff2479736
3 changed files with 32 additions and 9 deletions
+10 -3
View File
@@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it.
import configparser
import os
VERSION = "0.0.0.170"
VERSION = "0.0.0.171"
PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties")
DEFAULT_GRID_SIZE = 10
DEFAULT_ADD_TIMESTAMP = True
@@ -118,6 +118,7 @@ def load_preferences():
left_pane_width = DEFAULT_LEFT_PANE_WIDTH
sedona_home = ""
trace_dasp = False
lazy_loading = True
if os.path.exists(PROPERTIES_FILE):
try:
@@ -130,6 +131,7 @@ def load_preferences():
)
sedona_home = config.get("Editor", "sedona.home", fallback="").strip()
trace_dasp = config.getboolean("Editor", "trace_dasp", fallback=False)
lazy_loading = config.getboolean("Editor", "lazy_loading", fallback=True)
except Exception:
pass
else:
@@ -150,7 +152,8 @@ def load_preferences():
left_pane_width = max(
MIN_ALLOWED_LEFT_PANE_WIDTH, min(MAX_ALLOWED_LEFT_PANE_WIDTH, left_pane_width)
)
return sedona_home, grid_size, add_timestamp, box_width, left_pane_width, trace_dasp
return (sedona_home, grid_size, add_timestamp, box_width, left_pane_width, trace_dasp,
lazy_loading)
def save_preferences():
@@ -170,6 +173,7 @@ def save_preferences():
"box_width": str(BOX_WIDTH),
"left_pane_width": str(LEFT_PANE_WIDTH),
"trace_dasp": str(TRACE_DASP),
"lazy_loading": str(LAZY_LOADING),
}
with open(PROPERTIES_FILE, "w") as configfile:
config.write(configfile)
@@ -259,5 +263,8 @@ def base_window_title_live():
return f"Sedona Live Editor [v{VERSION}] — {device_host}:{device_port}"
SEDONA_HOME, GRID_SIZE, ADD_TIMESTAMP, BOX_WIDTH, LEFT_PANE_WIDTH, TRACE_DASP = load_preferences()
# LAZY_LOADING: on connect, read components as folders are opened (True) or the whole
# app from app.sab first (False). Read at each connect, so a change takes effect on the next.
(SEDONA_HOME, GRID_SIZE, ADD_TIMESTAMP, BOX_WIDTH, LEFT_PANE_WIDTH, TRACE_DASP,
LAZY_LOADING) = load_preferences()
LAST_PALETTE_KIT = load_last_palette_kit()