schrodinger.ui.qt.appframework2.taskwidgets module¶
<<<<< DEPRECATED >>>>>
This module should not be used for new code. Instead, consider using
schrodinger.ui.qt.tasks
<<<<< !!!!!!!!! >>>>>
- schrodinger.ui.qt.appframework2.taskwidgets.get_spin_icons()¶
- schrodinger.ui.qt.appframework2.taskwidgets.get_error_icon()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin¶
Bases:
object
This mixin provides the framework for making a user interface for a task runner. In MVC parlance, this mixin is used for creating a view/controller for a task runner model.
- start_latency = 750¶
- connectRunner(runner)¶
Sets the task runner object for this UI and connects signals. If there is already a runner connected to this UI, it will first be disconnected before connecting the new runner. Passing in None will leave the UI not connected to anything.
- Parameters
runner (tasks.AbstractTaskRunner) – the task runner to act as a model for this UI
- disconnectRunner()¶
Disconnects the current runner from this UI. When subclassing, first perform any subclass-specific disconnection logic before calling the parent class’ disconnectRunner(). If there is no runner connected, this method will do nothing.
- onResetPressed()¶
- onStartPressed()¶
- onStartRequested()¶
- onStartFailed()¶
- onTaskStarted(task)¶
Start latency is the small delay after a task is started before another task can be started.
- onTaskEnded(task)¶
This slot will only be called if the task was run within a single Maestro session.
- onRunnerStateChanged()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskUIWidget(runner=None)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin
,PyQt6.QtWidgets.QWidget
A general base class for task UI widgets. It creates the widget and provides the familiar af2-like setOptions, setup, and layOut methods, along with a main_layout for quickly adding child widgets.
- __init__(runner=None)¶
- setOptions()¶
- setup()¶
- layOut()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskNameLineEdit(runner=None)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin
,PyQt6.QtWidgets.QLineEdit
A line edit interface for task names (i.e. job names). This widget will automatically respond to changes in the job runner. It will also set itself read-only if the job runner does not allow custom job names.
- __init__(runner=None)¶
- setText(text)¶
Overrides parent method so that programmatic modification of the text will trigger an update of the runner.
- connectRunner(runner)¶
Sets the task runner object for this UI and connects signals. If there is already a runner connected to this UI, it will first be disconnected before connecting the new runner. Passing in None will leave the UI not connected to anything.
- Parameters
runner (tasks.AbstractTaskRunner) – the task runner to act as a model for this UI
- onTextChanged()¶
We need to respond to the textChanged signal because if a user edits the name and directly clicks the start button, the editingFinished signal can come after the start button clicked signal, resulting in the new name not being assigned to the task that gets launched.
Because textChanged is emitted while the user is editing the field, we don’t want to process the empty-name case (which re-populates the field with the default job name).
- onNameChanged()¶
- onRunnerNameChanged()¶
- onTaskStarted(task)¶
Start latency is the small delay after a task is started before another task can be started.
- class schrodinger.ui.qt.appframework2.taskwidgets.SpinLabel(runner=None)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin
,PyQt6.QtWidgets.QLabel
This is a simple label that displays a spinner animation. Whenever a task from the connected task launcher is running, the spinner will be animated. It stops automatically when the last task ends. Other than connecting a runner, nothing generally needs to be done with this label.
Note that QLabel uses a pixmap, not an icon, so the SpinnerIconMixin will not work here.
- __init__(runner=None)¶
- onRunnerStateChanged()¶
- startSpinner()¶
- stopSpinner()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.SpinnerIconMixin¶
Bases:
object
Contains common code for widgets with spinners that use icons.
- setupSpinner()¶
- startSpinner()¶
- stopSpinner()¶
- updateSpinIcon()¶
- setError(state=False)¶
- class schrodinger.ui.qt.appframework2.taskwidgets.SpinButton(text='', runner=None)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin
,schrodinger.ui.qt.appframework2.taskwidgets.SpinnerIconMixin
,PyQt6.QtWidgets.QPushButton
This is a push button which displays a spinner next to the button text. Clicking the button will automatically start the associated task runner, and the spinner will animate for as long as there is at least one task from that runner still running. Like the SpinLabel, once a runner is connected, this widget should just work.
- __init__(text='', runner=None)¶
- onRunnerStateChanged()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.SpinToolButton(runner=None)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin
,schrodinger.ui.qt.appframework2.taskwidgets.SpinnerIconMixin
,PyQt6.QtWidgets.QToolButton
This is like the SpinLabel except it is a tool button. Clicking the tool button does not automatically start the task runner, so the button behavior can be customized.
- __init__(runner=None)¶
- onRunnerStateChanged()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskBar(runner=None, label_text='Task name:', button_text='Run', show_spinner=True, task_reset=True)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIWidget
A compound widget with a task name label, a spinner, and a run button.
- __init__(runner=None, label_text='Task name:', button_text='Run', show_spinner=True, task_reset=True)¶
- Parameters
runner (tasks.AbstractTaskRunner) – the runner to connect to this task bar
label_text (str) – text label associated with the task name field
button_text (str) – text on the “start” button
show_spinner (bool) – whether to show a progress spinner
task_reset (bool) – whether to include a separate task reset action. Otherwise, reset will emit a global reset signal
- setOptions()¶
- setup()¶
- layOut()¶
- connectRunner(runner)¶
Sets the task runner object for this UI and connects signals. If there is already a runner connected to this UI, it will first be disconnected before connecting the new runner. Passing in None will leave the UI not connected to anything.
- Parameters
runner (tasks.AbstractTaskRunner) – the task runner to act as a model for this UI
- disconnectRunner()¶
Disconnects the current runner from this UI. When subclassing, first perform any subclass-specific disconnection logic before calling the parent class’ disconnectRunner(). If there is no runner connected, this method will do nothing.
- onNameChanged()¶
- onRunnerStateChanged()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.MiniTaskBar(runner=None, label_text='Task name:', button_text='Run', show_spinner=True, task_reset=True)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskBar
A narrow version of the TaskBar for narrow or dockable panels. No functional difference.
- setup()¶
- layOut()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.SettingsButton(runner=None, task_reset=False)¶
Bases:
schrodinger.ui.qt.swidgets.SToolButton
,schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin
The “gear” button from the job bar. This button connects with a job runner and provides access to the config dialog, as well as write, write STU, and reset functionality.
- __init__(runner=None, task_reset=False)¶
- Parameters
runner (tasks.AbstractTaskRunner) – the runner to connect to this task bar
task_reset (bool) – whether to include a separate task reset action. Otherwise, reset will emit a global reset signal
- populateMenu()¶
- startGuiDebug()¶
- onClicked()¶
- resetAllAction()¶
- resetAction()¶
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskTableColumns¶
Bases:
object
Columns object expected by table_helper
- HEADERS = ['Task Name', 'Status']¶
- NUM_COLS = 2¶
- NAME = 0¶
- STATUS = 1¶
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskTableModel¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIMixin
,schrodinger.ui.qt.table_helper.RowBasedTableModel
The table model for representing multiple tasks and their current statuses
- COLUMN¶
alias of
schrodinger.ui.qt.appframework2.taskwidgets.TaskTableColumns
- ROW_CLASS¶
alias of
schrodinger.ui.qt.appframework2.tasks.AbstractTaskWrapper
- __init__()¶
- onRunnerStateChanged()¶
- af2SettingsGetValue()¶
This function adds support for the settings mixin. It allows to save table cell values in case this table is included in the settings panel. Returns list of rows if table model is of RowBasedTableModel class type.
- Returns
list of rows in tbe table’s model.
- Return type
list or None
- af2SettingsSetValue(value)¶
This function adds support for the settings mixin. It allows to set table cell values when this table is included in the settings panel.
- Parameters
value (list) – settings value, which is a list of row data here.
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskTableView¶
Bases:
PyQt6.QtWidgets.QTableView
- class schrodinger.ui.qt.appframework2.taskwidgets.TaskTableWidget(runner=None)¶
Bases:
schrodinger.ui.qt.appframework2.taskwidgets.TaskUIWidget
A widget containing both the table model and view objects.
- MODEL_CLASS¶
alias of
schrodinger.ui.qt.appframework2.taskwidgets.TaskTableModel
- VIEW_CLASS¶
alias of
schrodinger.ui.qt.appframework2.taskwidgets.TaskTableView
- setup()¶
- layOut()¶
- connectRunner(runner)¶
Sets the task runner object for this UI and connects signals. If there is already a runner connected to this UI, it will first be disconnected before connecting the new runner. Passing in None will leave the UI not connected to anything.
- Parameters
runner (tasks.AbstractTaskRunner) – the task runner to act as a model for this UI
- disconnectRunner()¶
Disconnects the current runner from this UI. When subclassing, first perform any subclass-specific disconnection logic before calling the parent class’ disconnectRunner(). If there is no runner connected, this method will do nothing.