diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index 5bf8e6dd..2f4c0bbd 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -33,7 +33,6 @@ _Widgets = { "BECShell": "BECShell", "BECStatusBox": "BECStatusBox", "BeamlineStateManager": "BeamlineStateManager", - "BeamlineStatePill": "BeamlineStatePill", "BecConsole": "BecConsole", "DapComboBox": "DapComboBox", "DeviceBrowser": "DeviceBrowser", @@ -775,54 +774,6 @@ class BeamlineStateManager(RPCBase): """ -class BeamlineStatePill(RPCBase): - """Compact widget showing one BEC beamline state.""" - - _IMPORT_MODULE = "bec_widgets.widgets.services.beamline_states.beamline_state_pill" - - @property - @rpc_call - def state_name(self) -> "str | None": - """ - Name of the BEC beamline state displayed by this pill. - """ - - @rpc_call - def set_state_name(self, state_name: "str | None", title: "str | None" = None) -> "None": - """ - Set the BEC beamline state this pill displays. - - Args: - state_name: State name as published by ``AvailableBeamlineStatesMessage``. - title: Optional human-readable title for the state. - """ - - @rpc_call - def remove(self): - """ - Cleanup the BECConnector - """ - - @rpc_call - def attach(self): - """ - None - """ - - @rpc_call - def detach(self): - """ - Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. - """ - - @rpc_timeout(None) - @rpc_call - def screenshot(self, file_name: "str | None" = None): - """ - Take a screenshot of the dock area and save it to a file. - """ - - class BecConsole(RPCBase): """A console widget with access to a shared registry of terminals, such that instances can be moved around.""" diff --git a/bec_widgets/cli/designer_plugins.py b/bec_widgets/cli/designer_plugins.py index 6315596e..9cbb660e 100644 --- a/bec_widgets/cli/designer_plugins.py +++ b/bec_widgets/cli/designer_plugins.py @@ -23,10 +23,6 @@ designer_plugins = { "bec_widgets.widgets.services.beamline_states.beamline_state_pill", "BeamlineStateManager", ), - "BeamlineStatePill": ( - "bec_widgets.widgets.services.beamline_states.beamline_state_pill", - "BeamlineStatePill", - ), "BecConsole": ("bec_widgets.widgets.editors.bec_console.bec_console", "BecConsole"), "ColorButton": ("bec_widgets.widgets.utility.visual.color_button.color_button", "ColorButton"), "ColorButtonNative": ( @@ -127,7 +123,6 @@ widget_icons = { "BECSpinBox": "123", "BECStatusBox": "widgets", "BeamlineStateManager": "format_list_bulleted", - "BeamlineStatePill": "info", "BecConsole": "terminal", "ColorButton": "colors", "ColorButtonNative": "colors", diff --git a/bec_widgets/widgets/services/beamline_states/beamline_state_pill.py b/bec_widgets/widgets/services/beamline_states/beamline_state_pill.py index 7b8572b3..3b4715b5 100644 --- a/bec_widgets/widgets/services/beamline_states/beamline_state_pill.py +++ b/bec_widgets/widgets/services/beamline_states/beamline_state_pill.py @@ -93,9 +93,8 @@ class BeamlineStatePill(BECWidget, QWidget): a ``BeamlineStateMessage`` is published for that state. """ - PLUGIN = True - ICON_NAME = "info" - USER_ACCESS = ["state_name", "set_state_name", "remove", "attach", "detach", "screenshot"] + PLUGIN = False + RPC = False state_changed = Signal(str, str, str) update_requested = Signal(str, object) diff --git a/bec_widgets/widgets/services/beamline_states/beamline_state_pill.pyproject b/bec_widgets/widgets/services/beamline_states/beamline_state_pill.pyproject deleted file mode 100644 index 340bae9a..00000000 --- a/bec_widgets/widgets/services/beamline_states/beamline_state_pill.pyproject +++ /dev/null @@ -1 +0,0 @@ -{'files': ['beamline_state_pill.py']} \ No newline at end of file diff --git a/bec_widgets/widgets/services/beamline_states/beamline_state_pill_plugin.py b/bec_widgets/widgets/services/beamline_states/beamline_state_pill_plugin.py deleted file mode 100644 index 537d2279..00000000 --- a/bec_widgets/widgets/services/beamline_states/beamline_state_pill_plugin.py +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from qtpy.QtDesigner import QDesignerCustomWidgetInterface -from qtpy.QtWidgets import QWidget - -from bec_widgets.utils.bec_designer import designer_material_icon -from bec_widgets.widgets.services.beamline_states.beamline_state_pill import BeamlineStatePill - -DOM_XML = """ - - - - -""" - - -class BeamlineStatePillPlugin(QDesignerCustomWidgetInterface): # pragma: no cover - def __init__(self): - super().__init__() - self._form_editor = None - - def createWidget(self, parent): - if parent is None: - return QWidget() - t = BeamlineStatePill(parent) - return t - - def domXml(self): - return DOM_XML - - def group(self): - return "" - - def icon(self): - return designer_material_icon(BeamlineStatePill.ICON_NAME) - - def includeFile(self): - return "beamline_state_pill" - - def initialize(self, form_editor): - self._form_editor = form_editor - - def isContainer(self): - return False - - def isInitialized(self): - return self._form_editor is not None - - def name(self): - return "BeamlineStatePill" - - def toolTip(self): - return "" - - def whatsThis(self): - return self.toolTip() diff --git a/bec_widgets/widgets/services/beamline_states/register_beamline_state_pill.py b/bec_widgets/widgets/services/beamline_states/register_beamline_state_pill.py deleted file mode 100644 index 5c032ab5..00000000 --- a/bec_widgets/widgets/services/beamline_states/register_beamline_state_pill.py +++ /dev/null @@ -1,17 +0,0 @@ -def main(): # pragma: no cover - from qtpy import PYSIDE6 - - if not PYSIDE6: - print("PYSIDE6 is not available in the environment. Cannot patch designer.") - return - from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection - - from bec_widgets.widgets.services.beamline_states.beamline_state_pill_plugin import ( - BeamlineStatePillPlugin, - ) - - QPyDesignerCustomWidgetCollection.addCustomWidget(BeamlineStatePillPlugin()) - - -if __name__ == "__main__": # pragma: no cover - main()