Package schrodinger :: Package ui :: Package qt :: Module appframework :: Class AppFramework
[hide private]
[frames] | no frames]

Class AppFramework

       object --+                    
                |                    
sip.simplewrapper --+                
                    |                
          sip.wrapper --+            
                        |            
     PyQt4.QtCore.QObject --+        
                            |        
           object --+       |        
                    |       |        
    sip.simplewrapper --+   |        
                        |   |        
 PyQt4.QtGui.QPaintDevice --+        
                            |        
          PyQt4.QtGui.QWidget --+    
                                |    
          PyQt4.QtGui.QMainWindow --+
                                    |
                                   AppFramework
Known Subclasses:


The AppFramework class is basically a hull for applications.

With its own instance of a DialogParameters class, Application manages
Schrodinger dialogs like start, read, and write so that the programmer is
free to worry about other things.  The dialogs can be manipulated at
anytime to fit the needs of the programmer (please see the DialogParameters
class below).

The Application class also comes with an instance of the JobParameters
class (jobparam).  This object is intended to be used to store all GUI
settings.  Please see the JobParameters class below for more information
on proper usage.

In addition to these features, the AppFramework class can take arguments
for Main Menu creation.

Supposing I wanted a menu of the form:

File      Edit              Help
^Save     ^Options          ^About
^Close    ^^First Option
          ^^Second Option

When I create my AppFramework instance, I would pass the following keyword,
value pair:

menu = {1: ["File", "Edit", "Help"],
        "File": {"Save": {"command": <command_here>},
                 "Close": {"command": <command_here>},
                 },
        "Edit": {"Options": {"First Option": {"command": <command_here>},
                             "Second Option": {"command": <command_here>},
                             },
                 },
        "Help": {"About": {"command": <command_here>},
                 },
        }

The dictionary key 1 (int form, not string form) is the key for an ordering
list.  Because dictionaries are not ordered, this is needed to specify your
prefered order.

AppFramework also manages the Bottom Button Bar.  One more keyword for the
AppFramework instance is "buttons", and would appear like:

buttons = {"start": {"command": <command_here>},
                     "dialog": <boolean_show_dialog?>},
           "read": {"command": <command_here>},
           "write": {"command": <command_here>,
                     "dialog": <boolean_show_dialog?>},
           "reset": {"command": <command_here>},
           "close": {"command": <command_here>},
           "help": {"command": <command_here>},
           }

The six supported buttons are "start", "read", "write", "reset", "close",
and "help".  Any button name for which you supply a command will be
created and placed in the correct location.

Non-default button names can be used by supplying a 'text' keyword.

You can also specify a command for start, read, and write buttons
that will be called when the button is pressed before displaying
the dialog with the 'precommand' keyword.
For example, you may want to check an input before allowing
the start dialog to appear.  These functions should return 0
unless the dialog should not be displayed (nor the specified
start/read/write function called).  Any function that returns a
non-zero value will halt the dialog process, and return to the GUI.

If "checkcommand" is specified, then this function will be called when
the user clicks on the Start/Write button (before closing the dialog),
and if the function returns a non-zero value, the dialog will not close.
The only argument that is given is a job name.
This callback is typically used to check for existing files based on
the user-specified jobname.
IMPORTANT: If the function returns 0, and <jobname>.maegz exists,
AppFramework will overwrite the file without asking the user. It is
up to your application to make sure the user is okay with that file
being overwritten.

Before the user supplied command is called, if there is an associated
dialog, the AppFramework presents the dialog, saves the input in the
jobparam object mentioned above. Then AppFramework calls the command.

Button configuration options are:
    command -    Required callback function.
    precommand - Optional command called prior to displaying dialog.
                 Available for Start, Read, and Write dialogs.
    dialog -     If False, the Start or Write dialog is not displayed.
    text -       If used, overrides the text of the button.

Finally, there is an Input Frame that can be used.  Please see that class
below for information on proper use.

@type subwindow: bool
@param subwindow: If subwindow is True, this panel will not try to start
a new QApplication instance even if running outside of Maestro (useful for
subwindows when a main window is already running).

@type dockable: bool
@param dockable: If True this instance will be dockable in Maestro.

@type dockarea: Qt QFlags (See constants at top of this module)
@param dockarea: By default this is to the right, but you can specify any
of the *DOCK_AREA constants specified in this module.

@type periodic_callback: callable
@param periodic_callback: If specified, this function will be called
periodically, a few times a second (frequency is not guaranteed).

@type config_dialog_class: ConfigDialog class or subclass of ConfigDialog
@param config_dialog_class:
This allows you to pass in custom dialogs to be used to configure your
panel.

@type help_topic: str
@param help_topic: If given, a help button will be created and connected to
the specified topic.  Note that if help_topic is given, then
buttons['help']['command'] will be ignored.

@type help_product: str
@param help_product: The help product to access for help_topic.  Defaults to
"Maestro".  This parameter is ignored if help_topic is not given.

@type show_desres_icon: bool
@param show_desres_icon: A large amount of panels are contractually bound
to show a DE Shaw Research icon, turning this to True will automatically
add it to the bottom of the panel.

@type product_text: str
@param product_text: In panels where DE Shaw Research requires an icon
(see above), we also sometimes need to specify that parts of the technology
present were developed by Schrodinger.  This option will only be used if
show_desres_icon==True.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QMainWindow: DockOption, DockOptions

Inherited from PyQt4.QtGui.QWidget: RenderFlag, RenderFlags

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
jobCompleted(...)
 
__init__(self, ui=None, title=None, subwindow=False, dockable=False, dockarea=2, buttons=None, dialogs=None, inputframe=None, menu=None, periodic_callback=None, config_dialog_class=<class schrodinger.ui.qt.appframework.ConfigDialog at 0x2b21ae..., help_topic=None, help_product='Maestro', show_desres_icon=False, product_text='', flip=False)
See class docstring.
 
_updateToolWindowFlag(self)
 
_commandCallback(self, command)
Called by Maestro when a command is issued, and is used to update the 2D Viewer preferences when Maestro's preferences change.
 
isDockableInMaestro(self)
Returns True if the PyQt panel can be docked into Maestro mainwindow.
 
setJobViewname(self, viewname)
sets the job viewname used to filter in the monitor panel.
 
interior(self)
Return the interior frame where client widgets should be parented from
 
addCentralWidget(self, w)
Add a widget to the central area of the AppFramework dialog
 
exec_(self)
Calls exec_() method of the application.
 
show(self, also_raise=True, also_activate=True)
Redefine the show() method to deiconize if necessary and also raise_() the panel if 'also_raise' is specified as True.
 
createMenus(self, dict)
Setup for making individual menus, create MainMenuBar.
 
_makeMenu(self, menuname, dict)
Create the menu <menuname>
 
_createMenuItem(self, menu, itemname, dict)
Setup the item <itemname> of menu <menu>.
 
_makeItem(self, menu, itemname, dict)
Create individual item in a menu.
 
_setButtonDefaults(self, button, default_name, default_dialog)
Sets defaults for unspecified button options and adds ellipses to the button text if it brings up a dialog.
 
_setupDESResIcon(self, product_text, flip=False)
If requested, this function adds the DESRES icon and potentially Schrodinger text information.
 
_setupBottomButtons(self, **_buttonDict)
Create the requested bottom buttons, configured according to the 'buttonDict'.
str
addButtonToBottomLayout(self, text, command)
Adds a button to the bottom bar, to go to the right of Job Start buttons.
 
updateJobname(self)
Update jobname in parameters from main window.
 
_applyStartDialogParams(self)
Retrieves settings from the start dialog (aka config_dialog) and applies them to the job parameters of the app.
 
_start(self)
Method for start button.
 
_start_wrapper(self)
This is a wrapper for the start command, where we disable the run button and show a status message.
 
_read(self)
Method for read button.
 
_write(self)
Method for write button.
 
_reset(self)
Method for reset button.
 
setButtonState(self, button, state)
Set the state of the specified button, e.g.,
 
setButtonEnabled(self, button, enabled)
Enable / disable the specified button, e.g.,
 
setupJobParameters(self)
Setups up the job parameters from the state of the input frame.
 
getInputSource(self)
Return the selected input source.
 
getInputFile(self)
Return the selected input file path (Python string).
 
monitorJob(self, jobid, showpanel=False)
Monitor the given jobid and show the monitor panel; if in maestro.
 
runCommand(self, cmd, jobname=None, monitor=True)
Run the specified command under job control without freezing Maestro.
 
processEvents(self)
Allow the QApplication's or Maestro's main event loop to process pending events.
None
warning(self, text, preferences=None, key='')
Display a warning dialog with the specified text.
None
info(self, text, preferences=None, key='')
Display an information dialog with the specified text.
None
error(self, text, preferences=None, key='')
Display an error dialog with the specified text.
 
question(self, msg, button1='OK', button2='Cancel', title='Question')
Display a prompt dialog window with specified text.
 
askOverwrite(self, files=None, parent=None)
Display a dialog asking the user whether to overwrite existing files.
 
askOverwriteIfNecessary(self, files)
If any of the files in the <files> list exists, will bring up a dialog box asking the user whether they want to overwrite them.
 
_settings(self)
Open the config dialog.
 
_jobprefersettings(self)
Open the Maestro preference panel with Jobs/Starting node selected.
 
updateStatusBar(self)
Updates the status bar.
 
setWaitCursor(self, app_wide=True)
Set the cursor to the wait cursor.
 
restoreCursor(self, app_wide=True)
Restore the application level cursor to the default.
 
getApp(self)
Return QApplication instance which this panel is running under.
 
closeEvent(self, event)
Called by QApplication when the user clicked on the "x" button to close the window.
 
closePanel(self)
Hide panel, if in Maestro.
 
quitPanel(self)
Quit the panel (even if in Maestro)
 
getOpenFileName(self, caption='Select a file', initial_dir=None, support_mae=True, support_sd=True, support_pdb=True)
Brings up an open file dialog box for selecting structure files.
 
getOpenFileNames(self, caption='Select file(s)', initial_dir=None, support_mae=True, support_sd=True, support_pdb=True)
 
trackJobProgress(self, job)
Display a progress dialog showing the progress of this job.
 
setProgress(self, step, total_steps)
Set the progress bar value (bottom of the panel) to <step> out of <total_steps>
 
setProgressError(self, error)
Set the color of the progress bar to red (error=True) or normal color (error=False).
 
_periodicCallback(self)
 
timerEvent(self, event)
Method implemented for the self.timer created when jobs are run outside Maestro.
 
showEvent(self, show_event)
Override the normal processing when the panel is shown.
 
help(self)
Display the help dialog (or a warning dialog if no help can be found).
 
_updatePanelJobname(self, reset=False)
Update the job name in the panel
 
_populateEmptyJobname(self)
If the user clears the job name line edit, populate it with the standard job name
 
setJobname(self, jobname)

Inherited from PyQt4.QtGui.QMainWindow: addDockWidget, addToolBar, addToolBarBreak, centralWidget, contextMenuEvent, corner, createPopupMenu, dockOptions, dockWidgetArea, documentMode, event, iconSize, iconSizeChanged, insertToolBar, insertToolBarBreak, isAnimated, isDockNestingEnabled, isSeparator, menuBar, menuWidget, removeDockWidget, removeToolBar, removeToolBarBreak, restoreDockWidget, restoreState, saveState, setAnimated, setCentralWidget, setCorner, setDockNestingEnabled, setDockOptions, setDocumentMode, setIconSize, setMenuBar, setMenuWidget, setStatusBar, setTabPosition, setTabShape, setToolButtonStyle, setUnifiedTitleAndToolBarOnMac, splitDockWidget, statusBar, tabPosition, tabShape, tabifiedDockWidgets, tabifyDockWidget, toolBarArea, toolBarBreak, toolButtonStyle, toolButtonStyleChanged, unifiedTitleAndToolBarOnMac

Inherited from PyQt4.QtGui.QWidget: acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, contentsMargins, contentsRect, contextMenuPolicy, create, cursor, customContextMenuRequested, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, enabledChange, ensurePolished, enterEvent, find, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontChange, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabGesture, grabKeyboard, grabMouse, grabShortcut, graphicsEffect, graphicsProxyWidget, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, hideEvent, inputContext, inputMethodEvent, inputMethodHints, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyPressEvent, keyReleaseEvent, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, locale, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, palette, paletteChange, parentWidget, pos, previousInFocusChain, raise_, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, repaint, resetInputContext, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGraphicsEffect, setHidden, setInputContext, setInputMethodHints, setLayout, setLayoutDirection, setLocale, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, topLevelWidget, underMouse, ungrabGesture, unsetCursor, unsetLayoutDirection, unsetLocale, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, winId, window, windowActivationChange, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setProperty, signalsBlocked, startTimer, thread, tr, trUtf8

Inherited from PyQt4.QtGui.QPaintDevice: colorCount, depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  start_wrapper_timeout = 3000

Inherited from PyQt4.QtGui.QMainWindow: AllowNestedDocks, AllowTabbedDocks, AnimatedDocks, ForceTabbedDocks, VerticalTabs

Inherited from PyQt4.QtGui.QWidget: DrawChildren, DrawWindowBackground, IgnoreMask

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ui=None, title=None, subwindow=False, dockable=False, dockarea=2, buttons=None, dialogs=None, inputframe=None, menu=None, periodic_callback=None, config_dialog_class=<class schrodinger.ui.qt.appframework.ConfigDialog at 0x2b21ae..., help_topic=None, help_product='Maestro', show_desres_icon=False, product_text='', flip=False)
(Constructor)

 

See class docstring.

Overrides: object.__init__

isDockableInMaestro(self)

 

Returns True if the PyQt panel can be docked into Maestro mainwindow. Otherwise returns false. This function should be called only after parsing the 'dockable' argument inside the constructor.

setJobViewname(self, viewname)

 

sets the job viewname used to filter in the monitor panel. this name defaults to the __name__ of the panel.

show(self, also_raise=True, also_activate=True)

 

Redefine the show() method to deiconize if necessary and also raise_() the panel if 'also_raise' is specified as True.

Parameters:
  • also_raise (bool) - If True (default), the raise_ method will also be called on the window. If False it is not. This is important on some Window managers to ensure the window is placed on top of other windows.
  • also_activate (bool) - If True (default), the activateWindow method will also be called on the window. If False it is not. This is important on some Window managers to ensure the window is placed on top of other windows.
Overrides: PyQt4.QtGui.QWidget.show

_createMenuItem(self, menu, itemname, dict)

 

Setup the item <itemname> of menu <menu>. Creates the item or cascading menu.

_setButtonDefaults(self, button, default_name, default_dialog)

 

Sets defaults for unspecified button options and adds ellipses to the button text if it brings up a dialog. Raises a SyntaxError if no command is specified for the button in the button dictionary.

_setupDESResIcon(self, product_text, flip=False)

 

If requested, this function adds the DESRES icon and potentially Schrodinger text information.

Parameters:
  • product_text (str) - If not empty, what Schrodinger text to put across from the DESRES icon.

addButtonToBottomLayout(self, text, command)

 

Adds a button to the bottom bar, to go to the right of Job Start buttons. Useful when you need a button on the bottom which is not standard job launching.

Buttons are added from left to right in the order that this function is called..

@param text text that goes on the button @type text str

@param command the slot that the button will run @param callable

Returns: str
name of button, to be used in setButtonEnabled

_start(self)

 

Method for start button. Show dialog, process results, call command.

_start_wrapper(self)

 

This is a wrapper for the start command, where we disable the run button and show a status message.

Returns:
jobid (or None, if not yet implemented)

_read(self)

 

Method for read button. Show dialog, process results, call command.

_write(self)

 

Method for write button. Show dialog, process results, call command.

_reset(self)

 

Method for reset button. Reset file input frame, call command.

setButtonState(self, button, state)

 

Set the state of the specified button, e.g.,

self.setButtonState('start', 'disabled')

The standard state is 'normal'. Raises a RuntimeError if the button doesn't exist or if the requested state can't be set.

Obsolete. Please use setButtonEnabled() method instead.

setButtonEnabled(self, button, enabled)

 

Enable / disable the specified button, e.g.,

self.setButtonEnabled('start', False)

Raises a RuntimeError if the button doesn't exist.

setupJobParameters(self)

 

Setups up the job parameters from the state of the input frame. Do not call directly from your script.

Returns True if success, False on error (after displaying an error message).

getInputSource(self)

 

Return the selected input source.
Available values (module constants):
  WORKSPACE
  SELECTED_ENTRIES
  INCLUDED_ENTRIES
  INCLUDED_ENTRY
  FILE

If the panel has no input frame, raises RuntimeError.

getInputFile(self)

 

Return the selected input file path (Python string).

If the panel has no input frame, raises RuntimeError. If FILE source is not allowed, raises RuntimeError.

monitorJob(self, jobid, showpanel=False)

 

Monitor the given jobid and show the monitor panel; if in maestro.

jobid     - jobid of the job to monitor
showpanel - whether to bring up the Monitor panel. By default, the panel
            will open if the "Open Monitor panel" preference is set.

Example:
After launching the job, use the jobid to issue the command:

<AppFramework_instance>.monitorJob(<jobid>)

runCommand(self, cmd, jobname=None, monitor=True)

 

Run the specified command under job control without freezing Maestro.
While the job is run, all panel's widgets are disabled.
Raises a RuntimeError if the job failed to complete.

If the specified program already supports running under job control,
do not specify the jobname.

If the program does NOT support running under job control, specify a
jobname to use. The job will be run in the local directory, and
stdout/stderr will be saved to <jobname>.log.

<monitor>  - Whether to bring up the monitor dialog box (if the
             "Open Monitor panel" Maestro preference is set)

warning(self, text, preferences=None, key='')

 

Display a warning dialog with the specified text. If preferences and key are both supplied, then the dialog will contain a "Don't show this again" checkbox. Future invocations of this dialog with the same preferences and key values will obey the user's show preference.

Parameters:
  • text (str) - The information to display in the dialog
  • preferences (schrodinger.utils.preferences.Preferences object) - The Preferences class to use to store the show/don't show preference for this dialog. Note that the Preferences object must currently be set to the preference group containing key.
  • key (str) - The key to store the preference under
Returns: None

info(self, text, preferences=None, key='')

 

Display an information dialog with the specified text. If preferences and key are both supplied, then the dialog will contain a "Don't show this again" checkbox. Future invocations of this dialog with the same preferences and key values will obey the user's show preference.

Parameters:
  • text (str) - The information to display in the dialog
  • preferences (schrodinger.utils.preferences.Preferences object) - The Preferences class to use to store the show/don't show preference for this dialog. Note that the Preferences object must currently be set to the preference group containing key.
  • key (str) - The key to store the preference under
Returns: None

error(self, text, preferences=None, key='')

 

Display an error dialog with the specified text. If preferences and key are both supplied, then the dialog will contain a "Don't show this again" checkbox. Future invocations of this dialog with the same preferences and key values will obey the user's show preference.

Parameters:
  • text (str) - The information to display in the dialog
  • preferences (schrodinger.utils.preferences.Preferences object) - The Preferences class to use to store the show/don't show preference for this dialog. Note that the Preferences object must currently be set to the preference group containing key.
  • key (str) - The key to store the preference under
Returns: None

question(self, msg, button1='OK', button2='Cancel', title='Question')

 

Display a prompt dialog window with specified text. Returns True if first button (default OK) is pressed, False otherwise.

askOverwrite(self, files=None, parent=None)

 

Display a dialog asking the user whether to overwrite existing files. Returns True if user chose to overwrite, False otherwise.

Optionally specify a list of files that will be overwritten if the user presses the Overwrite button.

askOverwriteIfNecessary(self, files)

 

If any of the files in the <files> list exists, will bring up a dialog box asking the user whether they want to overwrite them. Returns True if the user chose to overwrite or if specified files do not exist. Returns False if the user cancelled.

_settings(self)

 

Open the config dialog. If settings are accepted (okay), returns the StartDialogParams, otherwise returns None.

setWaitCursor(self, app_wide=True)

 

Set the cursor to the wait cursor. This will be an hourglass, clock or similar. Call restoreCursor() to return to the default cursor. If 'app_wide' is True then it will apply to the entire application (including Maestro if running there). If it's False then it will apply only to this panel.

restoreCursor(self, app_wide=True)

 

Restore the application level cursor to the default. If 'app_wide' is True then if will be restored for the entire application, if it's False, it will be just for this panel.

getApp(self)

 

Return QApplication instance which this panel is running under. If in Maestro, returns Maestro's global QApplication instance.

closeEvent(self, event)

 

Called by QApplication when the user clicked on the "x" button to close the window. Will call the user-specified close command (if specified).

Overrides: PyQt4.QtGui.QWidget.closeEvent

closePanel(self)

 

Hide panel, if in Maestro. Otherwise close it.

quitPanel(self)

 

Quit the panel (even if in Maestro)

Note that the calling script needs to unset the variable that holds this
panel instance in order to truly delete the panel.  For example, this
method should be subclassed as follows:

def quitPanel(self):
    global mypanel # Where mypanel is the variable holding this object
    appframework.AppFramework.quitPanel(self)
    mypanel = None

getOpenFileName(self, caption='Select a file', initial_dir=None, support_mae=True, support_sd=True, support_pdb=True)

 

Brings up an open file dialog box for selecting structure files. By default reads Maestro, SD, and PDB formats. Returns file path that is readable by StructureReader. Is user pressed cancel, empty string is returned.

trackJobProgress(self, job)

 

Display a progress dialog showing the progress of this job. (Any previously tracked job will no longer be tracked)

job - a jobcontrol.Job object.

setProgress(self, step, total_steps)

 

Set the progress bar value (bottom of the panel) to <step> out of <total_steps>

Set both to 0 to hide the progress bar.

timerEvent(self, event)

 

Method implemented for the self.timer created when jobs are run outside Maestro. This is implemented to have a periodic callback outside of the Maestro environment.

Overrides: PyQt4.QtCore.QObject.timerEvent

showEvent(self, show_event)

 

Override the normal processing when the panel is shown.

Overrides: PyQt4.QtGui.QWidget.showEvent

help(self)

 

Display the help dialog (or a warning dialog if no help can be found). This function requires help_topic to have been given when the class was initialized.

_updatePanelJobname(self, reset=False)

 

Update the job name in the panel

Parameters:
  • reset (bool) - If True, the new job name will be based on the default job name. Otherwise, it will be based on the current job name.