Cortex  10.0.0-a4
Public Member Functions | Static Public Member Functions | List of all members
IECoreMaya.FileDialog Class Reference

The FileDialog class provides an alternative to Maya's maya.cmds.fileDialog(). More...

Public Member Functions

def __init__ (self, key=None, callback=None, title="Choose a file", path=None, kw)
 
def setPath (self, path, args)
 Can be called to set the path being displayed in the Dialog. More...
 

Static Public Member Functions

def registerPreset
 Register a preset for the 'Bookmarks' menu. More...
 
def removePreset
 Removes the named preset with the given key, or global preset if no key is specified. More...
 

Detailed Description

The FileDialog class provides an alternative to Maya's maya.cmds.fileDialog().

It is not a complete drop-in replacement, as, in order to have nice, resizable window functionality, it is not modal. Instead, a callback is registered, which will be called with the result of the users selection, which will be empty in the case of dismissal or cancellation.

If effectively provides an instance of the IECoreMaya.FileBrowser class in a window, along with path history, and bookmarking facilities.

Parameters
key(string) This key is used to provide context specific path history and bookmarks. It can be None, in which case, the global history/bookmarks are used.
callbackShould be a callable with the signature f( result ). result will be a list of absolute paths to the seleceted items, or an empty list if the dialog was dismissed or cancelled.

title (string) A title for the window.

Parameters
path(string) if specified, this path will be used as the initial path for the dialog. If the string "last" is passed, then the last path picked in an instance with a matching key will be used. If the argument is omitted, then the current working directory is used.

Other kw arguments are passed to the FileBrowser constructor.

See also
IECoreMaya.FileBrowser

Member Function Documentation

def IECoreMaya.FileDialog.registerPreset (   name,
  pathOrProc,
  key = None 
)
static

Register a preset for the 'Bookmarks' menu.

Parameters
Thename (string) the name of the preset, as it will appear in the menu. (srting) or <callable> If a string, the path to go to when selected. if a callable, it should return a tuple of ( name, path ) pairs. If the return tuple has more than one item, a submenu will be created.
key(string) if specified, the preset will only be available for dialogs with that ui key.
def IECoreMaya.FileDialog.removePreset (   name,
  key = None 
)
static

Removes the named preset with the given key, or global preset if no key is specified.

References IECoreMaya.FileDialog.__bookmarkMenuItemsForKey(), IECoreMaya.FileDialog.__bookmarksMenu, IECoreMaya.FileDialog.__key, IECore.curry(), IECoreMaya.ParameterUI.registerPopupMenuCallback(), IECoreMaya.FileBrowser.setPath(), and IECoreMaya.FileDialog.setPath().

def IECoreMaya.FileDialog.setPath (   self,
  path,
  args 
)

Can be called to set the path being displayed in the Dialog.

See also
IECoreMaya.FileBrowser.setPath

References IECoreMaya.FileDialog.__addToHistory(), IECoreMaya.FileDialog.__callback, IECoreMaya.FileDialog.__deletionCallback, IECoreMaya.FileDialog.__exit(), IECoreMaya.FileDialog.__key, and IECoreMaya.FileDialog.__window.

Referenced by IECoreMaya.FileDialog.removePreset().


The documentation for this class was generated from the following file: