schrodinger.ui.qt.tasks.job_settings_dialog module¶
- class schrodinger.ui.qt.tasks.job_settings_dialog.IncorporationModeCombo(parent=None)¶
Bases:
MappableComboBox- allowedIncorporationModes() list[IncorporationMode]¶
- setAllowedIncorporationModes(modes: Sequence[IncorporationMode]) None¶
- class schrodinger.ui.qt.tasks.job_settings_dialog.AbstractJobSettingsDialog(*args, **kwargs)¶
Bases:
JsonableClassMixin,BaseOptionsDialogAbstract base class for job settings dialogs. Subclasses must specify a
model_classthat is a jobtask class.- model_class = NotImplemented¶
- startRequested¶
A
pyqtSignalemitted by instances of the class.
- opened¶
A
pyqtSignalemitted by instances of the class.
- initSetOptions()¶
Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).
- initSetUp()¶
Creates widget from
uiand stores itui_widget.Suggested subclass use: create and initialize subwidgets, and connect signals.
- initLayOut()¶
@overrides: widgetmixins.InitMixin
- initSetDefaults()¶
@overrides: widgetmixins.InitMixin
- initFinalize()¶
Suggested subclass use: perform any remaining initialization.
- defineMappings()¶
Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:
a basic widget, like
QLineEditorQComboBoxa custom object that inherits
MapperMixinorTargetMixina
TargetSpecinstancea 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
TargetSpecobject, 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)]
- allowedIncorporationModes() list[IncorporationMode]¶
Return the allowed incorporation modes for this dialog.
- setAllowedIncorporationModes(modes: Sequence[IncorporationMode]) None¶
Set the allowed incorporation modes for this dialog. Passing an empty iterable hides the incorporation mode selector and vice versa.
- defaultIncorporationMode() IncorporationMode | None¶
The default incorporation mode. Persists across model resets for a given dialog instance.
- setDefaultIncorporationMode(mode: IncorporationMode | None) None¶
- updateHostsList() str | None¶
Update the list of hosts available in all the registered HostSelectors. If the config dialog is not visible returns the message that would be displayed to the user else displays a dialog to the user and returns None.
- getPersistentState() dict¶
Return a dictionary containing only the serialized parameters that we want to persist across sessions.
- setPersistentState(state: dict) None¶
Load serialized parameters from a previous session.
- run(*args, **kwargs) None¶
See
ExecutionMixinfor documentation.- Returns:
Dialog code indicating the dialog acceptance / rejection.
- Default = 'default'¶
- Panel = 'panel'¶
- schrodinger.ui.qt.tasks.job_settings_dialog.make_job_settings_dialog(task_class: type[schrodinger.tasks.jobtasks._AbstractJobMixin], allowed_host_types: AllowedHostTypes = AllowedHostTypes.CPU_ONLY, default_incorporation_mode: IncorporationMode | None = None) AbstractJobSettingsDialog¶
A factory for a single-host job settings dialog. For more customization, subclass AbstractJobSettingsDialog directly and add your own host selectors.
- Parameters:
task_class – A jobtask class with USE_JOB_SETTINGS=True
allowed_host_types – The allowed host types for the host selector.
default_incorporation_mode – The incorporation mode to use by default. If None, the incorporation mode selector will be hidden.