panel_controller
freecad.datamanager_wb.ui.panel_controller
¶
UI-facing controller facade for the DataManager MainPanel.
This module provides a higher-level API used by the GUI layer. It delegates
tab-generic logic to TabController instances and owns document recompute and
GUI refresh behavior.
PanelController(*, ctx=None)
¶
Facade used by MainPanel to access workbench behavior.
Responsibilities:
- Provide a UI-oriented API for both tabs (VarSets and Aliases).
- Delegate tab-generic operations to two TabController instances.
- Own the document refresh boundary (doc.recompute() + Gui.updateGui()).
Source code in freecad/datamanager_wb/ui/panel_controller.py
can_remove_unused(*, only_unused, selected_items)
¶
Return whether a selection is eligible for remove-unused (VarSets tab).
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_active_document_name()
¶
Return the active document name, if available.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_alias_expression_items(selected_aliases)
¶
Return expression items and counts for selected spreadsheet aliases.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_alias_post_remove_unused_update(*, selected_spreadsheets, alias_filter_text, only_unused)
¶
Compute the post-mutation UI update for the Aliases tab.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_expression_items(selected_vars)
¶
Return expression items and counts for selected VarSet variables.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_expression_reference_counts(selected_vars)
¶
Return expression reference counts for selected VarSet variables.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_filtered_spreadsheet_alias_items(*, selected_spreadsheets, alias_filter_text, only_unused)
¶
Return filtered spreadsheet alias refs for the UI.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_filtered_spreadsheets(*, filter_text, exclude_copy_on_change=False)
¶
Return spreadsheet names filtered by the UI filter text.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_filtered_varset_variable_items(*, selected_varsets, variable_filter_text, only_unused)
¶
Return filtered VarSet variable refs for the UI.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_filtered_varsets(*, filter_text, exclude_copy_on_change=False)
¶
Return VarSet names filtered by the UI filter text.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_object_label(object_name)
¶
Return the label for a named document object, if available.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_post_remove_unused_update(*, selected_varsets, variable_filter_text, only_unused)
¶
Compute the post-mutation UI update for the VarSets tab.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_sorted_spreadsheets(*, exclude_copy_on_change=False)
¶
Return sorted spreadsheet names.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_sorted_varsets(*, exclude_copy_on_change=False)
¶
Return sorted VarSet names.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_spreadsheet_alias_refs(selected_spreadsheets)
¶
Return structured alias refs for the selected spreadsheets.
Source code in freecad/datamanager_wb/ui/panel_controller.py
get_varset_variable_items(selected_varsets)
¶
Return VarSet.Variable strings for the selected VarSets.
get_varset_variable_refs(selected_varsets)
¶
Return structured variable refs for the selected VarSets.
Source code in freecad/datamanager_wb/ui/panel_controller.py
refresh_document()
¶
Recompute the active document and refresh the FreeCAD GUI.
Any exceptions are swallowed to keep the UI responsive.
Source code in freecad/datamanager_wb/ui/panel_controller.py
remove_unused_aliases_and_get_update(*, selected_alias_items, selected_spreadsheets, alias_filter_text, only_unused)
¶
Remove unused aliases and return updated UI state (Aliases tab).
Source code in freecad/datamanager_wb/ui/panel_controller.py
remove_unused_and_get_update(*, selected_varset_variable_items, selected_varsets, variable_filter_text, only_unused)
¶
Remove unused variables and return updated UI state (VarSets tab).
Source code in freecad/datamanager_wb/ui/panel_controller.py
remove_unused_varset_variables(selected_varset_variable_items)
¶
Remove unused variables (VarSets tab) and refresh the document.
Source code in freecad/datamanager_wb/ui/panel_controller.py
select_expression_item(expression_item)
¶
Select the FreeCAD object referenced by an expression list entry.
should_enable_remove_unused(*, only_unused, selected_count)
¶
Delegate the enable/disable rule for remove-unused in the VarSets tab.