MetaControls¶
class MetaControls(parent: Optional[QWidget] = None)
Bases: QWidget
Shared base for the control panels that sit below each analysis tab’s plot.
Every analysis tab owns a controls widget - ClusteringControls,
EventAnalysisControls, MetadataControls, ProteinControls and
RawDataControls - which builds the tab’s comboboxes, buttons and labels and
turns user interaction into signals the tab’s View connects to. Those five
widgets were written by copy-paste and carried the same helpers verbatim; this
base holds the shared half so there is one copy to fix.
What a subclass inherits:
Widget factories.
createLabel(),create_comboBox()andcreateButton()build the three plain widgets every panel uses, with the font, size policy and translation call applied consistently.Icon buttons.
create_info_button(),create_add_button()andcreate_delete_button()build the pencil, plus and trash buttons beside each plugin combobox, already wired to the signals below.The placeholder guard.
is_placeholder_item()andtoggle_info_button()keep a combobox’s edit and delete buttons disabled until a real plugin is selected, reading the tab’s ownplaceholder_texts.Signals.
actionTriggeredcarries a request into the tab’s Controller as(submodel_name, action_name, args).add_processed,edit_processedanddelete_processedcarry plugin-management requests, and are emitted for the metaclass whose combobox the user acted on.
What a subclass owes it:
Its own
logger = logging.getLogger(__name__). This base deliberately declares none, because every call in the family goes throughself.loggerand resolves through the MRO - so a logger here would silently re-home every subclass’s records toporiscope.utils.MetaControls.Its own
placeholder_texts, or the placeholder guard above will read every combobox entry as a real selection.setupUi,connect_signals,validate_inputsandcollect_parameters, which are genuinely per-tab and are called by the subclass’s own__init__.
Public Methods¶
Abstract Methods¶
These methods must be implemented by subclasses.
(none)
Concrete Methods¶
- MetaControls.createButton(parent: QWidget, text: str, bold: bool = False) QPushButton¶
Build a checkable push button carrying translated text.
- MetaControls.createLabel(parent: QWidget, pointSize: int, text: str) QLabel¶
Build a label carrying translated text at a size relative to
pointSize.
- MetaControls.create_add_button(parent: QWidget, comboBox: QComboBox, add_text: str, metaclass: str) QToolButton¶
Build the plus button that opens the plugin manager on a new plugin.
Always enabled: adding a plugin does not depend on one already being selected.
- MetaControls.create_comboBox(parent: QWidget) QComboBox¶
Build a combobox that expands to fill the width available to it.
- Parameters:
parent (QWidget) – Widget to parent the combobox to.
- Returns:
The new combobox.
- Return type:
QComboBox
- MetaControls.create_delete_button(parent: QWidget, comboBox: QComboBox, info_text: str, metaclass: str) QToolButton¶
Build the trash button that deletes the combobox’s current selection.
Disabled while the selection is a placeholder, and re-evaluated whenever the combobox changes.
- MetaControls.create_info_button(parent: QWidget, comboBox: QComboBox, info_text: str, metaclass: str) QToolButton¶
Build the pencil button that opens the plugin manager on a combobox’s selection.
Disabled while the selection is a placeholder, and re-evaluated whenever the combobox changes.
- MetaControls.delete_plugin(comboBox: QComboBox, metaclass: str) None¶
Ask the tab to delete the plugin the combobox currently names.
- Parameters:
comboBox (QComboBox) – Combobox whose current text names the plugin to delete.
metaclass (str) – Plugin family the combobox lists.
- MetaControls.is_placeholder_item(comboBox: QComboBox) bool¶
Report whether the combobox’s current text is this tab’s “nothing here yet”.
- Parameters:
comboBox (QComboBox) – Combobox to inspect.
- Returns:
True when the selection is a placeholder rather than a real plugin.
- Return type:
- MetaControls.show_plugin_add_manager(comboBox: QComboBox, metaclass: str) None¶
Ask the tab to open the plugin manager on a new plugin of this family.
- Parameters:
comboBox (QComboBox) – Combobox the request came from; its selection is not read.
metaclass (str) – Plugin family to add to.
- MetaControls.show_plugin_edit_manager(comboBox: QComboBox, metaclass: str) None¶
Ask the tab to open the plugin manager on the combobox’s current selection.
- Parameters:
comboBox (QComboBox) – Combobox whose current text names the plugin to edit.
metaclass (str) – Plugin family the combobox lists.
- MetaControls.toggle_info_button(button: QToolButton, comboBox: QComboBox) None¶
Enable a combobox’s edit or delete button only for a real selection.
- Parameters:
button (QToolButton) – Button to enable or disable.
comboBox (QComboBox) – Combobox the button acts on.
Private Methods¶
Abstract Methods¶
These methods must be implemented by subclasses.
(none)