Auto-open Kit Manager when file has kits without checksums
When a SAX file is opened and any declared kit is missing a checksum, the Kit Manager panel opens automatically and the palette stays empty until the checksums are resolved. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it.
|
|||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
|
|
||||||
VERSION = "0.0.0.064"
|
VERSION = "0.0.0.065"
|
||||||
PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties")
|
PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties")
|
||||||
DEFAULT_GRID_SIZE = 10
|
DEFAULT_GRID_SIZE = 10
|
||||||
DEFAULT_ADD_TIMESTAMP = True
|
DEFAULT_ADD_TIMESTAMP = True
|
||||||
|
|||||||
@@ -1578,11 +1578,21 @@ def on_tree_filled():
|
|||||||
if app_state.current_file_path != _history_file_path:
|
if app_state.current_file_path != _history_file_path:
|
||||||
_history_file_path = app_state.current_file_path
|
_history_file_path = app_state.current_file_path
|
||||||
reset_view_history()
|
reset_view_history()
|
||||||
|
|
||||||
|
if _schema_has_incomplete_checksums():
|
||||||
|
show_kits()
|
||||||
else:
|
else:
|
||||||
_prune_view_history()
|
_prune_view_history()
|
||||||
update_history_controls()
|
update_history_controls()
|
||||||
|
|
||||||
|
|
||||||
|
def _schema_has_incomplete_checksums():
|
||||||
|
"""Whether any declared kit is missing a checksum."""
|
||||||
|
if not app_state.active_schema_kits:
|
||||||
|
return False
|
||||||
|
return any(cs is None for cs in app_state.active_schema_kits.values())
|
||||||
|
|
||||||
|
|
||||||
# --- Dialogs ---
|
# --- Dialogs ---
|
||||||
|
|
||||||
def open_preferences_dialog():
|
def open_preferences_dialog():
|
||||||
@@ -2105,8 +2115,11 @@ def refresh_palette_kits():
|
|||||||
global palette_kit_names
|
global palette_kit_names
|
||||||
|
|
||||||
palette.invalidate()
|
palette.invalidate()
|
||||||
declared = list(app_state.active_schema_kits.keys())
|
|
||||||
palette_kit_names = sorted(declared)
|
if _schema_has_incomplete_checksums():
|
||||||
|
palette_kit_names = []
|
||||||
|
else:
|
||||||
|
palette_kit_names = sorted(app_state.active_schema_kits.keys())
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
for kit_name in palette_kit_names:
|
for kit_name in palette_kit_names:
|
||||||
|
|||||||
Reference in New Issue
Block a user