schrodinger.ui.qt.tasks.taskwidgets module

schrodinger.ui.qt.tasks.taskwidgets.get_spin_icons()
schrodinger.ui.qt.tasks.taskwidgets.get_error_icon()
class schrodinger.ui.qt.tasks.taskwidgets.SpinnerLabel(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.taskwidgets._SpinnerMixin, schrodinger.ui.qt.tasks.taskbarwidgets.TaskWidgetMixin, PyQt6.QtWidgets.QLabel

clicked

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

__init__(*args, **kwargs)
mousePressEvent(self, ev: QMouseEvent)
setImage(image)
class schrodinger.ui.qt.tasks.taskwidgets.ProgressBar(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.taskbarwidgets.TaskWidgetMixin, PyQt6.QtWidgets.QProgressBar

Progress bar for a running task. For AbstractTask, this monitors the task.status, task.progress, and task.max_progress and updates accordingly. For TaskManager, this monitors taskman.status only.

Set max_progress to 0 for an indeterminate progress bar. Both progress and max_progress may be adjusted while the task is running.

Determinate progress is only supported for tasks. For a taskmanager, the progress dialog will run as long as any task in the taskmanager is running.

__init__(*args, **kwargs)
defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
setModel(model)

Sets the model object for the mapper. Disconnects the old model, if one is set, and connects the new model. Pass in None to have no model set.

Parameters

model – the model instance or None

updateStatus()
updateProgress()

Updates the numerical progress. Not called for TaskManager.

isRunning()
class schrodinger.ui.qt.tasks.taskwidgets.ProgressDialog(*args, **kwargs)

Bases: schrodinger.models.advanced_mappers.MultiModelClassMapperMixin, schrodinger.ui.qt.basewidgets.BaseWidget

A basic modal progress dialog that shows itself whenever its model task is running and hides itself whenever it’s not running. The dialog contains a ProgressBar instance and a text label, which can be set with setLabelText.

Calling setTask with a running task will result in the dialog immediately being shown.

model_classes = (<class 'schrodinger.tasks.tasks.AbstractTask'>, <class 'schrodinger.tasks.taskmanager.TaskManager'>)
SHOW_AS_WINDOW = True
initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

@overrides: widgetmixins.InitMixin

setTask(task)
setModel(model)

Sets the model object for the mapper. Disconnects the old model, if one is set, and connects the new model. Pass in None to have no model set.

Parameters

model – the model instance or None

setLabelText(text)
defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
updateStatus()
isRunning()
class schrodinger.ui.qt.tasks.taskwidgets.KillableProgressDialog(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.taskwidgets.ProgressDialog

A ProgressDialog with a “Cancel” button that kills the running task.

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

@overrides: widgetmixins.InitMixin

class schrodinger.ui.qt.tasks.taskwidgets.StatusLabel(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.taskbarwidgets.TaskWidgetMixin, PyQt6.QtWidgets.QLabel

defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
setStatus(value)
class schrodinger.ui.qt.tasks.taskwidgets.StartButton(*args, **kwargs)

Bases: schrodinger.ui.qt.utils.ButtonAcceptsFocusMixin, schrodinger.ui.qt.tasks.taskbarwidgets.TaskWidgetMixin, PyQt6.QtWidgets.QPushButton

A button responsible for launching a task.

Variables

aboutToStartTask (QtCore.pyqtSignal) – a signal emitted just before the task is launched; contains the task instance as an argument

aboutToStartTask

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

__init__(*args, **kwargs)
updateEnabled(value=None)
defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
onClicked()
class schrodinger.ui.qt.tasks.taskwidgets.SpinnerStartButton(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.taskwidgets._SpinnerMixin, schrodinger.ui.qt.tasks.taskwidgets.StartButton

__init__(*args, **kwargs)
setImage(image)
class schrodinger.ui.qt.tasks.taskwidgets.SettingsButton(*args, **kwargs)

Bases: PyQt6.QtWidgets.QToolButton

__init__(*args, **kwargs)
setActions(text_to_slots)

Set the actions to show for the settings menu that popups when pressing the down arrow on the button.

Parameters

text_to_slots (list[tuple(str, callable) or None]) – A list of tuples mapping the desired menu item text with the function that should be called when the item is selected. If tuple is None, then a separator will be added instead and the text will be ignored.

class schrodinger.ui.qt.tasks.taskwidgets.AbstractTaskBar(*args, **kwargs)

Bases: schrodinger.models.mappers.MapperMixin, schrodinger.ui.qt.basewidgets.BaseWidget

Base class for all taskbars. To create a fully customized taskbar, subclass this class and make sure that startRequested is emitted whenever a task should be started.

model_class

alias of schrodinger.tasks.taskmanager.TaskManager

startRequested

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

setConfigDialog(config_dialog)

Set a config dialog for this taskbar.

Subclasses should define this if they support a config dialog.

makeInitialModel()

@overrides: mappers.MapperMixin

setSettingsMenuActions(text_to_slots)

Set the actions to show for the settings menu shown from the settings tool button.

Subclasses should define this if they have a settings button.

Parameters

text_to_slots (list[tuple(str, callable) or None]) – A list of tuples mapping the desired menu item text with the function that should be called when the item is selected. If the slot is None, then a separator will be added instead and the text will be ignored.

class schrodinger.ui.qt.tasks.taskwidgets.TaskBar(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.taskwidgets.AbstractTaskBar

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initFinalize()

Suggested subclass use: perform any remaining initialization.

setConfigDialog(config_dialog)

Set a config dialog for this taskbar.

Subclasses should define this if they support a config dialog.

showConfigDialog()
initLayOut()

@overrides: widgetmixins.InitMixin

setModel(model)

Sets the model object for the mapper. Disconnects the old model, if one is set, and connects the new model. Pass in None to have no model set.

Parameters

model – the model instance or None

setSettingsMenuActions(text_to_slots)

Set the actions to show for the settings menu shown from the settings tool button.

Parameters

text_to_slots (list[tuple(str, callable) or None]) – A list of tuples mapping the desired menu item text with the function that should be called when the item is selected. If the slot is None, then a separator will be added instead and the text will be ignored.

defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
class schrodinger.ui.qt.tasks.taskwidgets.JobTaskBar(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.taskwidgets.TaskBar

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.