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() and createButton() 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() and create_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() and toggle_info_button() keep a combobox’s edit and delete buttons disabled until a real plugin is selected, reading the tab’s own placeholder_texts.

  • Signals. actionTriggered carries a request into the tab’s Controller as (submodel_name, action_name, args). add_processed, edit_processed and delete_processed carry 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 through self.logger and resolves through the MRO - so a logger here would silently re-home every subclass’s records to poriscope.utils.MetaControls.

  • Its own placeholder_texts, or the placeholder guard above will read every combobox entry as a real selection.

  • setupUi, connect_signals, validate_inputs and collect_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.

Parameters:
  • parent (QWidget) – Widget to parent the button to.

  • text (str) – Untranslated button text.

  • bold (bool) – Whether to render the text bold.

Returns:

The new button.

Return type:

QPushButton

MetaControls.createLabel(parent: QWidget, pointSize: int, text: str) → QLabel

Build a label carrying translated text at a size relative to pointSize.

Parameters:
  • parent (QWidget) – Widget to parent the label to.

  • pointSize (int) – Nominal point size; the label is rendered six points smaller.

  • text (str) – Untranslated label text.

Returns:

The new label.

Return type:

QLabel

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.

Parameters:
  • parent (QWidget) – Widget to parent the button to.

  • comboBox (QComboBox) – Combobox the new plugin will be added to.

  • add_text (str) – Tooltip text.

  • metaclass (str) – Plugin family to add to.

Returns:

The new button.

Return type:

QToolButton

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.

Parameters:
  • parent (QWidget) – Widget to parent the button to.

  • comboBox (QComboBox) – Combobox the button acts on.

  • info_text (str) – Tooltip text.

  • metaclass (str) – Plugin family the combobox lists.

Returns:

The new button.

Return type:

QToolButton

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.

Parameters:
  • parent (QWidget) – Widget to parent the button to.

  • comboBox (QComboBox) – Combobox the button acts on.

  • info_text (str) – Tooltip text.

  • metaclass (str) – Plugin family the combobox lists.

Returns:

The new button.

Return type:

QToolButton

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:

bool

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)