Package schrodinger :: Package application :: Package jaguar :: Package gui :: Package tabs :: Module base_tab :: Class BaseTab
[hide private]
[frames] | no frames]

Class BaseTab

PyQt4.QtGui.QWidget --+
                      |
                     BaseTab

The base class for all Jaguar tabs. Subclasses should define NAME, HELP_TOPIC, UI_MODULES, setup(), getMmJagKeywords(), restoreSettings(), and reset().

Instance Methods [hide private]
 
__init__(self, parent, input_selector=None)
Perform common tab initialization.
 
_populateUi(self)
Instantiate all ui files and subtabs and add them to a single layout.
 
setup(self)
Perform tab specific initialization.
 
getDefaultKeywords(self)
Get the default keywords for this tab.
dict
getMmJagKeywords(self)
Return all keywords that should be put into the mmjag handle.
 
loadSettings(self, jag_input)
Restore tab settings from mmjag keywords.
 
loadPerAtomSettings(self, jag_input, eid=None, title=None)
Restore per-atom tab settings from mmjag keywords.
 
saveSettings(self, jag_input, eid)
Save tab settings in jaguar handle.
 
reset(self)
Reset the tab to its original state.
str or NoneType
validate(self)
Make sure that the tab settings will allow a job to be run successfully.
 
error(self, msg)
Display an error dialog with the specified message
 
warning(self, msg)
Display a warning dialog with the specified message
 
activate(self)
This function will be called whenever the user selects this tab.
 
deactivate(self)
This function will be called whenever the user selects a different tab.
Class Variables [hide private]
str NAME = ""
The name of the tab
str HELP_TOPIC = ""
The help topic for the tab
tuple UI_MODULES = None
A tuple of ui modules defining the tab widgets.
Instance Variables [hide private]
schrodinger.ui.qt.appframework.JobInputFrame input_selector
The AppFramework input selector frame from the panel containing this tab.
str task_name
The name of the panel this tab is part of
CombinedUi ui
An object that provides access to all widgets from all ui files.
Method Details [hide private]

__init__(self, parent, input_selector=None)
(Constructor)

 

Perform common tab initialization. All tab specific initialization should go in setup().

Parameters:
  • parent (PyQt4.QtGui.QWidget) - The Qt parent widget
  • input_selector (schrodinger.ui.qt.appframework.JobInputFrame) - The panel's input selector widget, if available.

_populateUi(self)

 

Instantiate all ui files and subtabs and add them to a single layout. All widgets will be added to self.ui.

setup(self)

 

Perform tab specific initialization. This function should be defined in subclasses if initialization is needed.

getDefaultKeywords(self)

 

Get the default keywords for this tab. Note that defaults that exist in mmjag should not be explicitly set here.

getMmJagKeywords(self)

 

Return all keywords that should be put into the mmjag handle. This function should be defined in subclasses.

Returns: dict
All keywords that should be put into the mmjag handle
Raises:

loadSettings(self, jag_input)

 

Restore tab settings from mmjag keywords. This function should be defined in subclasses.

Parameters:

loadPerAtomSettings(self, jag_input, eid=None, title=None)

 

Restore per-atom tab settings from mmjag keywords. This function should be defined in subclasses for any tabs that contain per-atom settings.

Parameters:

saveSettings(self, jag_input, eid)

 

Save tab settings in jaguar handle. It is only used for settings which are not defined using keywords (typically per-atom settings). This function should be defined in subclasses for any tabs that contain per- atom settings.

Parameters:

reset(self)

 

Reset the tab to its original state. Note that this function is only necessary for settings that are not stored in the mmjag handle. For mmjag settings, reset will be carried out using loadSettings with a default schrodinger.application.jaguar.input.JaguarInput object. This function should only be defined in subclasses if there are any settings that cannot be reset via loadSettings.

validate(self)

 

Make sure that the tab settings will allow a job to be run successfully. Note that this validation should not be redundant with that performed in getMmJagKeywords. Any tab setting that prevents valid mmjag keywords from being generated should cause getMmJagKeywords to raise a JaguarSettingError. Any tab setting that allows mmjag keywords to be successfully generated but will result in a job failure should cause a validate fail. This function should be defined in subclasses if validation is needed.

Returns: str or NoneType
If the validation passes, None is returned. If the validation fails, a string that describes the error is returned.

error(self, msg)

 

Display an error dialog with the specified message

Parameters:
  • msg (str) - The message to include in the error dialog

warning(self, msg)

 

Display a warning dialog with the specified message

Parameters:
  • msg (str) - The message to include in the warning dialog

activate(self)

 

This function will be called whenever the user selects this tab. Subclasses can override it if necessary to, e.g., activate picking.

deactivate(self)

 

This function will be called whenever the user selects a different tab. Subclasses can override it if necessary to, e.g., deactivate picking.


Class Variable Details [hide private]

UI_MODULES

A tuple of ui modules defining the tab widgets. These ui modules should be listed top to bottom. Optionally, a tuple of (tab class, attribute name) may be listed instead of a ui file to include a subtab.
Type:
tuple
Value:
None

Instance Variable Details [hide private]

ui

An object that provides access to all widgets from all ui files. Note that widget names should be unique amongst all ui files for the tab.
Type:
CombinedUi