Kit manager menu oncesi
This commit is contained in:
+27
-1
@@ -23,6 +23,12 @@ MAX_ALLOWED_BOX_WIDTH = 400
|
||||
window = None
|
||||
canvas = None
|
||||
tree = None
|
||||
status_label = None # the window's bottom status bar
|
||||
|
||||
# Status bar tones. A hint that something needs attention later is worth a colour, so a
|
||||
# placement that leaves the schema out of step is not read as a plain confirmation.
|
||||
STATUS_INFO_COLOUR = "#333333"
|
||||
STATUS_WARN_COLOUR = "#a04b00"
|
||||
|
||||
# Maps to hold tracking states
|
||||
tree_element_map = {} # Treeview item ID -> ET.Element
|
||||
@@ -47,7 +53,12 @@ drag_data = {"x": 0, "y": 0, "tag": None}
|
||||
|
||||
# Global component slot registries compiled dynamically per file load
|
||||
final_components_registry = {}
|
||||
active_schema_kits = {}
|
||||
active_schema_kits = {} # kit name -> checksum, as the open file's <schema> declares them
|
||||
|
||||
# Kits a placed component needs that the file's <schema> does not declare yet, as
|
||||
# kit name -> checksum resolved from Sedona home. Filled in when a palette component is
|
||||
# placed and read back when saving, which is where the <schema> block is reconciled.
|
||||
pending_schema_kits = {}
|
||||
|
||||
|
||||
def load_preferences():
|
||||
@@ -102,6 +113,21 @@ def base_window_title():
|
||||
return f"Sedona SAX Tree View Viewer & Program Editor [v{VERSION}]"
|
||||
|
||||
|
||||
def set_status(message, warn=False):
|
||||
"""Posts a one-line note to the status bar. A no-op before the UI exists."""
|
||||
if status_label is None:
|
||||
return
|
||||
status_label.config(
|
||||
text=message,
|
||||
foreground=STATUS_WARN_COLOUR if warn else STATUS_INFO_COLOUR
|
||||
)
|
||||
|
||||
|
||||
def clear_status():
|
||||
"""Empties the status bar, for when the note no longer describes anything on screen."""
|
||||
set_status("")
|
||||
|
||||
|
||||
def mark_dirty():
|
||||
"""Single funnel for 'the document changed', including the unsaved-state tint."""
|
||||
global is_dirty
|
||||
|
||||
Reference in New Issue
Block a user